@aibee/crc-bmap 0.12.41 → 0.12.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Sa=Object.create;var ln=Object.defineProperty;var ba=Object.getOwnPropertyDescriptor;var Ma=Object.getOwnPropertyNames,mo=Object.getOwnPropertySymbols,wa=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty,Ta=Object.prototype.propertyIsEnumerable;var Qr=(a,t,e)=>t in a?ln(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,ti=(a,t)=>{for(var e in t||(t={}))_o.call(t,e)&&Qr(a,e,t[e]);if(mo)for(var e of mo(t))Ta.call(t,e)&&Qr(a,e,t[e]);return a};var Te=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),vo=(a,t)=>{for(var e in t)ln(a,e,{get:t[e],enumerable:!0})},yo=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ma(t))!_o.call(a,r)&&r!==e&&ln(a,r,{get:()=>t[r],enumerable:!(n=ba(t,r))||n.enumerable});return a};var ei=(a,t,e)=>(e=a!=null?Sa(wa(a)):{},yo(t||!a||!a.__esModule?ln(e,"default",{value:a,enumerable:!0}):e,a)),Aa=a=>yo(ln({},"__esModule",{value:!0}),a);var ct=(a,t,e)=>Qr(a,typeof t!="symbol"?t+"":t,e);var g=(a,t,e)=>new Promise((n,r)=>{var i=u=>{try{s(e.next(u))}catch(l){r(l)}},o=u=>{try{s(e.throw(u))}catch(l){r(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,o);s((e=e.apply(a,t)).next())});var Eo=Te((B0,xo)=>{xo.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var Mo=Te((z0,bo)=>{var So=Eo();bo.exports=function(a,t){Array.isArray(t)||(t=[]),a.length>0&&t.push(So([0,0],a[0]));for(var e=0;e<a.length-1;e++){var n=a[e],r=a[e+1],i=n[0],o=n[1],s=r[0],u=r[1],l=[.75*i+.25*s,.75*o+.25*u],c=[.25*i+.75*s,.25*o+.75*u];t.push(l),t.push(c)}return a.length>1&&t.push(So([0,0],a[a.length-1])),t}});var Ro=Te((W0,Co)=>{var gi=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let n=Number(e);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(r=>(r.key===t&&Object.assign(r,{priority:n}),r)):(this.keys.add(t),this.queue.push({key:t,priority:n})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};Co.exports=gi});var Lo=Te((X0,Io)=>{function Po(a,t){let e=new Map;for(let[n,r]of a)n!==t&&r instanceof Map?e.set(n,Po(r,t)):n!==t&&e.set(n,r);return e}Io.exports=Po});var Do=Te((q0,Oo)=>{function za(a){let t=Number(a);return!(isNaN(t)||t<=0)}function No(a){let t=new Map;return Object.keys(a).forEach(n=>{let r=a[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return t.set(n,No(r));if(!za(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return t.set(n,Number(r))}),t}Oo.exports=No});var Bo=Te((j0,Fo)=>{function Uo(a){if(!(a instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof a}`);a.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){Uo(t);return}if(typeof t!="number"||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at ${e}`)})}Fo.exports=Uo});var _i=Te((Y0,ko)=>{var Ga=Ro(),ka=Lo(),zo=Do(),Go=Bo(),mi=class{constructor(t){t instanceof Map?(Go(t),this.graph=t):t?this.graph=zo(t):this.graph=new Map}addNode(t,e){let n;return e instanceof Map?(Go(e),n=e):n=zo(e),this.graph.set(t,n),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=ka(this.graph,t),this}path(t,e,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,i=new Ga,o=new Map,s=[],u=0,l=[];if(n.avoid&&(l=[].concat(n.avoid)),l.includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(l.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(i.set(t,0);!i.isEmpty();){let c=i.next();if(c.key===e){u=c.priority;let p=c.key;for(;o.has(p);)s.push(p),p=o.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,f)=>{if(r.has(f)||l.includes(f))return null;if(!i.has(f))return o.set(f,c.key),i.set(f,c.priority+p);let d=i.get(f).priority,m=c.priority+p;return m<d?(o.set(f,c.key),i.set(f,m)):null})}return s.length?(n.trim?s.shift():s=s.concat([t]),n.reverse||(s=s.reverse()),n.cost?{path:s,cost:u}:s):n.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};ko.exports=mi});var Wu={};vo(Wu,{AibeeLoader:()=>Fe,BMap:()=>ki,BMapSelect:()=>Zi,BaseSvg:()=>zt,CarInertialPosition:()=>er,ClickHelper:()=>_n,Context:()=>Xn,CrLoader:()=>Gi,CrNavPath:()=>Yi,Equipment:()=>Vi,EventDispatcher:()=>it,Events:()=>hi,Floor:()=>Bt,GlbModel:()=>Ci,Graphic:()=>pt,GraphicLayer:()=>wn,GroundTexture:()=>ye,HeatmapElement:()=>bn,HighlightPoi:()=>io,HooksName:()=>_t,HoverHelper:()=>Hn,InstancedModel:()=>Pn,InstancedParkingSpace:()=>Ve,KalmanFilter:()=>yn,Lane:()=>Bn,Layer:()=>ot,LineElement:()=>qe,MapTypePolar:()=>Ru,MergeAttributeGraphic:()=>Ee,MergeAttributeGroundTexture:()=>xe,MergeAttributeLane:()=>kn,MergeAttributeWall:()=>Gn,MergeGraphic:()=>Ri,MergeParkingSpace:()=>Cn,MergedGraphicLayer:()=>On,MergedModelLayer:()=>Rn,Model:()=>Mn,MulFloorNavigation:()=>Ki,MulFloorSelect:()=>$i,MulFloors:()=>Xi,NavPath:()=>Yn,Navigation:()=>Wi,Overlay:()=>Oe,ParkingLayer:()=>An,ParkingType:()=>Pu,PathDirection:()=>ee,PdrPosition:()=>$n,Poi:()=>ve,Poi2:()=>et,PoiLayer:()=>Tn,PoiLayer2:()=>De,Position:()=>no,RENDER_VERSION:()=>Ke,RecommendParkingSpace:()=>Qi,RoadNetwork:()=>vi,RoadNetwork2:()=>yi,SENSOR_TYPE:()=>k,SelectBox:()=>Ai,Selection:()=>Vn,Sensor:()=>Zn,Shadow:()=>Sn,Socket:()=>rn,SortByDistance:()=>oo,SvgLine:()=>Dn,SvgPolygon:()=>Un,TaskQueue:()=>Ne,TextTexture:()=>zn,Timer:()=>K,TweenUtil:()=>le,UA:()=>li,UseMyPosition:()=>ro,Wall:()=>Fn,WorkerPool:()=>vn,addAlphaToHexColor:()=>Na,calc_angle:()=>pn,calc_direction:()=>sr,calculateInstantaneousSpeed:()=>zu,calculateLineDirection:()=>Qn,convertToSnakeCase:()=>xi,createCircle:()=>Ge,createLine:()=>dn,createRect:()=>ue,createSvg:()=>si,createSvgElement:()=>fn,createThreeBox:()=>Wa,createThreeLine:()=>Ha,darkenColor:()=>te,defaultConfig:()=>ks,defaultGraphicOptions:()=>_e,defaultOptions:()=>br,defaultTextTextureOptions:()=>Ps,deviceToVector3:()=>Ca,dispose:()=>B,distancePointToSegment:()=>fi,generatorKeyByObj:()=>Pe,getAngle:()=>To,getBorderPoints:()=>lr,getCenter:()=>hn,getConfig:()=>Oi,getDirectPath:()=>Ba,getDirectionByAngle:()=>ar,getDistanceByPathPos:()=>di,getLength:()=>G,getLongestSideDir:()=>Ra,getMinEdgeSquare:()=>Pa,getPathLength:()=>At,getPointEdgeIndex:()=>Qt,getPosByPathDistance:()=>Ie,hasChinese:()=>ii,hexToRgb:()=>or,initDirectionalLight:()=>ri,initLight:()=>ni,initShape:()=>cn,isAndroid:()=>Oa,isContain:()=>ae,isControl:()=>Re,isIphone:()=>ge,isMac:()=>Ce,isPointInPolygon:()=>oi,loadBuildingGround:()=>Bi,loadExternalStreet:()=>Au,loadGraphics:()=>zi,mergeGraphicGeometries:()=>Xa,mergeGraphicLineGeometries:()=>Zo,moveOnRoute:()=>Fa,predictFuturePosition:()=>nn,predictFutureSpeed:()=>Gu,proxyOptions:()=>Ae,removeOutliers:()=>ku,removeWeightPath:()=>Ao,setCirclePosition:()=>de,setLineStartEnd:()=>Wt,setRectPosition:()=>wt,simplifyPath:()=>gn,sleepByRf:()=>ui,sleepOnePromise:()=>ai,sleepOneRf:()=>ir,smoothPath:()=>pi,strToNumber:()=>La,timeoutPromise:()=>Ft,toWebWorker:()=>Va,transformGraphicData:()=>mn,transformSpeed:()=>Yr,translatePosToCenter:()=>Le,triggerWorker:()=>$,vector3ToDevice:()=>I,xhrGet:()=>Da});module.exports=Aa(Wu);function x(){return x=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},x.apply(this,arguments)}var Ev=require("core-js/modules/es.array.push.js"),Sv=require("core-js/modules/web.dom-collections.iterator.js"),bv=require("core-js/modules/es.json.stringify.js"),Vt=require("three");var P_=require("core-js/modules/web.dom-collections.iterator.js");var ju=require("core-js/modules/es.set.difference.v2.js"),Yu=require("core-js/modules/es.set.intersection.v2.js"),Zu=require("core-js/modules/es.set.is-disjoint-from.v2.js"),Ku=require("core-js/modules/es.set.is-subset-of.v2.js"),$u=require("core-js/modules/es.set.is-superset-of.v2.js"),Ju=require("core-js/modules/es.set.symmetric-difference.v2.js"),Qu=require("core-js/modules/es.set.union.v2.js"),t0=require("core-js/modules/web.dom-collections.iterator.js"),K=class{requestAnimationFrame(t){let e=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(e),t()});return this.tasks.requestAnimation.add(e),e}cancelAnimationFrame(t){this.tasks.requestAnimation.delete(t),window.cancelAnimationFrame(t)}setTimeout(t,e){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),t()},e);return this.tasks.timeout.add(n),n}clearTimeout(t){this.tasks.timeout.delete(t),window.clearTimeout(t)}setInterval(t,e){let n=window.setInterval(()=>{t()},e);return this.tasks.interval.add(n),n}clearInterval(t){this.tasks.interval.delete(t),window.clearInterval(t)}requestIdleCallback(t,e){let n=window.requestIdleCallback(r=>{this.tasks.requestIdleCallback.delete(n),t(r)},e);return this.tasks.requestIdleCallback.add(n),n}cancelIdleCallback(t){this.tasks.requestIdleCallback.delete(t),window.cancelIdleCallback(t)}dispose(){this.tasks.requestAnimation.forEach(t=>{window.cancelAnimationFrame(t)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(t=>{window.cancelIdleCallback(t)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(t=>{window.clearTimeout(t)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(t=>{window.clearInterval(t)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var n0=require("core-js/modules/web.dom-collections.iterator.js"),r0=require("core-js/modules/es.array.push.js"),Ut=require("three");function ni(){let a=new Ut.Group,t=new Ut.AmbientLight(16777215,2.6);return a.add(t),a}function cn(a,t){t===void 0&&(t=[]);let e=new Ut.Shape(a.map(n=>new Ut.Vector2(...n)));return t.length&&t.forEach(n=>{var r=new Ut.Path(n.map(i=>new Ut.Vector2(...i)));e.holes.push(r)}),e}function ri(a,t){a===void 0&&(a=16777215),t===void 0&&(t=1);let e=new Ut.DirectionalLight(a,t);return e.castShadow=!0,e.shadow.radius=8,e.shadow.bias=-.001,e.shadow.mapSize.set(256,256),e.shadow.camera.left=-200,e.shadow.camera.right=200,e.shadow.camera.top=200,e.shadow.camera.bottom=-200,e}function B(a,t){if(t&&a.children&&a.children.length&&a.children.forEach(e=>{B(e,t)}),a.isMesh){let e=a;e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n.dispose()}):e.material.dispose())}a.isLight&&(a.dispose==null||a.dispose.call(a))}var s0=require("core-js/modules/es.regexp.exec.js");function ii(a){return/[\u4E00-\u9FA5]+/g.test(a)}var u0=require("core-js/modules/web.dom-collections.iterator.js"),at=require("three"),ze=require("@turf/turf");function I(a,t,e,n){let r=a.clone().project(t),i=e/2,o=n/2,s=Math.round(r.x*i+i),u=Math.round(-r.y*o+o);return{x:s,y:u}}function Ca(a,t,e,n,r){if(!r)return null;e=Math.min(1,e),n=Math.min(1,n);let i=a/e*2-1,o=1-t/n*2;return new at.Vector3(i,o,0).unproject(r)}function hn(a){let t=(0,ze.featureCollection)(a.map(n=>(0,ze.point)(n)));return(0,ze.center)(t).geometry.coordinates}function ae(a,t,e){return a.x>=t.x&&a.x<=e.x&&a.y>=t.y&&a.y<=e.y}function Ra(a){let t=0,e=new at.Vector3;for(let n=1;n<a.length;n++){let r=new at.Vector3(a[n-1][0],a[n-1][1],0),i=new at.Vector3(a[n][0],a[n][1],0),o=i.distanceTo(r);o>t&&(t=o,e=i.clone().sub(r).normalize())}return e}function G(a,t){return Math.sqrt((t[0]-a[0])**2+(t[1]-a[1])**2)}function At(a){let t=0;for(let e=0;e<a.length-1;e++)t+=G(a[e],a[e+1]);return t}function pn(a,t,e){let n=new at.Vector2(t[0]-a[0],t[1]-a[1]),r=new at.Vector2(t[0]-e[0],t[1]-e[1]),o=n.angleTo(r)*180/Math.PI,s=new at.Vector2(t[0]-a[0],t[1]-a[1]);return new at.Vector2(e[0]-a[0],e[1]-a[1]).cross(s)>0?o:-o}function Pa(a,t){let e=Math.min(G(a[0][0],a[0][1]),G(a[0][2],a[0][1]))-1;t||(t=hn(a[0]));let n=Ia(t,e),r=new at.Vector2(a[0][0][0],a[0][0][1]),i=new at.Vector2(a[0][1][0],a[0][1][1]),o=new at.Vector2(a[0][2][0],a[0][2][1]),u=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new at.Vector2(0,1)),l=new at.Matrix3;return l.multiply(new at.Matrix3().translate(t[0],t[1])).multiply(new at.Matrix3().rotate(u)).multiply(new at.Matrix3().translate(-t[0],-t[1])),[n.map(c=>{let h=new at.Vector2(c[0],c[1]).applyMatrix3(l);return[h.x,h.y]})]}function Ia(a,t){let e=t/2;return[[a[0]-e,a[1]+e],[a[0]+e,a[1]+e],[a[0]+e,a[1]-e],[a[0]-e,a[1]-e],[a[0]-e,a[1]+e]]}function Qt(a,t){let e=0,n=1/0,[r,i]=t;for(let o=0;o<a.length-1;o++){let[s,u]=a[o],[l,c]=a[o+1],h=Math.min(s,l)<=r&&r<=Math.max(s,l),p=Math.min(u,c)<=i&&i<=Math.max(u,c);if(h&&p){let f=Math.abs((l-s)*(i-u)-(c-u)*(r-s));f<n&&(n=f,e=o)}}return e}function oi(a,t){let e=a[0],n=a[1],r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let s=t[i][0],u=t[i][1],l=t[o][0],c=t[o][1];u>n!=c>n&&e<(l-s)*(n-u)/(c-u)+s&&(r=!r)}return r}var c0=require("core-js/modules/es.reflect.to-string-tag.js");function Ae(a,t){return new Proxy(a,{get:(e,n,r)=>Reflect.get(e,n,r),set:(e,n,r,i)=>{let o=Reflect.get(e,n,i),s=Reflect.set(e,n,r,i);return o!==r&&t.dispatchEvent({type:"change-"+n,value:r}),s}})}var p0=require("core-js/modules/web.dom-collections.iterator.js"),f0=require("core-js/modules/es.error.cause.js");function Ft(a,t){return Promise.race([a,new Promise((e,n)=>{setTimeout(()=>n(new Error("Promise timeout")),t)})])}function fn(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function si(a,t){let e=fn("svg");return e.setAttribute("width",a),e.setAttribute("height",t),e.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",e}function Ge(a,t){a===void 0&&(a="2");let e=fn("circle");return e.setAttribute("r",a),e.setAttribute("fill",t),e}function dn(a){let t=fn("line");return t.setAttribute("stroke",a),t}function ue(a,t){let e=fn("rect");return e.setAttribute("stroke",a),e.setAttribute("fill",t),e}function de(a,t,e){a.setAttribute("cx",""+t),a.setAttribute("cy",""+e)}function Wt(a,t,e){t&&(a.setAttribute("x1",""+t.x),a.setAttribute("y1",""+t.y)),e&&(a.setAttribute("x2",""+e.x),a.setAttribute("y2",""+e.y))}function wt(a,t,e,n,r){a.setAttribute("x",""+t),a.setAttribute("y",""+e),a.setAttribute("width",""+n),a.setAttribute("height",""+r)}function ai(){return Promise.resolve()}function ir(){return new Promise(a=>{requestAnimationFrame(a)})}function ui(a){return a===void 0&&(a=1),new Promise(t=>{function e(){a<=0?t(!0):(a--,window.requestAnimationFrame(e))}window.requestAnimationFrame(e)})}var _0=require("core-js/modules/es.string.replace.js"),v0=require("core-js/modules/es.regexp.exec.js"),y0=require("core-js/modules/es.string.trim.js");function La(a){return parseInt(a.replace("#","0x"),16)}function Na(a,t){let e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16),i=Math.round(e*t),o=Math.round(n*t),s=Math.round(r*t);return"#"+(1<<24|i<<16|o<<8|s).toString(16).slice(1)}function te(a,t){t===void 0&&(t=.85);let e,n,r;if(a.startsWith("#"))e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16);else{let o=a.slice(4,-1).split(",");e=parseInt(o[0].trim()),n=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return e=Math.min(Math.floor(e*t),255),n=Math.min(Math.floor(n*t),255),r=Math.min(Math.floor(r*t),255),"#"+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)}function or(a,t){a=a.replace(/^#/,"");let e=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),r=parseInt(a.substring(4,6),16);return t!==void 0?"rgba("+e+", "+n+", "+r+", "+t+")":"rgb("+e+", "+n+", "+r+")"}var E0=require("core-js/modules/es.regexp.exec.js"),Ce=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,li=(navigator.userAgent||"").toLocaleLowerCase(),ge=/ios|iphone/i.test(li),Oa=/android|adr|linux/gi.test(li);function Re(a){return Ce?a==="Meta":a==="Control"}var w0=require("core-js/modules/es.set.difference.v2.js"),T0=require("core-js/modules/es.set.intersection.v2.js"),A0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),C0=require("core-js/modules/es.set.is-subset-of.v2.js"),R0=require("core-js/modules/es.set.is-superset-of.v2.js"),P0=require("core-js/modules/es.set.symmetric-difference.v2.js"),I0=require("core-js/modules/es.set.union.v2.js"),L0=require("core-js/modules/web.dom-collections.iterator.js"),ci="__once__",hi=class{on(t,e){if(typeof e!="function")return;let n=this.events.get(t);return n?n.add(e):this.events.set(t,new Set([e]))}once(t,e){if(typeof e!="function")return;let n=""+ci+t,r=this.events.get(n);return r?r.add(e):this.events.set(n,new Set([e]))}off(t,e){let n=this.events.get(t),r=this.events.get(""+ci+t);!n&&!r||(e===void 0&&(n==null||n.clear(),r==null||r.clear()),n!=null&&n.has(e)&&n.delete(e),r!=null&&r.has(e)&&r.delete(e))}offAll(){this.events.clear()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let i=this.events.get(t),o=this.events.get(""+ci+t);!i&&!o||(i==null||i.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.clear())}constructor(){this.events=new Map}};var _t=function(a){return a.SWITCH_FLOOR_BEFORE="switch_floor_before",a.SWITCH_FLOOR_GROUND="switch_floor_ground",a.SWITCH_FLOOR_AFTER="switch_floor_after",a}({});var D0=require("core-js/modules/es.array.sort.js");function Pe(a){return Object.keys(a).sort().map(t=>t+"="+a[t]).join("&")}function Da(a,t){return new Promise((e,n)=>{let r=new XMLHttpRequest;r.open("GET",a,!0),Object.keys(t.headers||{}).forEach(i=>{r.setRequestHeader(i,t.headers[i])}),t.responseType&&(r.responseType=t.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(t.responseType==="arraybuffer")e(r.response);else try{let i=JSON.parse(r.responseText);e(i)}catch(i){n(i)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var G0=require("core-js/modules/web.dom-collections.iterator.js"),k0=require("core-js/modules/es.array.push.js"),ke=require("three"),wo=ei(Mo(),1);function To(a,t){let e=a.clone().normalize(),n=t.clone().normalize();return Math.acos(e.dot(n))}function Ua(a){let t=0;return a.reduce((e,n)=>{let[r,i]=e,[o,s]=n;return t+=Math.sqrt((o-r)**2+(s-i)**2),[o,s]}),t/a.length}function pi(a,t){if(t===void 0&&(t=.25),Ua(a)<t)return a;let e=(0,wo.default)(a);return pi(e,t)}function gn(a,t,e,n,r,i){t===void 0&&(t=!1),e===void 0&&(e=!0),n===void 0&&(n=5),r===void 0&&(r=150),i===void 0&&(i=3);let o=[],s=!t;if(o.push(a[0]),a.length<2)return o;for(let l=0;l<a.length-2;l+=1){let c=a[l],h=a[l+1],p=a[l+2],f=new ke.Vector2(c[0]-h[0],c[1]-h[1]),d=new ke.Vector2(p[0]-h[0],p[1]-h[1]),m=To(f,d)/Math.PI*180,v=f.length()+d.length();(!s||m<r&&v>.01||v>n)&&(o.push(a[l+1]),s=!0)}if(o.push(a[a.length-1]),!e)return o;let u=[];u.push(o[0]);for(let l=0;l<o.length-2;l+=1){let c=new ke.Vector2(o[l][0],o[l][1]),h=new ke.Vector2(o[l+1][0],o[l+1][1]),p=new ke.Vector2(o[l+2][0],o[l+2][1]),f=c.distanceTo(h)/2,d=p.distanceTo(h)/2,m=h.clone(),v=h.clone();m.add(c.clone().sub(h).normalize().multiplyScalar(f>i?i/2:f)),v.add(p.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d));let y=[[m.x,m.y],[h.x,h.y],[v.x,v.y]];u.push(...pi(y,i/25))}return u.push(o[o.length-1]),Ao(u)}function Ao(a){if(a.length<=1)return a;let t=[],e;return a.forEach(n=>{let[r,i]=n;e?r===e[0]&&i===e[1]||(e=[r,i],t.push([r,i])):(e=[r,i],t.push([r,i]))}),t}function fi(a,t,e){let n=Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2);if(n===0)return{distance:Math.sqrt((a[0]-t[0])**2+(a[1]-t[1])**2),closestPoint:t.slice(0)};let r=Math.max(0,Math.min(1,((a[0]-t[0])*(e[0]-t[0])+(a[1]-t[1])*(e[1]-t[1]))/n**2)),i=[t[0]+r*(e[0]-t[0]),t[1]+r*(e[1]-t[1])];return{distance:Math.sqrt((a[0]-i[0])**2+(a[1]-i[1])**2),closestPoint:i}}function Fa(a,t,e){let[n,r]=a,[i,o]=t,s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2));if(s===0||s<e)return[...t];let u=e/s,l=n+(i-n)*u,c=r+(o-r)*u;return[l,c]}var ee=function(a){return a.START="start",a.END="end",a.FRONT="front",a.RIGHT="right",a.LEFT="left",a.RIGHT_FRONT="right_front",a.LEFT_FRONT="left_front",a.RIGHT_BACK="right_back",a.LEFT_BACK="left_back",a}({});function sr(a,t,e){let n=pn(a,t,e);return ar(n)}function ar(a){return 180-Math.abs(a)<15?"front":a>135?"right_front":a<-135?"left_front":a<=135&&a>=60?"right":a>=-135&&a<=-60?"left":a<60&&a>0?"right_back":a>-60&&a<0?"left_back":"front"}function Ba(a){if(!a.length)return[];if(a.length===1)return[{direction:"start",distance:0,points:a}];let t=[{direction:"start",distance:G(a[0],a[1]),points:[a[0],a[1]]}];for(let e=2;e<a.length;e++){let n=sr(a[e-2],a[e-1],a[e]);if(n==="front"){let r=t[t.length-1],i=G(a[e-1],a[e]);r.distance+=i,e!==2&&r.points.push(a[e-1])}else t.push({direction:n,distance:G(a[e-1],a[e]),points:[a[e-1],a[e]]})}return t.push({direction:"end",distance:0,points:[a[a.length-1]]}),t}function di(a,t){if(a.length<2)return-1;let e=0;for(let n=1;n<a.length;n++){let r=a[n-1],i=a[n],o=[t[0]-r[0],t[1]-r[1]],s=[i[0]-r[0],i[1]-r[1]],u=Math.min(i[0],r[0])<=t[0]&&t[0]<=Math.max(i[0],r[0]),l=Math.min(i[1],r[1])<=t[1]&&t[1]<=Math.max(i[1],r[1]);if(u&&l){let c=o[0]*s[1]-o[1]*s[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((t[0]-r[0])**2+(t[1]-r[1])**2);return e+h}}e+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function Ie(a,t){if(a.length<2){var e;return(e=a[0])!=null?e:null}let n=0;for(let r=1;r<a.length;r++){let i=a[r-1],o=a[r],s=Math.sqrt((o[0]-i[0])**2+(o[1]-i[1])**2);if(n+=s,n>=t){let u=(t-(n-s))/s,l=i[0]+(o[0]-i[0])*u,c=i[1]+(o[1]-i[1])*u;return[l,c]}}return null}var K0=require("core-js/modules/es.array.push.js"),$0=require("core-js/modules/web.dom-collections.iterator.js"),J0=require("core-js/modules/es.regexp.exec.js"),ne=ei(_i(),1);var Xt="___",vi=class{initRoute(t){this.clear(),this.roadInfo=t,t.length&&(t.forEach(e=>{e.points.forEach(n=>{let r=""+e.floor+Xt+n.id;if(this.pointMap.set(r,n),this.nodeMap.set(""+n.floor+Xt+n.nodeId,r),n.type==="straightLadder"){let i=this.straightLadderMap.get(n.name)||[];i.push(x({},n)),this.straightLadderMap.set(n.name,i)}if(n.type==="staircase"){let i=this.staircaseMap.get(n.name)||[];i.push(x({},n)),this.staircaseMap.set(n.name,i)}if(n.type==="escalator"){let i=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?i.end={floor:n.floor,id:n.id}:i.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,i)}if(n.type==="facility"){let i=this.facilityMap.get(n.targetId)||[];i.push(x({},n)),this.facilityMap.set(n.targetId,i)}}),e.lines.filter(n=>n.direction!=="no").forEach(n=>{var r,i;let o=""+e.floor+Xt+n.from,s=""+e.floor+Xt+n.to,u=(r=this.pointMap.get(o))==null?void 0:r.cds,l=(i=this.pointMap.get(s))==null?void 0:i.cds;if(u!=null&&u.length&&(l!=null&&l.length)){let c=G(u,l);this.addLineItem(o,s,c),n.direction==="double"&&this.addLineItem(s,o,c)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let c=0;c<s.length;c++){let h=""+s[c].floor+Xt+s[c].id;for(let p=0;p<s.length;p++)if(c!==p){var u,l;let f=""+s[p].floor+Xt+s[p].id,d=(u=this.pointMap.get(h))==null?void 0:u.cds,m=(l=this.pointMap.get(f))==null?void 0:l.cds;if(d!=null&&d.length&&(m!=null&&m.length))if(s[c].type==="straightLadder"){let v=e;this.addLineItem(h,f,v,r)}else{let v=n;this.addLineItem(h,f,v,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){var s,u;let l=""+i.start.floor+Xt+i.start.id,c=""+i.end.floor+Xt+i.end.id,h=(s=this.pointMap.get(l))==null?void 0:s.cds,p=(u=this.pointMap.get(c))==null?void 0:u.cds;if(h!=null&&h.length&&(p!=null&&p.length)){let f=t;this.addLineItem(l,c,f,r)}}})}initBaseRoute(){let t=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,t),this.baseRoute=new ne.default(t)}initEscalatorRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ne.default(t)}initStraightLadderRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new ne.default(t)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility?!0:this.checkStart(t)}transformStart(t){var e;if(t.nodeId){let n=this.nodeMap.get(""+t.floor+Xt+t.nodeId);if(n){let[r,i]=n.split(Xt);return{floor:r,id:i}}}if((e=t.coord)!=null&&e.length){let n=this.roadInfo.find(i=>i.floor===t.floor);if(!n)return null;let r=n.points.reduce((i,o)=>{let s=G(t.coord,o.cds);return s<i.min&&(i.min=s,i.point=o),i},{min:1/0,point:n.points[0]});return{floor:r.point.floor,id:r.point.id}}return null}transformEnd(t){if(t.floor){let e=this.transformStart(t);if(e)return e}if(t.facility){let e=this.facilityMap.get(t.facility);if(e!=null&&e.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n){if(n===void 0&&(n=""),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let r=this.transformStart(t);if(!r)return"no-start";let i=this.transformEnd(e);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let s=this.facilityMap.get(i.facility).filter(l=>i.floor?l.floor===i.floor:!0);if(!s.length)return null;let u=s.map(l=>o(r,{floor:l.floor,id:l.id})).filter(l=>!!l);return u.reduce((l,c)=>{let h=c.reduce((p,f)=>p+At(f.points),0);return h<l.distance&&(l.distance=h,l.path=c),l},{distance:1/0,path:u[0]}).path}}getRoutePath(t,e,n){let r=""+t.floor+Xt+t.id,i=""+e.floor+Xt+e.id,o=n.path(r,i);if(!o)return null;let s=[];return o.map(u=>{let l=this.pointMap.get(u);if(l){var c;let{floor:h}=l;if(((c=s[s.length-1])==null?void 0:c.floor)===h){let p=s[s.length-1];p.points.push(l.cds),p.endType=l.type,p.destId=l.nodeId,p.distance=At(p.points)}else s.push({floor:h,points:[l.cds],endType:l.type,destId:l.nodeId,distance:0})}}),s}getBasePath(t,e){return this.getRoutePath(t,e,this.baseRoute)}getEscalatorPath(t,e){return this.getRoutePath(t,e,this.escalatorRoute)}getStraightLadderPath(t,e){return this.getRoutePath(t,e,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ne.default,this.escalatorRoute=new ne.default,this.straightLadderRoute=new ne.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.staircaseMap=new Map,this.lineMap=new Map,this.baseRoute=new ne.default,this.escalatorRoute=new ne.default,this.straightLadderRoute=new ne.default}};var nl=require("core-js/modules/web.dom-collections.iterator.js"),rl=require("core-js/modules/es.regexp.exec.js"),il=require("core-js/modules/es.array.push.js"),ol=require("core-js/modules/es.set.difference.v2.js"),sl=require("core-js/modules/es.set.intersection.v2.js"),al=require("core-js/modules/es.set.is-disjoint-from.v2.js"),ul=require("core-js/modules/es.set.is-subset-of.v2.js"),ll=require("core-js/modules/es.set.is-superset-of.v2.js"),cl=require("core-js/modules/es.set.symmetric-difference.v2.js"),hl=require("core-js/modules/es.set.union.v2.js"),pl=require("core-js/modules/es.array.flat.js"),fl=require("core-js/modules/es.array.unscopables.flat.js"),vt=ei(_i(),1);var Pt=require("lodash"),ur=require("three"),D="___",yi=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let n=[];try{n=JSON.parse(e.entry_end_floor)}catch(i){n=[]}let r=[];try{r=JSON.parse(e.entry_start_floor)}catch(i){r=[]}return x({},e,{entry_start_floor:r,entry_end_floor:n})})}getParkingSpaceInfo(t,e){let n=""+t+D+e;var r;return(r=this.parkingMap.get(n))!=null?r:null}getNodeInfo(t,e){let n=""+t+D+e,r=this.nodeMap.get(n);if(!(r!=null&&r.length))return null;let i=this.pointMap.get(r[0]);return i!=null?i:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let n=new Date,r=n.getHours()*60+n.getMinutes();t.length&&(t.forEach(i=>{let o=(i.points||[]).filter(s=>!(0,Pt.isNil)(s.passWeight)&&s.passWeight!==1&&!(0,Pt.isNil)(s.coverageArea)&&s.coverageArea!==0);(i.points||[]).filter(s=>s.openStatus!==!1).filter(s=>{if(!s.startTime||!s.endTime)return!0;let[u,l]=s.startTime.split(":").map(d=>+d),[c,h]=s.endTime.split(":").map(d=>+d),p=u*60+l,f=c*60+h;return r>=p&&r<=f}).forEach(s=>{s.floor=i.floor;let u=""+i.floor+D+s.id,l=""+i.floor+D+s.nodeId,c=this.nodeMap.get(l)||[];if(c.push(""+i.floor+D+(s.relatedId||s.id)),this.nodeMap.set(""+i.floor+D+s.nodeId,c),this.pointMap.set(u,s),this.isFacilityByType(s.type)){let h=this.facilities.find(p=>p.id===+s.targetId);if(h){switch(h.entry_infra_type){case"straightLadder":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.straightLadderMap.get(s.targetId)||[];m.push(x({},s)),this.straightLadderMap.set(s.targetId,m)}break;case"staircase":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.staircaseMap.get(s.targetId)||[];m.push(x({},s)),this.staircaseMap.set(s.targetId,m)}break;case"escalator":let f=this.escalatorMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=f.find(v=>{var y;return((y=v.end)==null?void 0:y.floor)!==i.floor&&!v.start});m?m.start=s:f.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=f.find(v=>{var y;return((y=v.start)==null?void 0:y.floor)!==i.floor&&!v.end});m?m.end=s:f.push({end:s})}this.escalatorMap.set(s.targetId,f);break;case"ramp":let d=this.rampMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=d.find(v=>{var y;return((y=v.end)==null?void 0:y.floor)!==i.floor&&!v.start});m?m.start=s:d.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=d.find(v=>{var y;return((y=v.start)==null?void 0:y.floor)!==i.floor&&!v.end});m?m.end=s:d.push({end:s})}this.rampMap.set(s.targetId,d);break;case"connectionPoint":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.connectionPointMap.get(s.targetId)||[];m.push(x({},s)),this.connectionPointMap.set(s.targetId,m)}break}let p=this.facilityMap.get(s.targetId)||[];p.push(x({},s)),this.facilityMap.set(s.targetId,p)}}s.type==="parkingSpace"&&s.name.split(/[,,]/).forEach(p=>{this.parkingMap.set(""+i.floor+D+p,s)})}),(i.lines||[]).filter(s=>s.to!==s.from).forEach(s=>{let u=""+i.floor+D+s.from,l=""+i.floor+D+s.to,c=this.pointMap.get(u),h=this.pointMap.get(l);if(!c||!h)return;let p=c.cds,f=h.cds,d=G(p,f);if(o.forEach(m=>{(m.id===s.from||m.id===s.to)&&(d=d/m.passWeight);let v=G(p,m.cds)<=m.coverageArea,y=G(f,m.cds)<=m.coverageArea;(v||y)&&(d=d/m.passWeight)}),!c.permission&&!h.permission){switch(this.addLineItem(u,l,d),this.addLineItem(l,u,d),s.direction){case"double":this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap);break;case"single":this.addLineItem(u,l,d,this.forwardLineMap);break;case"back":this.addLineItem(l,u,d,this.forwardLineMap);break}(c.type==="parkingSpace"||h.type==="parkingSpace")&&s.direction==="noDir"&&(this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap))}else c.permission&&(this.setPermissionLine(u,l,c.permission,d,""),this.setPermissionLine(l,u,c.permission,d,"")),h.permission&&h.permission!==c.permission&&(this.setPermissionLine(u,l,h.permission,d,""),this.setPermissionLine(l,u,h.permission,d,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,n,r,i){this.getPermissionMap(n).add({fromKey:t,toKey:e,distance:r,type:i})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"straightLadder"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"staircase"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,1,"escalator"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,10,"ramp"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"connectionPoint"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,n,r){this.getPermissionMap(t).forEach(o=>{e.includes(o.type)&&(o.type===""?this.addLineItem(o.fromKey,o.toKey,o.distance,n):this.addLineItem(o.fromKey,o.toKey,r.get(o.type),n))})}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let u=0;u<s.length;u++){let l=""+s[u].floor+D+s[u].id,c=this.pointMap.get(l);if(!(!c||c.permission)){for(let h=0;h<s.length;h++)if(u!==h){let p=""+s[h].floor+D+s[h].id,f=this.pointMap.get(p);if(!f||f.permission)continue;if(s[u].type==="straightLadder"){let d=e;this.addLineItem(l,p,d,r)}else{let d=n;this.addLineItem(l,p,d,r)}}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(s=>{if(s.start&&s.end){let u=""+s.start.floor+D+s.start.id,l=""+s.end.floor+D+s.end.id,c=this.pointMap.get(u),h=this.pointMap.get(l);if(c&&h&&!c.permission&&!h.permission){let p=t;this.addLineItem(u,l,p,r)}}})}),this.connectionPointMap.forEach((i,o)=>{if(!(i.length<2))for(let s=0;s<i.length;s++){let u=""+i[s].floor+D+i[s].id,l=this.pointMap.get(u);if(!(!l||l.permission)){for(let c=0;c<i.length;c++)if(s!==c){let h=""+i[c].floor+D+i[c].id,p=this.pointMap.get(h);if(!p||p.permission)continue;this.addLineItem(u,h,100,r)}}}})}initBaseRoute(){let t=new Map((0,Pt.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new vt.default(t)}initEscalatorRoute(){let t=new Map((0,Pt.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new vt.default(t)}initStraightLadderRoute(){let t=new Map((0,Pt.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new vt.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&!o.permission&&!s.permission&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(!(!i||i.permission)){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u||u.permission)continue;this.addLineItem(r,s,100,this.forwardLineMap)}}}}),this.forwardRoute=new vt.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,n){n===void 0&&(n={});var r;if(t.nodeId){let i=this.nodeMap.get(""+t.floor+D+t.nodeId);if(i!=null&&i.length)return i.map(o=>{let[s,u]=o.split(D);return{floor:s,id:u}})}if((r=t.coord)!=null&&r.length){let i=this.roadInfo.find(l=>l.floor===t.floor);if(!i)return null;let o=i.points.filter(l=>l.isStarted),s=i.points.filter(l=>{let c=""+l.floor+D+l.id;if(e==="forward"){if(!this.forwardLineMap.has(c)||n.adsorptionIntersection&&o.length&&!l.isStarted)return!1}else if(!this.lineMap.has(c))return!1;return!0});if(!s.length)return null;let u=s.reduce((l,c)=>{if(c.relatedId)return l;let h=G(t.coord,c.cds);return h<l.min&&(l.min=h,l.point=c),l},{min:1/0,point:s[0]});return[{floor:i.floor,id:u.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let r=this.parkingMap.get(""+t.floor+D+t.parkingSpace);if(r)return[{floor:t.floor,id:r.id}]}let n=this.transformStart(t,e);if(n)return n}if(t.facility){let r=this.facilities.filter(i=>+i.type_id==+t.facility).map(i=>i.id).map(i=>this.facilityMap.get(""+i)).flat(2);if(r!=null&&r.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n,r,i,o){if(n===void 0&&(n=""),o===void 0&&(o={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let s=this.transformStart(t,n,o);if(!s)return"no-start";let u=this.transformEnd(e,n);if(!u)return"no-end";let l=[];if(Array.isArray(u))for(let p=0;p<s.length;p++){let f=s[p];for(let d=0;d<u.length;d++){let m=u[d];if(f.floor===m.floor&&f.id===m.id)return"near"}}else{l=this.facilities.filter(f=>+f.type_id==+e.facility).map(f=>f.id).map(f=>this.facilityMap.get(""+f)).flat(2).filter(f=>f).filter(f=>u.floor?f.floor===u.floor:!0);for(let f=0;f<s.length;f++){let d=s[f];for(let m=0;m<l.length;m++){let v=l[m];if(d.floor===v.floor&&d.id===v.id)return"near"}}}let c;switch(n){case"escalator":c=this.getEscalatorPath.bind(this);break;case"straightLadder":c=this.getStraightLadderPath.bind(this);break;case"forward":c=this.getForwardPath.bind(this);break;default:c=this.getBasePath.bind(this);break}let h=null;return s.forEach(p=>{if(Array.isArray(u))u.forEach(f=>{let d=c(p,f,r,i);d&&d&&(!h||d[0].consume<h[0].consume)&&(h=d)});else{if(!l.length)return null;let f=l.map(d=>c(p,{floor:d.floor,id:d.id},r,i)).filter(d=>!!d);h=f.reduce((d,m)=>{let v=m[0].consume;return v<d.distance&&(d.distance=v,d.path=m),d},{distance:1/0,path:f[0]}).path}}),h}getRoutePath(t,e,n){let r=""+t.floor+D+t.id,i=this.pointMap.get(r),o=""+e.floor+D+e.id,s=this.pointMap.get(o);if(!i||!s)return null;let u=""+i.floor+D+(i.relatedId||i.id),l=""+s.floor+D+(s.relatedId||s.id),c=n.path(u,l);if(!c)return null;let h=[],p=c.reduce((f,d,m,v)=>{if(m===0)return 0;let y=v[m-1],S=n.graph.get(y).get(d);return f+S},0);return c.map(f=>{let d=this.pointMap.get(f);if(d){var m;let{floor:v}=d,y=d.type;if(this.isFacilityByType(d.type)){let S=this.facilities.find(w=>w.id===+d.targetId);S&&(y=S.entry_infra_type)}if(((m=h[h.length-1])==null?void 0:m.floor)===v){let S=h[h.length-1];S.points.push(d.cds),S.pointInfos.push(d),S.endType=y,S.destId=d.nodeId,S.distance=At(S.points)}else h.push({floor:v,points:[d.cds],pointInfos:[d],endType:y,destId:d.nodeId,distance:0,consume:p})}}),h}getBasePath(t,e,n){if(!n)return this.getRoutePath(t,e,this.baseRoute);let r=(0,Pt.cloneDeep)(this.baseRoute.graph),i=s=>{this.addPermissionLineToMap(s,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(n)?n.forEach(s=>{i(s)}):i(n);let o=new vt.default(r);return this.getRoutePath(t,e,o)}getEscalatorPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.escalatorRoute);let r=(0,Pt.cloneDeep)(this.escalatorRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*i],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new vt.default(r);return this.getRoutePath(t,e,s)}getStraightLadderPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.straightLadderRoute);let r=(0,Pt.cloneDeep)(this.straightLadderRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",3*i],["connectionPoint",100],["straightLadder",300],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new vt.default(r);return this.getRoutePath(t,e,s)}getForwardPath(t,e,n,r){let i=new Map,o=f=>{let d=this.forwardRoute.graph.get(u);f.forEach(m=>{let v=d.get(m);(0,Pt.isNil)(v)||(i.set(m,v),d.delete(m))})},s=()=>{let f=this.forwardRoute.graph.get(u);i.forEach((d,m)=>{f.set(m,d)})},u=""+t.floor+D+t.id;if(!(0,Pt.isNil)(r)){let f=this.forwardLineMap.get(u),d=this.pointMap.get(u);if(d&&(f!=null&&f.size)&&f.size>1){let m=new ur.Vector2(d.cds[0],d.cds[1]),v=new Map;f.forEach((S,w)=>{let O=this.pointMap.get(w);if(O){let N=new ur.Vector2(O.cds[0],O.cds[1]),C=360-(new ur.Vector2().subVectors(N,m).angle()/Math.PI*180-90+360)%360;v.set(w,C)}});let y=Array.from(v).filter(S=>{let[w,O]=S;return Math.abs(O-r)<=60}).map(S=>{let[w]=S;return w});if(y.length)y.forEach(S=>v.delete(S)),o([...v.keys()]);else{let S=Array.from(v).reduce((w,O)=>{let N=Math.abs(O[1]-r);return N<w.diff?{diff:N,key:O[0]}:w},{diff:1/0,key:""});v.delete(S.key),o([...v.keys()])}}}if(!n){let f=this.getRoutePath(t,e,this.forwardRoute);return s(),f||this.getRoutePath(t,e,this.forwardRoute)}let l=(0,Pt.cloneDeep)(this.forwardRoute.graph),c=f=>{this.addPermissionLineToMap(f,["","ramp"],l,new Map([["ramp",10]]))};Array.isArray(n)?n.forEach(f=>{c(f)}):c(n);let h=new vt.default(l),p=this.getRoutePath(t,e,h);if(s(),p)return p;{let f=(0,Pt.cloneDeep)(this.forwardRoute.graph);Array.isArray(n)?n.forEach(v=>{c(v)}):c(n);let d=new vt.default(f);return this.getRoutePath(t,e,d)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new vt.default,this.escalatorRoute=new vt.default,this.straightLadderRoute=new vt.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new vt.default,this.escalatorRoute=new vt.default,this.straightLadderRoute=new vt.default,this.forwardLineMap=new Map,this.forwardRoute=new vt.default}};var ml=require("core-js/modules/es.set.difference.v2.js"),_l=require("core-js/modules/es.set.intersection.v2.js"),vl=require("core-js/modules/es.set.is-disjoint-from.v2.js"),yl=require("core-js/modules/es.set.is-subset-of.v2.js"),xl=require("core-js/modules/es.set.is-superset-of.v2.js"),El=require("core-js/modules/es.set.symmetric-difference.v2.js"),Sl=require("core-js/modules/es.set.union.v2.js"),bl=require("core-js/modules/web.dom-collections.iterator.js"),me=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let t=this.createKey();for(;this.keySet.has(t);)t=this.createKey();return t}static removeKey(t){this.keySet.delete(t)}static dispose(){this.keySet.clear()}};me.keySet=new Set;var wl=require("core-js/modules/es.string.replace.js"),Tl=require("core-js/modules/es.regexp.exec.js");function xi(a){return a.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function $(a,t,e){return new Promise((n,r)=>{let i=me.genUniqueKey(),o=s=>{let{data:u}=s;u.type===""+t+"_result"&&u.key===i&&(me.removeKey(i),self.removeEventListener("message",o),u.error?r(u.error):n(u.data))};a.addEventListener("message",o),a.postMessage({type:t,key:i,data:e})})}function Va(a){let t={};for(let n in a)n.startsWith("on")&&(t[xi(n.slice(2))]=a[n]);let e=n=>g(this,null,function*(){let{data:r}=n;if(t[r.type])try{let i=yield t[r.type](r.data);if(i!=null&&i.$transfer&&Array.isArray(i.$transfer)){let o=i.$transfer;delete i.$transfer,self.postMessage({type:""+r.type+"_result",key:r.key,data:i},o)}else self.postMessage({type:""+r.type+"_result",key:r.key,data:i})}catch(i){self.postMessage({type:""+r.type+"_result",key:r.key,error:i})}else self.postMessage({type:""+r.type+"_result",key:r.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var Kt=require("three");function Ha(a,t){t===void 0&&(t=16711680);let e=new Kt.LineBasicMaterial({color:t}),n=new Kt.BufferGeometry().setFromPoints(a);return new Kt.Line(n,e)}function Wa(a,t){t===void 0&&(t=16711680);let e=new Kt.LineBasicMaterial({color:t}),n=new Kt.BoxGeometry(1,1,1),r=new Kt.Mesh(n,e);return r.position.copy(a),r}var Nl=require("core-js/modules/es.json.stringify.js"),Ol=require("core-js/modules/web.dom-collections.iterator.js");function mn(a,t,e){e===void 0&&(e=0),a.forEach(n=>{if(n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"){var r;n.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(o=>{o[0]-=t[0],o[1]-=t[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(i=>i.map(o=>Le(o,t)))),(r=n.doors)!=null&&r.length&&n.doors.map(i=>{i.coord=Le(i.coordinate,t)}),n.center&&(n.centerCoords=Le(n.center,t))}else n.geometry.coords=Le(n.geometry.cds,t),n.center&&(n.centerCoords=Le(n.center,t));if(n.center_x&&n.center_y){let[i,o]=Le([n.center_x,n.center_y],t);n.center_coord_x=i,n.center_coord_y=o}});for(let n=0;n<a.length;n++){let r=a[n];r.deltaHeight=1e-5*(e+n+1)}}function Le(a,t){return[a[0]-t[0],a[1]-t[1]]}var Ul=require("core-js/modules/es.set.difference.v2.js"),Fl=require("core-js/modules/es.set.intersection.v2.js"),Bl=require("core-js/modules/es.set.is-disjoint-from.v2.js"),zl=require("core-js/modules/es.set.is-subset-of.v2.js"),Gl=require("core-js/modules/es.set.is-superset-of.v2.js"),kl=require("core-js/modules/es.set.symmetric-difference.v2.js"),Vl=require("core-js/modules/es.set.union.v2.js"),Hl=require("core-js/modules/web.dom-collections.iterator.js"),Vo=require("@tweenjs/tween.js"),le=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(t=>{this.tweenStore.add(t),t.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(t=>{t.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(t){this.group.remove(t)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(t=>t.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new Vo.Group}};var Ho=require("three"),_n=class extends Ho.EventDispatcher{registryEvent(){this.ctn.addEventListener("pointerdown",this._pointerDown),this.ctn.addEventListener("pointerup",this._pointerUp)}unRegistryEvent(){this.ctn.removeEventListener("pointerdown",this._pointerDown),this.ctn.removeEventListener("pointerup",this._pointerUp)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.ctn=t,this._pointerDown=e=>{this.point={x:e.offsetX,y:e.offsetY}},this._pointerUp=e=>{if(!this.point)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.point;Math.hypot(i-n+(o-r))>3||this.dispatchEvent({type:"click",e})},this.registryEvent()}};var jl=require("core-js/modules/web.dom-collections.iterator.js"),Yl=require("core-js/modules/es.array.push.js"),Zl=require("core-js/modules/es.string.replace.js"),Kl=require("core-js/modules/es.regexp.exec.js"),Wo=require("lodash"),Xo=require("three");var Ne=class extends Xo.EventDispatcher{_isEffectiveTask(t){return t&&typeof t.run=="function"}_getIndexByTid(t){return this._task.findIndex(e=>e.tid===t)}_createTask(t){return this._isEffectiveTask(t)?x({},t,{tid:++this._id,meta:t.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(t){if(this._isEffectiveTask(t)){let e=this._createTask(t);return this._task.push(e),this.started&&!this.activeTask&&this.start(),e.tid}return!1}replace(t,e){if(!this._isEffectiveTask(e))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(t);if(n===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+t+"\u7684\u4EFB\u52A1"),!1;let r=this._createTask(e);return this._task.splice(n,1,r),r.tid}replaceByMetaType(t){var e;let n=(e=t.meta)==null?void 0:e.type;if((0,Wo.isNil)(n))return this.add(t);{let r=this._task.find(i=>i.meta.type===n);return r?this.replace(r.tid,t):this.add(t)}}remove(t){let e=this._getIndexByTid(t);return e===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+t+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(e,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return g(this,null,function*(){if(!this.started||!this._task.length)return!1;let t=this._task.shift();this.activeTask=t,this.dispatchEvent({type:"active-task-start",task:t});let e;try{e=yield t.run()}catch(n){console.warn("[task run err]",n,t)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:t,res:e}),this.exec()})}constructor(t=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,t&&this.start()}};var Ql=require("core-js/modules/es.array.push.js"),qo=require("three"),vn=class extends qo.EventDispatcher{getWorker(){return new Promise(t=>{let e=this.pool.find(r=>r.state==="leisure");if(e){e.state="used",t(e.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let r=this.workerConstructor();this.pool.push({worker:r,state:"used"}),t(r);return}let n=()=>{let r=this.pool.find(i=>i.state==="leisure");r&&(this.removeEventListener("release",n),r.state="used",t(r.worker))};this.addEventListener("release",n)})}releaseWorker(t){let e=this.pool.find(n=>n.worker===t);e&&(e.state="leisure",this.dispatchEvent({type:"release",worker:t}))}dispose(){this._listeners={},this.pool.forEach(t=>{t.worker.terminate()}),this.pool=[]}constructor(t=10,e){super(),this.max=10,this.pool=[],this.max=t,this.workerConstructor=e}};var jo=require("three"),it=class extends jo.EventDispatcher{dispose(){this._listeners={}}};var yn=class{filter(t){let e=this.estimate,n=this.errorEstimate+this.processNoise,r=n/(n+this.measurementNoise);return this.estimate=e+r*(t-e),this.errorEstimate=(1-r)*n,this.estimate}constructor(t={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=t.measurementNoise||1,this.processNoise=t.processNoise||.1,this.errorEstimate=t.errorEstimate||1}};var rc=require("core-js/modules/es.typed-array.float32-array.js"),ic=require("core-js/modules/es.typed-array.at.js"),oc=require("core-js/modules/es.typed-array.fill.js"),sc=require("core-js/modules/es.typed-array.find-last.js"),ac=require("core-js/modules/es.typed-array.find-last-index.js"),uc=require("core-js/modules/es.typed-array.set.js"),lc=require("core-js/modules/es.typed-array.sort.js"),cc=require("core-js/modules/es.typed-array.to-reversed.js"),hc=require("core-js/modules/es.typed-array.to-sorted.js"),pc=require("core-js/modules/es.typed-array.with.js"),fc=require("core-js/modules/es.array-buffer.constructor.js"),dc=require("core-js/modules/es.array-buffer.slice.js"),gc=require("core-js/modules/es.array-buffer.detached.js"),mc=require("core-js/modules/es.array-buffer.transfer.js"),_c=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),vc=require("core-js/modules/es.array.push.js"),yt=require("three");var Yo=require("three/examples/jsm/utils/BufferGeometryUtils.js");function Xa(a,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let n=a.filter(s=>s.geometry.type==="polygon");if(!n.length)return null;let r=n.map(s=>{var u;let l=s.geometry.coords,c=cn(l[0],l.slice(1)),h=new yt.ExtrudeGeometry(c,{steps:1,bevelEnabled:!1,depth:s.height,curveSegments:4});(u=s).deltaHeight||(u.deltaHeight=0),h.translate(0,0,s.airHeight+s.deltaHeight);let p=h.attributes.position.count,f=new Float32Array(p).fill(s.height+s.airHeight+s.deltaHeight);if(h.setAttribute("maxZ",new yt.BufferAttribute(f,1)),h.setAttribute("opacity",new yt.BufferAttribute(new Float32Array(p).fill(s.fillOpacity),1)),e){let v=new Float32Array(p).fill(s.airHeight+s.deltaHeight);h.setAttribute("minZ",new yt.BufferAttribute(v,1))}let d=new yt.Color(s.fillColor).convertLinearToSRGB(),m=new Float32Array(p*3);for(let v=0;v<p;v++)m[v*3]=d.r,m[v*3+1]=d.g,m[v*3+2]=d.b;return h.setAttribute("color",new yt.BufferAttribute(m,3)),h}),i=(0,Yo.mergeGeometries)(r);r.forEach(s=>s.dispose());let o={geometry:i};return i.dispose(),t&&(o.lineGeometry=Zo(n)||void 0),o}function Zo(a){let{points:t,colors:e,opacities:n}=lr(a);if(!t.length)return null;let r=new yt.BufferGeometry().setFromPoints(t);return r.setAttribute("color",new yt.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new yt.BufferAttribute(new Float32Array(n),1)),r}function lr(a){let t=[],e=[],n=[];return a.filter(r=>r.strokeOpacity>0).map(r=>{let i=r.height+(r.deltaHeight||0)+r.airHeight,{coords:o}=r.geometry,{strokeColor:s,strokeOpacity:u}=r,l=new yt.Color(s).convertLinearToSRGB();for(let c=0;c<o.length;c++){let h=o[c];for(let p=0;p<h.length;p++){let f=h[p],d=p+1===h.length?h[0]:h[p+1];t.push(new yt.Vector3(f[0],f[1],i)),t.push(new yt.Vector3(d[0],d[1],i)),e.push(l.r,l.g,l.b),e.push(l.r,l.g,l.b),n.push(u),n.push(u)}}}),{points:t,colors:e,opacities:n}}var H=require("three");var Vm=require("core-js/modules/web.dom-collections.iterator.js"),Hm=require("core-js/modules/es.set.difference.v2.js"),Wm=require("core-js/modules/es.set.intersection.v2.js"),Xm=require("core-js/modules/es.set.is-disjoint-from.v2.js"),qm=require("core-js/modules/es.set.is-subset-of.v2.js"),jm=require("core-js/modules/es.set.is-superset-of.v2.js"),Ym=require("core-js/modules/es.set.symmetric-difference.v2.js"),Zm=require("core-js/modules/es.set.union.v2.js"),Km=require("core-js/modules/es.array.push.js"),Us=require("three");var Sp=require("core-js/modules/web.dom-collections.iterator.js"),bp=require("core-js/modules/es.array.push.js"),P=require("three");var Ec=require("core-js/modules/web.dom-collections.iterator.js"),$o=require("three/examples/jsm/lines/LineMaterial.js"),Q=require("three");function Ko(a){return a.x+"-"+a.y+"-"+a.z}var L=class{static generateLineMaterialKey(t){let{color:e,opacity:n}=t;return e+"-"+n}static createLineMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=this.generateLineMaterialKey({color:e,opacity:n,vertexColors:r});if(this.lineMaterialMap.has(i))return this.lineMaterialMap.get(i);let o=new Q.LineBasicMaterial({color:new Q.Color(e).convertLinearToSRGB(),transparent:!0,opacity:n,vertexColors:r!=null?r:!1});return this.lineMaterialMap.set(i,o),o}static createMeshStandardMaterial(t){let{color:e,opacity:n}=t,r=e+"-"+n;if(this.meshStandardMaterialMap.has(r))return this.meshStandardMaterialMap.get(r);let i=new Q.MeshStandardMaterial({color:new Q.Color(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:n,depthWrite:!0});return this.meshStandardMaterialMap.set(r,i),i}static createMeshBasicMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=e+"-"+n+"-"+r;if(this.meshBasicMaterialMap.has(i))return this.meshBasicMaterialMap.get(i);let o=new Q.MeshBasicMaterial({color:e,transparent:!0,opacity:n,depthWrite:!0,vertexColors:r!=null?r:!1});return this.meshBasicMaterialMap.set(i,o),o}static createShaderMaterial(t){let{gradualColor:e,center:n,maxValue:r,opacity:i,direction:o,max:s,min:u}=t,l=e.toString()+"-"+Ko(n)+"-"+r+"-"+i+"-"+Ko(o);if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let c=`
1
+ "use strict";var Sa=Object.create;var ln=Object.defineProperty;var ba=Object.getOwnPropertyDescriptor;var Ma=Object.getOwnPropertyNames,mo=Object.getOwnPropertySymbols,wa=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty,Ta=Object.prototype.propertyIsEnumerable;var Qr=(a,t,e)=>t in a?ln(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,ti=(a,t)=>{for(var e in t||(t={}))_o.call(t,e)&&Qr(a,e,t[e]);if(mo)for(var e of mo(t))Ta.call(t,e)&&Qr(a,e,t[e]);return a};var Te=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),vo=(a,t)=>{for(var e in t)ln(a,e,{get:t[e],enumerable:!0})},yo=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ma(t))!_o.call(a,r)&&r!==e&&ln(a,r,{get:()=>t[r],enumerable:!(n=ba(t,r))||n.enumerable});return a};var ei=(a,t,e)=>(e=a!=null?Sa(wa(a)):{},yo(t||!a||!a.__esModule?ln(e,"default",{value:a,enumerable:!0}):e,a)),Aa=a=>yo(ln({},"__esModule",{value:!0}),a);var ct=(a,t,e)=>Qr(a,typeof t!="symbol"?t+"":t,e);var g=(a,t,e)=>new Promise((n,r)=>{var i=u=>{try{s(e.next(u))}catch(l){r(l)}},o=u=>{try{s(e.throw(u))}catch(l){r(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,o);s((e=e.apply(a,t)).next())});var Eo=Te((B0,xo)=>{xo.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var Mo=Te((z0,bo)=>{var So=Eo();bo.exports=function(a,t){Array.isArray(t)||(t=[]),a.length>0&&t.push(So([0,0],a[0]));for(var e=0;e<a.length-1;e++){var n=a[e],r=a[e+1],i=n[0],o=n[1],s=r[0],u=r[1],l=[.75*i+.25*s,.75*o+.25*u],c=[.25*i+.75*s,.25*o+.75*u];t.push(l),t.push(c)}return a.length>1&&t.push(So([0,0],a[a.length-1])),t}});var Ro=Te((W0,Co)=>{var gi=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let n=Number(e);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(r=>(r.key===t&&Object.assign(r,{priority:n}),r)):(this.keys.add(t),this.queue.push({key:t,priority:n})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};Co.exports=gi});var Lo=Te((X0,Io)=>{function Po(a,t){let e=new Map;for(let[n,r]of a)n!==t&&r instanceof Map?e.set(n,Po(r,t)):n!==t&&e.set(n,r);return e}Io.exports=Po});var Do=Te((q0,Oo)=>{function za(a){let t=Number(a);return!(isNaN(t)||t<=0)}function No(a){let t=new Map;return Object.keys(a).forEach(n=>{let r=a[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return t.set(n,No(r));if(!za(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return t.set(n,Number(r))}),t}Oo.exports=No});var Bo=Te((j0,Fo)=>{function Uo(a){if(!(a instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof a}`);a.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){Uo(t);return}if(typeof t!="number"||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at ${e}`)})}Fo.exports=Uo});var _i=Te((Y0,ko)=>{var Ga=Ro(),ka=Lo(),zo=Do(),Go=Bo(),mi=class{constructor(t){t instanceof Map?(Go(t),this.graph=t):t?this.graph=zo(t):this.graph=new Map}addNode(t,e){let n;return e instanceof Map?(Go(e),n=e):n=zo(e),this.graph.set(t,n),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=ka(this.graph,t),this}path(t,e,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,i=new Ga,o=new Map,s=[],u=0,l=[];if(n.avoid&&(l=[].concat(n.avoid)),l.includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(l.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(i.set(t,0);!i.isEmpty();){let c=i.next();if(c.key===e){u=c.priority;let p=c.key;for(;o.has(p);)s.push(p),p=o.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,f)=>{if(r.has(f)||l.includes(f))return null;if(!i.has(f))return o.set(f,c.key),i.set(f,c.priority+p);let d=i.get(f).priority,m=c.priority+p;return m<d?(o.set(f,c.key),i.set(f,m)):null})}return s.length?(n.trim?s.shift():s=s.concat([t]),n.reverse||(s=s.reverse()),n.cost?{path:s,cost:u}:s):n.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};ko.exports=mi});var Wu={};vo(Wu,{AibeeLoader:()=>Fe,BMap:()=>ki,BMapSelect:()=>Zi,BaseSvg:()=>zt,CarInertialPosition:()=>er,ClickHelper:()=>_n,Context:()=>Xn,CrLoader:()=>Gi,CrNavPath:()=>Yi,Equipment:()=>Vi,EventDispatcher:()=>it,Events:()=>hi,Floor:()=>Bt,GlbModel:()=>Ci,Graphic:()=>pt,GraphicLayer:()=>wn,GroundTexture:()=>ye,HeatmapElement:()=>bn,HighlightPoi:()=>io,HooksName:()=>_t,HoverHelper:()=>Hn,InstancedModel:()=>Pn,InstancedParkingSpace:()=>Ve,KalmanFilter:()=>yn,Lane:()=>Bn,Layer:()=>ot,LineElement:()=>qe,MapTypePolar:()=>Ru,MergeAttributeGraphic:()=>Ee,MergeAttributeGroundTexture:()=>xe,MergeAttributeLane:()=>kn,MergeAttributeWall:()=>Gn,MergeGraphic:()=>Ri,MergeParkingSpace:()=>Cn,MergedGraphicLayer:()=>On,MergedModelLayer:()=>Rn,Model:()=>Mn,MulFloorNavigation:()=>Ki,MulFloorSelect:()=>$i,MulFloors:()=>Xi,NavPath:()=>Yn,Navigation:()=>Wi,Overlay:()=>Oe,ParkingLayer:()=>An,ParkingType:()=>Pu,PathDirection:()=>ee,PdrPosition:()=>$n,Poi:()=>ve,Poi2:()=>et,PoiLayer:()=>Tn,PoiLayer2:()=>De,Position:()=>no,RENDER_VERSION:()=>Ke,RecommendParkingSpace:()=>Qi,RoadNetwork:()=>vi,RoadNetwork2:()=>yi,SENSOR_TYPE:()=>k,SelectBox:()=>Ai,Selection:()=>Vn,Sensor:()=>Zn,Shadow:()=>Sn,Socket:()=>rn,SortByDistance:()=>oo,SvgLine:()=>Dn,SvgPolygon:()=>Un,TaskQueue:()=>Ne,TextTexture:()=>zn,Timer:()=>K,TweenUtil:()=>le,UA:()=>li,UseMyPosition:()=>ro,Wall:()=>Fn,WorkerPool:()=>vn,addAlphaToHexColor:()=>Na,calc_angle:()=>pn,calc_direction:()=>sr,calculateInstantaneousSpeed:()=>zu,calculateLineDirection:()=>Qn,convertToSnakeCase:()=>xi,createCircle:()=>Ge,createLine:()=>dn,createRect:()=>ue,createSvg:()=>si,createSvgElement:()=>fn,createThreeBox:()=>Wa,createThreeLine:()=>Ha,darkenColor:()=>te,defaultConfig:()=>ks,defaultGraphicOptions:()=>_e,defaultOptions:()=>br,defaultTextTextureOptions:()=>Ps,deviceToVector3:()=>Ca,dispose:()=>B,distancePointToSegment:()=>fi,generatorKeyByObj:()=>Pe,getAngle:()=>To,getBorderPoints:()=>lr,getCenter:()=>hn,getConfig:()=>Oi,getDirectPath:()=>Ba,getDirectionByAngle:()=>ar,getDistanceByPathPos:()=>di,getLength:()=>G,getLongestSideDir:()=>Ra,getMinEdgeSquare:()=>Pa,getPathLength:()=>At,getPointEdgeIndex:()=>Qt,getPosByPathDistance:()=>Ie,hasChinese:()=>ii,hexToRgb:()=>or,initDirectionalLight:()=>ri,initLight:()=>ni,initShape:()=>cn,isAndroid:()=>Oa,isContain:()=>ae,isControl:()=>Re,isIphone:()=>ge,isMac:()=>Ce,isPointInPolygon:()=>oi,loadBuildingGround:()=>Bi,loadExternalStreet:()=>Au,loadGraphics:()=>zi,mergeGraphicGeometries:()=>Xa,mergeGraphicLineGeometries:()=>Zo,moveOnRoute:()=>Fa,predictFuturePosition:()=>nn,predictFutureSpeed:()=>Gu,proxyOptions:()=>Ae,removeOutliers:()=>ku,removeWeightPath:()=>Ao,setCirclePosition:()=>de,setLineStartEnd:()=>Wt,setRectPosition:()=>wt,simplifyPath:()=>gn,sleepByRf:()=>ui,sleepOnePromise:()=>ai,sleepOneRf:()=>ir,smoothPath:()=>pi,strToNumber:()=>La,timeoutPromise:()=>Ft,toWebWorker:()=>Va,transformGraphicData:()=>mn,transformSpeed:()=>Yr,translatePosToCenter:()=>Le,triggerWorker:()=>$,vector3ToDevice:()=>I,xhrGet:()=>Da});module.exports=Aa(Wu);function x(){return x=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},x.apply(this,arguments)}var Ev=require("core-js/modules/es.array.push.js"),Sv=require("core-js/modules/web.dom-collections.iterator.js"),bv=require("core-js/modules/es.json.stringify.js"),Vt=require("three");var P_=require("core-js/modules/web.dom-collections.iterator.js");var ju=require("core-js/modules/es.set.difference.v2.js"),Yu=require("core-js/modules/es.set.intersection.v2.js"),Zu=require("core-js/modules/es.set.is-disjoint-from.v2.js"),Ku=require("core-js/modules/es.set.is-subset-of.v2.js"),$u=require("core-js/modules/es.set.is-superset-of.v2.js"),Ju=require("core-js/modules/es.set.symmetric-difference.v2.js"),Qu=require("core-js/modules/es.set.union.v2.js"),t0=require("core-js/modules/web.dom-collections.iterator.js"),K=class{requestAnimationFrame(t){let e=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(e),t()});return this.tasks.requestAnimation.add(e),e}cancelAnimationFrame(t){this.tasks.requestAnimation.delete(t),window.cancelAnimationFrame(t)}setTimeout(t,e){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),t()},e);return this.tasks.timeout.add(n),n}clearTimeout(t){this.tasks.timeout.delete(t),window.clearTimeout(t)}setInterval(t,e){let n=window.setInterval(()=>{t()},e);return this.tasks.interval.add(n),n}clearInterval(t){this.tasks.interval.delete(t),window.clearInterval(t)}requestIdleCallback(t,e){let n=window.requestIdleCallback(r=>{this.tasks.requestIdleCallback.delete(n),t(r)},e);return this.tasks.requestIdleCallback.add(n),n}cancelIdleCallback(t){this.tasks.requestIdleCallback.delete(t),window.cancelIdleCallback(t)}dispose(){this.tasks.requestAnimation.forEach(t=>{window.cancelAnimationFrame(t)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(t=>{window.cancelIdleCallback(t)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(t=>{window.clearTimeout(t)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(t=>{window.clearInterval(t)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var n0=require("core-js/modules/web.dom-collections.iterator.js"),r0=require("core-js/modules/es.array.push.js"),Ut=require("three");function ni(){let a=new Ut.Group,t=new Ut.AmbientLight(16777215,2.6);return a.add(t),a}function cn(a,t){t===void 0&&(t=[]);let e=new Ut.Shape(a.map(n=>new Ut.Vector2(...n)));return t.length&&t.forEach(n=>{var r=new Ut.Path(n.map(i=>new Ut.Vector2(...i)));e.holes.push(r)}),e}function ri(a,t){a===void 0&&(a=16777215),t===void 0&&(t=1);let e=new Ut.DirectionalLight(a,t);return e.castShadow=!0,e.shadow.radius=8,e.shadow.bias=-.001,e.shadow.mapSize.set(256,256),e.shadow.camera.left=-200,e.shadow.camera.right=200,e.shadow.camera.top=200,e.shadow.camera.bottom=-200,e}function B(a,t){if(t&&a.children&&a.children.length&&a.children.forEach(e=>{B(e,t)}),a.isMesh){let e=a;e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n.dispose()}):e.material.dispose())}a.isLight&&(a.dispose==null||a.dispose.call(a))}var s0=require("core-js/modules/es.regexp.exec.js");function ii(a){return/[\u4E00-\u9FA5]+/g.test(a)}var u0=require("core-js/modules/web.dom-collections.iterator.js"),at=require("three"),ze=require("@turf/turf");function I(a,t,e,n){let r=a.clone().project(t),i=e/2,o=n/2,s=Math.round(r.x*i+i),u=Math.round(-r.y*o+o);return{x:s,y:u}}function Ca(a,t,e,n,r){if(!r)return null;e=Math.min(1,e),n=Math.min(1,n);let i=a/e*2-1,o=1-t/n*2;return new at.Vector3(i,o,0).unproject(r)}function hn(a){let t=(0,ze.featureCollection)(a.map(n=>(0,ze.point)(n)));return(0,ze.center)(t).geometry.coordinates}function ae(a,t,e){return a.x>=t.x&&a.x<=e.x&&a.y>=t.y&&a.y<=e.y}function Ra(a){let t=0,e=new at.Vector3;for(let n=1;n<a.length;n++){let r=new at.Vector3(a[n-1][0],a[n-1][1],0),i=new at.Vector3(a[n][0],a[n][1],0),o=i.distanceTo(r);o>t&&(t=o,e=i.clone().sub(r).normalize())}return e}function G(a,t){return Math.sqrt((t[0]-a[0])**2+(t[1]-a[1])**2)}function At(a){let t=0;for(let e=0;e<a.length-1;e++)t+=G(a[e],a[e+1]);return t}function pn(a,t,e){let n=new at.Vector2(t[0]-a[0],t[1]-a[1]),r=new at.Vector2(t[0]-e[0],t[1]-e[1]),o=n.angleTo(r)*180/Math.PI,s=new at.Vector2(t[0]-a[0],t[1]-a[1]);return new at.Vector2(e[0]-a[0],e[1]-a[1]).cross(s)>0?o:-o}function Pa(a,t){let e=Math.min(G(a[0][0],a[0][1]),G(a[0][2],a[0][1]))-1;t||(t=hn(a[0]));let n=Ia(t,e),r=new at.Vector2(a[0][0][0],a[0][0][1]),i=new at.Vector2(a[0][1][0],a[0][1][1]),o=new at.Vector2(a[0][2][0],a[0][2][1]),u=(r.distanceTo(i)>i.distanceTo(o)?i.clone().sub(r):o.clone().sub(i)).angleTo(new at.Vector2(0,1)),l=new at.Matrix3;return l.multiply(new at.Matrix3().translate(t[0],t[1])).multiply(new at.Matrix3().rotate(u)).multiply(new at.Matrix3().translate(-t[0],-t[1])),[n.map(c=>{let h=new at.Vector2(c[0],c[1]).applyMatrix3(l);return[h.x,h.y]})]}function Ia(a,t){let e=t/2;return[[a[0]-e,a[1]+e],[a[0]+e,a[1]+e],[a[0]+e,a[1]-e],[a[0]-e,a[1]-e],[a[0]-e,a[1]+e]]}function Qt(a,t){let e=0,n=1/0,[r,i]=t;for(let o=0;o<a.length-1;o++){let[s,u]=a[o],[l,c]=a[o+1],h=Math.min(s,l)<=r&&r<=Math.max(s,l),p=Math.min(u,c)<=i&&i<=Math.max(u,c);if(h&&p){let f=Math.abs((l-s)*(i-u)-(c-u)*(r-s));f<n&&(n=f,e=o)}}return e}function oi(a,t){let e=a[0],n=a[1],r=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let s=t[i][0],u=t[i][1],l=t[o][0],c=t[o][1];u>n!=c>n&&e<(l-s)*(n-u)/(c-u)+s&&(r=!r)}return r}var c0=require("core-js/modules/es.reflect.to-string-tag.js");function Ae(a,t){return new Proxy(a,{get:(e,n,r)=>Reflect.get(e,n,r),set:(e,n,r,i)=>{let o=Reflect.get(e,n,i),s=Reflect.set(e,n,r,i);return o!==r&&t.dispatchEvent({type:"change-"+n,value:r}),s}})}var p0=require("core-js/modules/web.dom-collections.iterator.js"),f0=require("core-js/modules/es.error.cause.js");function Ft(a,t){return Promise.race([a,new Promise((e,n)=>{setTimeout(()=>n(new Error("Promise timeout")),t)})])}function fn(a){return document.createElementNS("http://www.w3.org/2000/svg",a)}function si(a,t){let e=fn("svg");return e.setAttribute("width",a),e.setAttribute("height",t),e.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",e}function Ge(a,t){a===void 0&&(a="2");let e=fn("circle");return e.setAttribute("r",a),e.setAttribute("fill",t),e}function dn(a){let t=fn("line");return t.setAttribute("stroke",a),t}function ue(a,t){let e=fn("rect");return e.setAttribute("stroke",a),e.setAttribute("fill",t),e}function de(a,t,e){a.setAttribute("cx",""+t),a.setAttribute("cy",""+e)}function Wt(a,t,e){t&&(a.setAttribute("x1",""+t.x),a.setAttribute("y1",""+t.y)),e&&(a.setAttribute("x2",""+e.x),a.setAttribute("y2",""+e.y))}function wt(a,t,e,n,r){a.setAttribute("x",""+t),a.setAttribute("y",""+e),a.setAttribute("width",""+n),a.setAttribute("height",""+r)}function ai(){return Promise.resolve()}function ir(){return new Promise(a=>{requestAnimationFrame(a)})}function ui(a){return a===void 0&&(a=1),new Promise(t=>{function e(){a<=0?t(!0):(a--,window.requestAnimationFrame(e))}window.requestAnimationFrame(e)})}var _0=require("core-js/modules/es.string.replace.js"),v0=require("core-js/modules/es.regexp.exec.js"),y0=require("core-js/modules/es.string.trim.js");function La(a){return parseInt(a.replace("#","0x"),16)}function Na(a,t){let e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16),i=Math.round(e*t),o=Math.round(n*t),s=Math.round(r*t);return"#"+(1<<24|i<<16|o<<8|s).toString(16).slice(1)}function te(a,t){t===void 0&&(t=.85);let e,n,r;if(a.startsWith("#"))e=parseInt(a.substring(1,3),16),n=parseInt(a.substring(3,5),16),r=parseInt(a.substring(5,7),16);else{let o=a.slice(4,-1).split(",");e=parseInt(o[0].trim()),n=parseInt(o[1].trim()),r=parseInt(o[2].trim())}return e=Math.min(Math.floor(e*t),255),n=Math.min(Math.floor(n*t),255),r=Math.min(Math.floor(r*t),255),"#"+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)}function or(a,t){a=a.replace(/^#/,"");let e=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),r=parseInt(a.substring(4,6),16);return t!==void 0?"rgba("+e+", "+n+", "+r+", "+t+")":"rgb("+e+", "+n+", "+r+")"}var E0=require("core-js/modules/es.regexp.exec.js"),Ce=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,li=(navigator.userAgent||"").toLocaleLowerCase(),ge=/ios|iphone/i.test(li),Oa=/android|adr|linux/gi.test(li);function Re(a){return Ce?a==="Meta":a==="Control"}var w0=require("core-js/modules/es.set.difference.v2.js"),T0=require("core-js/modules/es.set.intersection.v2.js"),A0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),C0=require("core-js/modules/es.set.is-subset-of.v2.js"),R0=require("core-js/modules/es.set.is-superset-of.v2.js"),P0=require("core-js/modules/es.set.symmetric-difference.v2.js"),I0=require("core-js/modules/es.set.union.v2.js"),L0=require("core-js/modules/web.dom-collections.iterator.js"),ci="__once__",hi=class{on(t,e){if(typeof e!="function")return;let n=this.events.get(t);return n?n.add(e):this.events.set(t,new Set([e]))}once(t,e){if(typeof e!="function")return;let n=""+ci+t,r=this.events.get(n);return r?r.add(e):this.events.set(n,new Set([e]))}off(t,e){let n=this.events.get(t),r=this.events.get(""+ci+t);!n&&!r||(e===void 0&&(n==null||n.clear(),r==null||r.clear()),n!=null&&n.has(e)&&n.delete(e),r!=null&&r.has(e)&&r.delete(e))}offAll(){this.events.clear()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let i=this.events.get(t),o=this.events.get(""+ci+t);!i&&!o||(i==null||i.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.forEach(s=>{typeof s=="function"&&s(...n)}),o==null||o.clear())}constructor(){this.events=new Map}};var _t=function(a){return a.SWITCH_FLOOR_BEFORE="switch_floor_before",a.SWITCH_FLOOR_GROUND="switch_floor_ground",a.SWITCH_FLOOR_AFTER="switch_floor_after",a}({});var D0=require("core-js/modules/es.array.sort.js");function Pe(a){return Object.keys(a).sort().map(t=>t+"="+a[t]).join("&")}function Da(a,t){return new Promise((e,n)=>{let r=new XMLHttpRequest;r.open("GET",a,!0),Object.keys(t.headers||{}).forEach(i=>{r.setRequestHeader(i,t.headers[i])}),t.responseType&&(r.responseType=t.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(t.responseType==="arraybuffer")e(r.response);else try{let i=JSON.parse(r.responseText);e(i)}catch(i){n(i)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var G0=require("core-js/modules/web.dom-collections.iterator.js"),k0=require("core-js/modules/es.array.push.js"),ke=require("three"),wo=ei(Mo(),1);function To(a,t){let e=a.clone().normalize(),n=t.clone().normalize();return Math.acos(e.dot(n))}function Ua(a){let t=0;return a.reduce((e,n)=>{let[r,i]=e,[o,s]=n;return t+=Math.sqrt((o-r)**2+(s-i)**2),[o,s]}),t/a.length}function pi(a,t){if(t===void 0&&(t=.25),Ua(a)<t)return a;let e=(0,wo.default)(a);return pi(e,t)}function gn(a,t,e,n,r,i){t===void 0&&(t=!1),e===void 0&&(e=!0),n===void 0&&(n=5),r===void 0&&(r=150),i===void 0&&(i=3);let o=[],s=!t;if(o.push(a[0]),a.length<2)return o;for(let l=0;l<a.length-2;l+=1){let c=a[l],h=a[l+1],p=a[l+2],f=new ke.Vector2(c[0]-h[0],c[1]-h[1]),d=new ke.Vector2(p[0]-h[0],p[1]-h[1]),m=To(f,d)/Math.PI*180,v=f.length()+d.length();(!s||m<r&&v>.01||v>n)&&(o.push(a[l+1]),s=!0)}if(o.push(a[a.length-1]),!e)return o;let u=[];u.push(o[0]);for(let l=0;l<o.length-2;l+=1){let c=new ke.Vector2(o[l][0],o[l][1]),h=new ke.Vector2(o[l+1][0],o[l+1][1]),p=new ke.Vector2(o[l+2][0],o[l+2][1]),f=c.distanceTo(h)/2,d=p.distanceTo(h)/2,m=h.clone(),v=h.clone();m.add(c.clone().sub(h).normalize().multiplyScalar(f>i?i/2:f)),v.add(p.clone().sub(h).normalize().multiplyScalar(d>i?i/2:d));let y=[[m.x,m.y],[h.x,h.y],[v.x,v.y]];u.push(...pi(y,i/25))}return u.push(o[o.length-1]),Ao(u)}function Ao(a){if(a.length<=1)return a;let t=[],e;return a.forEach(n=>{let[r,i]=n;e?r===e[0]&&i===e[1]||(e=[r,i],t.push([r,i])):(e=[r,i],t.push([r,i]))}),t}function fi(a,t,e){let n=Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2);if(n===0)return{distance:Math.sqrt((a[0]-t[0])**2+(a[1]-t[1])**2),closestPoint:t.slice(0)};let r=Math.max(0,Math.min(1,((a[0]-t[0])*(e[0]-t[0])+(a[1]-t[1])*(e[1]-t[1]))/n**2)),i=[t[0]+r*(e[0]-t[0]),t[1]+r*(e[1]-t[1])];return{distance:Math.sqrt((a[0]-i[0])**2+(a[1]-i[1])**2),closestPoint:i}}function Fa(a,t,e){let[n,r]=a,[i,o]=t,s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2));if(s===0||s<e)return[...t];let u=e/s,l=n+(i-n)*u,c=r+(o-r)*u;return[l,c]}var ee=function(a){return a.START="start",a.END="end",a.FRONT="front",a.RIGHT="right",a.LEFT="left",a.RIGHT_FRONT="right_front",a.LEFT_FRONT="left_front",a.RIGHT_BACK="right_back",a.LEFT_BACK="left_back",a}({});function sr(a,t,e){let n=pn(a,t,e);return ar(n)}function ar(a){return 180-Math.abs(a)<15?"front":a>135?"right_front":a<-135?"left_front":a<=135&&a>=60?"right":a>=-135&&a<=-60?"left":a<60&&a>0?"right_back":a>-60&&a<0?"left_back":"front"}function Ba(a){if(!a.length)return[];if(a.length===1)return[{direction:"start",distance:0,points:a}];let t=[{direction:"start",distance:G(a[0],a[1]),points:[a[0],a[1]]}];for(let e=2;e<a.length;e++){let n=sr(a[e-2],a[e-1],a[e]);if(n==="front"){let r=t[t.length-1],i=G(a[e-1],a[e]);r.distance+=i,e!==2&&r.points.push(a[e-1])}else t.push({direction:n,distance:G(a[e-1],a[e]),points:[a[e-1],a[e]]})}return t.push({direction:"end",distance:0,points:[a[a.length-1]]}),t}function di(a,t){if(a.length<2)return-1;let e=0;for(let n=1;n<a.length;n++){let r=a[n-1],i=a[n],o=[t[0]-r[0],t[1]-r[1]],s=[i[0]-r[0],i[1]-r[1]],u=Math.min(i[0],r[0])<=t[0]&&t[0]<=Math.max(i[0],r[0]),l=Math.min(i[1],r[1])<=t[1]&&t[1]<=Math.max(i[1],r[1]);if(u&&l){let c=o[0]*s[1]-o[1]*s[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((t[0]-r[0])**2+(t[1]-r[1])**2);return e+h}}e+=Math.sqrt((i[0]-r[0])**2+(i[1]-r[1])**2)}return-1}function Ie(a,t){if(a.length<2){var e;return(e=a[0])!=null?e:null}let n=0;for(let r=1;r<a.length;r++){let i=a[r-1],o=a[r],s=Math.sqrt((o[0]-i[0])**2+(o[1]-i[1])**2);if(n+=s,n>=t){let u=(t-(n-s))/s,l=i[0]+(o[0]-i[0])*u,c=i[1]+(o[1]-i[1])*u;return[l,c]}}return null}var K0=require("core-js/modules/es.array.push.js"),$0=require("core-js/modules/web.dom-collections.iterator.js"),J0=require("core-js/modules/es.regexp.exec.js"),ne=ei(_i(),1);var Xt="___",vi=class{initRoute(t){this.clear(),this.roadInfo=t,t.length&&(t.forEach(e=>{e.points.forEach(n=>{let r=""+e.floor+Xt+n.id;if(this.pointMap.set(r,n),this.nodeMap.set(""+n.floor+Xt+n.nodeId,r),n.type==="straightLadder"){let i=this.straightLadderMap.get(n.name)||[];i.push(x({},n)),this.straightLadderMap.set(n.name,i)}if(n.type==="staircase"){let i=this.staircaseMap.get(n.name)||[];i.push(x({},n)),this.staircaseMap.set(n.name,i)}if(n.type==="escalator"){let i=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?i.end={floor:n.floor,id:n.id}:i.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,i)}if(n.type==="facility"){let i=this.facilityMap.get(n.targetId)||[];i.push(x({},n)),this.facilityMap.set(n.targetId,i)}}),e.lines.filter(n=>n.direction!=="no").forEach(n=>{var r,i;let o=""+e.floor+Xt+n.from,s=""+e.floor+Xt+n.to,u=(r=this.pointMap.get(o))==null?void 0:r.cds,l=(i=this.pointMap.get(s))==null?void 0:i.cds;if(u!=null&&u.length&&(l!=null&&l.length)){let c=G(u,l);this.addLineItem(o,s,c),n.direction==="double"&&this.addLineItem(s,o,c)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let c=0;c<s.length;c++){let h=""+s[c].floor+Xt+s[c].id;for(let p=0;p<s.length;p++)if(c!==p){var u,l;let f=""+s[p].floor+Xt+s[p].id,d=(u=this.pointMap.get(h))==null?void 0:u.cds,m=(l=this.pointMap.get(f))==null?void 0:l.cds;if(d!=null&&d.length&&(m!=null&&m.length))if(s[c].type==="straightLadder"){let v=e;this.addLineItem(h,f,v,r)}else{let v=n;this.addLineItem(h,f,v,r)}}}}),this.escalatorMap.forEach((i,o)=>{if(i.start&&i.end){var s,u;let l=""+i.start.floor+Xt+i.start.id,c=""+i.end.floor+Xt+i.end.id,h=(s=this.pointMap.get(l))==null?void 0:s.cds,p=(u=this.pointMap.get(c))==null?void 0:u.cds;if(h!=null&&h.length&&(p!=null&&p.length)){let f=t;this.addLineItem(l,c,f,r)}}})}initBaseRoute(){let t=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,t),this.baseRoute=new ne.default(t)}initEscalatorRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ne.default(t)}initStraightLadderRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new ne.default(t)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility?!0:this.checkStart(t)}transformStart(t){var e;if(t.nodeId){let n=this.nodeMap.get(""+t.floor+Xt+t.nodeId);if(n){let[r,i]=n.split(Xt);return{floor:r,id:i}}}if((e=t.coord)!=null&&e.length){let n=this.roadInfo.find(i=>i.floor===t.floor);if(!n)return null;let r=n.points.reduce((i,o)=>{let s=G(t.coord,o.cds);return s<i.min&&(i.min=s,i.point=o),i},{min:1/0,point:n.points[0]});return{floor:r.point.floor,id:r.point.id}}return null}transformEnd(t){if(t.floor){let e=this.transformStart(t);if(e)return e}if(t.facility){let e=this.facilityMap.get(t.facility);if(e!=null&&e.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n){if(n===void 0&&(n=""),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let r=this.transformStart(t);if(!r)return"no-start";let i=this.transformEnd(e);if(!i)return"no-end";let o=this.getBasePath.bind(this);switch(n){case"escalator":o=this.getEscalatorPath.bind(this);break;case"straightLadder":o=this.getStraightLadderPath.bind(this);break;default:o=this.getBasePath.bind(this);break}if(i.id)return o(r,i);if(i.facility){let s=this.facilityMap.get(i.facility).filter(l=>i.floor?l.floor===i.floor:!0);if(!s.length)return null;let u=s.map(l=>o(r,{floor:l.floor,id:l.id})).filter(l=>!!l);return u.reduce((l,c)=>{let h=c.reduce((p,f)=>p+At(f.points),0);return h<l.distance&&(l.distance=h,l.path=c),l},{distance:1/0,path:u[0]}).path}}getRoutePath(t,e,n){let r=""+t.floor+Xt+t.id,i=""+e.floor+Xt+e.id,o=n.path(r,i);if(!o)return null;let s=[];return o.map(u=>{let l=this.pointMap.get(u);if(l){var c;let{floor:h}=l;if(((c=s[s.length-1])==null?void 0:c.floor)===h){let p=s[s.length-1];p.points.push(l.cds),p.endType=l.type,p.destId=l.nodeId,p.distance=At(p.points)}else s.push({floor:h,points:[l.cds],endType:l.type,destId:l.nodeId,distance:0})}}),s}getBasePath(t,e){return this.getRoutePath(t,e,this.baseRoute)}getEscalatorPath(t,e){return this.getRoutePath(t,e,this.escalatorRoute)}getStraightLadderPath(t,e){return this.getRoutePath(t,e,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ne.default,this.escalatorRoute=new ne.default,this.straightLadderRoute=new ne.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.staircaseMap=new Map,this.lineMap=new Map,this.baseRoute=new ne.default,this.escalatorRoute=new ne.default,this.straightLadderRoute=new ne.default}};var nl=require("core-js/modules/web.dom-collections.iterator.js"),rl=require("core-js/modules/es.regexp.exec.js"),il=require("core-js/modules/es.array.push.js"),ol=require("core-js/modules/es.set.difference.v2.js"),sl=require("core-js/modules/es.set.intersection.v2.js"),al=require("core-js/modules/es.set.is-disjoint-from.v2.js"),ul=require("core-js/modules/es.set.is-subset-of.v2.js"),ll=require("core-js/modules/es.set.is-superset-of.v2.js"),cl=require("core-js/modules/es.set.symmetric-difference.v2.js"),hl=require("core-js/modules/es.set.union.v2.js"),pl=require("core-js/modules/es.array.flat.js"),fl=require("core-js/modules/es.array.unscopables.flat.js"),vt=ei(_i(),1);var Pt=require("lodash"),ur=require("three"),D="___",yi=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let n=[];try{n=JSON.parse(e.entry_end_floor)}catch(i){n=[]}let r=[];try{r=JSON.parse(e.entry_start_floor)}catch(i){r=[]}return x({},e,{entry_start_floor:r,entry_end_floor:n})})}getParkingSpaceInfo(t,e){let n=""+t+D+e;var r;return(r=this.parkingMap.get(n))!=null?r:null}getNodeInfo(t,e){let n=""+t+D+e,r=this.nodeMap.get(n);if(!(r!=null&&r.length))return null;let i=this.pointMap.get(r[0]);return i!=null?i:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let n=new Date,r=n.getHours()*60+n.getMinutes();t.length&&(t.forEach(i=>{let o=(i.points||[]).filter(s=>!(0,Pt.isNil)(s.passWeight)&&s.passWeight!==1&&!(0,Pt.isNil)(s.coverageArea)&&s.coverageArea!==0);(i.points||[]).filter(s=>s.openStatus!==!1).filter(s=>{if(!s.startTime||!s.endTime)return!0;let[u,l]=s.startTime.split(":").map(d=>+d),[c,h]=s.endTime.split(":").map(d=>+d),p=u*60+l,f=c*60+h;return r>=p&&r<=f}).forEach(s=>{s.floor=i.floor;let u=""+i.floor+D+s.id,l=""+i.floor+D+s.nodeId,c=this.nodeMap.get(l)||[];if(c.push(""+i.floor+D+(s.relatedId||s.id)),this.nodeMap.set(""+i.floor+D+s.nodeId,c),this.pointMap.set(u,s),this.isFacilityByType(s.type)){let h=this.facilities.find(p=>p.id===+s.targetId);if(h){switch(h.entry_infra_type){case"straightLadder":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.straightLadderMap.get(s.targetId)||[];m.push(x({},s)),this.straightLadderMap.set(s.targetId,m)}break;case"staircase":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.staircaseMap.get(s.targetId)||[];m.push(x({},s)),this.staircaseMap.set(s.targetId,m)}break;case"escalator":let f=this.escalatorMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=f.find(v=>{var y;return((y=v.end)==null?void 0:y.floor)!==i.floor&&!v.start});m?m.start=s:f.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=f.find(v=>{var y;return((y=v.start)==null?void 0:y.floor)!==i.floor&&!v.end});m?m.end=s:f.push({end:s})}this.escalatorMap.set(s.targetId,f);break;case"ramp":let d=this.rampMap.get(s.targetId)||[];if(h.entry_start_floor.find(m=>m.floor===i.floor)){let m=d.find(v=>{var y;return((y=v.end)==null?void 0:y.floor)!==i.floor&&!v.start});m?m.start=s:d.push({start:s})}if(h.entry_end_floor.find(m=>m.floor===i.floor)){let m=d.find(v=>{var y;return((y=v.start)==null?void 0:y.floor)!==i.floor&&!v.end});m?m.end=s:d.push({end:s})}this.rampMap.set(s.targetId,d);break;case"connectionPoint":if(h.entry_end_floor.find(m=>m.floor===i.floor)&&h.entry_start_floor.find(m=>m.floor===i.floor)){let m=this.connectionPointMap.get(s.targetId)||[];m.push(x({},s)),this.connectionPointMap.set(s.targetId,m)}break}let p=this.facilityMap.get(s.targetId)||[];p.push(x({},s)),this.facilityMap.set(s.targetId,p)}}s.type==="parkingSpace"&&s.name.split(/[,,]/).forEach(p=>{this.parkingMap.set(""+i.floor+D+p,s)})}),(i.lines||[]).filter(s=>s.to!==s.from).forEach(s=>{let u=""+i.floor+D+s.from,l=""+i.floor+D+s.to,c=this.pointMap.get(u),h=this.pointMap.get(l);if(!c||!h)return;let p=c.cds,f=h.cds,d=G(p,f);if(o.forEach(m=>{(m.id===s.from||m.id===s.to)&&(d=d/m.passWeight);let v=G(p,m.cds)<=m.coverageArea,y=G(f,m.cds)<=m.coverageArea;(v||y)&&(d=d/m.passWeight)}),!c.permission&&!h.permission){switch(this.addLineItem(u,l,d),this.addLineItem(l,u,d),s.direction){case"double":this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap);break;case"single":this.addLineItem(u,l,d,this.forwardLineMap);break;case"back":this.addLineItem(l,u,d,this.forwardLineMap);break}(c.type==="parkingSpace"||h.type==="parkingSpace")&&s.direction==="noDir"&&(this.addLineItem(u,l,d,this.forwardLineMap),this.addLineItem(l,u,d,this.forwardLineMap))}else c.permission&&(this.setPermissionLine(u,l,c.permission,d,""),this.setPermissionLine(l,u,c.permission,d,"")),h.permission&&h.permission!==c.permission&&(this.setPermissionLine(u,l,h.permission,d,""),this.setPermissionLine(l,u,h.permission,d,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,n,r,i){this.getPermissionMap(n).add({fromKey:t,toKey:e,distance:r,type:i})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"straightLadder"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"staircase"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,1,"escalator"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&(o.permission&&this.setPermissionLine(r,i,o.permission,10,"ramp"),s.permission&&s.permission!==o.permission&&this.setPermissionLine(r,i,s.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(i){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u)continue;i.permission&&this.setPermissionLine(r,s,i.permission,1,"connectionPoint"),u.permission&&u.permission!==i.permission&&this.setPermissionLine(r,s,u.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,n,r){this.getPermissionMap(t).forEach(o=>{e.includes(o.type)&&(o.type===""?this.addLineItem(o.fromKey,o.toKey,o.distance,n):this.addLineItem(o.fromKey,o.toKey,r.get(o.type),n))})}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let i=r.get(t)||new Map;i.set(e,n),r.set(t,i)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(i=>{let[o,s]=i;if(!(s.length<2))for(let u=0;u<s.length;u++){let l=""+s[u].floor+D+s[u].id,c=this.pointMap.get(l);if(!(!c||c.permission)){for(let h=0;h<s.length;h++)if(u!==h){let p=""+s[h].floor+D+s[h].id,f=this.pointMap.get(p);if(!f||f.permission)continue;if(s[u].type==="straightLadder"){let d=e;this.addLineItem(l,p,d,r)}else{let d=n;this.addLineItem(l,p,d,r)}}}}}),this.escalatorMap.forEach((i,o)=>{i.forEach(s=>{if(s.start&&s.end){let u=""+s.start.floor+D+s.start.id,l=""+s.end.floor+D+s.end.id,c=this.pointMap.get(u),h=this.pointMap.get(l);if(c&&h&&!c.permission&&!h.permission){let p=t;this.addLineItem(u,l,p,r)}}})}),this.connectionPointMap.forEach((i,o)=>{if(!(i.length<2))for(let s=0;s<i.length;s++){let u=""+i[s].floor+D+i[s].id,l=this.pointMap.get(u);if(!(!l||l.permission)){for(let c=0;c<i.length;c++)if(s!==c){let h=""+i[c].floor+D+i[c].id,p=this.pointMap.get(h);if(!p||p.permission)continue;this.addLineItem(u,h,100,r)}}}})}initBaseRoute(){let t=new Map((0,Pt.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new vt.default(t)}initEscalatorRoute(){let t=new Map((0,Pt.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(100,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new vt.default(t)}initStraightLadderRoute(){let t=new Map((0,Pt.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,300,3e4*e,t),this.straightLadderRoute=new vt.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+D+n.start.id,i=""+n.end.floor+D+n.end.id,o=this.pointMap.get(r),s=this.pointMap.get(i);o&&s&&!o.permission&&!s.permission&&this.addLineItem(r,i,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let n=0;n<t.length;n++){let r=""+t[n].floor+D+t[n].id,i=this.pointMap.get(r);if(!(!i||i.permission)){for(let o=0;o<t.length;o++)if(n!==o){let s=""+t[o].floor+D+t[o].id,u=this.pointMap.get(s);if(!u||u.permission)continue;this.addLineItem(r,s,100,this.forwardLineMap)}}}}),this.forwardRoute=new vt.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,n){n===void 0&&(n={});var r;if(t.nodeId){let i=this.nodeMap.get(""+t.floor+D+t.nodeId);if(i!=null&&i.length)return i.map(o=>{let[s,u]=o.split(D);return{floor:s,id:u}})}if((r=t.coord)!=null&&r.length){let i=this.roadInfo.find(l=>l.floor===t.floor);if(!i)return null;let o=i.points.filter(l=>l.isStarted),s=i.points.filter(l=>{let c=""+l.floor+D+l.id;if(e==="forward"){if(!this.forwardLineMap.has(c)||n.adsorptionIntersection&&o.length&&!l.isStarted)return!1}else if(!this.lineMap.has(c))return!1;return!0});if(!s.length)return null;let u=s.reduce((l,c)=>{if(c.relatedId)return l;let h=G(t.coord,c.cds);return h<l.min&&(l.min=h,l.point=c),l},{min:1/0,point:s[0]});return[{floor:i.floor,id:u.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let r=this.parkingMap.get(""+t.floor+D+t.parkingSpace);if(r)return[{floor:t.floor,id:r.id}]}let n=this.transformStart(t,e);if(n)return n}if(t.facility){let r=this.facilities.filter(i=>+i.type_id==+t.facility).map(i=>i.id).map(i=>this.facilityMap.get(""+i)).flat(2);if(r!=null&&r.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n,r,i,o){if(n===void 0&&(n=""),o===void 0&&(o={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let s=this.transformStart(t,n,o);if(!s)return"no-start";let u=this.transformEnd(e,n);if(!u)return"no-end";let l=[];if(Array.isArray(u))for(let p=0;p<s.length;p++){let f=s[p];for(let d=0;d<u.length;d++){let m=u[d];if(f.floor===m.floor&&f.id===m.id)return"near"}}else{l=this.facilities.filter(f=>+f.type_id==+e.facility).map(f=>f.id).map(f=>this.facilityMap.get(""+f)).flat(2).filter(f=>f).filter(f=>u.floor?f.floor===u.floor:!0);for(let f=0;f<s.length;f++){let d=s[f];for(let m=0;m<l.length;m++){let v=l[m];if(d.floor===v.floor&&d.id===v.id)return"near"}}}let c;switch(n){case"escalator":c=this.getEscalatorPath.bind(this);break;case"straightLadder":c=this.getStraightLadderPath.bind(this);break;case"forward":c=this.getForwardPath.bind(this);break;default:c=this.getBasePath.bind(this);break}let h=null;return s.forEach(p=>{if(Array.isArray(u))u.forEach(f=>{let d=c(p,f,r,i);d&&d&&(!h||d[0].consume<h[0].consume)&&(h=d)});else{if(!l.length)return null;let f=l.map(d=>c(p,{floor:d.floor,id:d.id},r,i)).filter(d=>!!d);h=f.reduce((d,m)=>{let v=m[0].consume;return v<d.distance&&(d.distance=v,d.path=m),d},{distance:1/0,path:f[0]}).path}}),h}getRoutePath(t,e,n){let r=""+t.floor+D+t.id,i=this.pointMap.get(r),o=""+e.floor+D+e.id,s=this.pointMap.get(o);if(!i||!s)return null;let u=""+i.floor+D+(i.relatedId||i.id),l=""+s.floor+D+(s.relatedId||s.id),c=n.path(u,l);if(!c)return null;let h=[],p=c.reduce((f,d,m,v)=>{if(m===0)return 0;let y=v[m-1],S=n.graph.get(y).get(d);return f+S},0);return c.map(f=>{let d=this.pointMap.get(f);if(d){var m;let{floor:v}=d,y=d.type;if(this.isFacilityByType(d.type)){let S=this.facilities.find(w=>w.id===+d.targetId);S&&(y=S.entry_infra_type)}if(((m=h[h.length-1])==null?void 0:m.floor)===v){let S=h[h.length-1];S.points.push(d.cds),S.pointInfos.push(d),S.endType=y,S.destId=d.nodeId,S.distance=At(S.points)}else h.push({floor:v,points:[d.cds],pointInfos:[d],endType:y,destId:d.nodeId,distance:0,consume:p})}}),h}getBasePath(t,e,n){if(!n)return this.getRoutePath(t,e,this.baseRoute);let r=(0,Pt.cloneDeep)(this.baseRoute.graph),i=s=>{this.addPermissionLineToMap(s,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]))};Array.isArray(n)?n.forEach(s=>{i(s)}):i(n);let o=new vt.default(r);return this.getRoutePath(t,e,o)}getEscalatorPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.escalatorRoute);let r=(0,Pt.cloneDeep)(this.escalatorRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",this.lift_priority*i],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new vt.default(r);return this.getRoutePath(t,e,s)}getStraightLadderPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.straightLadderRoute);let r=(0,Pt.cloneDeep)(this.straightLadderRoute.graph),i=1e4,o=u=>{this.addPermissionLineToMap(u,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",3*i],["connectionPoint",100],["straightLadder",300],["staircase",3e4*i]]))};Array.isArray(n)?n.forEach(u=>{o(u)}):o(n);let s=new vt.default(r);return this.getRoutePath(t,e,s)}getForwardPath(t,e,n,r){let i=new Map,o=f=>{let d=this.forwardRoute.graph.get(u);f.forEach(m=>{let v=d.get(m);(0,Pt.isNil)(v)||(i.set(m,v),d.delete(m))})},s=()=>{let f=this.forwardRoute.graph.get(u);i.forEach((d,m)=>{f.set(m,d)})},u=""+t.floor+D+t.id;if(!(0,Pt.isNil)(r)){let f=this.forwardLineMap.get(u),d=this.pointMap.get(u);if(d&&(f!=null&&f.size)&&f.size>1){let m=new ur.Vector2(d.cds[0],d.cds[1]),v=new Map;f.forEach((S,w)=>{let O=this.pointMap.get(w);if(O){let N=new ur.Vector2(O.cds[0],O.cds[1]),C=360-(new ur.Vector2().subVectors(N,m).angle()/Math.PI*180-90+360)%360;v.set(w,C)}});let y=Array.from(v).filter(S=>{let[w,O]=S;return Math.abs(O-r)<=60}).map(S=>{let[w]=S;return w});if(y.length)y.forEach(S=>v.delete(S)),o([...v.keys()]);else{let S=Array.from(v).reduce((w,O)=>{let N=Math.abs(O[1]-r);return N<w.diff?{diff:N,key:O[0]}:w},{diff:1/0,key:""});v.delete(S.key),o([...v.keys()])}}}if(!n){let f=this.getRoutePath(t,e,this.forwardRoute);return s(),f||this.getRoutePath(t,e,this.forwardRoute)}let l=(0,Pt.cloneDeep)(this.forwardRoute.graph),c=f=>{this.addPermissionLineToMap(f,["","ramp"],l,new Map([["ramp",10]]))};Array.isArray(n)?n.forEach(f=>{c(f)}):c(n);let h=new vt.default(l),p=this.getRoutePath(t,e,h);if(s(),p)return p;{let f=(0,Pt.cloneDeep)(this.forwardRoute.graph);Array.isArray(n)?n.forEach(v=>{c(v)}):c(n);let d=new vt.default(f);return this.getRoutePath(t,e,d)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new vt.default,this.escalatorRoute=new vt.default,this.straightLadderRoute=new vt.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new vt.default,this.escalatorRoute=new vt.default,this.straightLadderRoute=new vt.default,this.forwardLineMap=new Map,this.forwardRoute=new vt.default}};var ml=require("core-js/modules/es.set.difference.v2.js"),_l=require("core-js/modules/es.set.intersection.v2.js"),vl=require("core-js/modules/es.set.is-disjoint-from.v2.js"),yl=require("core-js/modules/es.set.is-subset-of.v2.js"),xl=require("core-js/modules/es.set.is-superset-of.v2.js"),El=require("core-js/modules/es.set.symmetric-difference.v2.js"),Sl=require("core-js/modules/es.set.union.v2.js"),bl=require("core-js/modules/web.dom-collections.iterator.js"),me=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let t=this.createKey();for(;this.keySet.has(t);)t=this.createKey();return t}static removeKey(t){this.keySet.delete(t)}static dispose(){this.keySet.clear()}};me.keySet=new Set;var wl=require("core-js/modules/es.string.replace.js"),Tl=require("core-js/modules/es.regexp.exec.js");function xi(a){return a.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function $(a,t,e){return new Promise((n,r)=>{let i=me.genUniqueKey(),o=s=>{let{data:u}=s;u.type===""+t+"_result"&&u.key===i&&(me.removeKey(i),self.removeEventListener("message",o),u.error?r(u.error):n(u.data))};a.addEventListener("message",o),a.postMessage({type:t,key:i,data:e})})}function Va(a){let t={};for(let n in a)n.startsWith("on")&&(t[xi(n.slice(2))]=a[n]);let e=n=>g(this,null,function*(){let{data:r}=n;if(t[r.type])try{let i=yield t[r.type](r.data);if(i!=null&&i.$transfer&&Array.isArray(i.$transfer)){let o=i.$transfer;delete i.$transfer,self.postMessage({type:""+r.type+"_result",key:r.key,data:i},o)}else self.postMessage({type:""+r.type+"_result",key:r.key,data:i})}catch(i){self.postMessage({type:""+r.type+"_result",key:r.key,error:i})}else self.postMessage({type:""+r.type+"_result",key:r.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var qt=require("three");function Ha(a,t){t===void 0&&(t=16711680);let e=new qt.LineBasicMaterial({color:t}),n=new qt.BufferGeometry().setFromPoints(a);return new qt.Line(n,e)}function Wa(a,t){t===void 0&&(t=16711680);let e=new qt.MeshBasicMaterial({color:t,depthTest:!1,transparent:!0}),n=new qt.BoxGeometry(1,1,1),r=new qt.Mesh(n,e);return r.position.copy(a),r.renderOrder=100100,r}var Nl=require("core-js/modules/es.json.stringify.js"),Ol=require("core-js/modules/web.dom-collections.iterator.js");function mn(a,t,e){e===void 0&&(e=0),a.forEach(n=>{if(n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"){var r;n.geometry.coords.map(i=>{Array.isArray(i)&&i.forEach(o=>{o[0]-=t[0],o[1]-=t[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(i=>i.map(o=>Le(o,t)))),(r=n.doors)!=null&&r.length&&n.doors.map(i=>{i.coord=Le(i.coordinate,t)}),n.center&&(n.centerCoords=Le(n.center,t))}else n.geometry.coords=Le(n.geometry.cds,t),n.center&&(n.centerCoords=Le(n.center,t));if(n.center_x&&n.center_y){let[i,o]=Le([n.center_x,n.center_y],t);n.center_coord_x=i,n.center_coord_y=o}});for(let n=0;n<a.length;n++){let r=a[n];r.deltaHeight=1e-5*(e+n+1)}}function Le(a,t){return[a[0]-t[0],a[1]-t[1]]}var Ul=require("core-js/modules/es.set.difference.v2.js"),Fl=require("core-js/modules/es.set.intersection.v2.js"),Bl=require("core-js/modules/es.set.is-disjoint-from.v2.js"),zl=require("core-js/modules/es.set.is-subset-of.v2.js"),Gl=require("core-js/modules/es.set.is-superset-of.v2.js"),kl=require("core-js/modules/es.set.symmetric-difference.v2.js"),Vl=require("core-js/modules/es.set.union.v2.js"),Hl=require("core-js/modules/web.dom-collections.iterator.js"),Vo=require("@tweenjs/tween.js"),le=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(t=>{this.tweenStore.add(t),t.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(t=>{t.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(t){this.group.remove(t)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(t=>t.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new Vo.Group}};var Ho=require("three"),_n=class extends Ho.EventDispatcher{registryEvent(){this.ctn.addEventListener("pointerdown",this._pointerDown),this.ctn.addEventListener("pointerup",this._pointerUp)}unRegistryEvent(){this.ctn.removeEventListener("pointerdown",this._pointerDown),this.ctn.removeEventListener("pointerup",this._pointerUp)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.ctn=t,this._pointerDown=e=>{this.point={x:e.offsetX,y:e.offsetY}},this._pointerUp=e=>{if(!this.point)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.point;Math.hypot(i-n+(o-r))>3||this.dispatchEvent({type:"click",e})},this.registryEvent()}};var jl=require("core-js/modules/web.dom-collections.iterator.js"),Yl=require("core-js/modules/es.array.push.js"),Zl=require("core-js/modules/es.string.replace.js"),Kl=require("core-js/modules/es.regexp.exec.js"),Wo=require("lodash"),Xo=require("three");var Ne=class extends Xo.EventDispatcher{_isEffectiveTask(t){return t&&typeof t.run=="function"}_getIndexByTid(t){return this._task.findIndex(e=>e.tid===t)}_createTask(t){return this._isEffectiveTask(t)?x({},t,{tid:++this._id,meta:t.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(t){if(this._isEffectiveTask(t)){let e=this._createTask(t);return this._task.push(e),this.started&&!this.activeTask&&this.start(),e.tid}return!1}replace(t,e){if(!this._isEffectiveTask(e))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(t);if(n===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+t+"\u7684\u4EFB\u52A1"),!1;let r=this._createTask(e);return this._task.splice(n,1,r),r.tid}replaceByMetaType(t){var e;let n=(e=t.meta)==null?void 0:e.type;if((0,Wo.isNil)(n))return this.add(t);{let r=this._task.find(i=>i.meta.type===n);return r?this.replace(r.tid,t):this.add(t)}}remove(t){let e=this._getIndexByTid(t);return e===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+t+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(e,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return g(this,null,function*(){if(!this.started||!this._task.length)return!1;let t=this._task.shift();this.activeTask=t,this.dispatchEvent({type:"active-task-start",task:t});let e;try{e=yield t.run()}catch(n){console.warn("[task run err]",n,t)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:t,res:e}),this.exec()})}constructor(t=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,t&&this.start()}};var Ql=require("core-js/modules/es.array.push.js"),qo=require("three"),vn=class extends qo.EventDispatcher{getWorker(){return new Promise(t=>{let e=this.pool.find(r=>r.state==="leisure");if(e){e.state="used",t(e.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let r=this.workerConstructor();this.pool.push({worker:r,state:"used"}),t(r);return}let n=()=>{let r=this.pool.find(i=>i.state==="leisure");r&&(this.removeEventListener("release",n),r.state="used",t(r.worker))};this.addEventListener("release",n)})}releaseWorker(t){let e=this.pool.find(n=>n.worker===t);e&&(e.state="leisure",this.dispatchEvent({type:"release",worker:t}))}dispose(){this._listeners={},this.pool.forEach(t=>{t.worker.terminate()}),this.pool=[]}constructor(t=10,e){super(),this.max=10,this.pool=[],this.max=t,this.workerConstructor=e}};var jo=require("three"),it=class extends jo.EventDispatcher{dispose(){this._listeners={}}};var yn=class{filter(t){let e=this.estimate,n=this.errorEstimate+this.processNoise,r=n/(n+this.measurementNoise);return this.estimate=e+r*(t-e),this.errorEstimate=(1-r)*n,this.estimate}constructor(t={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=t.measurementNoise||1,this.processNoise=t.processNoise||.1,this.errorEstimate=t.errorEstimate||1}};var rc=require("core-js/modules/es.typed-array.float32-array.js"),ic=require("core-js/modules/es.typed-array.at.js"),oc=require("core-js/modules/es.typed-array.fill.js"),sc=require("core-js/modules/es.typed-array.find-last.js"),ac=require("core-js/modules/es.typed-array.find-last-index.js"),uc=require("core-js/modules/es.typed-array.set.js"),lc=require("core-js/modules/es.typed-array.sort.js"),cc=require("core-js/modules/es.typed-array.to-reversed.js"),hc=require("core-js/modules/es.typed-array.to-sorted.js"),pc=require("core-js/modules/es.typed-array.with.js"),fc=require("core-js/modules/es.array-buffer.constructor.js"),dc=require("core-js/modules/es.array-buffer.slice.js"),gc=require("core-js/modules/es.array-buffer.detached.js"),mc=require("core-js/modules/es.array-buffer.transfer.js"),_c=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),vc=require("core-js/modules/es.array.push.js"),yt=require("three");var Yo=require("three/examples/jsm/utils/BufferGeometryUtils.js");function Xa(a,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let n=a.filter(s=>s.geometry.type==="polygon");if(!n.length)return null;let r=n.map(s=>{var u;let l=s.geometry.coords,c=cn(l[0],l.slice(1)),h=new yt.ExtrudeGeometry(c,{steps:1,bevelEnabled:!1,depth:s.height,curveSegments:4});(u=s).deltaHeight||(u.deltaHeight=0),h.translate(0,0,s.airHeight+s.deltaHeight);let p=h.attributes.position.count,f=new Float32Array(p).fill(s.height+s.airHeight+s.deltaHeight);if(h.setAttribute("maxZ",new yt.BufferAttribute(f,1)),h.setAttribute("opacity",new yt.BufferAttribute(new Float32Array(p).fill(s.fillOpacity),1)),e){let v=new Float32Array(p).fill(s.airHeight+s.deltaHeight);h.setAttribute("minZ",new yt.BufferAttribute(v,1))}let d=new yt.Color(s.fillColor).convertLinearToSRGB(),m=new Float32Array(p*3);for(let v=0;v<p;v++)m[v*3]=d.r,m[v*3+1]=d.g,m[v*3+2]=d.b;return h.setAttribute("color",new yt.BufferAttribute(m,3)),h}),i=(0,Yo.mergeGeometries)(r);r.forEach(s=>s.dispose());let o={geometry:i};return i.dispose(),t&&(o.lineGeometry=Zo(n)||void 0),o}function Zo(a){let{points:t,colors:e,opacities:n}=lr(a);if(!t.length)return null;let r=new yt.BufferGeometry().setFromPoints(t);return r.setAttribute("color",new yt.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new yt.BufferAttribute(new Float32Array(n),1)),r}function lr(a){let t=[],e=[],n=[];return a.filter(r=>r.strokeOpacity>0).map(r=>{let i=r.height+(r.deltaHeight||0)+r.airHeight,{coords:o}=r.geometry,{strokeColor:s,strokeOpacity:u}=r,l=new yt.Color(s).convertLinearToSRGB();for(let c=0;c<o.length;c++){let h=o[c];for(let p=0;p<h.length;p++){let f=h[p],d=p+1===h.length?h[0]:h[p+1];t.push(new yt.Vector3(f[0],f[1],i)),t.push(new yt.Vector3(d[0],d[1],i)),e.push(l.r,l.g,l.b),e.push(l.r,l.g,l.b),n.push(u),n.push(u)}}}),{points:t,colors:e,opacities:n}}var H=require("three");var Vm=require("core-js/modules/web.dom-collections.iterator.js"),Hm=require("core-js/modules/es.set.difference.v2.js"),Wm=require("core-js/modules/es.set.intersection.v2.js"),Xm=require("core-js/modules/es.set.is-disjoint-from.v2.js"),qm=require("core-js/modules/es.set.is-subset-of.v2.js"),jm=require("core-js/modules/es.set.is-superset-of.v2.js"),Ym=require("core-js/modules/es.set.symmetric-difference.v2.js"),Zm=require("core-js/modules/es.set.union.v2.js"),Km=require("core-js/modules/es.array.push.js"),Us=require("three");var Sp=require("core-js/modules/web.dom-collections.iterator.js"),bp=require("core-js/modules/es.array.push.js"),P=require("three");var Ec=require("core-js/modules/web.dom-collections.iterator.js"),$o=require("three/examples/jsm/lines/LineMaterial.js"),Q=require("three");function Ko(a){return a.x+"-"+a.y+"-"+a.z}var L=class{static generateLineMaterialKey(t){let{color:e,opacity:n}=t;return e+"-"+n}static createLineMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=this.generateLineMaterialKey({color:e,opacity:n,vertexColors:r});if(this.lineMaterialMap.has(i))return this.lineMaterialMap.get(i);let o=new Q.LineBasicMaterial({color:new Q.Color(e).convertLinearToSRGB(),transparent:!0,opacity:n,vertexColors:r!=null?r:!1});return this.lineMaterialMap.set(i,o),o}static createMeshStandardMaterial(t){let{color:e,opacity:n}=t,r=e+"-"+n;if(this.meshStandardMaterialMap.has(r))return this.meshStandardMaterialMap.get(r);let i=new Q.MeshStandardMaterial({color:new Q.Color(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:n,depthWrite:!0});return this.meshStandardMaterialMap.set(r,i),i}static createMeshBasicMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,i=e+"-"+n+"-"+r;if(this.meshBasicMaterialMap.has(i))return this.meshBasicMaterialMap.get(i);let o=new Q.MeshBasicMaterial({color:e,transparent:!0,opacity:n,depthWrite:!0,vertexColors:r!=null?r:!1});return this.meshBasicMaterialMap.set(i,o),o}static createShaderMaterial(t){let{gradualColor:e,center:n,maxValue:r,opacity:i,direction:o,max:s,min:u}=t,l=e.toString()+"-"+Ko(n)+"-"+r+"-"+i+"-"+Ko(o);if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let c=`
2
2
  uniform vec3 uColor;
3
3
  uniform vec3 uGradualColor;
4
4
  uniform vec3 center;
@@ -170,7 +170,7 @@
170
170
  `],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}function Si(){let a=new Blob([`var Pp=Object.create;var Xn=Object.defineProperty;var _p=Object.getOwnPropertyDescriptor;var Cp=Object.getOwnPropertyNames;var Np=Object.getPrototypeOf,Fp=Object.prototype.hasOwnProperty;var i=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Lp=(r,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cp(e))!Fp.call(r,n)&&n!==t&&Xn(r,n,{get:()=>e[n],enumerable:!(a=_p(e,n))||a.enumerable});return r};var S=(r,e,t)=>(t=r!=null?Pp(Np(r)):{},Lp(e||!r||!r.__esModule?Xn(t,"default",{value:r,enumerable:!0}):t,r));var Y=(r,e,t)=>new Promise((a,n)=>{var u=c=>{try{s(t.next(c))}catch(f){n(f)}},o=c=>{try{s(t.throw(c))}catch(f){n(f)}},s=c=>c.done?a(c.value):Promise.resolve(c.value).then(u,o);s((t=t.apply(r,e)).next())});var T=i((At,Zn)=>{"use strict";var Wr=function(r){return r&&r.Math===Math&&r};Zn.exports=Wr(typeof globalThis=="object"&&globalThis)||Wr(typeof window=="object"&&window)||Wr(typeof self=="object"&&self)||Wr(typeof global=="object"&&global)||Wr(typeof At=="object"&&At)||function(){return this}()||Function("return this")()});var I=i((TE,Jn)=>{"use strict";Jn.exports=function(r){try{return!!r()}catch(e){return!0}}});var w=i((SE,Qn)=>{"use strict";var Bp=I();Qn.exports=!Bp(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Yr=i((IE,ri)=>{"use strict";var jp=I();ri.exports=!jp(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var b=i((xE,ei)=>{"use strict";var Dp=Yr(),de=Function.prototype.call;ei.exports=Dp?de.bind(de):function(){return de.apply(de,arguments)}});var ii=i(ni=>{"use strict";var ti={}.propertyIsEnumerable,ai=Object.getOwnPropertyDescriptor,Mp=ai&&!ti.call({1:2},1);ni.f=Mp?function(e){var t=ai(this,e);return!!t&&t.enumerable}:ti});var Kr=i((OE,ui)=>{"use strict";ui.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var A=i((bE,vi)=>{"use strict";var oi=Yr(),si=Function.prototype,Ot=si.call,Up=oi&&si.bind.bind(Ot,Ot);vi.exports=oi?Up:function(r){return function(){return Ot.apply(r,arguments)}}});var ir=i((EE,fi)=>{"use strict";var ci=A(),kp=ci({}.toString),Gp=ci("".slice);fi.exports=function(r){return Gp(kp(r),8,-1)}});var qe=i((wE,li)=>{"use strict";var $p=A(),Vp=I(),Wp=ir(),bt=Object,Yp=$p("".split);li.exports=Vp(function(){return!bt("z").propertyIsEnumerable(0)})?function(r){return Wp(r)==="String"?Yp(r,""):bt(r)}:bt});var ge=i((RE,pi)=>{"use strict";pi.exports=function(r){return r==null}});var wr=i((mE,yi)=>{"use strict";var Kp=ge(),zp=TypeError;yi.exports=function(r){if(Kp(r))throw new zp("Can't call method on "+r);return r}});var Rr=i((PE,di)=>{"use strict";var Hp=qe(),Xp=wr();di.exports=function(r){return Hp(Xp(r))}});var O=i((_E,qi)=>{"use strict";var Et=typeof document=="object"&&document.all;qi.exports=typeof Et=="undefined"&&Et!==void 0?function(r){return typeof r=="function"||r===Et}:function(r){return typeof r=="function"}});var m=i((CE,gi)=>{"use strict";var Zp=O();gi.exports=function(r){return typeof r=="object"?r!==null:Zp(r)}});var hr=i((NE,hi)=>{"use strict";var wt=T(),Jp=O(),Qp=function(r){return Jp(r)?r:void 0};hi.exports=function(r,e){return arguments.length<2?Qp(wt[r]):wt[r]&&wt[r][e]}});var zr=i((FE,Ti)=>{"use strict";var ry=A();Ti.exports=ry({}.isPrototypeOf)});var mr=i((LE,xi)=>{"use strict";var ey=T(),Si=ey.navigator,Ii=Si&&Si.userAgent;xi.exports=Ii?String(Ii):""});var Te=i((BE,Ri)=>{"use strict";var wi=T(),Rt=mr(),Ai=wi.process,Oi=wi.Deno,bi=Ai&&Ai.versions||Oi&&Oi.version,Ei=bi&&bi.v8,k,he;Ei&&(k=Ei.split("."),he=k[0]>0&&k[0]<4?1:+(k[0]+k[1]));!he&&Rt&&(k=Rt.match(/Edge\\/(\\d+)/),(!k||k[1]>=74)&&(k=Rt.match(/Chrome\\/(\\d+)/),k&&(he=+k[1])));Ri.exports=he});var mt=i((jE,Pi)=>{"use strict";var mi=Te(),ty=I(),ay=T(),ny=ay.String;Pi.exports=!!Object.getOwnPropertySymbols&&!ty(function(){var r=Symbol("symbol detection");return!ny(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&mi&&mi<41})});var Pt=i((DE,_i)=>{"use strict";var iy=mt();_i.exports=iy&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Se=i((ME,Ci)=>{"use strict";var uy=hr(),oy=O(),sy=zr(),vy=Pt(),cy=Object;Ci.exports=vy?function(r){return typeof r=="symbol"}:function(r){var e=uy("Symbol");return oy(e)&&sy(e.prototype,cy(r))}});var Hr=i((UE,Ni)=>{"use strict";var fy=String;Ni.exports=function(r){try{return fy(r)}catch(e){return"Object"}}});var ur=i((kE,Fi)=>{"use strict";var ly=O(),py=Hr(),yy=TypeError;Fi.exports=function(r){if(ly(r))return r;throw new yy(py(r)+" is not a function")}});var Xr=i((GE,Li)=>{"use strict";var dy=ur(),qy=ge();Li.exports=function(r,e){var t=r[e];return qy(t)?void 0:dy(t)}});var ji=i(($E,Bi)=>{"use strict";var _t=b(),Ct=O(),Nt=m(),gy=TypeError;Bi.exports=function(r,e){var t,a;if(e==="string"&&Ct(t=r.toString)&&!Nt(a=_t(t,r))||Ct(t=r.valueOf)&&!Nt(a=_t(t,r))||e!=="string"&&Ct(t=r.toString)&&!Nt(a=_t(t,r)))return a;throw new gy("Can't convert object to primitive value")}});var Zr=i((VE,Di)=>{"use strict";Di.exports=!1});var Ie=i((WE,Ui)=>{"use strict";var Mi=T(),hy=Object.defineProperty;Ui.exports=function(r,e){try{hy(Mi,r,{value:e,configurable:!0,writable:!0})}catch(t){Mi[r]=e}return e}});var xe=i((YE,$i)=>{"use strict";var Ty=Zr(),Sy=T(),Iy=Ie(),ki="__core-js_shared__",Gi=$i.exports=Sy[ki]||Iy(ki,{});(Gi.versions||(Gi.versions=[])).push({version:"3.42.0",mode:Ty?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Ae=i((KE,Wi)=>{"use strict";var Vi=xe();Wi.exports=function(r,e){return Vi[r]||(Vi[r]=e||{})}});var K=i((zE,Yi)=>{"use strict";var xy=wr(),Ay=Object;Yi.exports=function(r){return Ay(xy(r))}});var j=i((HE,Ki)=>{"use strict";var Oy=A(),by=K(),Ey=Oy({}.hasOwnProperty);Ki.exports=Object.hasOwn||function(e,t){return Ey(by(e),t)}});var Oe=i((XE,zi)=>{"use strict";var wy=A(),Ry=0,my=Math.random(),Py=wy(1 .toString);zi.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Py(++Ry+my,36)}});var E=i((ZE,Xi)=>{"use strict";var _y=T(),Cy=Ae(),Hi=j(),Ny=Oe(),Fy=mt(),Ly=Pt(),Pr=_y.Symbol,Ft=Cy("wks"),By=Ly?Pr.for||Pr:Pr&&Pr.withoutSetter||Ny;Xi.exports=function(r){return Hi(Ft,r)||(Ft[r]=Fy&&Hi(Pr,r)?Pr[r]:By("Symbol."+r)),Ft[r]}});var Lt=i((JE,Qi)=>{"use strict";var jy=b(),Zi=m(),Ji=Se(),Dy=Xr(),My=ji(),Uy=E(),ky=TypeError,Gy=Uy("toPrimitive");Qi.exports=function(r,e){if(!Zi(r)||Ji(r))return r;var t=Dy(r,Gy),a;if(t){if(e===void 0&&(e="default"),a=jy(t,r,e),!Zi(a)||Ji(a))return a;throw new ky("Can't convert object to primitive value")}return e===void 0&&(e="number"),My(r,e)}});var be=i((QE,ru)=>{"use strict";var $y=Lt(),Vy=Se();ru.exports=function(r){var e=$y(r,"string");return Vy(e)?e:e+""}});var Ee=i((rw,tu)=>{"use strict";var Wy=T(),eu=m(),Bt=Wy.document,Yy=eu(Bt)&&eu(Bt.createElement);tu.exports=function(r){return Yy?Bt.createElement(r):{}}});var jt=i((ew,au)=>{"use strict";var Ky=w(),zy=I(),Hy=Ee();au.exports=!Ky&&!zy(function(){return Object.defineProperty(Hy("div"),"a",{get:function(){return 7}}).a!==7})});var we=i(iu=>{"use strict";var Xy=w(),Zy=b(),Jy=ii(),Qy=Kr(),rd=Rr(),ed=be(),td=j(),ad=jt(),nu=Object.getOwnPropertyDescriptor;iu.f=Xy?nu:function(e,t){if(e=rd(e),t=ed(t),ad)try{return nu(e,t)}catch(a){}if(td(e,t))return Qy(!Zy(Jy.f,e,t),e[t])}});var Dt=i((aw,uu)=>{"use strict";var nd=w(),id=I();uu.exports=nd&&id(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var D=i((nw,ou)=>{"use strict";var ud=m(),od=String,sd=TypeError;ou.exports=function(r){if(ud(r))return r;throw new sd(od(r)+" is not an object")}});var z=i(vu=>{"use strict";var vd=w(),cd=jt(),fd=Dt(),Re=D(),su=be(),ld=TypeError,Mt=Object.defineProperty,pd=Object.getOwnPropertyDescriptor,Ut="enumerable",kt="configurable",Gt="writable";vu.f=vd?fd?function(e,t,a){if(Re(e),t=su(t),Re(a),typeof e=="function"&&t==="prototype"&&"value"in a&&Gt in a&&!a[Gt]){var n=pd(e,t);n&&n[Gt]&&(e[t]=a.value,a={configurable:kt in a?a[kt]:n[kt],enumerable:Ut in a?a[Ut]:n[Ut],writable:!1})}return Mt(e,t,a)}:Mt:function(e,t,a){if(Re(e),t=su(t),Re(a),cd)try{return Mt(e,t,a)}catch(n){}if("get"in a||"set"in a)throw new ld("Accessors not supported");return"value"in a&&(e[t]=a.value),e}});var J=i((uw,cu)=>{"use strict";var yd=w(),dd=z(),qd=Kr();cu.exports=yd?function(r,e,t){return dd.f(r,e,qd(1,t))}:function(r,e,t){return r[e]=t,r}});var me=i((ow,lu)=>{"use strict";var $t=w(),gd=j(),fu=Function.prototype,hd=$t&&Object.getOwnPropertyDescriptor,Vt=gd(fu,"name"),Td=Vt&&function(){}.name==="something",Sd=Vt&&(!$t||$t&&hd(fu,"name").configurable);lu.exports={EXISTS:Vt,PROPER:Td,CONFIGURABLE:Sd}});var Yt=i((sw,pu)=>{"use strict";var Id=A(),xd=O(),Wt=xe(),Ad=Id(Function.toString);xd(Wt.inspectSource)||(Wt.inspectSource=function(r){return Ad(r)});pu.exports=Wt.inspectSource});var qu=i((vw,du)=>{"use strict";var Od=T(),bd=O(),yu=Od.WeakMap;du.exports=bd(yu)&&/native code/.test(String(yu))});var Pe=i((cw,hu)=>{"use strict";var Ed=Ae(),wd=Oe(),gu=Ed("keys");hu.exports=function(r){return gu[r]||(gu[r]=wd(r))}});var _e=i((fw,Tu)=>{"use strict";Tu.exports={}});var Sr=i((lw,xu)=>{"use strict";var Rd=qu(),Iu=T(),md=m(),Pd=J(),Kt=j(),zt=xe(),_d=Pe(),Cd=_e(),Su="Object already initialized",Ht=Iu.TypeError,Nd=Iu.WeakMap,Ce,Jr,Ne,Fd=function(r){return Ne(r)?Jr(r):Ce(r,{})},Ld=function(r){return function(e){var t;if(!md(e)||(t=Jr(e)).type!==r)throw new Ht("Incompatible receiver, "+r+" required");return t}};Rd||zt.state?(G=zt.state||(zt.state=new Nd),G.get=G.get,G.has=G.has,G.set=G.set,Ce=function(r,e){if(G.has(r))throw new Ht(Su);return e.facade=r,G.set(r,e),e},Jr=function(r){return G.get(r)||{}},Ne=function(r){return G.has(r)}):(Tr=_d("state"),Cd[Tr]=!0,Ce=function(r,e){if(Kt(r,Tr))throw new Ht(Su);return e.facade=r,Pd(r,Tr,e),e},Jr=function(r){return Kt(r,Tr)?r[Tr]:{}},Ne=function(r){return Kt(r,Tr)});var G,Tr;xu.exports={set:Ce,get:Jr,has:Ne,enforce:Fd,getterFor:Ld}});var Jt=i((pw,bu)=>{"use strict";var Zt=A(),Bd=I(),jd=O(),Fe=j(),Xt=w(),Dd=me().CONFIGURABLE,Md=Yt(),Ou=Sr(),Ud=Ou.enforce,kd=Ou.get,Au=String,Le=Object.defineProperty,Gd=Zt("".slice),$d=Zt("".replace),Vd=Zt([].join),Wd=Xt&&!Bd(function(){return Le(function(){},"length",{value:8}).length!==8}),Yd=String(String).split("String"),Kd=bu.exports=function(r,e,t){Gd(Au(e),0,7)==="Symbol("&&(e="["+$d(Au(e),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Fe(r,"name")||Dd&&r.name!==e)&&(Xt?Le(r,"name",{value:e,configurable:!0}):r.name=e),Wd&&t&&Fe(t,"arity")&&r.length!==t.arity&&Le(r,"length",{value:t.arity});try{t&&Fe(t,"constructor")&&t.constructor?Xt&&Le(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch(n){}var a=Ud(r);return Fe(a,"source")||(a.source=Vd(Yd,typeof e=="string"?e:"")),r};Function.prototype.toString=Kd(function(){return jd(this)&&kd(this).source||Md(this)},"toString")});var Ir=i((yw,Eu)=>{"use strict";var zd=O(),Hd=z(),Xd=Jt(),Zd=Ie();Eu.exports=function(r,e,t,a){a||(a={});var n=a.enumerable,u=a.name!==void 0?a.name:e;if(zd(t)&&Xd(t,u,a),a.global)n?r[e]=t:Zd(e,t);else{try{a.unsafe?r[e]&&(n=!0):delete r[e]}catch(o){}n?r[e]=t:Hd.f(r,e,{value:t,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return r}});var Ru=i((dw,wu)=>{"use strict";var Jd=Math.ceil,Qd=Math.floor;wu.exports=Math.trunc||function(e){var t=+e;return(t>0?Qd:Jd)(t)}});var M=i((qw,mu)=>{"use strict";var rq=Ru();mu.exports=function(r){var e=+r;return e!==e||e===0?0:rq(e)}});var Be=i((gw,Pu)=>{"use strict";var eq=M(),tq=Math.max,aq=Math.min;Pu.exports=function(r,e){var t=eq(r);return t<0?tq(t+e,0):aq(t,e)}});var xr=i((hw,_u)=>{"use strict";var nq=M(),iq=Math.min;_u.exports=function(r){var e=nq(r);return e>0?iq(e,9007199254740991):0}});var U=i((Tw,Cu)=>{"use strict";var uq=xr();Cu.exports=function(r){return uq(r.length)}});var Lu=i((Sw,Fu)=>{"use strict";var oq=Rr(),sq=Be(),vq=U(),Nu=function(r){return function(e,t,a){var n=oq(e),u=vq(n);if(u===0)return!r&&-1;var o=sq(a,u),s;if(r&&t!==t){for(;u>o;)if(s=n[o++],s!==s)return!0}else for(;u>o;o++)if((r||o in n)&&n[o]===t)return r||o||0;return!r&&-1}};Fu.exports={includes:Nu(!0),indexOf:Nu(!1)}});var ra=i((Iw,ju)=>{"use strict";var cq=A(),Qt=j(),fq=Rr(),lq=Lu().indexOf,pq=_e(),Bu=cq([].push);ju.exports=function(r,e){var t=fq(r),a=0,n=[],u;for(u in t)!Qt(pq,u)&&Qt(t,u)&&Bu(n,u);for(;e.length>a;)Qt(t,u=e[a++])&&(~lq(n,u)||Bu(n,u));return n}});var je=i((xw,Du)=>{"use strict";Du.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var ea=i(Mu=>{"use strict";var yq=ra(),dq=je(),qq=dq.concat("length","prototype");Mu.f=Object.getOwnPropertyNames||function(e){return yq(e,qq)}});var ku=i(Uu=>{"use strict";Uu.f=Object.getOwnPropertySymbols});var $u=i((bw,Gu)=>{"use strict";var gq=hr(),hq=A(),Tq=ea(),Sq=ku(),Iq=D(),xq=hq([].concat);Gu.exports=gq("Reflect","ownKeys")||function(e){var t=Tq.f(Iq(e)),a=Sq.f;return a?xq(t,a(e)):t}});var ta=i((Ew,Wu)=>{"use strict";var Vu=j(),Aq=$u(),Oq=we(),bq=z();Wu.exports=function(r,e,t){for(var a=Aq(e),n=bq.f,u=Oq.f,o=0;o<a.length;o++){var s=a[o];!Vu(r,s)&&!(t&&Vu(t,s))&&n(r,s,u(e,s))}}});var Ku=i((ww,Yu)=>{"use strict";var Eq=I(),wq=O(),Rq=/#|\\.prototype\\./,Qr=function(r,e){var t=Pq[mq(r)];return t===Cq?!0:t===_q?!1:wq(e)?Eq(e):!!e},mq=Qr.normalize=function(r){return String(r).replace(Rq,".").toLowerCase()},Pq=Qr.data={},_q=Qr.NATIVE="N",Cq=Qr.POLYFILL="P";Yu.exports=Qr});var R=i((Rw,zu)=>{"use strict";var De=T(),Nq=we().f,Fq=J(),Lq=Ir(),Bq=Ie(),jq=ta(),Dq=Ku();zu.exports=function(r,e){var t=r.target,a=r.global,n=r.stat,u,o,s,c,f,v;if(a?o=De:n?o=De[t]||Bq(t,{}):o=De[t]&&De[t].prototype,o)for(s in e){if(f=e[s],r.dontCallGetSet?(v=Nq(o,s),c=v&&v.value):c=o[s],u=Dq(a?s:t+(n?".":"#")+s,r.forced),!u&&c!==void 0){if(typeof f==typeof c)continue;jq(f,c)}(r.sham||c&&c.sham)&&Fq(f,"sham",!0),Lq(o,s,f,r)}}});var $=i((mw,Hu)=>{"use strict";var aa=A(),Me=Set.prototype;Hu.exports={Set,add:aa(Me.add),has:aa(Me.has),remove:aa(Me.delete),proto:Me}});var or=i((Pw,Xu)=>{"use strict";var Mq=$().has;Xu.exports=function(r){return Mq(r),r}});var sr=i((_w,Zu)=>{"use strict";var Uq=b();Zu.exports=function(r,e,t){for(var a=t?r:r.iterator,n=r.next,u,o;!(u=Uq(n,a)).done;)if(o=e(u.value),o!==void 0)return o}});var _r=i((Cw,to)=>{"use strict";var Ju=A(),kq=sr(),Qu=$(),Gq=Qu.Set,ro=Qu.proto,$q=Ju(ro.forEach),eo=Ju(ro.keys),Vq=eo(new Gq).next;to.exports=function(r,e,t){return t?kq({iterator:eo(r),next:Vq},e):$q(r,e)}});var Ue=i((Nw,no)=>{"use strict";var ao=$(),Wq=_r(),Yq=ao.Set,Kq=ao.add;no.exports=function(r){var e=new Yq;return Wq(r,function(t){Kq(e,t)}),e}});var re=i((Fw,io)=>{"use strict";var zq=A(),Hq=ur();io.exports=function(r,e,t){try{return zq(Hq(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(a){}}});var Cr=i((Lw,uo)=>{"use strict";var Xq=re(),Zq=$();uo.exports=Xq(Zq.proto,"size","get")||function(r){return r.size}});var so=i((Bw,oo)=>{"use strict";oo.exports=function(r){return{iterator:r,next:r.next,done:!1}}});var vr=i((jw,yo)=>{"use strict";var vo=ur(),lo=D(),co=b(),Jq=M(),Qq=so(),fo="Invalid size",rg=RangeError,eg=TypeError,tg=Math.max,po=function(r,e){this.set=r,this.size=tg(e,0),this.has=vo(r.has),this.keys=vo(r.keys)};po.prototype={getIterator:function(){return Qq(lo(co(this.keys,this.set)))},includes:function(r){return co(this.has,this.set,r)}};yo.exports=function(r){lo(r);var e=+r.size;if(e!==e)throw new eg(fo);var t=Jq(e);if(t<0)throw new rg(fo);return new po(r,t)}});var To=i((Dw,ho)=>{"use strict";var ag=or(),go=$(),ng=Ue(),ig=Cr(),ug=vr(),og=_r(),sg=sr(),vg=go.has,qo=go.remove;ho.exports=function(e){var t=ag(this),a=ug(e),n=ng(t);return ig(t)<=a.size?og(t,function(u){a.includes(u)&&qo(n,u)}):sg(a.getIterator(),function(u){vg(t,u)&&qo(n,u)}),n}});var cr=i((Mw,xo)=>{"use strict";var cg=hr(),So=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Io=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};xo.exports=function(r,e){var t=cg("Set");try{new t()[r](So(0));try{return new t()[r](So(-1)),!1}catch(n){if(!e)return!0;try{return new t()[r](Io(-1/0)),!1}catch(u){var a=new t;return a.add(1),a.add(2),e(a[r](Io(1/0)))}}}catch(n){return!1}}});var Ao=i(()=>{"use strict";var fg=R(),lg=To(),pg=cr(),yg=!pg("difference",function(r){return r.size===0});fg({target:"Set",proto:!0,real:!0,forced:yg},{difference:lg})});var Eo=i((Gw,bo)=>{"use strict";var dg=or(),na=$(),qg=Cr(),gg=vr(),hg=_r(),Tg=sr(),Sg=na.Set,Oo=na.add,Ig=na.has;bo.exports=function(e){var t=dg(this),a=gg(e),n=new Sg;return qg(t)>a.size?Tg(a.getIterator(),function(u){Ig(t,u)&&Oo(n,u)}):hg(t,function(u){a.includes(u)&&Oo(n,u)}),n}});var wo=i(()=>{"use strict";var xg=R(),Ag=I(),Og=Eo(),bg=cr(),Eg=!bg("intersection",function(r){return r.size===2&&r.has(1)&&r.has(2)})||Ag(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});xg({target:"Set",proto:!0,real:!0,forced:Eg},{intersection:Og})});var ia=i((Ww,mo)=>{"use strict";var wg=b(),Ro=D(),Rg=Xr();mo.exports=function(r,e,t){var a,n;Ro(r);try{if(a=Rg(r,"return"),!a){if(e==="throw")throw t;return t}a=wg(a,r)}catch(u){n=!0,a=u}if(e==="throw")throw t;if(n)throw a;return Ro(a),t}});var _o=i((Yw,Po)=>{"use strict";var mg=or(),Pg=$().has,_g=Cr(),Cg=vr(),Ng=_r(),Fg=sr(),Lg=ia();Po.exports=function(e){var t=mg(this),a=Cg(e);if(_g(t)<=a.size)return Ng(t,function(u){if(a.includes(u))return!1},!0)!==!1;var n=a.getIterator();return Fg(n,function(u){if(Pg(t,u))return Lg(n,"normal",!1)})!==!1}});var Co=i(()=>{"use strict";var Bg=R(),jg=_o(),Dg=cr(),Mg=!Dg("isDisjointFrom",function(r){return!r});Bg({target:"Set",proto:!0,real:!0,forced:Mg},{isDisjointFrom:jg})});var Fo=i((Hw,No)=>{"use strict";var Ug=or(),kg=Cr(),Gg=_r(),$g=vr();No.exports=function(e){var t=Ug(this),a=$g(e);return kg(t)>a.size?!1:Gg(t,function(n){if(!a.includes(n))return!1},!0)!==!1}});var Lo=i(()=>{"use strict";var Vg=R(),Wg=Fo(),Yg=cr(),Kg=!Yg("isSubsetOf",function(r){return r});Vg({target:"Set",proto:!0,real:!0,forced:Kg},{isSubsetOf:Wg})});var jo=i((Jw,Bo)=>{"use strict";var zg=or(),Hg=$().has,Xg=Cr(),Zg=vr(),Jg=sr(),Qg=ia();Bo.exports=function(e){var t=zg(this),a=Zg(e);if(Xg(t)<a.size)return!1;var n=a.getIterator();return Jg(n,function(u){if(!Hg(t,u))return Qg(n,"normal",!1)})!==!1}});var Do=i(()=>{"use strict";var rh=R(),eh=jo(),th=cr(),ah=!th("isSupersetOf",function(r){return!r});rh({target:"Set",proto:!0,real:!0,forced:ah},{isSupersetOf:eh})});var Uo=i((eR,Mo)=>{"use strict";var nh=or(),ua=$(),ih=Ue(),uh=vr(),oh=sr(),sh=ua.add,vh=ua.has,ch=ua.remove;Mo.exports=function(e){var t=nh(this),a=uh(e).getIterator(),n=ih(t);return oh(a,function(u){vh(t,u)?ch(n,u):sh(n,u)}),n}});var ko=i(()=>{"use strict";var fh=R(),lh=Uo(),ph=cr();fh({target:"Set",proto:!0,real:!0,forced:!ph("symmetricDifference")},{symmetricDifference:lh})});var $o=i((nR,Go)=>{"use strict";var yh=or(),dh=$().add,qh=Ue(),gh=vr(),hh=sr();Go.exports=function(e){var t=yh(this),a=gh(e).getIterator(),n=qh(t);return hh(a,function(u){dh(n,u)}),n}});var Vo=i(()=>{"use strict";var Th=R(),Sh=$o(),Ih=cr();Th({target:"Set",proto:!0,real:!0,forced:!Ih("union")},{union:Sh})});var Yo=i((oR,Wo)=>{"use strict";Wo.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}});var Ho=i((sR,zo)=>{"use strict";var xh=Ee(),oa=xh("span").classList,Ko=oa&&oa.constructor&&oa.constructor.prototype;zo.exports=Ko===Object.prototype?void 0:Ko});var Zo=i((vR,Xo)=>{"use strict";var Ah=ra(),Oh=je();Xo.exports=Object.keys||function(e){return Ah(e,Oh)}});var Qo=i(Jo=>{"use strict";var bh=w(),Eh=Dt(),wh=z(),Rh=D(),mh=Rr(),Ph=Zo();Jo.f=bh&&!Eh?Object.defineProperties:function(e,t){Rh(e);for(var a=mh(t),n=Ph(t),u=n.length,o=0,s;u>o;)wh.f(e,s=n[o++],a[s]);return e}});var es=i((fR,rs)=>{"use strict";var _h=hr();rs.exports=_h("document","documentElement")});var Nr=i((lR,ss)=>{"use strict";var Ch=D(),Nh=Qo(),ts=je(),Fh=_e(),Lh=es(),Bh=Ee(),jh=Pe(),as=">",ns="<",va="prototype",ca="script",us=jh("IE_PROTO"),sa=function(){},os=function(r){return ns+ca+as+r+ns+"/"+ca+as},is=function(r){r.write(os("")),r.close();var e=r.parentWindow.Object;return r=null,e},Dh=function(){var r=Bh("iframe"),e="java"+ca+":",t;return r.style.display="none",Lh.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(os("document.F=Object")),t.close(),t.F},ke,Ge=function(){try{ke=new ActiveXObject("htmlfile")}catch(e){}Ge=typeof document!="undefined"?document.domain&&ke?is(ke):Dh():is(ke);for(var r=ts.length;r--;)delete Ge[va][ts[r]];return Ge()};Fh[us]=!0;ss.exports=Object.create||function(e,t){var a;return e!==null?(sa[va]=Ch(e),a=new sa,sa[va]=null,a[us]=e):a=Ge(),t===void 0?a:Nh.f(a,t)}});var cs=i((pR,vs)=>{"use strict";var Mh=E(),Uh=Nr(),kh=z().f,fa=Mh("unscopables"),la=Array.prototype;la[fa]===void 0&&kh(la,fa,{configurable:!0,value:Uh(null)});vs.exports=function(r){la[fa][r]=!0}});var Fr=i((yR,fs)=>{"use strict";fs.exports={}});var ps=i((dR,ls)=>{"use strict";var Gh=I();ls.exports=!Gh(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var ee=i((qR,ds)=>{"use strict";var $h=j(),Vh=O(),Wh=K(),Yh=Pe(),Kh=ps(),ys=Yh("IE_PROTO"),pa=Object,zh=pa.prototype;ds.exports=Kh?pa.getPrototypeOf:function(r){var e=Wh(r);if($h(e,ys))return e[ys];var t=e.constructor;return Vh(t)&&e instanceof t?t.prototype:e instanceof pa?zh:null}});var ga=i((gR,hs)=>{"use strict";var Hh=I(),Xh=O(),Zh=m(),Jh=Nr(),qs=ee(),Qh=Ir(),rT=E(),eT=Zr(),qa=rT("iterator"),gs=!1,Q,ya,da;[].keys&&(da=[].keys(),"next"in da?(ya=qs(qs(da)),ya!==Object.prototype&&(Q=ya)):gs=!0);var tT=!Zh(Q)||Hh(function(){var r={};return Q[qa].call(r)!==r});tT?Q={}:eT&&(Q=Jh(Q));Xh(Q[qa])||Qh(Q,qa,function(){return this});hs.exports={IteratorPrototype:Q,BUGGY_SAFARI_ITERATORS:gs}});var te=i((hR,Ss)=>{"use strict";var aT=z().f,nT=j(),iT=E(),Ts=iT("toStringTag");Ss.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!nT(r,Ts)&&aT(r,Ts,{configurable:!0,value:e})}});var xs=i((TR,Is)=>{"use strict";var uT=ga().IteratorPrototype,oT=Nr(),sT=Kr(),vT=te(),cT=Fr(),fT=function(){return this};Is.exports=function(r,e,t,a){var n=e+" Iterator";return r.prototype=oT(uT,{next:sT(+!a,t)}),vT(r,n,!1,!0),cT[n]=fT,r}});var Os=i((SR,As)=>{"use strict";var lT=m();As.exports=function(r){return lT(r)||r===null}});var Es=i((IR,bs)=>{"use strict";var pT=Os(),yT=String,dT=TypeError;bs.exports=function(r){if(pT(r))return r;throw new dT("Can't set "+yT(r)+" as a prototype")}});var Lr=i((xR,ws)=>{"use strict";var qT=re(),gT=m(),hT=wr(),TT=Es();ws.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=qT(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(a){}return function(n,u){return hT(n),TT(u),gT(n)&&(r?t(n,u):n.__proto__=u),n}}():void 0)});var Ds=i((AR,js)=>{"use strict";var ST=R(),IT=b(),$e=Zr(),Ls=me(),xT=O(),AT=xs(),Rs=ee(),ms=Lr(),OT=te(),bT=J(),ha=Ir(),ET=E(),Ps=Fr(),Bs=ga(),wT=Ls.PROPER,RT=Ls.CONFIGURABLE,_s=Bs.IteratorPrototype,Ve=Bs.BUGGY_SAFARI_ITERATORS,ae=ET("iterator"),Cs="keys",ne="values",Ns="entries",Fs=function(){return this};js.exports=function(r,e,t,a,n,u,o){AT(t,e,a);var s=function(g){if(g===n&&l)return l;if(!Ve&&g&&g in v)return v[g];switch(g){case Cs:return function(){return new t(this,g)};case ne:return function(){return new t(this,g)};case Ns:return function(){return new t(this,g)}}return function(){return new t(this)}},c=e+" Iterator",f=!1,v=r.prototype,p=v[ae]||v["@@iterator"]||n&&v[n],l=!Ve&&p||s(n),d=e==="Array"&&v.entries||p,h,q,y;if(d&&(h=Rs(d.call(new r)),h!==Object.prototype&&h.next&&(!$e&&Rs(h)!==_s&&(ms?ms(h,_s):xT(h[ae])||ha(h,ae,Fs)),OT(h,c,!0,!0),$e&&(Ps[c]=Fs))),wT&&n===ne&&p&&p.name!==ne&&(!$e&&RT?bT(v,"name",ne):(f=!0,l=function(){return IT(p,this)})),n)if(q={values:s(ne),keys:u?l:s(Cs),entries:s(Ns)},o)for(y in q)(Ve||f||!(y in v))&&ha(v,y,q[y]);else ST({target:e,proto:!0,forced:Ve||f},q);return(!$e||o)&&v[ae]!==l&&ha(v,ae,l,{name:n}),Ps[e]=l,q}});var Us=i((OR,Ms)=>{"use strict";Ms.exports=function(r,e){return{value:r,done:e}}});var Ys=i((bR,Ws)=>{"use strict";var mT=Rr(),Ta=cs(),ks=Fr(),$s=Sr(),PT=z().f,_T=Ds(),We=Us(),CT=Zr(),NT=w(),Vs="Array Iterator",FT=$s.set,LT=$s.getterFor(Vs);Ws.exports=_T(Array,"Array",function(r,e){FT(this,{type:Vs,target:mT(r),index:0,kind:e})},function(){var r=LT(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=null,We(void 0,!0);switch(r.kind){case"keys":return We(t,!1);case"values":return We(e[t],!1)}return We([t,e[t]],!1)},"values");var Gs=ks.Arguments=ks.Array;Ta("keys");Ta("values");Ta("entries");if(!CT&&NT&&Gs.name!=="values")try{PT(Gs,"name",{value:"values"})}catch(r){}});var Zs=i(()=>{"use strict";var Ks=T(),Hs=Yo(),BT=Ho(),ie=Ys(),zs=J(),jT=te(),DT=E(),Sa=DT("iterator"),Ia=ie.values,Xs=function(r,e){if(r){if(r[Sa]!==Ia)try{zs(r,Sa,Ia)}catch(a){r[Sa]=Ia}if(jT(r,e,!0),Hs[e]){for(var t in ie)if(r[t]!==ie[t])try{zs(r,t,ie[t])}catch(a){r[t]=ie[t]}}}};for(Ye in Hs)Xs(Ks[Ye]&&Ks[Ye].prototype,Ye);var Ye;Xs(BT,"DOMTokenList")});var tv=i((RR,ev)=>{"use strict";var MT=E(),Qs=MT("iterator"),rv=!1;try{Js=0,xa={next:function(){return{done:!!Js++}},return:function(){rv=!0}},xa[Qs]=function(){return this},Array.from(xa,function(){throw 2})}catch(r){}var Js,xa;ev.exports=function(r,e){try{if(!e&&!rv)return!1}catch(n){return!1}var t=!1;try{var a={};a[Qs]=function(){return{next:function(){return{done:t=!0}}}},r(a)}catch(n){}return t}});var Ke=i((mR,av)=>{"use strict";av.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var uv=i((PR,iv)=>{"use strict";var UT=E(),kT=UT("toStringTag"),nv={};nv[kT]="z";iv.exports=String(nv)==="[object z]"});var fr=i((_R,ov)=>{"use strict";var GT=uv(),$T=O(),ze=ir(),VT=E(),WT=VT("toStringTag"),YT=Object,KT=ze(function(){return arguments}())==="Arguments",zT=function(r,e){try{return r[e]}catch(t){}};ov.exports=GT?ze:function(r){var e,t,a;return r===void 0?"Undefined":r===null?"Null":typeof(t=zT(e=YT(r),WT))=="string"?t:KT?ze(e):(a=ze(e))==="Object"&&$T(e.callee)?"Arguments":a}});var Br=i((CR,vv)=>{"use strict";var sv=Jt(),HT=z();vv.exports=function(r,e,t){return t.get&&sv(t.get,e,{getter:!0}),t.set&&sv(t.set,e,{setter:!0}),HT.f(r,e,t)}});var N=i((NR,Tv)=>{"use strict";var XT=Ke(),Ea=w(),P=T(),pv=O(),Ze=m(),pr=j(),wa=fr(),ZT=Hr(),JT=J(),Aa=Ir(),QT=Br(),rS=zr(),Je=ee(),Dr=Lr(),eS=E(),tS=Oe(),yv=Sr(),dv=yv.enforce,aS=yv.get,He=P.Int8Array,Oa=He&&He.prototype,cv=P.Uint8ClampedArray,fv=cv&&cv.prototype,H=He&&Je(He),V=Oa&&Je(Oa),nS=Object.prototype,Ra=P.TypeError,lv=eS("toStringTag"),ba=tS("TYPED_ARRAY_TAG"),Xe="TypedArrayConstructor",rr=XT&&!!Dr&&wa(P.opera)!=="Opera",qv=!1,C,lr,jr,er={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ma={BigInt64Array:8,BigUint64Array:8},iS=function(e){if(!Ze(e))return!1;var t=wa(e);return t==="DataView"||pr(er,t)||pr(ma,t)},gv=function(r){var e=Je(r);if(Ze(e)){var t=aS(e);return t&&pr(t,Xe)?t[Xe]:gv(e)}},hv=function(r){if(!Ze(r))return!1;var e=wa(r);return pr(er,e)||pr(ma,e)},uS=function(r){if(hv(r))return r;throw new Ra("Target is not a typed array")},oS=function(r){if(pv(r)&&(!Dr||rS(H,r)))return r;throw new Ra(ZT(r)+" is not a typed array constructor")},sS=function(r,e,t,a){if(Ea){if(t)for(var n in er){var u=P[n];if(u&&pr(u.prototype,r))try{delete u.prototype[r]}catch(o){try{u.prototype[r]=e}catch(s){}}}(!V[r]||t)&&Aa(V,r,t?e:rr&&Oa[r]||e,a)}},vS=function(r,e,t){var a,n;if(Ea){if(Dr){if(t){for(a in er)if(n=P[a],n&&pr(n,r))try{delete n[r]}catch(u){}}if(!H[r]||t)try{return Aa(H,r,t?e:rr&&H[r]||e)}catch(u){}else return}for(a in er)n=P[a],n&&(!n[r]||t)&&Aa(n,r,e)}};for(C in er)lr=P[C],jr=lr&&lr.prototype,jr?dv(jr)[Xe]=lr:rr=!1;for(C in ma)lr=P[C],jr=lr&&lr.prototype,jr&&(dv(jr)[Xe]=lr);if((!rr||!pv(H)||H===Function.prototype)&&(H=function(){throw new Ra("Incorrect invocation")},rr))for(C in er)P[C]&&Dr(P[C],H);if((!rr||!V||V===nS)&&(V=H.prototype,rr))for(C in er)P[C]&&Dr(P[C].prototype,V);rr&&Je(fv)!==V&&Dr(fv,V);if(Ea&&!pr(V,lv)){qv=!0,QT(V,lv,{configurable:!0,get:function(){return Ze(this)?this[ba]:void 0}});for(C in er)P[C]&&JT(P[C],ba,C)}Tv.exports={NATIVE_ARRAY_BUFFER_VIEWS:rr,TYPED_ARRAY_TAG:qv&&ba,aTypedArray:uS,aTypedArrayConstructor:oS,exportTypedArrayMethod:sS,exportTypedArrayStaticMethod:vS,getTypedArrayConstructor:gv,isView:iS,isTypedArray:hv,TypedArray:H,TypedArrayPrototype:V}});var _a=i((FR,Iv)=>{"use strict";var Sv=T(),Pa=I(),cS=tv(),fS=N().NATIVE_ARRAY_BUFFER_VIEWS,lS=Sv.ArrayBuffer,Ar=Sv.Int8Array;Iv.exports=!fS||!Pa(function(){Ar(1)})||!Pa(function(){new Ar(-1)})||!cS(function(r){new Ar,new Ar(null),new Ar(1.5),new Ar(r)},!0)||Pa(function(){return new Ar(new lS(2),1,void 0).length!==1})});var Av=i((LR,xv)=>{"use strict";var pS=Ir();xv.exports=function(r,e,t){for(var a in e)pS(r,a,e[a],t);return r}});var Ca=i((BR,Ov)=>{"use strict";var yS=zr(),dS=TypeError;Ov.exports=function(r,e){if(yS(e,r))return r;throw new dS("Incorrect invocation")}});var Qe=i((jR,bv)=>{"use strict";var qS=M(),gS=xr(),hS=RangeError;bv.exports=function(r){if(r===void 0)return 0;var e=qS(r),t=gS(e);if(e!==t)throw new hS("Wrong length or index");return t}});var wv=i((DR,Ev)=>{"use strict";Ev.exports=Math.sign||function(e){var t=+e;return t===0||t!==t?t:t<0?-1:1}});var Pv=i((MR,mv)=>{"use strict";var TS=2220446049250313e-31,Rv=1/TS;mv.exports=function(r){return r+Rv-Rv}});var Cv=i((UR,_v)=>{"use strict";var SS=wv(),IS=Pv(),xS=Math.abs,AS=2220446049250313e-31;_v.exports=function(r,e,t,a){var n=+r,u=xS(n),o=SS(n);if(u<a)return o*IS(u/a/e)*a*e;var s=(1+e/AS)*u,c=s-(s-u);return c>t||c!==c?o*(1/0):o*c}});var Fv=i((kR,Nv)=>{"use strict";var OS=Cv(),bS=11920928955078125e-23,ES=34028234663852886e22,wS=11754943508222875e-54;Nv.exports=Math.fround||function(e){return OS(e,bS,ES,wS)}});var Bv=i((GR,Lv)=>{"use strict";var RS=Array,mS=Math.abs,tr=Math.pow,PS=Math.floor,_S=Math.log,CS=Math.LN2,NS=function(r,e,t){var a=RS(t),n=t*8-e-1,u=(1<<n)-1,o=u>>1,s=e===23?tr(2,-24)-tr(2,-77):0,c=r<0||r===0&&1/r<0?1:0,f=0,v,p,l;for(r=mS(r),r!==r||r===1/0?(p=r!==r?1:0,v=u):(v=PS(_S(r)/CS),l=tr(2,-v),r*l<1&&(v--,l*=2),v+o>=1?r+=s/l:r+=s*tr(2,1-o),r*l>=2&&(v++,l/=2),v+o>=u?(p=0,v=u):v+o>=1?(p=(r*l-1)*tr(2,e),v+=o):(p=r*tr(2,o-1)*tr(2,e),v=0));e>=8;)a[f++]=p&255,p/=256,e-=8;for(v=v<<e|p,n+=e;n>0;)a[f++]=v&255,v/=256,n-=8;return a[f-1]|=c*128,a},FS=function(r,e){var t=r.length,a=t*8-e-1,n=(1<<a)-1,u=n>>1,o=a-7,s=t-1,c=r[s--],f=c&127,v;for(c>>=7;o>0;)f=f*256+r[s--],o-=8;for(v=f&(1<<-o)-1,f>>=-o,o+=e;o>0;)v=v*256+r[s--],o-=8;if(f===0)f=1-u;else{if(f===n)return v?NaN:c?-1/0:1/0;v+=tr(2,e),f-=u}return(c?-1:1)*v*tr(2,f-e)};Lv.exports={pack:NS,unpack:FS}});var Na=i(($R,Dv)=>{"use strict";var LS=K(),jv=Be(),BS=U();Dv.exports=function(e){for(var t=LS(this),a=BS(t),n=arguments.length,u=jv(n>1?arguments[1]:void 0,a),o=n>2?arguments[2]:void 0,s=o===void 0?a:jv(o,a);s>u;)t[u++]=e;return t}});var Fa=i((VR,Mv)=>{"use strict";var jS=A();Mv.exports=jS([].slice)});var La=i((WR,kv)=>{"use strict";var DS=O(),MS=m(),Uv=Lr();kv.exports=function(r,e,t){var a,n;return Uv&&DS(a=e.constructor)&&a!==t&&MS(n=a.prototype)&&n!==t.prototype&&Uv(r,n),r}});var ut=i((YR,nc)=>{"use strict";var nt=T(),Ua=A(),Ba=w(),US=Ke(),Qv=me(),kS=J(),GS=Br(),Gv=Av(),ja=I(),rt=Ca(),$S=M(),VS=xr(),tt=Qe(),WS=Fv(),rc=Bv(),YS=ee(),$v=Lr(),KS=Na(),zS=Fa(),HS=La(),XS=ta(),ec=te(),ka=Sr(),ZS=Qv.PROPER,Vv=Qv.CONFIGURABLE,Ur="ArrayBuffer",it="DataView",kr="prototype",JS="Wrong length",tc="Wrong index",Wv=ka.getterFor(Ur),oe=ka.getterFor(it),Yv=ka.set,W=nt[Ur],F=W,Mr=F&&F[kr],X=nt[it],Or=X&&X[kr],Kv=Object.prototype,QS=nt.Array,at=nt.RangeError,rI=Ua(KS),eI=Ua([].reverse),ac=rc.pack,zv=rc.unpack,Hv=function(r){return[r&255]},Xv=function(r){return[r&255,r>>8&255]},Zv=function(r){return[r&255,r>>8&255,r>>16&255,r>>24&255]},Jv=function(r){return r[3]<<24|r[2]<<16|r[1]<<8|r[0]},tI=function(r){return ac(WS(r),23,4)},aI=function(r){return ac(r,52,8)},et=function(r,e,t){GS(r[kr],e,{configurable:!0,get:function(){return t(this)[e]}})},yr=function(r,e,t,a){var n=oe(r),u=tt(t),o=!!a;if(u+e>n.byteLength)throw new at(tc);var s=n.bytes,c=u+n.byteOffset,f=zS(s,c,c+e);return o?f:eI(f)},dr=function(r,e,t,a,n,u){var o=oe(r),s=tt(t),c=a(+n),f=!!u;if(s+e>o.byteLength)throw new at(tc);for(var v=o.bytes,p=s+o.byteOffset,l=0;l<e;l++)v[p+l]=c[f?l:e-l-1]};US?(Da=ZS&&W.name!==Ur,!ja(function(){W(1)})||!ja(function(){new W(-1)})||ja(function(){return new W,new W(1.5),new W(NaN),W.length!==1||Da&&!Vv})?(F=function(e){return rt(this,Mr),HS(new W(tt(e)),this,F)},F[kr]=Mr,Mr.constructor=F,XS(F,W)):Da&&Vv&&kS(W,"name",Ur),$v&&YS(Or)!==Kv&&$v(Or,Kv),ue=new X(new F(2)),Ma=Ua(Or.setInt8),ue.setInt8(0,2147483648),ue.setInt8(1,2147483649),(ue.getInt8(0)||!ue.getInt8(1))&&Gv(Or,{setInt8:function(e,t){Ma(this,e,t<<24>>24)},setUint8:function(e,t){Ma(this,e,t<<24>>24)}},{unsafe:!0})):(F=function(e){rt(this,Mr);var t=tt(e);Yv(this,{type:Ur,bytes:rI(QS(t),0),byteLength:t}),Ba||(this.byteLength=t,this.detached=!1)},Mr=F[kr],X=function(e,t,a){rt(this,Or),rt(e,Mr);var n=Wv(e),u=n.byteLength,o=$S(t);if(o<0||o>u)throw new at("Wrong offset");if(a=a===void 0?u-o:VS(a),o+a>u)throw new at(JS);Yv(this,{type:it,buffer:e,byteLength:a,byteOffset:o,bytes:n.bytes}),Ba||(this.buffer=e,this.byteLength=a,this.byteOffset=o)},Or=X[kr],Ba&&(et(F,"byteLength",Wv),et(X,"buffer",oe),et(X,"byteLength",oe),et(X,"byteOffset",oe)),Gv(Or,{getInt8:function(e){return yr(this,1,e)[0]<<24>>24},getUint8:function(e){return yr(this,1,e)[0]},getInt16:function(e){var t=yr(this,2,e,arguments.length>1?arguments[1]:!1);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=yr(this,2,e,arguments.length>1?arguments[1]:!1);return t[1]<<8|t[0]},getInt32:function(e){return Jv(yr(this,4,e,arguments.length>1?arguments[1]:!1))},getUint32:function(e){return Jv(yr(this,4,e,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(e){return zv(yr(this,4,e,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(e){return zv(yr(this,8,e,arguments.length>1?arguments[1]:!1),52)},setInt8:function(e,t){dr(this,1,e,Hv,t)},setUint8:function(e,t){dr(this,1,e,Hv,t)},setInt16:function(e,t){dr(this,2,e,Xv,t,arguments.length>2?arguments[2]:!1)},setUint16:function(e,t){dr(this,2,e,Xv,t,arguments.length>2?arguments[2]:!1)},setInt32:function(e,t){dr(this,4,e,Zv,t,arguments.length>2?arguments[2]:!1)},setUint32:function(e,t){dr(this,4,e,Zv,t,arguments.length>2?arguments[2]:!1)},setFloat32:function(e,t){dr(this,4,e,tI,t,arguments.length>2?arguments[2]:!1)},setFloat64:function(e,t){dr(this,8,e,aI,t,arguments.length>2?arguments[2]:!1)}}));var Da,ue,Ma;ec(F,Ur);ec(X,it);nc.exports={ArrayBuffer:F,DataView:X}});var uc=i((KR,ic)=>{"use strict";var nI=m(),iI=Math.floor;ic.exports=Number.isInteger||function(e){return!nI(e)&&isFinite(e)&&iI(e)===e}});var sc=i((zR,oc)=>{"use strict";var uI=M(),oI=RangeError;oc.exports=function(r){var e=uI(r);if(e<0)throw new oI("The argument can't be less than 0");return e}});var Ga=i((HR,vc)=>{"use strict";var sI=sc(),vI=RangeError;vc.exports=function(r,e){var t=sI(r);if(t%e)throw new vI("Wrong offset");return t}});var fc=i((XR,cc)=>{"use strict";var cI=Math.round;cc.exports=function(r){var e=cI(r);return e<0?0:e>255?255:e&255}});var ot=i((ZR,lc)=>{"use strict";var fI=ir(),lI=A();lc.exports=function(r){if(fI(r)==="Function")return lI(r)}});var st=i((JR,yc)=>{"use strict";var pc=ot(),pI=ur(),yI=Yr(),dI=pc(pc.bind);yc.exports=function(r,e){return pI(r),e===void 0?r:yI?dI(r,e):function(){return r.apply(e,arguments)}}});var Va=i((QR,Tc)=>{"use strict";var qI=A(),gI=I(),dc=O(),hI=fr(),TI=hr(),SI=Yt(),qc=function(){},gc=TI("Reflect","construct"),$a=/^\\s*(?:class|function)\\b/,II=qI($a.exec),xI=!$a.test(qc),se=function(e){if(!dc(e))return!1;try{return gc(qc,[],e),!0}catch(t){return!1}},hc=function(e){if(!dc(e))return!1;switch(hI(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return xI||!!II($a,SI(e))}catch(t){return!0}};hc.sham=!0;Tc.exports=!gc||gI(function(){var r;return se(se.call)||!se(Object)||!se(function(){r=!0})||r})?hc:se});var Ic=i((rm,Sc)=>{"use strict";var AI=Va(),OI=Hr(),bI=TypeError;Sc.exports=function(r){if(AI(r))return r;throw new bI(OI(r)+" is not a constructor")}});var Wa=i((em,Ac)=>{"use strict";var EI=fr(),xc=Xr(),wI=ge(),RI=Fr(),mI=E(),PI=mI("iterator");Ac.exports=function(r){if(!wI(r))return xc(r,PI)||xc(r,"@@iterator")||RI[EI(r)]}});var bc=i((tm,Oc)=>{"use strict";var _I=b(),CI=ur(),NI=D(),FI=Hr(),LI=Wa(),BI=TypeError;Oc.exports=function(r,e){var t=arguments.length<2?LI(r):e;if(CI(t))return NI(_I(t,r));throw new BI(FI(r)+" is not iterable")}});var wc=i((am,Ec)=>{"use strict";var jI=E(),DI=Fr(),MI=jI("iterator"),UI=Array.prototype;Ec.exports=function(r){return r!==void 0&&(DI.Array===r||UI[MI]===r)}});var Ya=i((nm,Rc)=>{"use strict";var kI=fr();Rc.exports=function(r){var e=kI(r);return e==="BigInt64Array"||e==="BigUint64Array"}});var vt=i((im,mc)=>{"use strict";var GI=Lt(),$I=TypeError;mc.exports=function(r){var e=GI(r,"number");if(typeof e=="number")throw new $I("Can't convert number to bigint");return BigInt(e)}});var Ka=i((um,Pc)=>{"use strict";var VI=st(),WI=b(),YI=Ic(),KI=K(),zI=U(),HI=bc(),XI=Wa(),ZI=wc(),JI=Ya(),QI=N().aTypedArrayConstructor,rx=vt();Pc.exports=function(e){var t=YI(this),a=KI(e),n=arguments.length,u=n>1?arguments[1]:void 0,o=u!==void 0,s=XI(a),c,f,v,p,l,d,h,q;if(s&&!ZI(s))for(h=HI(a,s),q=h.next,a=[];!(d=WI(q,h)).done;)a.push(d.value);for(o&&n>2&&(u=VI(u,arguments[2])),f=zI(a),v=new(QI(t))(f),p=JI(v),c=0;f>c;c++)l=o?u(a[c],c):a[c],v[c]=p?rx(l):+l;return v}});var za=i((om,_c)=>{"use strict";var ex=ir();_c.exports=Array.isArray||function(e){return ex(e)==="Array"}});var Lc=i((sm,Fc)=>{"use strict";var Cc=za(),tx=Va(),ax=m(),nx=E(),ix=nx("species"),Nc=Array;Fc.exports=function(r){var e;return Cc(r)&&(e=r.constructor,tx(e)&&(e===Nc||Cc(e.prototype))?e=void 0:ax(e)&&(e=e[ix],e===null&&(e=void 0))),e===void 0?Nc:e}});var jc=i((vm,Bc)=>{"use strict";var ux=Lc();Bc.exports=function(r,e){return new(ux(r))(e===0?0:e)}});var Uc=i((cm,Mc)=>{"use strict";var ox=st(),sx=A(),vx=qe(),cx=K(),fx=U(),lx=jc(),Dc=sx([].push),qr=function(r){var e=r===1,t=r===2,a=r===3,n=r===4,u=r===6,o=r===7,s=r===5||u;return function(c,f,v,p){for(var l=cx(c),d=vx(l),h=fx(d),q=ox(f,v),y=0,g=p||lx,x=e?g(c,h):t||o?g(c,0):void 0,_,L;h>y;y++)if((s||y in d)&&(_=d[y],L=q(_,y,l),r))if(e)x[y]=L;else if(L)switch(r){case 3:return!0;case 5:return _;case 6:return y;case 2:Dc(x,_)}else switch(r){case 4:return!1;case 7:Dc(x,_)}return u?-1:a||n?n:x}};Mc.exports={forEach:qr(0),map:qr(1),filter:qr(2),some:qr(3),every:qr(4),find:qr(5),findIndex:qr(6),filterReject:qr(7)}});var Ha=i((fm,Gc)=>{"use strict";var px=hr(),yx=Br(),dx=E(),qx=w(),kc=dx("species");Gc.exports=function(r){var e=px(r);qx&&e&&!e[kc]&&yx(e,kc,{configurable:!0,get:function(){return this}})}});var Xa=i((lm,$c)=>{"use strict";var gx=U();$c.exports=function(r,e,t){for(var a=0,n=arguments.length>2?t:gx(e),u=new r(n);n>a;)u[a]=e[a++];return u}});var cf=i((pm,an)=>{"use strict";var Vc=R(),ef=T(),Wc=b(),hx=w(),Tx=_a(),le=N(),tf=ut(),Yc=Ca(),Sx=Kr(),ve=J(),Ix=uc(),xx=xr(),Kc=Qe(),Za=Ga(),Ax=fc(),af=be(),ce=j(),Ox=fr(),rn=m(),bx=Se(),Ex=Nr(),wx=zr(),ct=Lr(),Rx=ea().f,zc=Ka(),mx=Uc().forEach,Px=Ha(),_x=Br(),nf=z(),uf=we(),Hc=Xa(),nn=Sr(),Cx=La(),en=nn.get,Nx=nn.set,Fx=nn.enforce,of=nf.f,Lx=uf.f,Ja=ef.RangeError,sf=tf.ArrayBuffer,Bx=sf.prototype,jx=tf.DataView,ft=le.NATIVE_ARRAY_BUFFER_VIEWS,Xc=le.TYPED_ARRAY_TAG,Zc=le.TypedArray,fe=le.TypedArrayPrototype,tn=le.isTypedArray,lt="BYTES_PER_ELEMENT",Qa="Wrong length",pt=function(r,e){_x(r,e,{configurable:!0,get:function(){return en(this)[e]}})},Jc=function(r){var e;return wx(Bx,r)||(e=Ox(r))==="ArrayBuffer"||e==="SharedArrayBuffer"},vf=function(r,e){return tn(r)&&!bx(e)&&e in r&&Ix(+e)&&e>=0},Qc=function(e,t){return t=af(t),vf(e,t)?Sx(2,e[t]):Lx(e,t)},rf=function(e,t,a){return t=af(t),vf(e,t)&&rn(a)&&ce(a,"value")&&!ce(a,"get")&&!ce(a,"set")&&!a.configurable&&(!ce(a,"writable")||a.writable)&&(!ce(a,"enumerable")||a.enumerable)?(e[t]=a.value,e):of(e,t,a)};hx?(ft||(uf.f=Qc,nf.f=rf,pt(fe,"buffer"),pt(fe,"byteOffset"),pt(fe,"byteLength"),pt(fe,"length")),Vc({target:"Object",stat:!0,forced:!ft},{getOwnPropertyDescriptor:Qc,defineProperty:rf}),an.exports=function(r,e,t){var a=r.match(/\\d+/)[0]/8,n=r+(t?"Clamped":"")+"Array",u="get"+r,o="set"+r,s=ef[n],c=s,f=c&&c.prototype,v={},p=function(q,y){var g=en(q);return g.view[u](y*a+g.byteOffset,!0)},l=function(q,y,g){var x=en(q);x.view[o](y*a+x.byteOffset,t?Ax(g):g,!0)},d=function(q,y){of(q,y,{get:function(){return p(this,y)},set:function(g){return l(this,y,g)},enumerable:!0})};ft?Tx&&(c=e(function(q,y,g,x){return Yc(q,f),Cx(function(){return rn(y)?Jc(y)?x!==void 0?new s(y,Za(g,a),x):g!==void 0?new s(y,Za(g,a)):new s(y):tn(y)?Hc(c,y):Wc(zc,c,y):new s(Kc(y))}(),q,c)}),ct&&ct(c,Zc),mx(Rx(s),function(q){q in c||ve(c,q,s[q])}),c.prototype=f):(c=e(function(q,y,g,x){Yc(q,f);var _=0,L=0,nr,B,Z;if(!rn(y))Z=Kc(y),B=Z*a,nr=new sf(B);else if(Jc(y)){nr=y,L=Za(g,a);var Er=y.byteLength;if(x===void 0){if(Er%a)throw new Ja(Qa);if(B=Er-L,B<0)throw new Ja(Qa)}else if(B=xx(x)*a,B+L>Er)throw new Ja(Qa);Z=B/a}else return tn(y)?Hc(c,y):Wc(zc,c,y);for(Nx(q,{buffer:nr,byteOffset:L,byteLength:B,length:Z,view:new jx(nr)});_<Z;)d(q,_++)}),ct&&ct(c,Zc),f=c.prototype=Ex(fe)),f.constructor!==c&&ve(f,"constructor",c),Fx(f).TypedArrayConstructor=c,Xc&&ve(f,Xc,n);var h=c!==s;v[n]=c,Vc({global:!0,constructor:!0,forced:h,sham:!ft},v),lt in c||ve(c,lt,a),lt in f||ve(f,lt,a),Px(n)}):an.exports=function(){}});var ff=i(()=>{"use strict";var Dx=cf();Dx("Uint8",function(r){return function(t,a,n){return r(this,t,a,n)}})});var pf=i(()=>{"use strict";var lf=N(),Mx=U(),Ux=M(),kx=lf.aTypedArray,Gx=lf.exportTypedArrayMethod;Gx("at",function(e){var t=kx(this),a=Mx(t),n=Ux(e),u=n>=0?n:a+n;return u<0||u>=a?void 0:t[u]})});var df=i(()=>{"use strict";var yf=N(),$x=Na(),Vx=vt(),Wx=fr(),Yx=b(),Kx=A(),zx=I(),Hx=yf.aTypedArray,Xx=yf.exportTypedArrayMethod,Zx=Kx("".slice),Jx=zx(function(){var r=0;return new Int8Array(2).fill({valueOf:function(){return r++}}),r!==1});Xx("fill",function(e){var t=arguments.length;Hx(this);var a=Zx(Wx(this),0,3)==="Big"?Vx(e):+e;return Yx($x,this,a,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},Jx)});var un=i((Sm,gf)=>{"use strict";var Qx=st(),rA=qe(),eA=K(),tA=U(),qf=function(r){var e=r===1;return function(t,a,n){for(var u=eA(t),o=rA(u),s=tA(o),c=Qx(a,n),f,v;s-- >0;)if(f=o[s],v=c(f,s,u),v)switch(r){case 0:return f;case 1:return s}return e?-1:void 0}};gf.exports={findLast:qf(0),findLastIndex:qf(1)}});var Tf=i(()=>{"use strict";var hf=N(),aA=un().findLast,nA=hf.aTypedArray,iA=hf.exportTypedArrayMethod;iA("findLast",function(e){return aA(nA(this),e,arguments.length>1?arguments[1]:void 0)})});var If=i(()=>{"use strict";var Sf=N(),uA=un().findLastIndex,oA=Sf.aTypedArray,sA=Sf.exportTypedArrayMethod;sA("findLastIndex",function(e){return uA(oA(this),e,arguments.length>1?arguments[1]:void 0)})});var wf=i(()=>{"use strict";var Af=T(),Of=b(),vn=N(),vA=U(),cA=Ga(),fA=K(),bf=I(),lA=Af.RangeError,on=Af.Int8Array,xf=on&&on.prototype,Ef=xf&&xf.set,pA=vn.aTypedArray,yA=vn.exportTypedArrayMethod,sn=!bf(function(){var r=new Uint8ClampedArray(2);return Of(Ef,r,{length:1,0:3},1),r[1]!==3}),dA=sn&&vn.NATIVE_ARRAY_BUFFER_VIEWS&&bf(function(){var r=new on(2);return r.set(1),r.set("2",1),r[0]!==0||r[1]!==2});yA("set",function(e){pA(this);var t=cA(arguments.length>1?arguments[1]:void 0,1),a=fA(e);if(sn)return Of(Ef,this,a,t);var n=this.length,u=vA(a),o=0;if(u+t>n)throw new lA("Wrong length");for(;o<u;)this[t+o]=a[o++]},!sn||dA)});var Pf=i((wm,mf)=>{"use strict";var Rf=Fa(),qA=Math.floor,cn=function(r,e){var t=r.length;if(t<8)for(var a=1,n,u;a<t;){for(u=a,n=r[a];u&&e(r[u-1],n)>0;)r[u]=r[--u];u!==a++&&(r[u]=n)}else for(var o=qA(t/2),s=cn(Rf(r,0,o),e),c=cn(Rf(r,o),e),f=s.length,v=c.length,p=0,l=0;p<f||l<v;)r[p+l]=p<f&&l<v?e(s[p],c[l])<=0?s[p++]:c[l++]:p<f?s[p++]:c[l++];return r};mf.exports=cn});var Nf=i((Rm,Cf)=>{"use strict";var gA=mr(),_f=gA.match(/firefox\\/(\\d+)/i);Cf.exports=!!_f&&+_f[1]});var Lf=i((mm,Ff)=>{"use strict";var hA=mr();Ff.exports=/MSIE|Trident/.test(hA)});var Df=i((Pm,jf)=>{"use strict";var TA=mr(),Bf=TA.match(/AppleWebKit\\/(\\d+)\\./);jf.exports=!!Bf&&+Bf[1]});var Vf=i(()=>{"use strict";var SA=T(),IA=ot(),fn=I(),xA=ur(),AA=Pf(),$f=N(),Mf=Nf(),OA=Lf(),Uf=Te(),kf=Df(),bA=$f.aTypedArray,EA=$f.exportTypedArrayMethod,pe=SA.Uint16Array,Gr=pe&&IA(pe.prototype.sort),wA=!!Gr&&!(fn(function(){Gr(new pe(2),null)})&&fn(function(){Gr(new pe(2),{})})),Gf=!!Gr&&!fn(function(){if(Uf)return Uf<74;if(Mf)return Mf<67;if(OA)return!0;if(kf)return kf<602;var r=new pe(516),e=Array(516),t,a;for(t=0;t<516;t++)a=t%4,r[t]=515-t,e[t]=t-2*a+3;for(Gr(r,function(n,u){return(n/4|0)-(u/4|0)}),t=0;t<516;t++)if(r[t]!==e[t])return!0}),RA=function(r){return function(e,t){return r!==void 0?+r(e,t)||0:t!==t?-1:e!==e?1:e===0&&t===0?1/e>0&&1/t<0?1:-1:e>t}};EA("sort",function(e){return e!==void 0&&xA(e),Gf?Gr(this,e):AA(bA(this),RA(e))},!Gf||wA)});var Yf=i((Nm,Wf)=>{"use strict";var mA=U();Wf.exports=function(r,e){for(var t=mA(r),a=new e(t),n=0;n<t;n++)a[n]=r[t-n-1];return a}});var Kf=i(()=>{"use strict";var PA=Yf(),ln=N(),_A=ln.aTypedArray,CA=ln.exportTypedArrayMethod,NA=ln.getTypedArrayConstructor;CA("toReversed",function(){return PA(_A(this),NA(this))})});var zf=i(()=>{"use strict";var yt=N(),FA=A(),LA=ur(),BA=Xa(),jA=yt.aTypedArray,DA=yt.getTypedArrayConstructor,MA=yt.exportTypedArrayMethod,UA=FA(yt.TypedArrayPrototype.sort);MA("toSorted",function(e){e!==void 0&&LA(e);var t=jA(this),a=BA(DA(t),t);return UA(a,e)})});var Xf=i((Dm,Hf)=>{"use strict";var kA=U(),GA=M(),$A=RangeError;Hf.exports=function(r,e,t,a){var n=kA(r),u=GA(t),o=u<0?n+u:u;if(o>=n||o<0)throw new $A("Incorrect index");for(var s=new e(n),c=0;c<n;c++)s[c]=c===o?a:r[c];return s}});var Zf=i(()=>{"use strict";var VA=Xf(),pn=N(),WA=Ya(),YA=M(),KA=vt(),zA=pn.aTypedArray,HA=pn.getTypedArrayConstructor,XA=pn.exportTypedArrayMethod,ZA=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(r){return r===8}}();XA("with",function(r,e){var t=zA(this),a=YA(r),n=WA(t)?KA(e):+e;return VA(t,HA(t),a,n)},!ZA)});var Qf=i(()=>{"use strict";var JA=R(),QA=T(),rO=ut(),eO=Ha(),yn="ArrayBuffer",Jf=rO[yn],tO=QA[yn];JA({global:!0,constructor:!0,forced:tO!==Jf},{ArrayBuffer:Jf});eO(yn)});var il=i(()=>{"use strict";var aO=R(),qn=ot(),nO=I(),al=ut(),rl=D(),el=Be(),iO=xr(),gn=al.ArrayBuffer,dn=al.DataView,nl=dn.prototype,tl=qn(gn.prototype.slice),uO=qn(nl.getUint8),oO=qn(nl.setUint8),sO=nO(function(){return!new gn(2).slice(1,void 0).byteLength});aO({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:sO},{slice:function(e,t){if(tl&&t===void 0)return tl(rl(this),e);for(var a=rl(this).byteLength,n=el(e,a),u=el(t===void 0?a:t,a),o=new gn(iO(u-n)),s=new dn(this),c=new dn(o),f=0;n<u;)oO(c,f++,uO(s,n++));return o}})});var hn=i((Wm,sl)=>{"use strict";var ol=T(),vO=re(),cO=ir(),ul=ol.ArrayBuffer,fO=ol.TypeError;sl.exports=ul&&vO(ul.prototype,"byteLength","get")||function(r){if(cO(r)!=="ArrayBuffer")throw new fO("ArrayBuffer expected");return r.byteLength}});var Tn=i((Ym,vl)=>{"use strict";var lO=T(),pO=Ke(),yO=hn(),dO=lO.DataView;vl.exports=function(r){if(!pO||yO(r)!==0)return!1;try{return new dO(r),!1}catch(e){return!0}}});var fl=i(()=>{"use strict";var qO=w(),gO=Br(),hO=Tn(),cl=ArrayBuffer.prototype;qO&&!("detached"in cl)&&gO(cl,"detached",{configurable:!0,get:function(){return hO(this)}})});var pl=i((Hm,ll)=>{"use strict";var TO=Tn(),SO=TypeError;ll.exports=function(r){if(TO(r))throw new SO("ArrayBuffer is detached");return r}});var Sn=i((Xm,yl)=>{"use strict";var ye=T(),IO=mr(),xO=ir(),dt=function(r){return IO.slice(0,r.length)===r};yl.exports=function(){return dt("Bun/")?"BUN":dt("Cloudflare-Workers")?"CLOUDFLARE":dt("Deno/")?"DENO":dt("Node.js/")?"NODE":ye.Bun&&typeof Bun.version=="string"?"BUN":ye.Deno&&typeof Deno.version=="object"?"DENO":xO(ye.process)==="process"?"NODE":ye.window&&ye.document?"BROWSER":"REST"}()});var ql=i((Zm,dl)=>{"use strict";var AO=Sn();dl.exports=AO==="NODE"});var hl=i((Jm,gl)=>{"use strict";var OO=T(),bO=ql();gl.exports=function(r){if(bO){try{return OO.process.getBuiltinModule(r)}catch(e){}try{return Function('return require("'+r+'")')()}catch(e){}}}});var An=i((Qm,Sl)=>{"use strict";var EO=T(),wO=I(),In=Te(),xn=Sn(),Tl=EO.structuredClone;Sl.exports=!!Tl&&!wO(function(){if(xn==="DENO"&&In>92||xn==="NODE"&&In>94||xn==="BROWSER"&&In>97)return!1;var r=new ArrayBuffer(8),e=Tl(r,{transfer:[r]});return r.byteLength!==0||e.byteLength!==8})});var Ol=i((rP,Al)=>{"use strict";var wn=T(),RO=hl(),mO=An(),PO=wn.structuredClone,Il=wn.ArrayBuffer,qt=wn.MessageChannel,En=!1,On,xl,gt,bn;if(mO)En=function(r){PO(r,{transfer:[r]})};else if(Il)try{qt||(On=RO("worker_threads"),On&&(qt=On.MessageChannel)),qt&&(xl=new qt,gt=new Il(2),bn=function(r){xl.port1.postMessage(null,[r])},gt.byteLength===2&&(bn(gt),gt.byteLength===0&&(En=bn)))}catch(r){}Al.exports=En});var Nn=i((eP,_l)=>{"use strict";var Pn=T(),_n=A(),Rl=re(),_O=Qe(),CO=pl(),NO=hn(),bl=Ol(),Rn=An(),FO=Pn.structuredClone,ml=Pn.ArrayBuffer,mn=Pn.DataView,LO=Math.min,Cn=ml.prototype,Pl=mn.prototype,BO=_n(Cn.slice),El=Rl(Cn,"resizable","get"),wl=Rl(Cn,"maxByteLength","get"),jO=_n(Pl.getInt8),DO=_n(Pl.setInt8);_l.exports=(Rn||bl)&&function(r,e,t){var a=NO(r),n=e===void 0?a:_O(e),u=!El||!El(r),o;if(CO(r),Rn&&(r=FO(r,{transfer:[r]}),a===n&&(t||u)))return r;if(a>=n&&(!t||u))o=BO(r,0,n);else{var s=t&&!u&&wl?{maxByteLength:wl(r)}:void 0;o=new ml(n,s);for(var c=new mn(r),f=new mn(o),v=LO(n,a),p=0;p<v;p++)DO(f,p,jO(c,p))}return Rn||bl(r),o}});var Nl=i(()=>{"use strict";var MO=R(),Cl=Nn();Cl&&MO({target:"ArrayBuffer",proto:!0},{transfer:function(){return Cl(this,arguments.length?arguments[0]:void 0,!0)}})});var Ll=i(()=>{"use strict";var UO=R(),Fl=Nn();Fl&&UO({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return Fl(this,arguments.length?arguments[0]:void 0,!1)}})});var Bl=i(()=>{"use strict";var kO=_a(),GO=N().exportTypedArrayStaticMethod,$O=Ka();GO("from",$O,kO)});var Dl=i((sP,jl)=>{"use strict";var VO=w(),WO=za(),YO=TypeError,KO=Object.getOwnPropertyDescriptor,zO=VO&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(r){return r instanceof TypeError}}();jl.exports=zO?function(r,e){if(WO(r)&&!KO(r,"length").writable)throw new YO("Cannot set read only .length");return r.length=e}:function(r,e){return r.length=e}});var Ul=i((vP,Ml)=>{"use strict";var HO=TypeError,XO=9007199254740991;Ml.exports=function(r){if(r>XO)throw HO("Maximum allowed index exceeded");return r}});var kl=i(()=>{"use strict";var ZO=R(),JO=K(),QO=U(),rb=Dl(),eb=Ul(),tb=I(),ab=tb(function(){return[].push.call({length:4294967296},1)!==4294967297}),nb=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(r){return r instanceof TypeError}},ib=ab||!nb();ZO({target:"Array",proto:!0,arity:1,forced:ib},{push:function(e){var t=JO(this),a=QO(t),n=arguments.length;eb(a+n);for(var u=0;u<n;u++)t[a]=arguments[u],a++;return rb(t,a),a}})});var ht=i((lP,Gl)=>{"use strict";var ub=fr(),ob=String;Gl.exports=function(r){if(ub(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ob(r)}});var Vl=i((pP,$l)=>{"use strict";var sb=D();$l.exports=function(){var r=sb(this),e="";return r.hasIndices&&(e+="d"),r.global&&(e+="g"),r.ignoreCase&&(e+="i"),r.multiline&&(e+="m"),r.dotAll&&(e+="s"),r.unicode&&(e+="u"),r.unicodeSets&&(e+="v"),r.sticky&&(e+="y"),e}});var Yl=i((yP,Wl)=>{"use strict";var Fn=I(),vb=T(),Ln=vb.RegExp,Bn=Fn(function(){var r=Ln("a","y");return r.lastIndex=2,r.exec("abcd")!==null}),cb=Bn||Fn(function(){return!Ln("a","y").sticky}),fb=Bn||Fn(function(){var r=Ln("^r","gy");return r.lastIndex=2,r.exec("str")!==null});Wl.exports={BROKEN_CARET:fb,MISSED_STICKY:cb,UNSUPPORTED_Y:Bn}});var zl=i((dP,Kl)=>{"use strict";var lb=I(),pb=T(),yb=pb.RegExp;Kl.exports=lb(function(){var r=yb(".","s");return!(r.dotAll&&r.test(\`
171
171
  \`)&&r.flags==="s")})});var Xl=i((qP,Hl)=>{"use strict";var db=I(),qb=T(),gb=qb.RegExp;Hl.exports=db(function(){var r=gb("(?<a>b)","g");return r.exec("b").groups.a!=="b"||"b".replace(r,"$<a>c")!=="bc"})});var It=i((gP,Jl)=>{"use strict";var $r=b(),St=A(),hb=ht(),Tb=Vl(),Sb=Yl(),Ib=Ae(),xb=Nr(),Ab=Sr().get,Ob=zl(),bb=Xl(),Eb=Ib("native-string-replace",String.prototype.replace),Tt=RegExp.prototype.exec,Dn=Tt,wb=St("".charAt),Rb=St("".indexOf),mb=St("".replace),jn=St("".slice),Mn=function(){var r=/a/,e=/b*/g;return $r(Tt,r,"a"),$r(Tt,e,"a"),r.lastIndex!==0||e.lastIndex!==0}(),Zl=Sb.BROKEN_CARET,Un=/()??/.exec("")[1]!==void 0,Pb=Mn||Un||Zl||Ob||bb;Pb&&(Dn=function(e){var t=this,a=Ab(t),n=hb(e),u=a.raw,o,s,c,f,v,p,l;if(u)return u.lastIndex=t.lastIndex,o=$r(Dn,u,n),t.lastIndex=u.lastIndex,o;var d=a.groups,h=Zl&&t.sticky,q=$r(Tb,t),y=t.source,g=0,x=n;if(h&&(q=mb(q,"y",""),Rb(q,"g")===-1&&(q+="g"),x=jn(n,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&wb(n,t.lastIndex-1)!==\`
172
172
  \`)&&(y="(?: "+y+")",x=" "+x,g++),s=new RegExp("^(?:"+y+")",q)),Un&&(s=new RegExp("^"+y+"$(?!\\\\s)",q)),Mn&&(c=t.lastIndex),f=$r(Tt,h?s:t,x),h?f?(f.input=jn(f.input,g),f[0]=jn(f[0],g),f.index=t.lastIndex,t.lastIndex+=f[0].length):t.lastIndex=0:Mn&&f&&(t.lastIndex=t.global?f.index+f[0].length:c),Un&&f&&f.length>1&&$r(Eb,f[0],s,function(){for(v=1;v<arguments.length-2;v++)arguments[v]===void 0&&(f[v]=void 0)}),f&&d)for(f.groups=p=xb(null),v=0;v<d.length;v++)l=d[v],p[l[0]]=f[l[1]];return f});Jl.exports=Dn});var kn=i(()=>{"use strict";var _b=R(),Ql=It();_b({target:"RegExp",proto:!0,forced:/./.exec!==Ql},{exec:Ql})});var np=i((SP,ap)=>{"use strict";var Cb=Yr(),tp=Function.prototype,rp=tp.apply,ep=tp.call;ap.exports=typeof Reflect=="object"&&Reflect.apply||(Cb?ep.bind(rp):function(){return ep.apply(rp,arguments)})});var cp=i((IP,vp)=>{"use strict";kn();var ip=b(),up=Ir(),Nb=It(),op=I(),sp=E(),Fb=J(),Lb=sp("species"),Gn=RegExp.prototype;vp.exports=function(r,e,t,a){var n=sp(r),u=!op(function(){var f={};return f[n]=function(){return 7},""[r](f)!==7}),o=u&&!op(function(){var f=!1,v=/a/;return r==="split"&&(v={},v.constructor={},v.constructor[Lb]=function(){return v},v.flags="",v[n]=/./[n]),v.exec=function(){return f=!0,null},v[n](""),!f});if(!u||!o||t){var s=/./[n],c=e(n,""[r],function(f,v,p,l,d){var h=v.exec;return h===Nb||h===Gn.exec?u&&!d?{done:!0,value:ip(s,v,p,l)}:{done:!0,value:ip(f,p,v,l)}:{done:!1}});up(String.prototype,r,c[0]),up(Gn,n,c[1])}a&&Fb(Gn[n],"sham",!0)}});var yp=i((xP,pp)=>{"use strict";var $n=A(),Bb=M(),jb=ht(),Db=wr(),Mb=$n("".charAt),fp=$n("".charCodeAt),Ub=$n("".slice),lp=function(r){return function(e,t){var a=jb(Db(e)),n=Bb(t),u=a.length,o,s;return n<0||n>=u?r?"":void 0:(o=fp(a,n),o<55296||o>56319||n+1===u||(s=fp(a,n+1))<56320||s>57343?r?Mb(a,n):o:r?Ub(a,n,n+2):(o-55296<<10)+(s-56320)+65536)}};pp.exports={codeAt:lp(!1),charAt:lp(!0)}});var qp=i((AP,dp)=>{"use strict";var kb=yp().charAt;dp.exports=function(r,e,t){return e+(t?kb(r,e).length:1)}});var hp=i((OP,gp)=>{"use strict";var Yn=A(),Gb=K(),$b=Math.floor,Vn=Yn("".charAt),Vb=Yn("".replace),Wn=Yn("".slice),Wb=/\\$([$&'\`]|\\d{1,2}|<[^>]*>)/g,Yb=/\\$([$&'\`]|\\d{1,2})/g;gp.exports=function(r,e,t,a,n,u){var o=t+r.length,s=a.length,c=Yb;return n!==void 0&&(n=Gb(n),c=Wb),Vb(u,c,function(f,v){var p;switch(Vn(v,0)){case"$":return"$";case"&":return r;case"\`":return Wn(e,0,t);case"'":return Wn(e,o);case"<":p=n[Wn(v,1,-1)];break;default:var l=+v;if(l===0)return f;if(l>s){var d=$b(l/10);return d===0?f:d<=s?a[d-1]===void 0?Vn(v,1):a[d-1]+Vn(v,1):f}p=a[l-1]}return p===void 0?"":p})}});var Ip=i((bP,Sp)=>{"use strict";var Tp=b(),Kb=D(),zb=O(),Hb=ir(),Xb=It(),Zb=TypeError;Sp.exports=function(r,e){var t=r.exec;if(zb(t)){var a=Tp(t,r,e);return a!==null&&Kb(a),a}if(Hb(r)==="RegExp")return Tp(Xb,r,e);throw new Zb("RegExp#exec called on incompatible receiver")}});var Ep=i(()=>{"use strict";var Jb=np(),xp=b(),xt=A(),Qb=cp(),rE=I(),eE=D(),tE=O(),aE=m(),nE=M(),iE=xr(),Vr=ht(),uE=wr(),oE=qp(),sE=Xr(),vE=hp(),cE=Ip(),fE=E(),zn=fE("replace"),lE=Math.max,pE=Math.min,yE=xt([].concat),Kn=xt([].push),Ap=xt("".indexOf),Op=xt("".slice),dE=function(r){return r===void 0?r:String(r)},qE=function(){return"a".replace(/./,"$0")==="$0"}(),bp=function(){return/./[zn]?/./[zn]("a","$0")==="":!1}(),gE=!rE(function(){var r=/./;return r.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(r,"$<a>")!=="7"});Qb("replace",function(r,e,t){var a=bp?"$":"$0";return[function(u,o){var s=uE(this),c=aE(u)?sE(u,zn):void 0;return c?xp(c,u,s,o):xp(e,Vr(s),u,o)},function(n,u){var o=eE(this),s=Vr(n);if(typeof u=="string"&&Ap(u,a)===-1&&Ap(u,"$<")===-1){var c=t(e,o,s,u);if(c.done)return c.value}var f=tE(u);f||(u=Vr(u));var v=o.global,p;v&&(p=o.unicode,o.lastIndex=0);for(var l=[],d;d=cE(o,s),!(d===null||(Kn(l,d),!v));){var h=Vr(d[0]);h===""&&(o.lastIndex=oE(s,iE(o.lastIndex),p))}for(var q="",y=0,g=0;g<l.length;g++){d=l[g];for(var x=Vr(d[0]),_=lE(pE(nE(d.index),s.length),0),L=[],nr,B=1;B<d.length;B++)Kn(L,dE(d[B]));var Z=d.groups;if(f){var Er=yE([x],L,_,s);Z!==void 0&&Kn(Er,Z),nr=Vr(Jb(u,void 0,Er))}else nr=vE(x,s,_,L,Z,u);_>=y&&(q+=Op(s,y,_)+nr,y=_+x.length)}return q+Op(s,y)}]},!gE||!qE||bp)});var BP=S(Ao(),1),jP=S(wo(),1),DP=S(Co(),1),MP=S(Lo(),1),UP=S(Do(),1),kP=S(ko(),1),GP=S(Vo(),1),$P=S(Zs(),1),VP=S(ff(),1),WP=S(pf(),1),YP=S(df(),1),KP=S(Tf(),1),zP=S(If(),1),HP=S(wf(),1),XP=S(Vf(),1),ZP=S(Kf(),1),JP=S(zf(),1),QP=S(Zf(),1),r_=S(Qf(),1),e_=S(il(),1),t_=S(fl(),1),a_=S(Nl(),1),n_=S(Ll(),1),i_=S(Bl(),1),u_=S(kl(),1);var RP=S(Ep(),1),mP=S(kn(),1);function wp(r){return r.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function Rp(r){let e={};for(let a in r)a.startsWith("on")&&(e[wp(a.slice(2))]=r[a]);let t=a=>Y(this,null,function*(){let{data:n}=a;if(e[n.type])try{let u=yield e[n.type](n.data);if(u!=null&&u.$transfer&&Array.isArray(u.$transfer)){let o=u.$transfer;delete u.$transfer,self.postMessage({type:""+n.type+"_result",key:n.key,data:u},o)}else self.postMessage({type:""+n.type+"_result",key:n.key,data:u})}catch(u){self.postMessage({type:""+n.type+"_result",key:n.key,error:u})}else self.postMessage({type:""+n.type+"_result",key:n.key,error:"no_event"})});return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var br,gr=function(r){return r.MAP_VERSION="map_version",r.ROUTE_VERSION="route_version",r.FACILITY_VERSION="facility_version",r.MAP_DATA="map_data",r.ROAD_NETWORK_DATA="road_network_data",r.FACILITY_DATA="facility_data",r.POI_TEXT="poi_text",r.LAZY_TEXTURE="lazy_texture",r.LAZY_POI="lazy_poi",r}({});function Hn(r,e){return r===void 0&&(r="aibee_map"),e===void 0&&(e=6),new Promise((t,a)=>{if(br)return console.log("[create db is opened]"),t({db:br,type:"success"});let n=indexedDB.open(r,e);n.onupgradeneeded=function(u){br=u.target.result,console.log("[open db is onupgradeneeded]"),ar("map_version"),ar("route_version"),ar("facility_version"),ar("map_data"),ar("road_network_data"),ar("facility_data"),ar("poi_text"),ar("lazy_texture"),ar("lazy_poi")},n.onsuccess=u=>{br=u.target.result,console.log("[open db is onsuccess]"),t({db:br,type:"success"})},n.onerror=u=>{console.log("[open db is onerror]"),a(u)}})}function mp(r,e,t){return t===void 0&&(t=br),new Promise((a,n)=>{t||n("\\u6CA1\\u6709db");let o=t.transaction([r],"readonly").objectStore(r).get(e);o.onsuccess=()=>{o.result?a(o.result.value):a(null)},o.onerror=s=>{console.log("[getVersionByKey]",s),a(null)}})}function ar(r,e){e===void 0&&(e=br),e&&(e.objectStoreNames.contains(r)||e.createObjectStore(r,{keyPath:"key"}))}Rp({onGetTextureByTexts(r){return Y(this,null,function*(){let{texts:e}=r,{db:t}=yield Hn(),n=t.transaction([gr.LAZY_POI],"readonly").objectStore(gr.LAZY_POI).openCursor(),u={},o=new Set,s={};return new Promise(c=>{let f=()=>Y(this,null,function*(){yield Promise.all(Object.values(s).map(v=>Y(this,null,function*(){if(u[v.textureKey])u[v.textureKey].map[v.key]=v;else{let p=yield mp(gr.LAZY_TEXTURE,v.textureKey);if(p){let{width:l,height:d,data:h}=p;u[v.textureKey]={width:l,height:d,data:Uint8Array.from(h),map:{[v.key]:v}}}else o.add(v.textureKey)}}))),c({textureKeyMap:u,$transfer:Object.values(u).map(v=>v.data.buffer)})});n.onsuccess=v=>Y(this,null,function*(){var p;let l=(p=v.target)==null?void 0:p.result;if(l){let d=l.key,h=l.value.value;e.includes(d)&&(s[d]=h),l.continue()}else console.log("\\u6240\\u6709\\u6570\\u636E\\u8BFB\\u53D6\\u5B8C\\u6BD5"),f()})})})},onSaveTextTextures(r){return Y(this,null,function*(){let{data:e}=r;return new Promise(t=>Y(this,null,function*(){let{db:a}=yield Hn(),n=a.transaction([gr.LAZY_TEXTURE],"readwrite"),u=a.transaction([gr.LAZY_POI],"readwrite"),o=n.objectStore(gr.LAZY_TEXTURE),s=u.objectStore(gr.LAZY_POI),c=[];for(let f in e){let{textureData:v,res:p}=e[f];o.add({key:f,value:v}),p.forEach(l=>{s.add({key:l.key,value:l})})}c.push(new Promise((f,v)=>{n.oncomplete=f,n.onerror=v}),new Promise((f,v)=>{u.oncomplete=f,u.onerror=v})),Promise.all(c).then(()=>{t({status:!0})}).catch(f=>{console.error(f),n.abort(),u.abort()})}))})}});
173
- `],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var re,Ct=function(a){return a.MAP_VERSION="map_version",a.ROUTE_VERSION="route_version",a.FACILITY_VERSION="facility_version",a.MAP_DATA="map_data",a.ROAD_NETWORK_DATA="road_network_data",a.FACILITY_DATA="facility_data",a.POI_TEXT="poi_text",a.LAZY_TEXTURE="lazy_texture",a.LAZY_POI="lazy_poi",a}({});function cr(a,t){return a===void 0&&(a="aibee_map"),t===void 0&&(t=6),new Promise((e,n)=>{if(re)return console.log("[create db is opened]"),e({db:re,type:"success"});let r=indexedDB.open(a,t);r.onupgradeneeded=function(i){re=i.target.result,console.log("[open db is onupgradeneeded]"),ce("map_version"),ce("route_version"),ce("facility_version"),ce("map_data"),ce("road_network_data"),ce("facility_data"),ce("poi_text"),ce("lazy_texture"),ce("lazy_poi")},r.onsuccess=i=>{re=i.target.result,console.log("[open db is onsuccess]"),e({db:re,type:"success"})},r.onerror=i=>{console.log("[open db is onerror]"),n(i)}})}function xn(a,t,e){return e===void 0&&(e=re),new Promise((n,r)=>{e||r("\u6CA1\u6709db");let o=e.transaction([a],"readonly").objectStore(a).get(t);o.onsuccess=()=>{o.result?n(o.result.value):n(null)},o.onerror=s=>{console.log("[getVersionByKey]",s),n(null)}})}function hr(a,t,e,n,r){return n===void 0&&(n=re),r===void 0&&(r=!1),new Promise((i,o)=>g(this,null,function*(){if(!n){o("\u6CA1\u6709db");return}let s=r;r||(s=!!(yield xn(a,t)));let u=n.transaction([a],"readwrite").objectStore(a),l=s?u.put({key:t,value:e}):u.add({key:t,value:e});l.onsuccess=function(c){i(c)},l.onerror=function(c){o(c)}}))}function ce(a,t){t===void 0&&(t=re),t&&(t.objectStoreNames.contains(a)||t.createObjectStore(a,{keyPath:"key"}))}function Jo(a){a===void 0&&(a=re),a==null||a.close(),re=null}var tt=class{static InitDb(){return cr()}static getCanvas(){if(this.canvas)return this.canvas;{let t=document.createElement("canvas");return this.canvas=t,t}}static getCtx(){if(this.ctx)return this.ctx;let e=this.getCanvas().getContext("2d",{willReadFrequently:!0});return this.ctx=e,e}static getIdleCanvas(){if(this.idleCanvas)return this.idleCanvas;{let t=document.createElement("canvas");return this.idleCanvas=t,t}}static getIdleCtx(){if(this.idleCtx)return this.idleCtx;let e=this.getIdleCanvas().getContext("2d",{willReadFrequently:!0});return this.idleCtx=e,e}static getMergedOptions(t){return x({},this.options,t)}static setCtxStyle(t,e,n){e===void 0&&(e=this.getCanvas()),n===void 0&&(n=this.getCtx()),e.width=t.width,e.height=t.height,n.font=t.font,n.textBaseline=t.textBaseline,n.lineWidth=t.lineWidth,n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle}static getLazyIndexDbTextTextureWorker(){if(this.lazyIndexDbTextTextureWorker)return this.lazyIndexDbTextTextureWorker;{let t=Si();return this.lazyIndexDbTextTextureWorker=t,t}}static getTextureByText(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=(e==null?void 0:e.maxWidth)||600,i=Pe(x({},n,{text:t,maxWidth:r}));if(this.cacheMap.has(i))return this.cacheMap.get(i);let o=new Promise((s,u)=>g(this,null,function*(){var l;yield this.InitDb();let c=yield xn(Ct.POI_TEXT,i);if(c){let T=new z.DataTexture(new Uint8Array(c.data),c.width,c.height,z.RGBAFormat);T.flipY=!0,T.minFilter=z.LinearFilter,T.magFilter=z.LinearFilter;let R={texture:T,lines:c.lines};this.cacheMap.set(i,R),s(R);return}let h=this.getCanvas(),p=this.getCtx();p.clearRect(0,0,h.width,h.height),this.setCtxStyle(n);let f=[],d="",m=[],v="",y=0;for(let T=0;T<t.length;T++){let R=t[T];if(R==="("||R==="\uFF08"){if(y===0&&v){let M=S(v);m.push(...M),v=""}y++}else if((R===")"||R==="\uFF09")&&(y--,y===0)){v+=R,m.push(v),v="";continue}v+=R}if(v){let T=S(v);m.push(...T)}function S(T){let R=[],M="",V=!1,Z="";for(let W=0;W<T.length;W++){let F=T[W];(F==='"'||F==="'")&&(!V||F===Z)?(V?(M+=F,R.push(M),M=""):(M&&R.push(M),M=F),V=!V,Z=F):M+=F}return M&&R.push(M),R}for(let T of m)if(T.startsWith("(")||T.startsWith("\uFF08")||T.startsWith('"')||T.startsWith("'"))if(p.measureText(T).width>r){d&&(f.push(d),d="");let M="",V=T.split("");for(let Z of V){let W=M+Z;p.measureText(W).width>r&&M?(f.push(M),M=Z):M=W}M&&(d=M)}else{let M=d?d+" "+T:T;p.measureText(M).width>r&&d?(f.push(d),d=T):d=M}else{let R=T.split(" ");for(let M of R){let V=d?d+" "+M:M,Z=p.measureText(V);if(Z.width>r)if(d&&f.push(d),Z.width>r||ii(M)){let W="",F=M.split("");for(let fe of F){let on=W+fe;p.measureText(on).width>r&&W?(f.push(W),W=fe):W=on}W&&(d=W)}else d=M;else d=V}}d&&f.push(d);let w=+(((l=n.font.match(/(\d+)px/))==null?void 0:l[1])||54),O=Math.ceil((w+n.lineWidth)*1.2),N=O*f.length,Y=Math.max(...f.map(T=>{let R=Math.ceil(p.measureText(T).width);return R%2===0?R:R+1}))+2;f.forEach((T,R)=>{let M=p.measureText(T),V=Math.ceil(M.width),Z=Math.floor((Y-V)/2),W=8+R*O;n.lineWidth&&p.strokeText(T,Z,W),p.fillText(T,Z,W)});let C=p.getImageData(0,0,Y,N),U=new z.DataTexture(C.data,Y,N,z.RGBAFormat);U.flipY=!0,U.minFilter=z.LinearFilter,U.magFilter=z.LinearFilter,this.cacheMap.set(i,{texture:U,lines:f.length}),hr(Ct.POI_TEXT,i,{data:Array.from(C.data),width:Y,height:N,lines:f.length},void 0,!0),s({texture:U,lines:f.length})}));return this.cacheMap.set(i,o),o})}static lazyGetTextureByTexts(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,2048);let i={},o=new Set;if(t.map(l=>{if(this.lazyPoiMap.has(l)){let c=this.lazyPoiMap.get(l),h=this.lazyTextureCacheMap.get(c.textureKey);if(h){i[l]={width:c.width,height:r,x:c.x,y:c.y,texture:h};return}}o.add(l)}),!o.size)return i;let s=Array.from(o);return new Promise((l,c)=>g(this,null,function*(){let h;window.OffscreenCanvas?(console.log("use webworker"),h=this.getTextsByWorker(s,n,r)):typeof window.requestIdleCallback=="function"?(console.log("use browser idle"),h=this.getTextsByBrowserIdle(s,n,r)):(console.log("use requestAnimation text textures"),h=Promise.resolve().then(()=>this.getTextsSync(s,n,r))),l(h)}))})}static getTextsByWorker(t,e,n){return g(this,null,function*(){return this.textTextureWorker||(this.textTextureWorker=Ei()),(yield $(this.textTextureWorker,"get_texture_by_texts",{texts:t,options:e,originHeight:n})).data.map(i=>{let o=new z.DataTexture(i.data,e.width,i.height,z.RGBAFormat);return o.flipY=!0,o.minFilter=z.LinearFilter,o.magFilter=z.LinearFilter,{texture:o,offsetMap:i.offsetMap}}).reduce((i,o)=>(Object.keys(o.offsetMap).forEach(s=>{i[s]=o.offsetMap[s],i[s].texture=o.texture}),i),{})})}static getTextsByBrowserIdle(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let v=l.reduce((y,S)=>{let w=new z.DataTexture(S.imageData.data,e.width,S.height,z.RGBAFormat);return w.flipY=!0,w.minFilter=z.LinearFilter,w.magFilter=z.LinearFilter,Object.keys(S.offsetMap).forEach(O=>{y[O]=x({},S.offsetMap[O],{texture:w})}),y},{});o(v)}),d=m=>{if(r>=i)return f();if(m.timeRemaining()>0){let v=t[r],y=Math.ceil(u.measureText(v).width);if(y=y%2===0?y:y+1,y+=2,y+c>e.width&&(c=0,h+=n,n+h>e.height)){let w=u.getImageData(0,0,e.width,h);l.push({imageData:w,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let S=8;if(e.lineWidth&&u.strokeText(v,2+c,S+h),u.fillText(v,2+c,S+h),p[v]={width:y,height:n,x:c,y:h},c+=y,++r>=i)return f();m.timeRemaining()>0?d(m):this.timer.requestIdleCallback(d)}else this.timer.requestIdleCallback(d)};this.timer.requestIdleCallback(d),this.timer.setTimeout(()=>{r===0&&(console.log("idle \u4E0D\u6267\u884C \u56DE\u9000\u5230\u540C\u6B65"),o(this.getTextsSync(t,e,n)))},1e3)})})}static getTextsByReqAniFrame(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let v=l.reduce((y,S)=>{let w=new z.DataTexture(S.imageData.data,e.width,S.height,z.RGBAFormat);return w.flipY=!0,w.minFilter=z.LinearFilter,w.magFilter=z.LinearFilter,Object.keys(S.offsetMap).forEach(O=>{y[O]=x({},S.offsetMap[O],{texture:w})}),y},{});o(v)}),d=()=>{if(r>=i)return f();let m=0;for(;m<30;){let v=t[r],y=Math.ceil(u.measureText(v).width);if(y=y%2===0?y:y+1,y+=2,y+c>e.width&&(c=0,h+=n,n+h>e.height)){let w=u.getImageData(0,0,e.width,h);l.push({imageData:w,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let S=8;if(e.lineWidth&&u.strokeText(v,2+c,S+h),u.fillText(v,2+c,S+h),p[v]={width:y,height:n,x:c,y:h},c+=y,++r>=i)return f();m++}this.timer.requestAnimationFrame(d)};this.timer.requestAnimationFrame(d)})})}static getTextsSync(t,e,n){let r=this.getCanvas(),i=this.getCtx();i.clearRect(0,0,r.width,r.height),this.setCtxStyle(e);let o=[],s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(i.measureText(p).width);if(f=f%2===0?f:f+1,f+=2,f+s>e.width&&(s=0,u+=n,n+u>e.height)){let m=i.getImageData(0,0,e.width,u);o.push({data:m.data,offsetMap:l,height:u}),u=0,i.clearRect(0,0,e.width,e.height),l={}}let d=8;e.lineWidth&&i.strokeText(p,2+s,d+u),i.fillText(p,2+s,d+u),l[p]={width:f,height:n,x:s,y:u},s+=f});let c=i.getImageData(0,0,e.width,n+u);return o.push({data:c.data,offsetMap:l,height:u+n}),o.reduce((p,f)=>{let d=new z.DataTexture(f.data,e.width,f.height,z.RGBAFormat);return d.flipY=!0,d.minFilter=z.LinearFilter,d.magFilter=z.LinearFilter,Object.keys(f.offsetMap).forEach(m=>{p[m]=x({},f.offsetMap[m],{texture:d})}),p},{})}static getTextureByTexts(t,e){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,1e4);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(n);let s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(o.measureText(p).width);f=f%2===0?f:f+1,f+=2,f+s>n.width&&(s=0,u+=r);let d=8;n.lineWidth&&o.strokeText(p,2+s,d+u),o.fillText(p,2+s,d+u),l[p]={width:f,height:r,x:s,y:u},s+=f});let c=o.getImageData(0,0,n.width,r+u),h=new z.DataTexture(Uint8Array.from(c.data),n.width,r+u,z.RGBAFormat);return h.flipY=!0,h.minFilter=z.LinearFilter,h.magFilter=z.LinearFilter,{texture:h,offsetMap:l}}static dispose(){var t,e;this.ctx=null,this.canvas=null,this.idleCtx=null,this.idleCanvas=null,this.timer.dispose(),this.cacheMap.forEach(n=>{n instanceof Promise?n.then(r=>{r.texture.dispose()}):n.texture.dispose()}),this.cacheMap.clear(),(t=this.textTextureWorker)==null||t.terminate(),(e=this.lazyIndexDbTextTextureWorker)==null||e.terminate(),this.textTextureWorker=null}};tt.canvas=document.createElement("canvas");tt.ctx=tt.canvas.getContext("2d",{willReadFrequently:!0});tt.cacheMap=new Map;tt.lazyTextureCacheMap=new Map;tt.lazyPoiMap=new Map;tt.textTextureWorker=null;tt.lazyIndexDbTextTextureWorker=null;tt.idleCanvas=null;tt.idleCtx=null;tt.timer=new K;tt.options={width:2048,height:512,font:"54px sans-serif",textBaseline:"top",lineWidth:8,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};var sh=require("core-js/modules/web.dom-collections.iterator.js"),qt=require("three"),ht=class{static getTextureByUrl(t){if(this.urlTextureMap.has(t))return Promise.resolve(this.urlTextureMap.get(t));let e=this.textureLoader.loadAsync(t);return e.then(n=>{n.format=qt.RGBAFormat,n.magFilter=qt.LinearFilter,n.minFilter=qt.LinearFilter,n.colorSpace="srgb",this.urlTextureMap.set(t,n)}),this.urlTextureMap.set(t,e),e}static getUrlTextureBorder(t,e,n){let r=t+"-"+n.width+"-"+n.color;if(this.borderUrlTextureMap.has(r))return Promise.resolve(this.borderUrlTextureMap.get(r));let i=this.textureLoader.loadAsync(t).then(o=>{let s=this.ctx,u=this.canvas,l=e+n.width*2;u.width=l,u.height=l;let c=l/2;s.clearRect(0,0,l,l),s.beginPath(),s.arc(c,c,e/2+n.width,0,2*Math.PI),s.fillStyle=n.color,s.fill(),s.beginPath(),s.arc(c,c,e/2,0,2*Math.PI),s.closePath(),s.clip(),s.drawImage(o.image,n.width,n.width,e,e);let h=new qt.Texture(u);return h.format=qt.RGBAFormat,h.magFilter=qt.LinearFilter,h.minFilter=qt.LinearFilter,h.colorSpace="srgb",h.needsUpdate=!0,this.borderUrlTextureMap.set(r,h),h});return this.borderUrlTextureMap.set(r,i),i}static dispose(){this.urlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.borderUrlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.urlTextureMap.clear(),this.borderUrlTextureMap.clear(),this.ctx=null,this.canvas=null}};ht.textureLoader=new qt.TextureLoader;ht.urlTextureMap=new Map;ht.borderUrlTextureMap=new Map;ht.canvas=document.createElement("canvas");ht.ctx=ht.canvas.getContext("2d",{willReadFrequently:!0});var cp=require("core-js/modules/web.dom-collections.iterator.js");var ds=require("three/examples/jsm/loaders/GLTFLoader.js");var Rh=require("core-js/modules/web.dom-collections.iterator.js"),Ph=require("core-js/modules/es.json.stringify.js"),Ih=require("core-js/modules/es.error.cause.js"),Lh=require("core-js/modules/es.typed-array.float32-array.js"),Nh=require("core-js/modules/es.typed-array.at.js"),Oh=require("core-js/modules/es.typed-array.fill.js"),Dh=require("core-js/modules/es.typed-array.find-last.js"),Uh=require("core-js/modules/es.typed-array.find-last-index.js"),Fh=require("core-js/modules/es.typed-array.set.js"),Bh=require("core-js/modules/es.typed-array.sort.js"),zh=require("core-js/modules/es.typed-array.to-reversed.js"),Gh=require("core-js/modules/es.typed-array.to-sorted.js"),kh=require("core-js/modules/es.typed-array.with.js"),Vh=require("core-js/modules/es.array-buffer.constructor.js"),Hh=require("core-js/modules/es.array-buffer.slice.js"),Wh=require("core-js/modules/es.array-buffer.detached.js"),Xh=require("core-js/modules/es.array-buffer.transfer.js"),qh=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),jh=require("core-js/modules/es.array.push.js"),Yh=require("core-js/modules/web.url.js"),Zh=require("core-js/modules/web.url.to-json.js"),Kh=require("core-js/modules/web.url-search-params.js"),$h=require("core-js/modules/web.url-search-params.delete.js"),Jh=require("core-js/modules/web.url-search-params.has.js"),Qh=require("core-js/modules/web.url-search-params.size.js"),tp=require("core-js/modules/es.array.sort.js"),ep=require("core-js/modules/es.typed-array.int8-array.js"),np=require("core-js/modules/es.typed-array.uint32-array.js"),rp=require("core-js/modules/es.typed-array.int16-array.js"),ip=require("core-js/modules/es.typed-array.int32-array.js"),op=require("core-js/modules/es.typed-array.uint8-array.js"),sp=require("core-js/modules/es.typed-array.uint16-array.js");var bi={};vo(bi,{Arrow:()=>iu,DracoDecoderJs:()=>os,DracoDecoderWasm:()=>ss,DracoWasmWrapperJs:()=>as,ManGlb:()=>ru,ParkingTypeIconMap:()=>nu,RoyalEsplanade1k:()=>ou});var qa={},Qo=new URL("./icon/parkingSpace/half.svg",qa.url).href;var ja={},ts=new URL("./icon/parkingSpace/power.svg",ja.url).href;var Ya={},es=new URL("./icon/parkingSpace/mechanical.svg",Ya.url).href;var Za={},ns=new URL("./icon/parkingSpace/vip.svg",Za.url).href;var Ka={},rs=new URL("./glb/man2.glb",Ka.url).href;var $a={},is=new URL("./icon/path/arrow.png",$a.url).href;var Ja={},os=new URL("./draco/draco_decoder.js",Ja.url).href;var Qa={},ss=new URL("./draco/draco_decoder.wasm",Qa.url).href;var tu={},as=new URL("./draco/draco_wasm_wrapper.js",tu.url).href;var eu={},us=new URL("./royal_esplanade_1k.hdr",eu.url).href;var nu={half:Qo,power:ts,mechanical:es,vip:ns},ru=rs,iu=is;var ou=us;var{ParkingTypeIconMap:pr,ManGlb:ls,Arrow:fr,DracoDecoderJs:cs,DracoDecoderWasm:hs,DracoWasmWrapperJs:ps,RoyalEsplanade1k:fs}=bi;var xt=require("three"),Mi=new WeakMap,dr=class extends xt.Loader{setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,n,r){let i=new xt.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(t,o=>{this.parse(o,e,r)},n,r)}parse(t,e,n){n===void 0&&(n=()=>{}),this.decodeDracoFile(t,e,null,null,xt.SRGBColorSpace).catch(n)}decodeDracoFile(t,e,n,r,i,o){i===void 0&&(i=xt.LinearSRGBColorSpace),o===void 0&&(o=()=>{});let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(t,s).then(e).catch(o)}decodeGeometry(t,e){let n=JSON.stringify(e);if(Mi.has(t)){let u=Mi.get(t);if(u.key===n)return u.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r,i=this.workerNextTaskID++,o=t.byteLength,s=this._getWorker(i,o).then(u=>(r=u,new Promise((l,c)=>{r._callbacks[i]={resolve:l,reject:c},r.postMessage({type:"decode",id:i,taskConfig:e,buffer:t},[t])}))).then(u=>this._createGeometry(u.geometry));return s.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),Mi.set(t,{key:n,promise:s}),s}_createGeometry(t){let e=new xt.BufferGeometry;t.index&&e.setIndex(new xt.BufferAttribute(t.index.array,1));for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n],i=r.name,o=r.array,s=r.itemSize,u=new xt.BufferAttribute(o,s);i==="color"&&(this._assignVertexColorSpace(u,r.vertexColorSpace),u.normalized=!(o instanceof Float32Array)),e.setAttribute(i,u)}return e}_assignVertexColorSpace(t,e){if(e!==xt.SRGBColorSpace)return;let n=new xt.Color;for(let r=0,i=t.count;r<i;r++)n.fromBufferAttribute(t,r).convertSRGBToLinear(),t.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(t,e){let n=new xt.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(e),n.setWithCredentials(this.withCredentials),new Promise((r,i)=>{n.load(t,r,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",e=[];return t?e.push(this._loadLibrary(cs,"text")):(e.push(this._loadLibrary(ps,"text")),e.push(this._loadLibrary(hs,"arraybuffer"))),this.decoderPending=Promise.all(e).then(n=>{let r=n[0];t||(this.decoderConfig.wasmBinary=n[1]);let i=su.toString(),o=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
173
+ `],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var re,Ct=function(a){return a.MAP_VERSION="map_version",a.ROUTE_VERSION="route_version",a.FACILITY_VERSION="facility_version",a.MAP_DATA="map_data",a.ROAD_NETWORK_DATA="road_network_data",a.FACILITY_DATA="facility_data",a.POI_TEXT="poi_text",a.LAZY_TEXTURE="lazy_texture",a.LAZY_POI="lazy_poi",a}({});function cr(a,t){return a===void 0&&(a="aibee_map"),t===void 0&&(t=6),new Promise((e,n)=>{if(re)return console.log("[create db is opened]"),e({db:re,type:"success"});let r=indexedDB.open(a,t);r.onupgradeneeded=function(i){re=i.target.result,console.log("[open db is onupgradeneeded]"),ce("map_version"),ce("route_version"),ce("facility_version"),ce("map_data"),ce("road_network_data"),ce("facility_data"),ce("poi_text"),ce("lazy_texture"),ce("lazy_poi")},r.onsuccess=i=>{re=i.target.result,console.log("[open db is onsuccess]"),e({db:re,type:"success"})},r.onerror=i=>{console.log("[open db is onerror]"),n(i)}})}function xn(a,t,e){return e===void 0&&(e=re),new Promise((n,r)=>{e||r("\u6CA1\u6709db");let o=e.transaction([a],"readonly").objectStore(a).get(t);o.onsuccess=()=>{o.result?n(o.result.value):n(null)},o.onerror=s=>{console.log("[getVersionByKey]",s),n(null)}})}function hr(a,t,e,n,r){return n===void 0&&(n=re),r===void 0&&(r=!1),new Promise((i,o)=>g(this,null,function*(){if(!n){o("\u6CA1\u6709db");return}let s=r;r||(s=!!(yield xn(a,t)));let u=n.transaction([a],"readwrite").objectStore(a),l=s?u.put({key:t,value:e}):u.add({key:t,value:e});l.onsuccess=function(c){i(c)},l.onerror=function(c){o(c)}}))}function ce(a,t){t===void 0&&(t=re),t&&(t.objectStoreNames.contains(a)||t.createObjectStore(a,{keyPath:"key"}))}function Jo(a){a===void 0&&(a=re),a==null||a.close(),re=null}var tt=class{static InitDb(){return cr()}static getCanvas(){if(this.canvas)return this.canvas;{let t=document.createElement("canvas");return this.canvas=t,t}}static getCtx(){if(this.ctx)return this.ctx;let e=this.getCanvas().getContext("2d",{willReadFrequently:!0});return this.ctx=e,e}static getIdleCanvas(){if(this.idleCanvas)return this.idleCanvas;{let t=document.createElement("canvas");return this.idleCanvas=t,t}}static getIdleCtx(){if(this.idleCtx)return this.idleCtx;let e=this.getIdleCanvas().getContext("2d",{willReadFrequently:!0});return this.idleCtx=e,e}static getMergedOptions(t){return x({},this.options,t)}static setCtxStyle(t,e,n){e===void 0&&(e=this.getCanvas()),n===void 0&&(n=this.getCtx()),e.width=t.width,e.height=t.height,n.font=t.font,n.textBaseline=t.textBaseline,n.lineWidth=t.lineWidth,n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle}static getLazyIndexDbTextTextureWorker(){if(this.lazyIndexDbTextTextureWorker)return this.lazyIndexDbTextTextureWorker;{let t=Si();return this.lazyIndexDbTextTextureWorker=t,t}}static getTextureByText(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=(e==null?void 0:e.maxWidth)||600,i=Pe(x({},n,{text:t,maxWidth:r}));if(this.cacheMap.has(i))return this.cacheMap.get(i);let o=new Promise((s,u)=>g(this,null,function*(){var l;yield this.InitDb();let c=yield xn(Ct.POI_TEXT,i);if(c){let T=new z.DataTexture(new Uint8Array(c.data),c.width,c.height,z.RGBAFormat);T.flipY=!0,T.minFilter=z.LinearFilter,T.magFilter=z.LinearFilter;let R={texture:T,lines:c.lines};this.cacheMap.set(i,R),s(R);return}let h=this.getCanvas(),p=this.getCtx();p.clearRect(0,0,h.width,h.height),this.setCtxStyle(n);let f=[],d="",m=[],v="",y=0;for(let T=0;T<t.length;T++){let R=t[T];if(R==="("||R==="\uFF08"){if(y===0&&v){let M=S(v);m.push(...M),v=""}y++}else if((R===")"||R==="\uFF09")&&(y--,y===0)){v+=R,m.push(v),v="";continue}v+=R}if(v){let T=S(v);m.push(...T)}function S(T){let R=[],M="",V=!1,Z="";for(let W=0;W<T.length;W++){let F=T[W];(F==='"'||F==="'")&&(!V||F===Z)?(V?(M+=F,R.push(M),M=""):(M&&R.push(M),M=F),V=!V,Z=F):M+=F}return M&&R.push(M),R}for(let T of m)if(T.startsWith("(")||T.startsWith("\uFF08")||T.startsWith('"')||T.startsWith("'"))if(p.measureText(T).width>r){d&&(f.push(d),d="");let M="",V=T.split("");for(let Z of V){let W=M+Z;p.measureText(W).width>r&&M?(f.push(M),M=Z):M=W}M&&(d=M)}else{let M=d?d+" "+T:T;p.measureText(M).width>r&&d?(f.push(d),d=T):d=M}else{let R=T.split(" ");for(let M of R){let V=d?d+" "+M:M,Z=p.measureText(V);if(Z.width>r)if(d&&f.push(d),Z.width>r||ii(M)){let W="",F=M.split("");for(let fe of F){let on=W+fe;p.measureText(on).width>r&&W?(f.push(W),W=fe):W=on}W&&(d=W)}else d=M;else d=V}}d&&f.push(d);let w=+(((l=n.font.match(/(\d+)px/))==null?void 0:l[1])||54),O=Math.ceil((w+n.lineWidth)*1.2),N=O*f.length,Y=Math.max(...f.map(T=>{let R=Math.ceil(p.measureText(T).width);return R%2===0?R:R+1}))+2;f.forEach((T,R)=>{let M=p.measureText(T),V=Math.ceil(M.width),Z=Math.floor((Y-V)/2),W=8+R*O;n.lineWidth&&p.strokeText(T,Z,W),p.fillText(T,Z,W)});let C=p.getImageData(0,0,Y,N),U=new z.DataTexture(C.data,Y,N,z.RGBAFormat);U.flipY=!0,U.minFilter=z.LinearFilter,U.magFilter=z.LinearFilter,this.cacheMap.set(i,{texture:U,lines:f.length}),hr(Ct.POI_TEXT,i,{data:Array.from(C.data),width:Y,height:N,lines:f.length},void 0,!0),s({texture:U,lines:f.length})}));return this.cacheMap.set(i,o),o})}static lazyGetTextureByTexts(t,e){return g(this,null,function*(){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,2048);let i={},o=new Set;if(t.map(l=>{if(this.lazyPoiMap.has(l)){let c=this.lazyPoiMap.get(l),h=this.lazyTextureCacheMap.get(c.textureKey);if(h){i[l]={width:c.width,height:r,x:c.x,y:c.y,texture:h};return}}o.add(l)}),!o.size)return i;let s=Array.from(o);return new Promise((l,c)=>g(this,null,function*(){let h;window.OffscreenCanvas?(console.log("use webworker"),h=this.getTextsByWorker(s,n,r)):typeof window.requestIdleCallback=="function"?(console.log("use browser idle"),h=this.getTextsByBrowserIdle(s,n,r)):(console.log("use requestAnimation text textures"),h=Promise.resolve().then(()=>this.getTextsSync(s,n,r))),l(h)}))})}static getTextsByWorker(t,e,n){return g(this,null,function*(){return this.textTextureWorker||(this.textTextureWorker=Ei()),(yield $(this.textTextureWorker,"get_texture_by_texts",{texts:t,options:e,originHeight:n})).data.map(i=>{let o=new z.DataTexture(i.data,e.width,i.height,z.RGBAFormat);return o.flipY=!0,o.minFilter=z.LinearFilter,o.magFilter=z.LinearFilter,{texture:o,offsetMap:i.offsetMap}}).reduce((i,o)=>(Object.keys(o.offsetMap).forEach(s=>{i[s]=o.offsetMap[s],i[s].texture=o.texture}),i),{})})}static getTextsByBrowserIdle(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let v=l.reduce((y,S)=>{let w=new z.DataTexture(S.imageData.data,e.width,S.height,z.RGBAFormat);return w.flipY=!0,w.minFilter=z.LinearFilter,w.magFilter=z.LinearFilter,Object.keys(S.offsetMap).forEach(O=>{y[O]=x({},S.offsetMap[O],{texture:w})}),y},{});o(v)}),d=m=>{if(r>=i)return f();if(m.timeRemaining()>0){let v=t[r],y=Math.ceil(u.measureText(v).width);if(y=y%2===0?y:y+1,y+=2,y+c>e.width&&(c=0,h+=n,n+h>e.height)){let w=u.getImageData(0,0,e.width,h);l.push({imageData:w,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let S=8;if(e.lineWidth&&u.strokeText(v,2+c,S+h),u.fillText(v,2+c,S+h),p[v]={width:y,height:n,x:c,y:h},c+=y,++r>=i)return f();m.timeRemaining()>0?d(m):this.timer.requestIdleCallback(d)}else this.timer.requestIdleCallback(d)};this.timer.requestIdleCallback(d),this.timer.setTimeout(()=>{r===0&&(console.log("idle \u4E0D\u6267\u884C \u56DE\u9000\u5230\u540C\u6B65"),o(this.getTextsSync(t,e,n)))},1e3)})})}static getTextsByReqAniFrame(t,e,n){return g(this,null,function*(){let r=0,i=t.length;return new Promise(o=>{let s=this.getIdleCanvas(),u=this.getIdleCtx();u.clearRect(0,0,s.width,s.height),this.setCtxStyle(e,s,u);let l=[],c=0,h=0,p={},f=()=>g(this,null,function*(){let m=u.getImageData(0,0,e.width,n+h);l.push({imageData:m,offsetMap:p,height:n+h});let v=l.reduce((y,S)=>{let w=new z.DataTexture(S.imageData.data,e.width,S.height,z.RGBAFormat);return w.flipY=!0,w.minFilter=z.LinearFilter,w.magFilter=z.LinearFilter,Object.keys(S.offsetMap).forEach(O=>{y[O]=x({},S.offsetMap[O],{texture:w})}),y},{});o(v)}),d=()=>{if(r>=i)return f();let m=0;for(;m<30;){let v=t[r],y=Math.ceil(u.measureText(v).width);if(y=y%2===0?y:y+1,y+=2,y+c>e.width&&(c=0,h+=n,n+h>e.height)){let w=u.getImageData(0,0,e.width,h);l.push({imageData:w,offsetMap:p,height:h}),h=0,u.clearRect(0,0,e.width,e.height),p={}}let S=8;if(e.lineWidth&&u.strokeText(v,2+c,S+h),u.fillText(v,2+c,S+h),p[v]={width:y,height:n,x:c,y:h},c+=y,++r>=i)return f();m++}this.timer.requestAnimationFrame(d)};this.timer.requestAnimationFrame(d)})})}static getTextsSync(t,e,n){let r=this.getCanvas(),i=this.getCtx();i.clearRect(0,0,r.width,r.height),this.setCtxStyle(e);let o=[],s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(i.measureText(p).width);if(f=f%2===0?f:f+1,f+=2,f+s>e.width&&(s=0,u+=n,n+u>e.height)){let m=i.getImageData(0,0,e.width,u);o.push({data:m.data,offsetMap:l,height:u}),u=0,i.clearRect(0,0,e.width,e.height),l={}}let d=8;e.lineWidth&&i.strokeText(p,2+s,d+u),i.fillText(p,2+s,d+u),l[p]={width:f,height:n,x:s,y:u},s+=f});let c=i.getImageData(0,0,e.width,n+u);return o.push({data:c.data,offsetMap:l,height:u+n}),o.reduce((p,f)=>{let d=new z.DataTexture(f.data,e.width,f.height,z.RGBAFormat);return d.flipY=!0,d.minFilter=z.LinearFilter,d.magFilter=z.LinearFilter,Object.keys(f.offsetMap).forEach(m=>{p[m]=x({},f.offsetMap[m],{texture:d})}),p},{})}static getTextureByTexts(t,e){let n=this.getMergedOptions(e),r=n.height;n.height=Math.min(r*t.length,1e4);let i=this.getCanvas(),o=this.getCtx();o.clearRect(0,0,i.width,i.height),this.setCtxStyle(n);let s=0,u=0,l={};t.forEach(p=>{let f=Math.ceil(o.measureText(p).width);f=f%2===0?f:f+1,f+=2,f+s>n.width&&(s=0,u+=r);let d=8;n.lineWidth&&o.strokeText(p,2+s,d+u),o.fillText(p,2+s,d+u),l[p]={width:f,height:r,x:s,y:u},s+=f});let c=o.getImageData(0,0,n.width,r+u),h=new z.DataTexture(Uint8Array.from(c.data),n.width,r+u,z.RGBAFormat);return h.flipY=!0,h.minFilter=z.LinearFilter,h.magFilter=z.LinearFilter,{texture:h,offsetMap:l}}static dispose(){var t,e;this.ctx=null,this.canvas=null,this.idleCtx=null,this.idleCanvas=null,this.timer.dispose(),this.cacheMap.forEach(n=>{n instanceof Promise?n.then(r=>{r.texture.dispose()}):n.texture.dispose()}),this.cacheMap.clear(),(t=this.textTextureWorker)==null||t.terminate(),(e=this.lazyIndexDbTextTextureWorker)==null||e.terminate(),this.textTextureWorker=null}};tt.canvas=document.createElement("canvas");tt.ctx=tt.canvas.getContext("2d",{willReadFrequently:!0});tt.cacheMap=new Map;tt.lazyTextureCacheMap=new Map;tt.lazyPoiMap=new Map;tt.textTextureWorker=null;tt.lazyIndexDbTextTextureWorker=null;tt.idleCanvas=null;tt.idleCtx=null;tt.timer=new K;tt.options={width:2048,height:512,font:"54px sans-serif",textBaseline:"top",lineWidth:8,fillStyle:"rgba(0,0,0,1)",strokeStyle:"white"};var sh=require("core-js/modules/web.dom-collections.iterator.js"),jt=require("three"),ht=class{static getTextureByUrl(t){if(this.urlTextureMap.has(t))return Promise.resolve(this.urlTextureMap.get(t));let e=this.textureLoader.loadAsync(t);return e.then(n=>{n.format=jt.RGBAFormat,n.magFilter=jt.LinearFilter,n.minFilter=jt.LinearFilter,n.colorSpace="srgb",this.urlTextureMap.set(t,n)}),this.urlTextureMap.set(t,e),e}static getUrlTextureBorder(t,e,n){let r=t+"-"+n.width+"-"+n.color;if(this.borderUrlTextureMap.has(r))return Promise.resolve(this.borderUrlTextureMap.get(r));let i=this.textureLoader.loadAsync(t).then(o=>{let s=this.ctx,u=this.canvas,l=e+n.width*2;u.width=l,u.height=l;let c=l/2;s.clearRect(0,0,l,l),s.beginPath(),s.arc(c,c,e/2+n.width,0,2*Math.PI),s.fillStyle=n.color,s.fill(),s.beginPath(),s.arc(c,c,e/2,0,2*Math.PI),s.closePath(),s.clip(),s.drawImage(o.image,n.width,n.width,e,e);let h=new jt.Texture(u);return h.format=jt.RGBAFormat,h.magFilter=jt.LinearFilter,h.minFilter=jt.LinearFilter,h.colorSpace="srgb",h.needsUpdate=!0,this.borderUrlTextureMap.set(r,h),h});return this.borderUrlTextureMap.set(r,i),i}static dispose(){this.urlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.borderUrlTextureMap.forEach(t=>{t instanceof Promise?t.then(e=>e.dispose()):t.dispose()}),this.urlTextureMap.clear(),this.borderUrlTextureMap.clear(),this.ctx=null,this.canvas=null}};ht.textureLoader=new jt.TextureLoader;ht.urlTextureMap=new Map;ht.borderUrlTextureMap=new Map;ht.canvas=document.createElement("canvas");ht.ctx=ht.canvas.getContext("2d",{willReadFrequently:!0});var cp=require("core-js/modules/web.dom-collections.iterator.js");var ds=require("three/examples/jsm/loaders/GLTFLoader.js");var Rh=require("core-js/modules/web.dom-collections.iterator.js"),Ph=require("core-js/modules/es.json.stringify.js"),Ih=require("core-js/modules/es.error.cause.js"),Lh=require("core-js/modules/es.typed-array.float32-array.js"),Nh=require("core-js/modules/es.typed-array.at.js"),Oh=require("core-js/modules/es.typed-array.fill.js"),Dh=require("core-js/modules/es.typed-array.find-last.js"),Uh=require("core-js/modules/es.typed-array.find-last-index.js"),Fh=require("core-js/modules/es.typed-array.set.js"),Bh=require("core-js/modules/es.typed-array.sort.js"),zh=require("core-js/modules/es.typed-array.to-reversed.js"),Gh=require("core-js/modules/es.typed-array.to-sorted.js"),kh=require("core-js/modules/es.typed-array.with.js"),Vh=require("core-js/modules/es.array-buffer.constructor.js"),Hh=require("core-js/modules/es.array-buffer.slice.js"),Wh=require("core-js/modules/es.array-buffer.detached.js"),Xh=require("core-js/modules/es.array-buffer.transfer.js"),qh=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),jh=require("core-js/modules/es.array.push.js"),Yh=require("core-js/modules/web.url.js"),Zh=require("core-js/modules/web.url.to-json.js"),Kh=require("core-js/modules/web.url-search-params.js"),$h=require("core-js/modules/web.url-search-params.delete.js"),Jh=require("core-js/modules/web.url-search-params.has.js"),Qh=require("core-js/modules/web.url-search-params.size.js"),tp=require("core-js/modules/es.array.sort.js"),ep=require("core-js/modules/es.typed-array.int8-array.js"),np=require("core-js/modules/es.typed-array.uint32-array.js"),rp=require("core-js/modules/es.typed-array.int16-array.js"),ip=require("core-js/modules/es.typed-array.int32-array.js"),op=require("core-js/modules/es.typed-array.uint8-array.js"),sp=require("core-js/modules/es.typed-array.uint16-array.js");var bi={};vo(bi,{Arrow:()=>iu,DracoDecoderJs:()=>os,DracoDecoderWasm:()=>ss,DracoWasmWrapperJs:()=>as,ManGlb:()=>ru,ParkingTypeIconMap:()=>nu,RoyalEsplanade1k:()=>ou});var qa={},Qo=new URL("./icon/parkingSpace/half.svg",qa.url).href;var ja={},ts=new URL("./icon/parkingSpace/power.svg",ja.url).href;var Ya={},es=new URL("./icon/parkingSpace/mechanical.svg",Ya.url).href;var Za={},ns=new URL("./icon/parkingSpace/vip.svg",Za.url).href;var Ka={},rs=new URL("./glb/man2.glb",Ka.url).href;var $a={},is=new URL("./icon/path/arrow.png",$a.url).href;var Ja={},os=new URL("./draco/draco_decoder.js",Ja.url).href;var Qa={},ss=new URL("./draco/draco_decoder.wasm",Qa.url).href;var tu={},as=new URL("./draco/draco_wasm_wrapper.js",tu.url).href;var eu={},us=new URL("./royal_esplanade_1k.hdr",eu.url).href;var nu={half:Qo,power:ts,mechanical:es,vip:ns},ru=rs,iu=is;var ou=us;var{ParkingTypeIconMap:pr,ManGlb:ls,Arrow:fr,DracoDecoderJs:cs,DracoDecoderWasm:hs,DracoWasmWrapperJs:ps,RoyalEsplanade1k:fs}=bi;var xt=require("three"),Mi=new WeakMap,dr=class extends xt.Loader{setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,e,n,r){let i=new xt.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(t,o=>{this.parse(o,e,r)},n,r)}parse(t,e,n){n===void 0&&(n=()=>{}),this.decodeDracoFile(t,e,null,null,xt.SRGBColorSpace).catch(n)}decodeDracoFile(t,e,n,r,i,o){i===void 0&&(i=xt.LinearSRGBColorSpace),o===void 0&&(o=()=>{});let s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(t,s).then(e).catch(o)}decodeGeometry(t,e){let n=JSON.stringify(e);if(Mi.has(t)){let u=Mi.get(t);if(u.key===n)return u.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r,i=this.workerNextTaskID++,o=t.byteLength,s=this._getWorker(i,o).then(u=>(r=u,new Promise((l,c)=>{r._callbacks[i]={resolve:l,reject:c},r.postMessage({type:"decode",id:i,taskConfig:e,buffer:t},[t])}))).then(u=>this._createGeometry(u.geometry));return s.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),Mi.set(t,{key:n,promise:s}),s}_createGeometry(t){let e=new xt.BufferGeometry;t.index&&e.setIndex(new xt.BufferAttribute(t.index.array,1));for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n],i=r.name,o=r.array,s=r.itemSize,u=new xt.BufferAttribute(o,s);i==="color"&&(this._assignVertexColorSpace(u,r.vertexColorSpace),u.normalized=!(o instanceof Float32Array)),e.setAttribute(i,u)}return e}_assignVertexColorSpace(t,e){if(e!==xt.SRGBColorSpace)return;let n=new xt.Color;for(let r=0,i=t.count;r<i;r++)n.fromBufferAttribute(t,r).convertSRGBToLinear(),t.setXYZ(r,n.r,n.g,n.b)}_loadLibrary(t,e){let n=new xt.FileLoader(this.manager);return n.setPath(this.decoderPath),n.setResponseType(e),n.setWithCredentials(this.withCredentials),new Promise((r,i)=>{n.load(t,r,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",e=[];return t?e.push(this._loadLibrary(cs,"text")):(e.push(this._loadLibrary(ps,"text")),e.push(this._loadLibrary(hs,"arraybuffer"))),this.decoderPending=Promise.all(e).then(n=>{let r=n[0];t||(this.decoderConfig.wasmBinary=n[1]);let i=su.toString(),o=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
174
174
  `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(t,e){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(i){let o=i.data;switch(o.type){case"decode":r._callbacks[o.id].resolve(o);break;case"error":r._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,i){return r._taskLoad>i._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[t]=e,n._taskLoad+=e,n})}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))}dispose(){for(let t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}};function su(){let a,t;onmessage=function(o){let s=o.data;switch(s.type){case"init":a=s.decoderConfig,t=new Promise(function(c){a.onModuleLoaded=function(h){c({draco:h})},DracoDecoderModule(a)});break;case"decode":let u=s.buffer,l=s.taskConfig;t.then(c=>{let h=c.draco,p=new h.Decoder;try{let f=e(h,p,new Int8Array(u),l),d=f.attributes.map(m=>m.array.buffer);f.index&&d.push(f.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:f},d)}catch(f){console.error(f),self.postMessage({type:"error",id:s.id,error:f.message})}finally{h.destroy(p)}});break}};function e(o,s,u,l){let c=l.attributeIDs,h=l.attributeTypes,p,f,d=s.GetEncodedGeometryType(u);if(d===o.TRIANGULAR_MESH)p=new o.Mesh,f=s.DecodeArrayToMesh(u,u.byteLength,p);else if(d===o.POINT_CLOUD)p=new o.PointCloud,f=s.DecodeArrayToPointCloud(u,u.byteLength,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let m={index:null,attributes:[]};for(let v in c){let y=self[h[v]],S,w;if(l.useUniqueIDs)w=c[v],S=s.GetAttributeByUniqueId(p,w);else{if(w=s.GetAttributeId(p,o[c[v]]),w===-1)continue;S=s.GetAttribute(p,w)}let O=r(o,s,p,v,y,S);v==="color"&&(O.vertexColorSpace=l.vertexColorSpace),m.attributes.push(O)}return d===o.TRIANGULAR_MESH&&(m.index=n(o,s,p)),o.destroy(p),m}function n(o,s,u){let c=u.num_faces()*3,h=c*4,p=o._malloc(h);s.GetTrianglesUInt32Array(u,h,p);let f=new Uint32Array(o.HEAPF32.buffer,p,c).slice();return o._free(p),{array:f,itemSize:1}}function r(o,s,u,l,c,h){let p=h.num_components(),d=u.num_points()*p,m=d*c.BYTES_PER_ELEMENT,v=i(o,c),y=o._malloc(m);s.GetAttributeDataArrayForAllPoints(u,h,v,m,y);let S=new c(o.HEAPF32.buffer,y,d).slice();return o._free(y),{name:l,array:S,itemSize:p}}function i(o,s){switch(s){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var Tt=class{static loadModel(t,e){return g(this,null,function*(){if(e===void 0&&(e=!0),e){if(this.modelMap.has(t)){let r=this.modelMap.get(t);if(r instanceof Promise)r.then(i=>x({},i,{scene:i.scene.clone()}));else return x({},r,{scene:r.scene.clone()})}let n=new Promise((r,i)=>{this.loader.load(t,o=>{this.modelMap.set(t,o),r(o)},void 0,i)});return this.modelMap.set(t,n),n.then(r=>x({},r,{scene:r.scene.clone()}))}else return new Promise((n,r)=>{this.loader.load(t,n,void 0,r)})})}static dispose(){this.modelMap.forEach(t=>{t instanceof Promise?t.then(e=>B(e.scene)):B(t.scene)}),this.modelMap.clear()}};Tt.dracoLoader=new dr;Tt.loader=new ds.GLTFLoader().setDRACOLoader(Tt.dracoLoader);Tt.modelMap=new Map;function wi(){let a=new Blob([`var Kx=Object.create;var Mf=Object.defineProperty;var jx=Object.getOwnPropertyDescriptor;var Qx=Object.getOwnPropertyNames;var eM=Object.getPrototypeOf,tM=Object.prototype.hasOwnProperty;var L=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var nM=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Qx(e))!tM.call(n,r)&&r!==t&&Mf(n,r,{get:()=>e[r],enumerable:!(i=jx(e,r))||i.enumerable});return n};var We=(n,e,t)=>(t=n!=null?Kx(eM(n)):{},nM(e||!n||!n.__esModule?Mf(t,"default",{value:n,enumerable:!0}):t,n));var Cs=(n,e,t)=>new Promise((i,r)=>{var s=c=>{try{a(t.next(c))}catch(l){r(l)}},o=c=>{try{a(t.throw(c))}catch(l){r(l)}},a=c=>c.done?i(c.value):Promise.resolve(c.value).then(s,o);a((t=t.apply(n,e)).next())});var $e=L(($o,Sf)=>{"use strict";var Br=function(n){return n&&n.Math===Math&&n};Sf.exports=Br(typeof globalThis=="object"&&globalThis)||Br(typeof window=="object"&&window)||Br(typeof self=="object"&&self)||Br(typeof global=="object"&&global)||Br(typeof $o=="object"&&$o)||function(){return this}()||Function("return this")()});var Qe=L((VO,bf)=>{"use strict";bf.exports=function(n){try{return!!n()}catch(e){return!0}}});var St=L((GO,Ef)=>{"use strict";var iM=Qe();Ef.exports=!iM(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var zr=L((HO,Af)=>{"use strict";var rM=Qe();Af.exports=!rM(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var wt=L((WO,Tf)=>{"use strict";var sM=zr(),Ps=Function.prototype.call;Tf.exports=sM?Ps.bind(Ps):function(){return Ps.apply(Ps,arguments)}});var Pf=L(Cf=>{"use strict";var wf={}.propertyIsEnumerable,Rf=Object.getOwnPropertyDescriptor,aM=Rf&&!wf.call({1:2},1);Cf.f=aM?function(e){var t=Rf(this,e);return!!t&&t.enumerable}:wf});var kr=L((XO,If)=>{"use strict";If.exports=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}}});var at=L((YO,Nf)=>{"use strict";var Lf=zr(),Uf=Function.prototype,Zo=Uf.call,oM=Lf&&Uf.bind.bind(Zo,Zo);Nf.exports=Lf?oM:function(n){return function(){return Zo.apply(n,arguments)}}});var zn=L(($O,Of)=>{"use strict";var Df=at(),cM=Df({}.toString),lM=Df("".slice);Of.exports=function(n){return lM(cM(n),8,-1)}});var Is=L((ZO,Ff)=>{"use strict";var uM=at(),hM=Qe(),fM=zn(),Jo=Object,dM=uM("".split);Ff.exports=hM(function(){return!Jo("z").propertyIsEnumerable(0)})?function(n){return fM(n)==="String"?dM(n,""):Jo(n)}:Jo});var Ls=L((JO,Bf)=>{"use strict";Bf.exports=function(n){return n==null}});var Bi=L((KO,zf)=>{"use strict";var pM=Ls(),mM=TypeError;zf.exports=function(n){if(pM(n))throw new mM("Can't call method on "+n);return n}});var zi=L((jO,kf)=>{"use strict";var gM=Is(),vM=Bi();kf.exports=function(n){return gM(vM(n))}});var ut=L((QO,Vf)=>{"use strict";var Ko=typeof document=="object"&&document.all;Vf.exports=typeof Ko=="undefined"&&Ko!==void 0?function(n){return typeof n=="function"||n===Ko}:function(n){return typeof n=="function"}});var Rt=L((e3,Gf)=>{"use strict";var _M=ut();Gf.exports=function(n){return typeof n=="object"?n!==null:_M(n)}});var ki=L((t3,Hf)=>{"use strict";var jo=$e(),yM=ut(),xM=function(n){return yM(n)?n:void 0};Hf.exports=function(n,e){return arguments.length<2?xM(jo[n]):jo[n]&&jo[n][e]}});var Vr=L((n3,Wf)=>{"use strict";var MM=at();Wf.exports=MM({}.isPrototypeOf)});var Vi=L((i3,Yf)=>{"use strict";var SM=$e(),qf=SM.navigator,Xf=qf&&qf.userAgent;Yf.exports=Xf?String(Xf):""});var Ns=L((r3,Qf)=>{"use strict";var jf=$e(),Qo=Vi(),$f=jf.process,Zf=jf.Deno,Jf=$f&&$f.versions||Zf&&Zf.version,Kf=Jf&&Jf.v8,Jt,Us;Kf&&(Jt=Kf.split("."),Us=Jt[0]>0&&Jt[0]<4?1:+(Jt[0]+Jt[1]));!Us&&Qo&&(Jt=Qo.match(/Edge\\/(\\d+)/),(!Jt||Jt[1]>=74)&&(Jt=Qo.match(/Chrome\\/(\\d+)/),Jt&&(Us=+Jt[1])));Qf.exports=Us});var ec=L((s3,td)=>{"use strict";var ed=Ns(),bM=Qe(),EM=$e(),AM=EM.String;td.exports=!!Object.getOwnPropertySymbols&&!bM(function(){var n=Symbol("symbol detection");return!AM(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&ed&&ed<41})});var tc=L((a3,nd)=>{"use strict";var TM=ec();nd.exports=TM&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ds=L((o3,id)=>{"use strict";var wM=ki(),RM=ut(),CM=Vr(),PM=tc(),IM=Object;id.exports=PM?function(n){return typeof n=="symbol"}:function(n){var e=wM("Symbol");return RM(e)&&CM(e.prototype,IM(n))}});var Gr=L((c3,rd)=>{"use strict";var LM=String;rd.exports=function(n){try{return LM(n)}catch(e){return"Object"}}});var hi=L((l3,sd)=>{"use strict";var UM=ut(),NM=Gr(),DM=TypeError;sd.exports=function(n){if(UM(n))return n;throw new DM(NM(n)+" is not a function")}});var Os=L((u3,ad)=>{"use strict";var OM=hi(),FM=Ls();ad.exports=function(n,e){var t=n[e];return FM(t)?void 0:OM(t)}});var cd=L((h3,od)=>{"use strict";var nc=wt(),ic=ut(),rc=Rt(),BM=TypeError;od.exports=function(n,e){var t,i;if(e==="string"&&ic(t=n.toString)&&!rc(i=nc(t,n))||ic(t=n.valueOf)&&!rc(i=nc(t,n))||e!=="string"&&ic(t=n.toString)&&!rc(i=nc(t,n)))return i;throw new BM("Can't convert object to primitive value")}});var Hr=L((f3,ld)=>{"use strict";ld.exports=!1});var Fs=L((d3,hd)=>{"use strict";var ud=$e(),zM=Object.defineProperty;hd.exports=function(n,e){try{zM(ud,n,{value:e,configurable:!0,writable:!0})}catch(t){ud[n]=e}return e}});var Bs=L((p3,pd)=>{"use strict";var kM=Hr(),VM=$e(),GM=Fs(),fd="__core-js_shared__",dd=pd.exports=VM[fd]||GM(fd,{});(dd.versions||(dd.versions=[])).push({version:"3.42.0",mode:kM?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var zs=L((m3,gd)=>{"use strict";var md=Bs();gd.exports=function(n,e){return md[n]||(md[n]=e||{})}});var hn=L((g3,vd)=>{"use strict";var HM=Bi(),WM=Object;vd.exports=function(n){return WM(HM(n))}});var qt=L((v3,_d)=>{"use strict";var qM=at(),XM=hn(),YM=qM({}.hasOwnProperty);_d.exports=Object.hasOwn||function(e,t){return YM(XM(e),t)}});var ks=L((_3,yd)=>{"use strict";var $M=at(),ZM=0,JM=Math.random(),KM=$M(1 .toString);yd.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+KM(++ZM+JM,36)}});var _t=L((y3,Md)=>{"use strict";var jM=$e(),QM=zs(),xd=qt(),eS=ks(),tS=ec(),nS=tc(),Gi=jM.Symbol,sc=QM("wks"),iS=nS?Gi.for||Gi:Gi&&Gi.withoutSetter||eS;Md.exports=function(n){return xd(sc,n)||(sc[n]=tS&&xd(Gi,n)?Gi[n]:iS("Symbol."+n)),sc[n]}});var ac=L((x3,Ed)=>{"use strict";var rS=wt(),Sd=Rt(),bd=Ds(),sS=Os(),aS=cd(),oS=_t(),cS=TypeError,lS=oS("toPrimitive");Ed.exports=function(n,e){if(!Sd(n)||bd(n))return n;var t=sS(n,lS),i;if(t){if(e===void 0&&(e="default"),i=rS(t,n,e),!Sd(i)||bd(i))return i;throw new cS("Can't convert object to primitive value")}return e===void 0&&(e="number"),aS(n,e)}});var Vs=L((M3,Ad)=>{"use strict";var uS=ac(),hS=Ds();Ad.exports=function(n){var e=uS(n,"string");return hS(e)?e:e+""}});var Gs=L((S3,wd)=>{"use strict";var fS=$e(),Td=Rt(),oc=fS.document,dS=Td(oc)&&Td(oc.createElement);wd.exports=function(n){return dS?oc.createElement(n):{}}});var cc=L((b3,Rd)=>{"use strict";var pS=St(),mS=Qe(),gS=Gs();Rd.exports=!pS&&!mS(function(){return Object.defineProperty(gS("div"),"a",{get:function(){return 7}}).a!==7})});var Hs=L(Pd=>{"use strict";var vS=St(),_S=wt(),yS=Pf(),xS=kr(),MS=zi(),SS=Vs(),bS=qt(),ES=cc(),Cd=Object.getOwnPropertyDescriptor;Pd.f=vS?Cd:function(e,t){if(e=MS(e),t=SS(t),ES)try{return Cd(e,t)}catch(i){}if(bS(e,t))return xS(!_S(yS.f,e,t),e[t])}});var lc=L((A3,Id)=>{"use strict";var AS=St(),TS=Qe();Id.exports=AS&&TS(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var fn=L((T3,Ld)=>{"use strict";var wS=Rt(),RS=String,CS=TypeError;Ld.exports=function(n){if(wS(n))return n;throw new CS(RS(n)+" is not an object")}});var dn=L(Nd=>{"use strict";var PS=St(),IS=cc(),LS=lc(),Ws=fn(),Ud=Vs(),US=TypeError,uc=Object.defineProperty,NS=Object.getOwnPropertyDescriptor,hc="enumerable",fc="configurable",dc="writable";Nd.f=PS?LS?function(e,t,i){if(Ws(e),t=Ud(t),Ws(i),typeof e=="function"&&t==="prototype"&&"value"in i&&dc in i&&!i[dc]){var r=NS(e,t);r&&r[dc]&&(e[t]=i.value,i={configurable:fc in i?i[fc]:r[fc],enumerable:hc in i?i[hc]:r[hc],writable:!1})}return uc(e,t,i)}:uc:function(e,t,i){if(Ws(e),t=Ud(t),Ws(i),IS)try{return uc(e,t,i)}catch(r){}if("get"in i||"set"in i)throw new US("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Sn=L((R3,Dd)=>{"use strict";var DS=St(),OS=dn(),FS=kr();Dd.exports=DS?function(n,e,t){return OS.f(n,e,FS(1,t))}:function(n,e,t){return n[e]=t,n}});var qs=L((C3,Fd)=>{"use strict";var pc=St(),BS=qt(),Od=Function.prototype,zS=pc&&Object.getOwnPropertyDescriptor,mc=BS(Od,"name"),kS=mc&&function(){}.name==="something",VS=mc&&(!pc||pc&&zS(Od,"name").configurable);Fd.exports={EXISTS:mc,PROPER:kS,CONFIGURABLE:VS}});var vc=L((P3,Bd)=>{"use strict";var GS=at(),HS=ut(),gc=Bs(),WS=GS(Function.toString);HS(gc.inspectSource)||(gc.inspectSource=function(n){return WS(n)});Bd.exports=gc.inspectSource});var Vd=L((I3,kd)=>{"use strict";var qS=$e(),XS=ut(),zd=qS.WeakMap;kd.exports=XS(zd)&&/native code/.test(String(zd))});var Xs=L((L3,Hd)=>{"use strict";var YS=zs(),$S=ks(),Gd=YS("keys");Hd.exports=function(n){return Gd[n]||(Gd[n]=$S(n))}});var Ys=L((U3,Wd)=>{"use strict";Wd.exports={}});var di=L((N3,Yd)=>{"use strict";var ZS=Vd(),Xd=$e(),JS=Rt(),KS=Sn(),_c=qt(),yc=Bs(),jS=Xs(),QS=Ys(),qd="Object already initialized",xc=Xd.TypeError,eb=Xd.WeakMap,$s,Wr,Zs,tb=function(n){return Zs(n)?Wr(n):$s(n,{})},nb=function(n){return function(e){var t;if(!JS(e)||(t=Wr(e)).type!==n)throw new xc("Incompatible receiver, "+n+" required");return t}};ZS||yc.state?(Kt=yc.state||(yc.state=new eb),Kt.get=Kt.get,Kt.has=Kt.has,Kt.set=Kt.set,$s=function(n,e){if(Kt.has(n))throw new xc(qd);return e.facade=n,Kt.set(n,e),e},Wr=function(n){return Kt.get(n)||{}},Zs=function(n){return Kt.has(n)}):(fi=jS("state"),QS[fi]=!0,$s=function(n,e){if(_c(n,fi))throw new xc(qd);return e.facade=n,KS(n,fi,e),e},Wr=function(n){return _c(n,fi)?n[fi]:{}},Zs=function(n){return _c(n,fi)});var Kt,fi;Yd.exports={set:$s,get:Wr,has:Zs,enforce:tb,getterFor:nb}});var bc=L((D3,Jd)=>{"use strict";var Sc=at(),ib=Qe(),rb=ut(),Js=qt(),Mc=St(),sb=qs().CONFIGURABLE,ab=vc(),Zd=di(),ob=Zd.enforce,cb=Zd.get,$d=String,Ks=Object.defineProperty,lb=Sc("".slice),ub=Sc("".replace),hb=Sc([].join),fb=Mc&&!ib(function(){return Ks(function(){},"length",{value:8}).length!==8}),db=String(String).split("String"),pb=Jd.exports=function(n,e,t){lb($d(e),0,7)==="Symbol("&&(e="["+ub($d(e),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Js(n,"name")||sb&&n.name!==e)&&(Mc?Ks(n,"name",{value:e,configurable:!0}):n.name=e),fb&&t&&Js(t,"arity")&&n.length!==t.arity&&Ks(n,"length",{value:t.arity});try{t&&Js(t,"constructor")&&t.constructor?Mc&&Ks(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(r){}var i=ob(n);return Js(i,"source")||(i.source=hb(db,typeof e=="string"?e:"")),n};Function.prototype.toString=pb(function(){return rb(this)&&cb(this).source||ab(this)},"toString")});var pi=L((O3,Kd)=>{"use strict";var mb=ut(),gb=dn(),vb=bc(),_b=Fs();Kd.exports=function(n,e,t,i){i||(i={});var r=i.enumerable,s=i.name!==void 0?i.name:e;if(mb(t)&&vb(t,s,i),i.global)r?n[e]=t:_b(e,t);else{try{i.unsafe?n[e]&&(r=!0):delete n[e]}catch(o){}r?n[e]=t:gb.f(n,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var Qd=L((F3,jd)=>{"use strict";var yb=Math.ceil,xb=Math.floor;jd.exports=Math.trunc||function(e){var t=+e;return(t>0?xb:yb)(t)}});var jt=L((B3,ep)=>{"use strict";var Mb=Qd();ep.exports=function(n){var e=+n;return e!==e||e===0?0:Mb(e)}});var js=L((z3,tp)=>{"use strict";var Sb=jt(),bb=Math.max,Eb=Math.min;tp.exports=function(n,e){var t=Sb(n);return t<0?bb(t+e,0):Eb(t,e)}});var mi=L((k3,np)=>{"use strict";var Ab=jt(),Tb=Math.min;np.exports=function(n){var e=Ab(n);return e>0?Tb(e,9007199254740991):0}});var Xt=L((V3,ip)=>{"use strict";var wb=mi();ip.exports=function(n){return wb(n.length)}});var ap=L((G3,sp)=>{"use strict";var Rb=zi(),Cb=js(),Pb=Xt(),rp=function(n){return function(e,t,i){var r=Rb(e),s=Pb(r);if(s===0)return!n&&-1;var o=Cb(i,s),a;if(n&&t!==t){for(;s>o;)if(a=r[o++],a!==a)return!0}else for(;s>o;o++)if((n||o in r)&&r[o]===t)return n||o||0;return!n&&-1}};sp.exports={includes:rp(!0),indexOf:rp(!1)}});var Ac=L((H3,cp)=>{"use strict";var Ib=at(),Ec=qt(),Lb=zi(),Ub=ap().indexOf,Nb=Ys(),op=Ib([].push);cp.exports=function(n,e){var t=Lb(n),i=0,r=[],s;for(s in t)!Ec(Nb,s)&&Ec(t,s)&&op(r,s);for(;e.length>i;)Ec(t,s=e[i++])&&(~Ub(r,s)||op(r,s));return r}});var Qs=L((W3,lp)=>{"use strict";lp.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Tc=L(up=>{"use strict";var Db=Ac(),Ob=Qs(),Fb=Ob.concat("length","prototype");up.f=Object.getOwnPropertyNames||function(e){return Db(e,Fb)}});var fp=L(hp=>{"use strict";hp.f=Object.getOwnPropertySymbols});var pp=L((Y3,dp)=>{"use strict";var Bb=ki(),zb=at(),kb=Tc(),Vb=fp(),Gb=fn(),Hb=zb([].concat);dp.exports=Bb("Reflect","ownKeys")||function(e){var t=kb.f(Gb(e)),i=Vb.f;return i?Hb(t,i(e)):t}});var wc=L(($3,gp)=>{"use strict";var mp=qt(),Wb=pp(),qb=Hs(),Xb=dn();gp.exports=function(n,e,t){for(var i=Wb(e),r=Xb.f,s=qb.f,o=0;o<i.length;o++){var a=i[o];!mp(n,a)&&!(t&&mp(t,a))&&r(n,a,s(e,a))}}});var _p=L((Z3,vp)=>{"use strict";var Yb=Qe(),$b=ut(),Zb=/#|\\.prototype\\./,qr=function(n,e){var t=Kb[Jb(n)];return t===Qb?!0:t===jb?!1:$b(e)?Yb(e):!!e},Jb=qr.normalize=function(n){return String(n).replace(Zb,".").toLowerCase()},Kb=qr.data={},jb=qr.NATIVE="N",Qb=qr.POLYFILL="P";vp.exports=qr});var pn=L((J3,yp)=>{"use strict";var ea=$e(),eE=Hs().f,tE=Sn(),nE=pi(),iE=Fs(),rE=wc(),sE=_p();yp.exports=function(n,e){var t=n.target,i=n.global,r=n.stat,s,o,a,c,l,u;if(i?o=ea:r?o=ea[t]||iE(t,{}):o=ea[t]&&ea[t].prototype,o)for(a in e){if(l=e[a],n.dontCallGetSet?(u=eE(o,a),c=u&&u.value):c=o[a],s=sE(i?a:t+(r?".":"#")+a,n.forced),!s&&c!==void 0){if(typeof l==typeof c)continue;rE(l,c)}(n.sham||c&&c.sham)&&tE(l,"sham",!0),nE(o,a,l,n)}}});var Rc=L((K3,xp)=>{"use strict";var aE=zn();xp.exports=Array.isArray||function(e){return aE(e)==="Array"}});var Sp=L((j3,Mp)=>{"use strict";var oE=St(),cE=Rc(),lE=TypeError,uE=Object.getOwnPropertyDescriptor,hE=oE&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();Mp.exports=hE?function(n,e){if(cE(n)&&!uE(n,"length").writable)throw new lE("Cannot set read only .length");return n.length=e}:function(n,e){return n.length=e}});var Ep=L((Q3,bp)=>{"use strict";var fE=TypeError,dE=9007199254740991;bp.exports=function(n){if(n>dE)throw fE("Maximum allowed index exceeded");return n}});var ta=L(()=>{"use strict";var pE=pn(),mE=hn(),gE=Xt(),vE=Sp(),_E=Ep(),yE=Qe(),xE=yE(function(){return[].push.call({length:4294967296},1)!==4294967297}),ME=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},SE=xE||!ME();pE({target:"Array",proto:!0,arity:1,forced:SE},{push:function(e){var t=mE(this),i=gE(t),r=arguments.length;_E(i+r);for(var s=0;s<r;s++)t[i]=arguments[s],i++;return vE(t,i),i}})});var Cp=L((nF,Rp)=>{"use strict";var bE=_t(),Tp=bE("iterator"),wp=!1;try{Ap=0,Cc={next:function(){return{done:!!Ap++}},return:function(){wp=!0}},Cc[Tp]=function(){return this},Array.from(Cc,function(){throw 2})}catch(n){}var Ap,Cc;Rp.exports=function(n,e){try{if(!e&&!wp)return!1}catch(r){return!1}var t=!1;try{var i={};i[Tp]=function(){return{next:function(){return{done:t=!0}}}},n(i)}catch(r){}return t}});var na=L((iF,Pp)=>{"use strict";Pp.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var Up=L((rF,Lp)=>{"use strict";var EE=_t(),AE=EE("toStringTag"),Ip={};Ip[AE]="z";Lp.exports=String(Ip)==="[object z]"});var kn=L((sF,Np)=>{"use strict";var TE=Up(),wE=ut(),ia=zn(),RE=_t(),CE=RE("toStringTag"),PE=Object,IE=ia(function(){return arguments}())==="Arguments",LE=function(n,e){try{return n[e]}catch(t){}};Np.exports=TE?ia:function(n){var e,t,i;return n===void 0?"Undefined":n===null?"Null":typeof(t=LE(e=PE(n),CE))=="string"?t:IE?ia(e):(i=ia(e))==="Object"&&wE(e.callee)?"Arguments":i}});var Hi=L((aF,Op)=>{"use strict";var Dp=bc(),UE=dn();Op.exports=function(n,e,t){return t.get&&Dp(t.get,e,{getter:!0}),t.set&&Dp(t.set,e,{setter:!0}),UE.f(n,e,t)}});var Bp=L((oF,Fp)=>{"use strict";var NE=Qe();Fp.exports=!NE(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Xr=L((cF,kp)=>{"use strict";var DE=qt(),OE=ut(),FE=hn(),BE=Xs(),zE=Bp(),zp=BE("IE_PROTO"),Pc=Object,kE=Pc.prototype;kp.exports=zE?Pc.getPrototypeOf:function(n){var e=FE(n);if(DE(e,zp))return e[zp];var t=e.constructor;return OE(t)&&e instanceof t?t.prototype:e instanceof Pc?kE:null}});var ra=L((lF,Vp)=>{"use strict";var VE=at(),GE=hi();Vp.exports=function(n,e,t){try{return VE(GE(Object.getOwnPropertyDescriptor(n,e)[t]))}catch(i){}}});var Hp=L((uF,Gp)=>{"use strict";var HE=Rt();Gp.exports=function(n){return HE(n)||n===null}});var qp=L((hF,Wp)=>{"use strict";var WE=Hp(),qE=String,XE=TypeError;Wp.exports=function(n){if(WE(n))return n;throw new XE("Can't set "+qE(n)+" as a prototype")}});var Wi=L((fF,Xp)=>{"use strict";var YE=ra(),$E=Rt(),ZE=Bi(),JE=qp();Xp.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,e={},t;try{t=YE(Object.prototype,"__proto__","set"),t(e,[]),n=e instanceof Array}catch(i){}return function(r,s){return ZE(r),JE(s),$E(r)&&(n?t(r,s):r.__proto__=s),r}}():void 0)});var Bt=L((dF,nm)=>{"use strict";var KE=na(),Nc=St(),Ct=$e(),Jp=ut(),oa=Rt(),Gn=qt(),Dc=kn(),jE=Gr(),QE=Sn(),Ic=pi(),eA=Hi(),tA=Vr(),ca=Xr(),Xi=Wi(),nA=_t(),iA=ks(),Kp=di(),jp=Kp.enforce,rA=Kp.get,sa=Ct.Int8Array,Lc=sa&&sa.prototype,Yp=Ct.Uint8ClampedArray,$p=Yp&&Yp.prototype,mn=sa&&ca(sa),Qt=Lc&&ca(Lc),sA=Object.prototype,Oc=Ct.TypeError,Zp=nA("toStringTag"),Uc=iA("TYPED_ARRAY_TAG"),aa="TypedArrayConstructor",bn=KE&&!!Xi&&Dc(Ct.opera)!=="Opera",Qp=!1,Ut,Vn,qi,En={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Fc={BigInt64Array:8,BigUint64Array:8},aA=function(e){if(!oa(e))return!1;var t=Dc(e);return t==="DataView"||Gn(En,t)||Gn(Fc,t)},em=function(n){var e=ca(n);if(oa(e)){var t=rA(e);return t&&Gn(t,aa)?t[aa]:em(e)}},tm=function(n){if(!oa(n))return!1;var e=Dc(n);return Gn(En,e)||Gn(Fc,e)},oA=function(n){if(tm(n))return n;throw new Oc("Target is not a typed array")},cA=function(n){if(Jp(n)&&(!Xi||tA(mn,n)))return n;throw new Oc(jE(n)+" is not a typed array constructor")},lA=function(n,e,t,i){if(Nc){if(t)for(var r in En){var s=Ct[r];if(s&&Gn(s.prototype,n))try{delete s.prototype[n]}catch(o){try{s.prototype[n]=e}catch(a){}}}(!Qt[n]||t)&&Ic(Qt,n,t?e:bn&&Lc[n]||e,i)}},uA=function(n,e,t){var i,r;if(Nc){if(Xi){if(t){for(i in En)if(r=Ct[i],r&&Gn(r,n))try{delete r[n]}catch(s){}}if(!mn[n]||t)try{return Ic(mn,n,t?e:bn&&mn[n]||e)}catch(s){}else return}for(i in En)r=Ct[i],r&&(!r[n]||t)&&Ic(r,n,e)}};for(Ut in En)Vn=Ct[Ut],qi=Vn&&Vn.prototype,qi?jp(qi)[aa]=Vn:bn=!1;for(Ut in Fc)Vn=Ct[Ut],qi=Vn&&Vn.prototype,qi&&(jp(qi)[aa]=Vn);if((!bn||!Jp(mn)||mn===Function.prototype)&&(mn=function(){throw new Oc("Incorrect invocation")},bn))for(Ut in En)Ct[Ut]&&Xi(Ct[Ut],mn);if((!bn||!Qt||Qt===sA)&&(Qt=mn.prototype,bn))for(Ut in En)Ct[Ut]&&Xi(Ct[Ut].prototype,Qt);bn&&ca($p)!==Qt&&Xi($p,Qt);if(Nc&&!Gn(Qt,Zp)){Qp=!0,eA(Qt,Zp,{configurable:!0,get:function(){return oa(this)?this[Uc]:void 0}});for(Ut in En)Ct[Ut]&&QE(Ct[Ut],Uc,Ut)}nm.exports={NATIVE_ARRAY_BUFFER_VIEWS:bn,TYPED_ARRAY_TAG:Qp&&Uc,aTypedArray:oA,aTypedArrayConstructor:cA,exportTypedArrayMethod:lA,exportTypedArrayStaticMethod:uA,getTypedArrayConstructor:em,isView:aA,isTypedArray:tm,TypedArray:mn,TypedArrayPrototype:Qt}});var sm=L((pF,rm)=>{"use strict";var im=$e(),Bc=Qe(),hA=Cp(),fA=Bt().NATIVE_ARRAY_BUFFER_VIEWS,dA=im.ArrayBuffer,gi=im.Int8Array;rm.exports=!fA||!Bc(function(){gi(1)})||!Bc(function(){new gi(-1)})||!hA(function(n){new gi,new gi(null),new gi(1.5),new gi(n)},!0)||Bc(function(){return new gi(new dA(2),1,void 0).length!==1})});var om=L((mF,am)=>{"use strict";var pA=pi();am.exports=function(n,e,t){for(var i in e)pA(n,i,e[i],t);return n}});var zc=L((gF,cm)=>{"use strict";var mA=Vr(),gA=TypeError;cm.exports=function(n,e){if(mA(e,n))return n;throw new gA("Incorrect invocation")}});var la=L((vF,lm)=>{"use strict";var vA=jt(),_A=mi(),yA=RangeError;lm.exports=function(n){if(n===void 0)return 0;var e=vA(n),t=_A(e);if(e!==t)throw new yA("Wrong length or index");return t}});var hm=L((_F,um)=>{"use strict";um.exports=Math.sign||function(e){var t=+e;return t===0||t!==t?t:t<0?-1:1}});var pm=L((yF,dm)=>{"use strict";var xA=2220446049250313e-31,fm=1/xA;dm.exports=function(n){return n+fm-fm}});var gm=L((xF,mm)=>{"use strict";var MA=hm(),SA=pm(),bA=Math.abs,EA=2220446049250313e-31;mm.exports=function(n,e,t,i){var r=+n,s=bA(r),o=MA(r);if(s<i)return o*SA(s/i/e)*i*e;var a=(1+e/EA)*s,c=a-(a-s);return c>t||c!==c?o*(1/0):o*c}});var _m=L((MF,vm)=>{"use strict";var AA=gm(),TA=11920928955078125e-23,wA=34028234663852886e22,RA=11754943508222875e-54;vm.exports=Math.fround||function(e){return AA(e,TA,wA,RA)}});var xm=L((SF,ym)=>{"use strict";var CA=Array,PA=Math.abs,An=Math.pow,IA=Math.floor,LA=Math.log,UA=Math.LN2,NA=function(n,e,t){var i=CA(t),r=t*8-e-1,s=(1<<r)-1,o=s>>1,a=e===23?An(2,-24)-An(2,-77):0,c=n<0||n===0&&1/n<0?1:0,l=0,u,h,f;for(n=PA(n),n!==n||n===1/0?(h=n!==n?1:0,u=s):(u=IA(LA(n)/UA),f=An(2,-u),n*f<1&&(u--,f*=2),u+o>=1?n+=a/f:n+=a*An(2,1-o),n*f>=2&&(u++,f/=2),u+o>=s?(h=0,u=s):u+o>=1?(h=(n*f-1)*An(2,e),u+=o):(h=n*An(2,o-1)*An(2,e),u=0));e>=8;)i[l++]=h&255,h/=256,e-=8;for(u=u<<e|h,r+=e;r>0;)i[l++]=u&255,u/=256,r-=8;return i[l-1]|=c*128,i},DA=function(n,e){var t=n.length,i=t*8-e-1,r=(1<<i)-1,s=r>>1,o=i-7,a=t-1,c=n[a--],l=c&127,u;for(c>>=7;o>0;)l=l*256+n[a--],o-=8;for(u=l&(1<<-o)-1,l>>=-o,o+=e;o>0;)u=u*256+n[a--],o-=8;if(l===0)l=1-s;else{if(l===r)return u?NaN:c?-1/0:1/0;u+=An(2,e),l-=s}return(c?-1:1)*u*An(2,l-e)};ym.exports={pack:NA,unpack:DA}});var kc=L((bF,Sm)=>{"use strict";var OA=hn(),Mm=js(),FA=Xt();Sm.exports=function(e){for(var t=OA(this),i=FA(t),r=arguments.length,s=Mm(r>1?arguments[1]:void 0,i),o=r>2?arguments[2]:void 0,a=o===void 0?i:Mm(o,i);a>s;)t[s++]=e;return t}});var Vc=L((EF,bm)=>{"use strict";var BA=at();bm.exports=BA([].slice)});var Gc=L((AF,Am)=>{"use strict";var zA=ut(),kA=Rt(),Em=Wi();Am.exports=function(n,e,t){var i,r;return Em&&zA(i=e.constructor)&&i!==t&&kA(r=i.prototype)&&r!==t.prototype&&Em(n,r),n}});var Yr=L((TF,wm)=>{"use strict";var VA=dn().f,GA=qt(),HA=_t(),Tm=HA("toStringTag");wm.exports=function(n,e,t){n&&!t&&(n=n.prototype),n&&!GA(n,Tm)&&VA(n,Tm,{configurable:!0,value:e})}});var ga=L((wF,Wm)=>{"use strict";var pa=$e(),Yc=at(),Hc=St(),WA=na(),zm=qs(),qA=Sn(),XA=Hi(),Rm=om(),Wc=Qe(),ua=zc(),YA=jt(),$A=mi(),fa=la(),ZA=_m(),km=xm(),JA=Xr(),Cm=Wi(),KA=kc(),jA=Vc(),QA=Gc(),eT=wc(),Vm=Yr(),$c=di(),tT=zm.PROPER,Pm=zm.CONFIGURABLE,$i="ArrayBuffer",ma="DataView",Zi="prototype",nT="Wrong length",Gm="Wrong index",Im=$c.getterFor($i),Zr=$c.getterFor(ma),Lm=$c.set,en=pa[$i],zt=en,Yi=zt&&zt[Zi],gn=pa[ma],vi=gn&&gn[Zi],Um=Object.prototype,iT=pa.Array,da=pa.RangeError,rT=Yc(KA),sT=Yc([].reverse),Hm=km.pack,Nm=km.unpack,Dm=function(n){return[n&255]},Om=function(n){return[n&255,n>>8&255]},Fm=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},Bm=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},aT=function(n){return Hm(ZA(n),23,4)},oT=function(n){return Hm(n,52,8)},ha=function(n,e,t){XA(n[Zi],e,{configurable:!0,get:function(){return t(this)[e]}})},Hn=function(n,e,t,i){var r=Zr(n),s=fa(t),o=!!i;if(s+e>r.byteLength)throw new da(Gm);var a=r.bytes,c=s+r.byteOffset,l=jA(a,c,c+e);return o?l:sT(l)},Wn=function(n,e,t,i,r,s){var o=Zr(n),a=fa(t),c=i(+r),l=!!s;if(a+e>o.byteLength)throw new da(Gm);for(var u=o.bytes,h=a+o.byteOffset,f=0;f<e;f++)u[h+f]=c[l?f:e-f-1]};WA?(qc=tT&&en.name!==$i,!Wc(function(){en(1)})||!Wc(function(){new en(-1)})||Wc(function(){return new en,new en(1.5),new en(NaN),en.length!==1||qc&&!Pm})?(zt=function(e){return ua(this,Yi),QA(new en(fa(e)),this,zt)},zt[Zi]=Yi,Yi.constructor=zt,eT(zt,en)):qc&&Pm&&qA(en,"name",$i),Cm&&JA(vi)!==Um&&Cm(vi,Um),$r=new gn(new zt(2)),Xc=Yc(vi.setInt8),$r.setInt8(0,2147483648),$r.setInt8(1,2147483649),($r.getInt8(0)||!$r.getInt8(1))&&Rm(vi,{setInt8:function(e,t){Xc(this,e,t<<24>>24)},setUint8:function(e,t){Xc(this,e,t<<24>>24)}},{unsafe:!0})):(zt=function(e){ua(this,Yi);var t=fa(e);Lm(this,{type:$i,bytes:rT(iT(t),0),byteLength:t}),Hc||(this.byteLength=t,this.detached=!1)},Yi=zt[Zi],gn=function(e,t,i){ua(this,vi),ua(e,Yi);var r=Im(e),s=r.byteLength,o=YA(t);if(o<0||o>s)throw new da("Wrong offset");if(i=i===void 0?s-o:$A(i),o+i>s)throw new da(nT);Lm(this,{type:ma,buffer:e,byteLength:i,byteOffset:o,bytes:r.bytes}),Hc||(this.buffer=e,this.byteLength=i,this.byteOffset=o)},vi=gn[Zi],Hc&&(ha(zt,"byteLength",Im),ha(gn,"buffer",Zr),ha(gn,"byteLength",Zr),ha(gn,"byteOffset",Zr)),Rm(vi,{getInt8:function(e){return Hn(this,1,e)[0]<<24>>24},getUint8:function(e){return Hn(this,1,e)[0]},getInt16:function(e){var t=Hn(this,2,e,arguments.length>1?arguments[1]:!1);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Hn(this,2,e,arguments.length>1?arguments[1]:!1);return t[1]<<8|t[0]},getInt32:function(e){return Bm(Hn(this,4,e,arguments.length>1?arguments[1]:!1))},getUint32:function(e){return Bm(Hn(this,4,e,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(e){return Nm(Hn(this,4,e,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(e){return Nm(Hn(this,8,e,arguments.length>1?arguments[1]:!1),52)},setInt8:function(e,t){Wn(this,1,e,Dm,t)},setUint8:function(e,t){Wn(this,1,e,Dm,t)},setInt16:function(e,t){Wn(this,2,e,Om,t,arguments.length>2?arguments[2]:!1)},setUint16:function(e,t){Wn(this,2,e,Om,t,arguments.length>2?arguments[2]:!1)},setInt32:function(e,t){Wn(this,4,e,Fm,t,arguments.length>2?arguments[2]:!1)},setUint32:function(e,t){Wn(this,4,e,Fm,t,arguments.length>2?arguments[2]:!1)},setFloat32:function(e,t){Wn(this,4,e,aT,t,arguments.length>2?arguments[2]:!1)},setFloat64:function(e,t){Wn(this,8,e,oT,t,arguments.length>2?arguments[2]:!1)}}));var qc,$r,Xc;Vm(zt,$i);Vm(gn,ma);Wm.exports={ArrayBuffer:zt,DataView:gn}});var Xm=L((RF,qm)=>{"use strict";var cT=Rt(),lT=Math.floor;qm.exports=Number.isInteger||function(e){return!cT(e)&&isFinite(e)&&lT(e)===e}});var $m=L((CF,Ym)=>{"use strict";var uT=jt(),hT=RangeError;Ym.exports=function(n){var e=uT(n);if(e<0)throw new hT("The argument can't be less than 0");return e}});var Zc=L((PF,Zm)=>{"use strict";var fT=$m(),dT=RangeError;Zm.exports=function(n,e){var t=fT(n);if(t%e)throw new dT("Wrong offset");return t}});var Km=L((IF,Jm)=>{"use strict";var pT=Math.round;Jm.exports=function(n){var e=pT(n);return e<0?0:e>255?255:e&255}});var Qm=L((LF,jm)=>{"use strict";var mT=Ac(),gT=Qs();jm.exports=Object.keys||function(e){return mT(e,gT)}});var tg=L(eg=>{"use strict";var vT=St(),_T=lc(),yT=dn(),xT=fn(),MT=zi(),ST=Qm();eg.f=vT&&!_T?Object.defineProperties:function(e,t){xT(e);for(var i=MT(t),r=ST(t),s=r.length,o=0,a;s>o;)yT.f(e,a=r[o++],i[a]);return e}});var ig=L((NF,ng)=>{"use strict";var bT=ki();ng.exports=bT("document","documentElement")});var Ji=L((DF,ug)=>{"use strict";var ET=fn(),AT=tg(),rg=Qs(),TT=Ys(),wT=ig(),RT=Gs(),CT=Xs(),sg=">",ag="<",Kc="prototype",jc="script",cg=CT("IE_PROTO"),Jc=function(){},lg=function(n){return ag+jc+sg+n+ag+"/"+jc+sg},og=function(n){n.write(lg("")),n.close();var e=n.parentWindow.Object;return n=null,e},PT=function(){var n=RT("iframe"),e="java"+jc+":",t;return n.style.display="none",wT.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(lg("document.F=Object")),t.close(),t.F},va,_a=function(){try{va=new ActiveXObject("htmlfile")}catch(e){}_a=typeof document!="undefined"?document.domain&&va?og(va):PT():og(va);for(var n=rg.length;n--;)delete _a[Kc][rg[n]];return _a()};TT[cg]=!0;ug.exports=Object.create||function(e,t){var i;return e!==null?(Jc[Kc]=ET(e),i=new Jc,Jc[Kc]=null,i[cg]=e):i=_a(),t===void 0?i:AT.f(i,t)}});var ya=L((OF,hg)=>{"use strict";var IT=zn(),LT=at();hg.exports=function(n){if(IT(n)==="Function")return LT(n)}});var xa=L((FF,dg)=>{"use strict";var fg=ya(),UT=hi(),NT=zr(),DT=fg(fg.bind);dg.exports=function(n,e){return UT(n),e===void 0?n:NT?DT(n,e):function(){return n.apply(e,arguments)}}});var el=L((BF,_g)=>{"use strict";var OT=at(),FT=Qe(),pg=ut(),BT=kn(),zT=ki(),kT=vc(),mg=function(){},gg=zT("Reflect","construct"),Qc=/^\\s*(?:class|function)\\b/,VT=OT(Qc.exec),GT=!Qc.test(mg),Jr=function(e){if(!pg(e))return!1;try{return gg(mg,[],e),!0}catch(t){return!1}},vg=function(e){if(!pg(e))return!1;switch(BT(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return GT||!!VT(Qc,kT(e))}catch(t){return!0}};vg.sham=!0;_g.exports=!gg||FT(function(){var n;return Jr(Jr.call)||!Jr(Object)||!Jr(function(){n=!0})||n})?vg:Jr});var xg=L((zF,yg)=>{"use strict";var HT=el(),WT=Gr(),qT=TypeError;yg.exports=function(n){if(HT(n))return n;throw new qT(WT(n)+" is not a constructor")}});var Ki=L((kF,Mg)=>{"use strict";Mg.exports={}});var tl=L((VF,bg)=>{"use strict";var XT=kn(),Sg=Os(),YT=Ls(),$T=Ki(),ZT=_t(),JT=ZT("iterator");bg.exports=function(n){if(!YT(n))return Sg(n,JT)||Sg(n,"@@iterator")||$T[XT(n)]}});var Ag=L((GF,Eg)=>{"use strict";var KT=wt(),jT=hi(),QT=fn(),ew=Gr(),tw=tl(),nw=TypeError;Eg.exports=function(n,e){var t=arguments.length<2?tw(n):e;if(jT(t))return QT(KT(t,n));throw new nw(ew(n)+" is not iterable")}});var wg=L((HF,Tg)=>{"use strict";var iw=_t(),rw=Ki(),sw=iw("iterator"),aw=Array.prototype;Tg.exports=function(n){return n!==void 0&&(rw.Array===n||aw[sw]===n)}});var nl=L((WF,Rg)=>{"use strict";var ow=kn();Rg.exports=function(n){var e=ow(n);return e==="BigInt64Array"||e==="BigUint64Array"}});var Ma=L((qF,Cg)=>{"use strict";var cw=ac(),lw=TypeError;Cg.exports=function(n){var e=cw(n,"number");if(typeof e=="number")throw new lw("Can't convert number to bigint");return BigInt(e)}});var Ig=L((XF,Pg)=>{"use strict";var uw=xa(),hw=wt(),fw=xg(),dw=hn(),pw=Xt(),mw=Ag(),gw=tl(),vw=wg(),_w=nl(),yw=Bt().aTypedArrayConstructor,xw=Ma();Pg.exports=function(e){var t=fw(this),i=dw(e),r=arguments.length,s=r>1?arguments[1]:void 0,o=s!==void 0,a=gw(i),c,l,u,h,f,m,g,_;if(a&&!vw(a))for(g=mw(i,a),_=g.next,i=[];!(m=hw(_,g)).done;)i.push(m.value);for(o&&r>2&&(s=uw(s,arguments[2])),l=pw(i),u=new(yw(t))(l),h=_w(u),c=0;l>c;c++)f=o?s(i[c],c):i[c],u[c]=h?xw(f):+f;return u}});var Dg=L((YF,Ng)=>{"use strict";var Lg=Rc(),Mw=el(),Sw=Rt(),bw=_t(),Ew=bw("species"),Ug=Array;Ng.exports=function(n){var e;return Lg(n)&&(e=n.constructor,Mw(e)&&(e===Ug||Lg(e.prototype))?e=void 0:Sw(e)&&(e=e[Ew],e===null&&(e=void 0))),e===void 0?Ug:e}});var Fg=L(($F,Og)=>{"use strict";var Aw=Dg();Og.exports=function(n,e){return new(Aw(n))(e===0?0:e)}});var kg=L((ZF,zg)=>{"use strict";var Tw=xa(),ww=at(),Rw=Is(),Cw=hn(),Pw=Xt(),Iw=Fg(),Bg=ww([].push),qn=function(n){var e=n===1,t=n===2,i=n===3,r=n===4,s=n===6,o=n===7,a=n===5||s;return function(c,l,u,h){for(var f=Cw(c),m=Rw(f),g=Pw(m),_=Tw(l,u),d=0,p=h||Iw,b=e?p(c,g):t||o?p(c,0):void 0,v,E;g>d;d++)if((a||d in m)&&(v=m[d],E=_(v,d,f),n))if(e)b[d]=E;else if(E)switch(n){case 3:return!0;case 5:return v;case 6:return d;case 2:Bg(b,v)}else switch(n){case 4:return!1;case 7:Bg(b,v)}return s?-1:i||r?r:b}};zg.exports={forEach:qn(0),map:qn(1),filter:qn(2),some:qn(3),every:qn(4),find:qn(5),findIndex:qn(6),filterReject:qn(7)}});var il=L((JF,Gg)=>{"use strict";var Lw=ki(),Uw=Hi(),Nw=_t(),Dw=St(),Vg=Nw("species");Gg.exports=function(n){var e=Lw(n);Dw&&e&&!e[Vg]&&Uw(e,Vg,{configurable:!0,get:function(){return this}})}});var rl=L((KF,Hg)=>{"use strict";var Ow=Xt();Hg.exports=function(n,e,t){for(var i=0,r=arguments.length>2?t:Ow(e),s=new n(r);r>i;)s[i]=e[i++];return s}});var lv=L((jF,hl)=>{"use strict";var Wg=pn(),tv=$e(),qg=wt(),Fw=St(),Bw=sm(),es=Bt(),nv=ga(),Xg=zc(),zw=kr(),Kr=Sn(),kw=Xm(),Vw=mi(),Yg=la(),sl=Zc(),Gw=Km(),iv=Vs(),jr=qt(),Hw=kn(),cl=Rt(),Ww=Ds(),qw=Ji(),Xw=Vr(),Sa=Wi(),Yw=Tc().f,$g=Ig(),$w=kg().forEach,Zw=il(),Jw=Hi(),rv=dn(),sv=Hs(),Zg=rl(),fl=di(),Kw=Gc(),ll=fl.get,jw=fl.set,Qw=fl.enforce,av=rv.f,e1=sv.f,al=tv.RangeError,ov=nv.ArrayBuffer,t1=ov.prototype,n1=nv.DataView,ba=es.NATIVE_ARRAY_BUFFER_VIEWS,Jg=es.TYPED_ARRAY_TAG,Kg=es.TypedArray,Qr=es.TypedArrayPrototype,ul=es.isTypedArray,Ea="BYTES_PER_ELEMENT",ol="Wrong length",Aa=function(n,e){Jw(n,e,{configurable:!0,get:function(){return ll(this)[e]}})},jg=function(n){var e;return Xw(t1,n)||(e=Hw(n))==="ArrayBuffer"||e==="SharedArrayBuffer"},cv=function(n,e){return ul(n)&&!Ww(e)&&e in n&&kw(+e)&&e>=0},Qg=function(e,t){return t=iv(t),cv(e,t)?zw(2,e[t]):e1(e,t)},ev=function(e,t,i){return t=iv(t),cv(e,t)&&cl(i)&&jr(i,"value")&&!jr(i,"get")&&!jr(i,"set")&&!i.configurable&&(!jr(i,"writable")||i.writable)&&(!jr(i,"enumerable")||i.enumerable)?(e[t]=i.value,e):av(e,t,i)};Fw?(ba||(sv.f=Qg,rv.f=ev,Aa(Qr,"buffer"),Aa(Qr,"byteOffset"),Aa(Qr,"byteLength"),Aa(Qr,"length")),Wg({target:"Object",stat:!0,forced:!ba},{getOwnPropertyDescriptor:Qg,defineProperty:ev}),hl.exports=function(n,e,t){var i=n.match(/\\d+/)[0]/8,r=n+(t?"Clamped":"")+"Array",s="get"+n,o="set"+n,a=tv[r],c=a,l=c&&c.prototype,u={},h=function(_,d){var p=ll(_);return p.view[s](d*i+p.byteOffset,!0)},f=function(_,d,p){var b=ll(_);b.view[o](d*i+b.byteOffset,t?Gw(p):p,!0)},m=function(_,d){av(_,d,{get:function(){return h(this,d)},set:function(p){return f(this,d,p)},enumerable:!0})};ba?Bw&&(c=e(function(_,d,p,b){return Xg(_,l),Kw(function(){return cl(d)?jg(d)?b!==void 0?new a(d,sl(p,i),b):p!==void 0?new a(d,sl(p,i)):new a(d):ul(d)?Zg(c,d):qg($g,c,d):new a(Yg(d))}(),_,c)}),Sa&&Sa(c,Kg),$w(Yw(a),function(_){_ in c||Kr(c,_,a[_])}),c.prototype=l):(c=e(function(_,d,p,b){Xg(_,l);var v=0,E=0,I,R,w;if(!cl(d))w=Yg(d),R=w*i,I=new ov(R);else if(jg(d)){I=d,E=sl(p,i);var B=d.byteLength;if(b===void 0){if(B%i)throw new al(ol);if(R=B-E,R<0)throw new al(ol)}else if(R=Vw(b)*i,R+E>B)throw new al(ol);w=R/i}else return ul(d)?Zg(c,d):qg($g,c,d);for(jw(_,{buffer:I,byteOffset:E,byteLength:R,length:w,view:new n1(I)});v<w;)m(_,v++)}),Sa&&Sa(c,Kg),l=c.prototype=qw(Qr)),l.constructor!==c&&Kr(l,"constructor",c),Qw(l).TypedArrayConstructor=c,Jg&&Kr(l,Jg,r);var g=c!==a;u[r]=c,Wg({global:!0,constructor:!0,forced:g,sham:!ba},u),Ea in c||Kr(c,Ea,i),Ea in l||Kr(l,Ea,i),Zw(r)}):hl.exports=function(){}});var dl=L(()=>{"use strict";var i1=lv();i1("Float32",function(n){return function(t,i,r){return n(this,t,i,r)}})});var pl=L(()=>{"use strict";var uv=Bt(),r1=Xt(),s1=jt(),a1=uv.aTypedArray,o1=uv.exportTypedArrayMethod;o1("at",function(e){var t=a1(this),i=r1(t),r=s1(e),s=r>=0?r:i+r;return s<0||s>=i?void 0:t[s]})});var ml=L(()=>{"use strict";var hv=Bt(),c1=kc(),l1=Ma(),u1=kn(),h1=wt(),f1=at(),d1=Qe(),p1=hv.aTypedArray,m1=hv.exportTypedArrayMethod,g1=f1("".slice),v1=d1(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});m1("fill",function(e){var t=arguments.length;p1(this);var i=g1(u1(this),0,3)==="Big"?l1(e):+e;return h1(c1,this,i,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},v1)});var gl=L((sB,dv)=>{"use strict";var _1=xa(),y1=Is(),x1=hn(),M1=Xt(),fv=function(n){var e=n===1;return function(t,i,r){for(var s=x1(t),o=y1(s),a=M1(o),c=_1(i,r),l,u;a-- >0;)if(l=o[a],u=c(l,a,s),u)switch(n){case 0:return l;case 1:return a}return e?-1:void 0}};dv.exports={findLast:fv(0),findLastIndex:fv(1)}});var vl=L(()=>{"use strict";var pv=Bt(),S1=gl().findLast,b1=pv.aTypedArray,E1=pv.exportTypedArrayMethod;E1("findLast",function(e){return S1(b1(this),e,arguments.length>1?arguments[1]:void 0)})});var _l=L(()=>{"use strict";var mv=Bt(),A1=gl().findLastIndex,T1=mv.aTypedArray,w1=mv.exportTypedArrayMethod;w1("findLastIndex",function(e){return A1(T1(this),e,arguments.length>1?arguments[1]:void 0)})});var Sl=L(()=>{"use strict";var vv=$e(),_v=wt(),Ml=Bt(),R1=Xt(),C1=Zc(),P1=hn(),yv=Qe(),I1=vv.RangeError,yl=vv.Int8Array,gv=yl&&yl.prototype,xv=gv&&gv.set,L1=Ml.aTypedArray,U1=Ml.exportTypedArrayMethod,xl=!yv(function(){var n=new Uint8ClampedArray(2);return _v(xv,n,{length:1,0:3},1),n[1]!==3}),N1=xl&&Ml.NATIVE_ARRAY_BUFFER_VIEWS&&yv(function(){var n=new yl(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});U1("set",function(e){L1(this);var t=C1(arguments.length>1?arguments[1]:void 0,1),i=P1(e);if(xl)return _v(xv,this,i,t);var r=this.length,s=R1(i),o=0;if(s+t>r)throw new I1("Wrong length");for(;o<s;)this[t+o]=i[o++]},!xl||N1)});var bv=L((fB,Sv)=>{"use strict";var Mv=Vc(),D1=Math.floor,bl=function(n,e){var t=n.length;if(t<8)for(var i=1,r,s;i<t;){for(s=i,r=n[i];s&&e(n[s-1],r)>0;)n[s]=n[--s];s!==i++&&(n[s]=r)}else for(var o=D1(t/2),a=bl(Mv(n,0,o),e),c=bl(Mv(n,o),e),l=a.length,u=c.length,h=0,f=0;h<l||f<u;)n[h+f]=h<l&&f<u?e(a[h],c[f])<=0?a[h++]:c[f++]:h<l?a[h++]:c[f++];return n};Sv.exports=bl});var Tv=L((dB,Av)=>{"use strict";var O1=Vi(),Ev=O1.match(/firefox\\/(\\d+)/i);Av.exports=!!Ev&&+Ev[1]});var Rv=L((pB,wv)=>{"use strict";var F1=Vi();wv.exports=/MSIE|Trident/.test(F1)});var Iv=L((mB,Pv)=>{"use strict";var B1=Vi(),Cv=B1.match(/AppleWebKit\\/(\\d+)\\./);Pv.exports=!!Cv&&+Cv[1]});var Al=L(()=>{"use strict";var z1=$e(),k1=ya(),El=Qe(),V1=hi(),G1=bv(),Ov=Bt(),Lv=Tv(),H1=Rv(),Uv=Ns(),Nv=Iv(),W1=Ov.aTypedArray,q1=Ov.exportTypedArrayMethod,ts=z1.Uint16Array,ji=ts&&k1(ts.prototype.sort),X1=!!ji&&!(El(function(){ji(new ts(2),null)})&&El(function(){ji(new ts(2),{})})),Dv=!!ji&&!El(function(){if(Uv)return Uv<74;if(Lv)return Lv<67;if(H1)return!0;if(Nv)return Nv<602;var n=new ts(516),e=Array(516),t,i;for(t=0;t<516;t++)i=t%4,n[t]=515-t,e[t]=t-2*i+3;for(ji(n,function(r,s){return(r/4|0)-(s/4|0)}),t=0;t<516;t++)if(n[t]!==e[t])return!0}),Y1=function(n){return function(e,t){return n!==void 0?+n(e,t)||0:t!==t?-1:e!==e?1:e===0&&t===0?1/e>0&&1/t<0?1:-1:e>t}};q1("sort",function(e){return e!==void 0&&V1(e),Dv?ji(this,e):G1(W1(this),Y1(e))},!Dv||X1)});var Bv=L((_B,Fv)=>{"use strict";var $1=Xt();Fv.exports=function(n,e){for(var t=$1(n),i=new e(t),r=0;r<t;r++)i[r]=n[t-r-1];return i}});var wl=L(()=>{"use strict";var Z1=Bv(),Tl=Bt(),J1=Tl.aTypedArray,K1=Tl.exportTypedArrayMethod,j1=Tl.getTypedArrayConstructor;K1("toReversed",function(){return Z1(J1(this),j1(this))})});var Rl=L(()=>{"use strict";var Ta=Bt(),Q1=at(),eR=hi(),tR=rl(),nR=Ta.aTypedArray,iR=Ta.getTypedArrayConstructor,rR=Ta.exportTypedArrayMethod,sR=Q1(Ta.TypedArrayPrototype.sort);rR("toSorted",function(e){e!==void 0&&eR(e);var t=nR(this),i=tR(iR(t),t);return sR(i,e)})});var kv=L((bB,zv)=>{"use strict";var aR=Xt(),oR=jt(),cR=RangeError;zv.exports=function(n,e,t,i){var r=aR(n),s=oR(t),o=s<0?r+s:s;if(o>=r||o<0)throw new cR("Incorrect index");for(var a=new e(r),c=0;c<r;c++)a[c]=c===o?i:n[c];return a}});var Pl=L(()=>{"use strict";var lR=kv(),Cl=Bt(),uR=nl(),hR=jt(),fR=Ma(),dR=Cl.aTypedArray,pR=Cl.getTypedArrayConstructor,mR=Cl.exportTypedArrayMethod,gR=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();mR("with",function(n,e){var t=dR(this),i=hR(n),r=uR(t)?fR(e):+e;return lR(t,pR(t),i,r)},!gR)});var Ll=L(()=>{"use strict";var vR=pn(),_R=$e(),yR=ga(),xR=il(),Il="ArrayBuffer",Vv=yR[Il],MR=_R[Il];vR({global:!0,constructor:!0,forced:MR!==Vv},{ArrayBuffer:Vv});xR(Il)});var Ol=L(()=>{"use strict";var SR=pn(),Nl=ya(),bR=Qe(),qv=ga(),Gv=fn(),Hv=js(),ER=mi(),Dl=qv.ArrayBuffer,Ul=qv.DataView,Xv=Ul.prototype,Wv=Nl(Dl.prototype.slice),AR=Nl(Xv.getUint8),TR=Nl(Xv.setUint8),wR=bR(function(){return!new Dl(2).slice(1,void 0).byteLength});SR({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:wR},{slice:function(e,t){if(Wv&&t===void 0)return Wv(Gv(this),e);for(var i=Gv(this).byteLength,r=Hv(e,i),s=Hv(t===void 0?i:t,i),o=new Dl(ER(s-r)),a=new Ul(this),c=new Ul(o),l=0;r<s;)TR(c,l++,AR(a,r++));return o}})});var Fl=L((PB,Zv)=>{"use strict";var $v=$e(),RR=ra(),CR=zn(),Yv=$v.ArrayBuffer,PR=$v.TypeError;Zv.exports=Yv&&RR(Yv.prototype,"byteLength","get")||function(n){if(CR(n)!=="ArrayBuffer")throw new PR("ArrayBuffer expected");return n.byteLength}});var Bl=L((IB,Jv)=>{"use strict";var IR=$e(),LR=na(),UR=Fl(),NR=IR.DataView;Jv.exports=function(n){if(!LR||UR(n)!==0)return!1;try{return new NR(n),!1}catch(e){return!0}}});var zl=L(()=>{"use strict";var DR=St(),OR=Hi(),FR=Bl(),Kv=ArrayBuffer.prototype;DR&&!("detached"in Kv)&&OR(Kv,"detached",{configurable:!0,get:function(){return FR(this)}})});var Qv=L((NB,jv)=>{"use strict";var BR=Bl(),zR=TypeError;jv.exports=function(n){if(BR(n))throw new zR("ArrayBuffer is detached");return n}});var kl=L((DB,e_)=>{"use strict";var ns=$e(),kR=Vi(),VR=zn(),wa=function(n){return kR.slice(0,n.length)===n};e_.exports=function(){return wa("Bun/")?"BUN":wa("Cloudflare-Workers")?"CLOUDFLARE":wa("Deno/")?"DENO":wa("Node.js/")?"NODE":ns.Bun&&typeof Bun.version=="string"?"BUN":ns.Deno&&typeof Deno.version=="object"?"DENO":VR(ns.process)==="process"?"NODE":ns.window&&ns.document?"BROWSER":"REST"}()});var n_=L((OB,t_)=>{"use strict";var GR=kl();t_.exports=GR==="NODE"});var r_=L((FB,i_)=>{"use strict";var HR=$e(),WR=n_();i_.exports=function(n){if(WR){try{return HR.process.getBuiltinModule(n)}catch(e){}try{return Function('return require("'+n+'")')()}catch(e){}}}});var Hl=L((BB,a_)=>{"use strict";var qR=$e(),XR=Qe(),Vl=Ns(),Gl=kl(),s_=qR.structuredClone;a_.exports=!!s_&&!XR(function(){if(Gl==="DENO"&&Vl>92||Gl==="NODE"&&Vl>94||Gl==="BROWSER"&&Vl>97)return!1;var n=new ArrayBuffer(8),e=s_(n,{transfer:[n]});return n.byteLength!==0||e.byteLength!==8})});var u_=L((zB,l_)=>{"use strict";var Yl=$e(),YR=r_(),$R=Hl(),ZR=Yl.structuredClone,o_=Yl.ArrayBuffer,Ra=Yl.MessageChannel,Xl=!1,Wl,c_,Ca,ql;if($R)Xl=function(n){ZR(n,{transfer:[n]})};else if(o_)try{Ra||(Wl=YR("worker_threads"),Wl&&(Ra=Wl.MessageChannel)),Ra&&(c_=new Ra,Ca=new o_(2),ql=function(n){c_.port1.postMessage(null,[n])},Ca.byteLength===2&&(ql(Ca),Ca.byteLength===0&&(Xl=ql)))}catch(n){}l_.exports=Xl});var Ql=L((kB,v_)=>{"use strict";var Jl=$e(),Kl=at(),p_=ra(),JR=la(),KR=Qv(),jR=Fl(),h_=u_(),$l=Hl(),QR=Jl.structuredClone,m_=Jl.ArrayBuffer,Zl=Jl.DataView,eC=Math.min,jl=m_.prototype,g_=Zl.prototype,tC=Kl(jl.slice),f_=p_(jl,"resizable","get"),d_=p_(jl,"maxByteLength","get"),nC=Kl(g_.getInt8),iC=Kl(g_.setInt8);v_.exports=($l||h_)&&function(n,e,t){var i=jR(n),r=e===void 0?i:JR(e),s=!f_||!f_(n),o;if(KR(n),$l&&(n=QR(n,{transfer:[n]}),i===r&&(t||s)))return n;if(i>=r&&(!t||s))o=tC(n,0,r);else{var a=t&&!s&&d_?{maxByteLength:d_(n)}:void 0;o=new m_(r,a);for(var c=new Zl(n),l=new Zl(o),u=eC(r,i),h=0;h<u;h++)iC(l,h,nC(c,h))}return $l||h_(n),o}});var eu=L(()=>{"use strict";var rC=pn(),__=Ql();__&&rC({target:"ArrayBuffer",proto:!0},{transfer:function(){return __(this,arguments.length?arguments[0]:void 0,!0)}})});var tu=L(()=>{"use strict";var sC=pn(),y_=Ql();y_&&sC({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return y_(this,arguments.length?arguments[0]:void 0,!1)}})});var x_=L(()=>{"use strict";var aC=pn(),oC=wt();aC({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return oC(URL.prototype.toString,this)}})});var Sy=L((jB,My)=>{"use strict";My.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}});var Ay=L((QB,Ey)=>{"use strict";var HN=Gs(),Gh=HN("span").classList,by=Gh&&Gh.constructor&&Gh.constructor.prototype;Ey.exports=by===Object.prototype?void 0:by});var wy=L((ez,Ty)=>{"use strict";var WN=_t(),qN=Ji(),XN=dn().f,Hh=WN("unscopables"),Wh=Array.prototype;Wh[Hh]===void 0&&XN(Wh,Hh,{configurable:!0,value:qN(null)});Ty.exports=function(n){Wh[Hh][n]=!0}});var $h=L((tz,Py)=>{"use strict";var YN=Qe(),$N=ut(),ZN=Rt(),JN=Ji(),Ry=Xr(),KN=pi(),jN=_t(),QN=Hr(),Yh=jN("iterator"),Cy=!1,Bn,qh,Xh;[].keys&&(Xh=[].keys(),"next"in Xh?(qh=Ry(Ry(Xh)),qh!==Object.prototype&&(Bn=qh)):Cy=!0);var eD=!ZN(Bn)||YN(function(){var n={};return Bn[Yh].call(n)!==n});eD?Bn={}:QN&&(Bn=JN(Bn));$N(Bn[Yh])||KN(Bn,Yh,function(){return this});Py.exports={IteratorPrototype:Bn,BUGGY_SAFARI_ITERATORS:Cy}});var Ly=L((nz,Iy)=>{"use strict";var tD=$h().IteratorPrototype,nD=Ji(),iD=kr(),rD=Yr(),sD=Ki(),aD=function(){return this};Iy.exports=function(n,e,t,i){var r=e+" Iterator";return n.prototype=nD(tD,{next:iD(+!i,t)}),rD(n,r,!1,!0),sD[r]=aD,n}});var Hy=L((iz,Gy)=>{"use strict";var oD=pn(),cD=wt(),Do=Hr(),ky=qs(),lD=ut(),uD=Ly(),Uy=Xr(),Ny=Wi(),hD=Yr(),fD=Sn(),Zh=pi(),dD=_t(),Dy=Ki(),Vy=$h(),pD=ky.PROPER,mD=ky.CONFIGURABLE,Oy=Vy.IteratorPrototype,Oo=Vy.BUGGY_SAFARI_ITERATORS,Es=dD("iterator"),Fy="keys",As="values",By="entries",zy=function(){return this};Gy.exports=function(n,e,t,i,r,s,o){uD(t,e,i);var a=function(p){if(p===r&&f)return f;if(!Oo&&p&&p in u)return u[p];switch(p){case Fy:return function(){return new t(this,p)};case As:return function(){return new t(this,p)};case By:return function(){return new t(this,p)}}return function(){return new t(this)}},c=e+" Iterator",l=!1,u=n.prototype,h=u[Es]||u["@@iterator"]||r&&u[r],f=!Oo&&h||a(r),m=e==="Array"&&u.entries||h,g,_,d;if(m&&(g=Uy(m.call(new n)),g!==Object.prototype&&g.next&&(!Do&&Uy(g)!==Oy&&(Ny?Ny(g,Oy):lD(g[Es])||Zh(g,Es,zy)),hD(g,c,!0,!0),Do&&(Dy[c]=zy))),pD&&r===As&&h&&h.name!==As&&(!Do&&mD?fD(u,"name",As):(l=!0,f=function(){return cD(h,this)})),r)if(_={values:a(As),keys:s?f:a(Fy),entries:a(By)},o)for(d in _)(Oo||l||!(d in u))&&Zh(u,d,_[d]);else oD({target:e,proto:!0,forced:Oo||l},_);return(!Do||o)&&u[Es]!==f&&Zh(u,Es,f,{name:r}),Dy[e]=f,_}});var qy=L((rz,Wy)=>{"use strict";Wy.exports=function(n,e){return{value:n,done:e}}});var Ky=L((sz,Jy)=>{"use strict";var gD=zi(),Jh=wy(),Xy=Ki(),$y=di(),vD=dn().f,_D=Hy(),Fo=qy(),yD=Hr(),xD=St(),Zy="Array Iterator",MD=$y.set,SD=$y.getterFor(Zy);Jy.exports=_D(Array,"Array",function(n,e){MD(this,{type:Zy,target:gD(n),index:0,kind:e})},function(){var n=SD(this),e=n.target,t=n.index++;if(!e||t>=e.length)return n.target=null,Fo(void 0,!0);switch(n.kind){case"keys":return Fo(t,!1);case"values":return Fo(e[t],!1)}return Fo([t,e[t]],!1)},"values");var Yy=Xy.Arguments=Xy.Array;Jh("keys");Jh("values");Jh("entries");if(!yD&&xD&&Yy.name!=="values")try{vD(Yy,"name",{value:"values"})}catch(n){}});var nx=L(()=>{"use strict";var jy=$e(),ex=Sy(),bD=Ay(),Ts=Ky(),Qy=Sn(),ED=Yr(),AD=_t(),Kh=AD("iterator"),jh=Ts.values,tx=function(n,e){if(n){if(n[Kh]!==jh)try{Qy(n,Kh,jh)}catch(i){n[Kh]=jh}if(ED(n,e,!0),ex[e]){for(var t in Ts)if(n[t]!==Ts[t])try{Qy(n,t,Ts[t])}catch(i){n[t]=Ts[t]}}}};for(Bo in ex)tx(jy[Bo]&&jy[Bo].prototype,Bo);var Bo;tx(bD,"DOMTokenList")});var zo=L((pz,ix)=>{"use strict";var TD=kn(),wD=String;ix.exports=function(n){if(TD(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return wD(n)}});var sx=L((mz,rx)=>{"use strict";var RD=fn();rx.exports=function(){var n=RD(this),e="";return n.hasIndices&&(e+="d"),n.global&&(e+="g"),n.ignoreCase&&(e+="i"),n.multiline&&(e+="m"),n.dotAll&&(e+="s"),n.unicode&&(e+="u"),n.unicodeSets&&(e+="v"),n.sticky&&(e+="y"),e}});var ox=L((gz,ax)=>{"use strict";var Qh=Qe(),CD=$e(),ef=CD.RegExp,tf=Qh(function(){var n=ef("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),PD=tf||Qh(function(){return!ef("a","y").sticky}),ID=tf||Qh(function(){var n=ef("^r","gy");return n.lastIndex=2,n.exec("str")!==null});ax.exports={BROKEN_CARET:ID,MISSED_STICKY:PD,UNSUPPORTED_Y:tf}});var lx=L((vz,cx)=>{"use strict";var LD=Qe(),UD=$e(),ND=UD.RegExp;cx.exports=LD(function(){var n=ND(".","s");return!(n.dotAll&&n.test(\`
175
175
  \`)&&n.flags==="s")})});var hx=L((_z,ux)=>{"use strict";var DD=Qe(),OD=$e(),FD=OD.RegExp;ux.exports=DD(function(){var n=FD("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Go=L((yz,dx)=>{"use strict";var Nr=wt(),Vo=at(),BD=zo(),zD=sx(),kD=ox(),VD=zs(),GD=Ji(),HD=di().get,WD=lx(),qD=hx(),XD=VD("native-string-replace",String.prototype.replace),ko=RegExp.prototype.exec,rf=ko,YD=Vo("".charAt),$D=Vo("".indexOf),ZD=Vo("".replace),nf=Vo("".slice),sf=function(){var n=/a/,e=/b*/g;return Nr(ko,n,"a"),Nr(ko,e,"a"),n.lastIndex!==0||e.lastIndex!==0}(),fx=kD.BROKEN_CARET,af=/()??/.exec("")[1]!==void 0,JD=sf||af||fx||WD||qD;JD&&(rf=function(e){var t=this,i=HD(t),r=BD(e),s=i.raw,o,a,c,l,u,h,f;if(s)return s.lastIndex=t.lastIndex,o=Nr(rf,s,r),t.lastIndex=s.lastIndex,o;var m=i.groups,g=fx&&t.sticky,_=Nr(zD,t),d=t.source,p=0,b=r;if(g&&(_=ZD(_,"y",""),$D(_,"g")===-1&&(_+="g"),b=nf(r,t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&YD(r,t.lastIndex-1)!==\`
176
176
  \`)&&(d="(?: "+d+")",b=" "+b,p++),a=new RegExp("^(?:"+d+")",_)),af&&(a=new RegExp("^"+d+"$(?!\\\\s)",_)),sf&&(c=t.lastIndex),l=Nr(ko,g?a:t,b),g?l?(l.input=nf(l.input,p),l[0]=nf(l[0],p),l.index=t.lastIndex,t.lastIndex+=l[0].length):t.lastIndex=0:sf&&l&&(t.lastIndex=t.global?l.index+l[0].length:c),af&&l&&l.length>1&&Nr(XD,l[0],a,function(){for(u=1;u<arguments.length-2;u++)arguments[u]===void 0&&(l[u]=void 0)}),l&&m)for(l.groups=h=GD(null),u=0;u<m.length;u++)f=m[u],h[f[0]]=l[f[1]];return l});dx.exports=rf});var of=L(()=>{"use strict";var KD=pn(),px=Go();KD({target:"RegExp",proto:!0,forced:/./.exec!==px},{exec:px})});var yx=L((Sz,_x)=>{"use strict";var jD=zr(),vx=Function.prototype,mx=vx.apply,gx=vx.call;_x.exports=typeof Reflect=="object"&&Reflect.apply||(jD?gx.bind(mx):function(){return gx.apply(mx,arguments)})});var Ax=L((bz,Ex)=>{"use strict";of();var xx=wt(),Mx=pi(),QD=Go(),Sx=Qe(),bx=_t(),eO=Sn(),tO=bx("species"),cf=RegExp.prototype;Ex.exports=function(n,e,t,i){var r=bx(n),s=!Sx(function(){var l={};return l[r]=function(){return 7},""[n](l)!==7}),o=s&&!Sx(function(){var l=!1,u=/a/;return n==="split"&&(u={},u.constructor={},u.constructor[tO]=function(){return u},u.flags="",u[r]=/./[r]),u.exec=function(){return l=!0,null},u[r](""),!l});if(!s||!o||t){var a=/./[r],c=e(r,""[n],function(l,u,h,f,m){var g=u.exec;return g===QD||g===cf.exec?s&&!m?{done:!0,value:xx(a,u,h,f)}:{done:!0,value:xx(l,h,u,f)}:{done:!1}});Mx(String.prototype,n,c[0]),Mx(cf,r,c[1])}i&&eO(cf[r],"sham",!0)}});var Cx=L((Ez,Rx)=>{"use strict";var lf=at(),nO=jt(),iO=zo(),rO=Bi(),sO=lf("".charAt),Tx=lf("".charCodeAt),aO=lf("".slice),wx=function(n){return function(e,t){var i=iO(rO(e)),r=nO(t),s=i.length,o,a;return r<0||r>=s?n?"":void 0:(o=Tx(i,r),o<55296||o>56319||r+1===s||(a=Tx(i,r+1))<56320||a>57343?n?sO(i,r):o:n?aO(i,r,r+2):(o-55296<<10)+(a-56320)+65536)}};Rx.exports={codeAt:wx(!1),charAt:wx(!0)}});var Ix=L((Az,Px)=>{"use strict";var oO=Cx().charAt;Px.exports=function(n,e,t){return e+(t?oO(n,e).length:1)}});var Ux=L((Tz,Lx)=>{"use strict";var ff=at(),cO=hn(),lO=Math.floor,uf=ff("".charAt),uO=ff("".replace),hf=ff("".slice),hO=/\\$([$&'\`]|\\d{1,2}|<[^>]*>)/g,fO=/\\$([$&'\`]|\\d{1,2})/g;Lx.exports=function(n,e,t,i,r,s){var o=t+n.length,a=i.length,c=fO;return r!==void 0&&(r=cO(r),c=hO),uO(s,c,function(l,u){var h;switch(uf(u,0)){case"$":return"$";case"&":return n;case"\`":return hf(e,0,t);case"'":return hf(e,o);case"<":h=r[hf(u,1,-1)];break;default:var f=+u;if(f===0)return l;if(f>a){var m=lO(f/10);return m===0?l:m<=a?i[m-1]===void 0?uf(u,1):i[m-1]+uf(u,1):l}h=i[f-1]}return h===void 0?"":h})}});var Ox=L((wz,Dx)=>{"use strict";var Nx=wt(),dO=fn(),pO=ut(),mO=zn(),gO=Go(),vO=TypeError;Dx.exports=function(n,e){var t=n.exec;if(pO(t)){var i=Nx(t,n,e);return i!==null&&dO(i),i}if(mO(n)==="RegExp")return Nx(gO,n,e);throw new vO("RegExp#exec called on incompatible receiver")}});var Vx=L(()=>{"use strict";var _O=yx(),Fx=wt(),Ho=at(),yO=Ax(),xO=Qe(),MO=fn(),SO=ut(),bO=Rt(),EO=jt(),AO=mi(),Dr=zo(),TO=Bi(),wO=Ix(),RO=Os(),CO=Ux(),PO=Ox(),IO=_t(),pf=IO("replace"),LO=Math.max,UO=Math.min,NO=Ho([].concat),df=Ho([].push),Bx=Ho("".indexOf),zx=Ho("".slice),DO=function(n){return n===void 0?n:String(n)},OO=function(){return"a".replace(/./,"$0")==="$0"}(),kx=function(){return/./[pf]?/./[pf]("a","$0")==="":!1}(),FO=!xO(function(){var n=/./;return n.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(n,"$<a>")!=="7"});yO("replace",function(n,e,t){var i=kx?"$":"$0";return[function(s,o){var a=TO(this),c=bO(s)?RO(s,pf):void 0;return c?Fx(c,s,a,o):Fx(e,Dr(a),s,o)},function(r,s){var o=MO(this),a=Dr(r);if(typeof s=="string"&&Bx(s,i)===-1&&Bx(s,"$<")===-1){var c=t(e,o,a,s);if(c.done)return c.value}var l=SO(s);l||(s=Dr(s));var u=o.global,h;u&&(h=o.unicode,o.lastIndex=0);for(var f=[],m;m=PO(o,a),!(m===null||(df(f,m),!u));){var g=Dr(m[0]);g===""&&(o.lastIndex=wO(a,AO(o.lastIndex),h))}for(var _="",d=0,p=0;p<f.length;p++){m=f[p];for(var b=Dr(m[0]),v=LO(UO(EO(m.index),a.length),0),E=[],I,R=1;R<m.length;R++)df(E,DO(m[R]));var w=m.groups;if(l){var B=NO([b],E,v,a);w!==void 0&&df(B,w),I=Dr(_O(s,void 0,B))}else I=CO(b,a,v,E,w,s);v>=d&&(_+=zx(a,d,v)+I,d=v+b.length)}return _+zx(a,d)}]},!FO||!OO||kx)});var ck=We(ta(),1),lk=We(dl(),1),uk=We(pl(),1),hk=We(ml(),1),fk=We(vl(),1),dk=We(_l(),1),pk=We(Sl(),1),mk=We(Al(),1),gk=We(wl(),1),vk=We(Rl(),1),_k=We(Pl(),1),yk=We(Ll(),1),xk=We(Ol(),1),Mk=We(zl(),1),Sk=We(eu(),1),bk=We(tu(),1),Ek=We(x_(),1);var Dh="162";var cC=0,M_=1,lC=2;var J0=1,uC=2,In=3,si=0,Dt=1,Un=2,ti=0,Mr=1,S_=2,b_=3,E_=4,hC=5,Ai=100,fC=101,dC=102,A_=103,T_=104,pC=200,mC=201,gC=202,vC=203,zu=204,ku=205,_C=206,yC=207,xC=208,MC=209,SC=210,bC=211,EC=212,AC=213,TC=214,wC=0,RC=1,CC=2,ro=3,PC=4,IC=5,LC=6,UC=7,K0=0,NC=1,DC=2,ni=0,OC=1,FC=2,BC=3,zC=4,kC=5,VC=6,GC=7;var j0=300,Er=301,Ar=302,Vu=303,Gu=304,Io=306,Hu=1e3,sn=1001,Wu=1002,Lt=1003,w_=1004;var is=1005;var Nt=1006,nu=1007;var wi=1008;var ii=1009,HC=1010,WC=1011,Oh=1012,Q0=1013,ei=1014,Nn=1015,ps=1016,ey=1017,ty=1018,Pi=1020,qC=1021,an=1023,XC=1024,YC=1025,Ii=1026,Tr=1027,$C=1028,ny=1029,ZC=1030,iy=1031,ry=1033,iu=33776,ru=33777,su=33778,au=33779,R_=35840,C_=35841,P_=35842,I_=35843,sy=36196,L_=37492,U_=37496,N_=37808,D_=37809,O_=37810,F_=37811,B_=37812,z_=37813,k_=37814,V_=37815,G_=37816,H_=37817,W_=37818,q_=37819,X_=37820,Y_=37821,ou=36492,$_=36494,Z_=36495,JC=36283,J_=36284,K_=36285,j_=36286;var so=2300,ao=2301,cu=2302,Q_=2400,e0=2401,t0=2402;var KC=3200,jC=3201,QC=0,eP=1,Qn="",vn="srgb",ci="srgb-linear",Fh="display-p3",Lo="display-p3-linear",oo="linear",et="srgb",co="rec709",lo="p3";var Qi=7680;var n0=519,tP=512,nP=513,iP=514,ay=515,rP=516,sP=517,aP=518,oP=519,qu=35044;var i0="300 es",Xu=1035,Dn=2e3,uo=2001,ai=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let r=this._listeners[e];if(r!==void 0){let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}},bt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var lu=Math.PI/180,Yu=180/Math.PI;function On(){let n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(bt[n&255]+bt[n>>8&255]+bt[n>>16&255]+bt[n>>24&255]+"-"+bt[e&255]+bt[e>>8&255]+"-"+bt[e>>16&15|64]+bt[e>>24&255]+"-"+bt[t&63|128]+bt[t>>8&255]+"-"+bt[t>>16&255]+bt[t>>24&255]+bt[i&255]+bt[i>>8&255]+bt[i>>16&255]+bt[i>>24&255]).toLowerCase()}function At(n,e,t){return Math.max(e,Math.min(t,n))}function cP(n,e){return(n%e+e)%e}function uu(n,e,t){return(1-t)*n+t*e}function r0(n){return(n&n-1)===0&&n!==0}function $u(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function yn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ze(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}var ie=class n{constructor(e=0,t=0){n.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){let t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[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){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(At(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,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){let i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},ze=class n{constructor(e,t,i,r,s,o,a,c,l){n.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,c,l)}set(e,t,i,r,s,o,a,c,l){let u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=c,u[6]=i,u[7]=o,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let 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){let i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],c=i[6],l=i[1],u=i[4],h=i[7],f=i[2],m=i[5],g=i[8],_=r[0],d=r[3],p=r[6],b=r[1],v=r[4],E=r[7],I=r[2],R=r[5],w=r[8];return s[0]=o*_+a*b+c*I,s[3]=o*d+a*v+c*R,s[6]=o*p+a*E+c*w,s[1]=l*_+u*b+h*I,s[4]=l*d+u*v+h*R,s[7]=l*p+u*E+h*w,s[2]=f*_+m*b+g*I,s[5]=f*d+m*v+g*R,s[8]=f*p+m*E+g*w,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8];return t*o*u-t*a*l-i*s*u+i*a*c+r*s*l-r*o*c}invert(){let e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=u*o-a*l,f=a*c-u*s,m=l*s-o*c,g=t*h+i*f+r*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);let _=1/g;return e[0]=h*_,e[1]=(r*l-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=f*_,e[4]=(u*t-r*c)*_,e[5]=(r*s-a*t)*_,e[6]=m*_,e[7]=(i*c-l*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e,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){let 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,i,r,s,o,a){let c=Math.cos(s),l=Math.sin(s);return this.set(i*c,i*l,-i*(c*o+l*a)+o+e,-r*l,r*c,-r*(-l*o+c*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(hu.makeScale(e,t)),this}rotate(e){return this.premultiply(hu.makeRotation(-e)),this}translate(e,t){return this.premultiply(hu.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){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},hu=new ze;function oy(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function ho(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function lP(){let n=ho("canvas");return n.style.display="block",n}var s0={};function cy(n){n in s0||(s0[n]=!0,console.warn(n))}var a0=new ze().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),o0=new ze().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Pa={[ci]:{transfer:oo,primaries:co,toReference:n=>n,fromReference:n=>n},[vn]:{transfer:et,primaries:co,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Lo]:{transfer:oo,primaries:lo,toReference:n=>n.applyMatrix3(o0),fromReference:n=>n.applyMatrix3(a0)},[Fh]:{transfer:et,primaries:lo,toReference:n=>n.convertSRGBToLinear().applyMatrix3(o0),fromReference:n=>n.applyMatrix3(a0).convertLinearToSRGB()}},uP=new Set([ci,Lo]),Je={enabled:!0,_workingColorSpace:ci,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!uP.has(n))throw new Error(\`Unsupported working color space, "\${n}".\`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;let i=Pa[e].toReference,r=Pa[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Pa[n].primaries},getTransfer:function(n){return n===Qn?oo:Pa[n].transfer}};function Sr(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function fu(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}var er,fo=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{er===void 0&&(er=ho("canvas")),er.width=e.width,er.height=e.height;let i=er.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=er}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(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){let t=ho("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Sr(s[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){let t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(Sr(t[i]/255)*255):t[i]=Sr(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},hP=0,po=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hP++}),this.uuid=On(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,a=r.length;o<a;o++)r[o].isDataTexture?s.push(du(r[o].image)):s.push(du(r[o]))}else s=du(r);i.url=s}return t||(e.images[this.uuid]=i),i}};function du(n){return typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap?fo.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var fP=0,$t=class n extends ai{constructor(e=n.DEFAULT_IMAGE,t=n.DEFAULT_MAPPING,i=sn,r=sn,s=Nt,o=wi,a=an,c=ii,l=n.DEFAULT_ANISOTROPY,u=Qn){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:fP++}),this.uuid=On(),this.name="",this.source=new po(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=c,this.offset=new ie(0,0),this.repeat=new ie(1,1),this.center=new ie(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ze,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==j0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Hu:e.x=e.x-Math.floor(e.x);break;case sn:e.x=e.x<0?0:1;break;case Wu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Hu:e.y=e.y-Math.floor(e.y);break;case sn:e.y=e.y<0?0:1;break;case Wu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}};$t.DEFAULT_IMAGE=null;$t.DEFAULT_MAPPING=j0;$t.DEFAULT_ANISOTROPY=1;var yt=class n{constructor(e=0,t=0,i=0,r=1){n.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}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,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,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=e.w!==void 0?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){let t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let 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,i,r,s,c=e.elements,l=c[0],u=c[4],h=c[8],f=c[1],m=c[5],g=c[9],_=c[2],d=c[6],p=c[10];if(Math.abs(u-f)<.01&&Math.abs(h-_)<.01&&Math.abs(g-d)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+_)<.1&&Math.abs(g+d)<.1&&Math.abs(l+m+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let v=(l+1)/2,E=(m+1)/2,I=(p+1)/2,R=(u+f)/4,w=(h+_)/4,B=(g+d)/4;return v>E&&v>I?v<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(v),r=R/i,s=w/i):E>I?E<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(E),i=R/r,s=B/r):I<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(I),i=w/s,r=B/s),this.set(i,r,s,t),this}let b=Math.sqrt((d-g)*(d-g)+(h-_)*(h-_)+(f-u)*(f-u));return Math.abs(b)<.001&&(b=1),this.x=(d-g)/b,this.y=(h-_)/b,this.z=(f-u)/b,this.w=Math.acos((l+m+p-1)/2),this}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.w=Math.min(this.w,e.w),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.w=Math.max(this.w,e.w),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.w=Math.max(e.w,Math.min(t.w,this.w)),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.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,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)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(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.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}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}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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Zu=class extends ai{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new yt(0,0,e,t),this.scissorTest=!1,this.viewport=new yt(0,0,e,t);let r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Nt,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let s=new $t(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,r=e.textures.length;i<r;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new po(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Fn=class extends Zu{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}},mo=class extends $t{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Lt,this.minFilter=Lt,this.wrapR=sn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Ju=class extends $t{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Lt,this.minFilter=Lt,this.wrapR=sn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var oi=class{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,o,a){let c=i[r+0],l=i[r+1],u=i[r+2],h=i[r+3],f=s[o+0],m=s[o+1],g=s[o+2],_=s[o+3];if(a===0){e[t+0]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h;return}if(a===1){e[t+0]=f,e[t+1]=m,e[t+2]=g,e[t+3]=_;return}if(h!==_||c!==f||l!==m||u!==g){let d=1-a,p=c*f+l*m+u*g+h*_,b=p>=0?1:-1,v=1-p*p;if(v>Number.EPSILON){let I=Math.sqrt(v),R=Math.atan2(I,p*b);d=Math.sin(d*R)/I,a=Math.sin(a*R)/I}let E=a*b;if(c=c*d+f*E,l=l*d+m*E,u=u*d+g*E,h=h*d+_*E,d===1-a){let I=1/Math.sqrt(c*c+l*l+u*u+h*h);c*=I,l*=I,u*=I,h*=I}}e[t]=c,e[t+1]=l,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){let a=i[r],c=i[r+1],l=i[r+2],u=i[r+3],h=s[o],f=s[o+1],m=s[o+2],g=s[o+3];return e[t]=a*g+u*h+c*m-l*f,e[t+1]=c*g+u*f+l*h-a*m,e[t+2]=l*g+u*m+a*f-c*h,e[t+3]=u*g-a*h-c*f-l*m,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,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,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){let i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(i/2),u=a(r/2),h=a(s/2),f=c(i/2),m=c(r/2),g=c(s/2);switch(o){case"XYZ":this._x=f*u*h+l*m*g,this._y=l*m*h-f*u*g,this._z=l*u*g+f*m*h,this._w=l*u*h-f*m*g;break;case"YXZ":this._x=f*u*h+l*m*g,this._y=l*m*h-f*u*g,this._z=l*u*g-f*m*h,this._w=l*u*h+f*m*g;break;case"ZXY":this._x=f*u*h-l*m*g,this._y=l*m*h+f*u*g,this._z=l*u*g+f*m*h,this._w=l*u*h-f*m*g;break;case"ZYX":this._x=f*u*h-l*m*g,this._y=l*m*h+f*u*g,this._z=l*u*g-f*m*h,this._w=l*u*h+f*m*g;break;case"YZX":this._x=f*u*h+l*m*g,this._y=l*m*h+f*u*g,this._z=l*u*g-f*m*h,this._w=l*u*h-f*m*g;break;case"XZY":this._x=f*u*h-l*m*g,this._y=l*m*h-f*u*g,this._z=l*u*g+f*m*h,this._w=l*u*h+f*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],c=t[9],l=t[2],u=t[6],h=t[10],f=i+a+h;if(f>0){let m=.5/Math.sqrt(f+1);this._w=.25/m,this._x=(u-c)*m,this._y=(s-l)*m,this._z=(o-r)*m}else if(i>a&&i>h){let m=2*Math.sqrt(1+i-a-h);this._w=(u-c)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+l)/m}else if(a>h){let m=2*Math.sqrt(1+a-i-h);this._w=(s-l)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(c+u)/m}else{let m=2*Math.sqrt(1+h-i-a);this._w=(o-r)/m,this._x=(s+l)/m,this._y=(c+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(At(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(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 e===0?(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){let i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,c=t._y,l=t._z,u=t._w;return this._x=i*u+o*a+r*l-s*c,this._y=r*u+o*c+s*a-i*l,this._z=s*u+o*l+i*c-r*a,this._w=o*u-i*a-r*c-s*l,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,r=this._y,s=this._z,o=this._w,a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;let c=1-a*a;if(c<=Number.EPSILON){let m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}let l=Math.sqrt(c),u=Math.atan2(l,a),h=Math.sin((1-t)*u)/l,f=Math.sin(t*u)/l;return this._w=o*h+this._w*f,this._x=i*h+this._x*f,this._y=r*h+this._y*f,this._z=s*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*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}},U=class n{constructor(e=0,t=0,i=0){n.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,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(c0.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(c0.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,c=e.w,l=2*(o*r-a*i),u=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+c*l+o*h-a*u,this.y=i+c*u+a*l-s*h,this.z=r+c*h+s*u-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,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){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,c=t.z;return this.x=r*c-s*a,this.y=s*o-i*c,this.z=i*a-r*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return pu.copy(this).projectOnVector(e),this.sub(pu)}reflect(e){return this.sub(pu.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(At(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}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,i){let r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}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(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},pu=new U,c0=new oi,Li=class{constructor(e=new U(1/0,1/0,1/0),t=new U(-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,i=e.length;t<i;t+=3)this.expandByPoint(tn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(tn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=tn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(i!==void 0){let s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,tn):tn.fromBufferAttribute(s,o),tn.applyMatrix4(e.matrixWorld),this.expandByPoint(tn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Ia.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Ia.copy(i.boundingBox)),Ia.applyMatrix4(e.matrixWorld),this.union(Ia)}let r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return!(e.x<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,tn),tn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(rs),La.subVectors(this.max,rs),tr.subVectors(e.a,rs),nr.subVectors(e.b,rs),ir.subVectors(e.c,rs),Xn.subVectors(nr,tr),Yn.subVectors(ir,nr),_i.subVectors(tr,ir);let t=[0,-Xn.z,Xn.y,0,-Yn.z,Yn.y,0,-_i.z,_i.y,Xn.z,0,-Xn.x,Yn.z,0,-Yn.x,_i.z,0,-_i.x,-Xn.y,Xn.x,0,-Yn.y,Yn.x,0,-_i.y,_i.x,0];return!mu(t,tr,nr,ir,La)||(t=[1,0,0,0,1,0,0,0,1],!mu(t,tr,nr,ir,La))?!1:(Ua.crossVectors(Xn,Yn),t=[Ua.x,Ua.y,Ua.z],mu(t,tr,nr,ir,La))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,tn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(tn).length()*.5),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()?this:(Tn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Tn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Tn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Tn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Tn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Tn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Tn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Tn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Tn),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)}},Tn=[new U,new U,new U,new U,new U,new U,new U,new U],tn=new U,Ia=new Li,tr=new U,nr=new U,ir=new U,Xn=new U,Yn=new U,_i=new U,rs=new U,La=new U,Ua=new U,yi=new U;function mu(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){yi.fromArray(n,s);let a=r.x*Math.abs(yi.x)+r.y*Math.abs(yi.y)+r.z*Math.abs(yi.z),c=e.dot(yi),l=t.dot(yi),u=i.dot(yi);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>a)return!1}return!0}var dP=new Li,ss=new U,gu=new U,ms=class{constructor(e=new U,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){let i=this.center;t!==void 0?i.copy(t):dP.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.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;ss.subVectors(e,this.center);let t=ss.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(ss,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(gu.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ss.copy(e.center).add(gu)),this.expandByPoint(ss.copy(e.center).sub(gu))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},wn=new U,vu=new U,Na=new U,$n=new U,_u=new U,Da=new U,yu=new U,Ku=class{constructor(e=new U,t=new U(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,wn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=wn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(wn.copy(this.origin).addScaledVector(this.direction,t),wn.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){vu.copy(e).add(t).multiplyScalar(.5),Na.copy(t).sub(e).normalize(),$n.copy(this.origin).sub(vu);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Na),a=$n.dot(this.direction),c=-$n.dot(Na),l=$n.lengthSq(),u=Math.abs(1-o*o),h,f,m,g;if(u>0)if(h=o*c-a,f=o*a-c,g=s*u,h>=0)if(f>=-g)if(f<=g){let _=1/u;h*=_,f*=_,m=h*(h+o*f+2*a)+f*(o*h+f+2*c)+l}else f=s,h=Math.max(0,-(o*f+a)),m=-h*h+f*(f+2*c)+l;else f=-s,h=Math.max(0,-(o*f+a)),m=-h*h+f*(f+2*c)+l;else f<=-g?(h=Math.max(0,-(-o*s+a)),f=h>0?-s:Math.min(Math.max(-s,-c),s),m=-h*h+f*(f+2*c)+l):f<=g?(h=0,f=Math.min(Math.max(-s,-c),s),m=f*(f+2*c)+l):(h=Math.max(0,-(o*s+a)),f=h>0?s:Math.min(Math.max(-s,-c),s),m=-h*h+f*(f+2*c)+l);else f=o>0?-s:s,h=Math.max(0,-(o*f+a)),m=-h*h+f*(f+2*c)+l;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(vu).addScaledVector(Na,f),m}intersectSphere(e,t){wn.subVectors(e.center,this.origin);let i=wn.dot(this.direction),r=wn.dot(wn)-i*i,s=e.radius*e.radius;if(r>s)return null;let o=Math.sqrt(s-r),a=i-o,c=i+o;return c<0?null:a<0?this.at(c,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,c,l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return l>=0?(i=(e.min.x-f.x)*l,r=(e.max.x-f.x)*l):(i=(e.max.x-f.x)*l,r=(e.min.x-f.x)*l),u>=0?(s=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),h>=0?(a=(e.min.z-f.z)*h,c=(e.max.z-f.z)*h):(a=(e.max.z-f.z)*h,c=(e.min.z-f.z)*h),i>c||a>r)||((a>i||i!==i)&&(i=a),(c<r||r!==r)&&(r=c),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,wn)!==null}intersectTriangle(e,t,i,r,s){_u.subVectors(t,e),Da.subVectors(i,e),yu.crossVectors(_u,Da);let o=this.direction.dot(yu),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;$n.subVectors(this.origin,e);let c=a*this.direction.dot(Da.crossVectors($n,Da));if(c<0)return null;let l=a*this.direction.dot(_u.cross($n));if(l<0||c+l>o)return null;let u=-a*$n.dot(yu);return u<0?null:this.at(u/o,s)}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)}},ft=class n{constructor(e,t,i,r,s,o,a,c,l,u,h,f,m,g,_,d){n.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,c,l,u,h,f,m,g,_,d)}set(e,t,i,r,s,o,a,c,l,u,h,f,m,g,_,d){let p=this.elements;return p[0]=e,p[4]=t,p[8]=i,p[12]=r,p[1]=s,p[5]=o,p[9]=a,p[13]=c,p[2]=l,p[6]=u,p[10]=h,p[14]=f,p[3]=m,p[7]=g,p[11]=_,p[15]=d,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 n().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let 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,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,r=1/rr.setFromMatrixColumn(e,0).length(),s=1/rr.setFromMatrixColumn(e,1).length(),o=1/rr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),c=Math.cos(r),l=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let f=o*u,m=o*h,g=a*u,_=a*h;t[0]=c*u,t[4]=-c*h,t[8]=l,t[1]=m+g*l,t[5]=f-_*l,t[9]=-a*c,t[2]=_-f*l,t[6]=g+m*l,t[10]=o*c}else if(e.order==="YXZ"){let f=c*u,m=c*h,g=l*u,_=l*h;t[0]=f+_*a,t[4]=g*a-m,t[8]=o*l,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=m*a-g,t[6]=_+f*a,t[10]=o*c}else if(e.order==="ZXY"){let f=c*u,m=c*h,g=l*u,_=l*h;t[0]=f-_*a,t[4]=-o*h,t[8]=g+m*a,t[1]=m+g*a,t[5]=o*u,t[9]=_-f*a,t[2]=-o*l,t[6]=a,t[10]=o*c}else if(e.order==="ZYX"){let f=o*u,m=o*h,g=a*u,_=a*h;t[0]=c*u,t[4]=g*l-m,t[8]=f*l+_,t[1]=c*h,t[5]=_*l+f,t[9]=m*l-g,t[2]=-l,t[6]=a*c,t[10]=o*c}else if(e.order==="YZX"){let f=o*c,m=o*l,g=a*c,_=a*l;t[0]=c*u,t[4]=_-f*h,t[8]=g*h+m,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-l*u,t[6]=m*h+g,t[10]=f-_*h}else if(e.order==="XZY"){let f=o*c,m=o*l,g=a*c,_=a*l;t[0]=c*u,t[4]=-h,t[8]=l*u,t[1]=f*h+_,t[5]=o*u,t[9]=m*h-g,t[2]=g*h-m,t[6]=a*u,t[10]=_*h+f}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(pP,e,mP)}lookAt(e,t,i){let r=this.elements;return kt.subVectors(e,t),kt.lengthSq()===0&&(kt.z=1),kt.normalize(),Zn.crossVectors(i,kt),Zn.lengthSq()===0&&(Math.abs(i.z)===1?kt.x+=1e-4:kt.z+=1e-4,kt.normalize(),Zn.crossVectors(i,kt)),Zn.normalize(),Oa.crossVectors(kt,Zn),r[0]=Zn.x,r[4]=Oa.x,r[8]=kt.x,r[1]=Zn.y,r[5]=Oa.y,r[9]=kt.y,r[2]=Zn.z,r[6]=Oa.z,r[10]=kt.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],c=i[8],l=i[12],u=i[1],h=i[5],f=i[9],m=i[13],g=i[2],_=i[6],d=i[10],p=i[14],b=i[3],v=i[7],E=i[11],I=i[15],R=r[0],w=r[4],B=r[8],j=r[12],x=r[1],A=r[5],re=r[9],K=r[13],C=r[2],W=r[6],G=r[10],$=r[14],q=r[3],X=r[7],ne=r[11],te=r[15];return s[0]=o*R+a*x+c*C+l*q,s[4]=o*w+a*A+c*W+l*X,s[8]=o*B+a*re+c*G+l*ne,s[12]=o*j+a*K+c*$+l*te,s[1]=u*R+h*x+f*C+m*q,s[5]=u*w+h*A+f*W+m*X,s[9]=u*B+h*re+f*G+m*ne,s[13]=u*j+h*K+f*$+m*te,s[2]=g*R+_*x+d*C+p*q,s[6]=g*w+_*A+d*W+p*X,s[10]=g*B+_*re+d*G+p*ne,s[14]=g*j+_*K+d*$+p*te,s[3]=b*R+v*x+E*C+I*q,s[7]=b*w+v*A+E*W+I*X,s[11]=b*B+v*re+E*G+I*ne,s[15]=b*j+v*K+E*$+I*te,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],c=e[9],l=e[13],u=e[2],h=e[6],f=e[10],m=e[14],g=e[3],_=e[7],d=e[11],p=e[15];return g*(+s*c*h-r*l*h-s*a*f+i*l*f+r*a*m-i*c*m)+_*(+t*c*m-t*l*f+s*o*f-r*o*m+r*l*u-s*c*u)+d*(+t*l*h-t*a*m-s*o*h+i*o*m+s*a*u-i*l*u)+p*(-r*a*u-t*c*h+t*a*f+r*o*h-i*o*f+i*c*u)}transpose(){let e=this.elements,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,i){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=e[9],f=e[10],m=e[11],g=e[12],_=e[13],d=e[14],p=e[15],b=h*d*l-_*f*l+_*c*m-a*d*m-h*c*p+a*f*p,v=g*f*l-u*d*l-g*c*m+o*d*m+u*c*p-o*f*p,E=u*_*l-g*h*l+g*a*m-o*_*m-u*a*p+o*h*p,I=g*h*c-u*_*c-g*a*f+o*_*f+u*a*d-o*h*d,R=t*b+i*v+r*E+s*I;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/R;return e[0]=b*w,e[1]=(_*f*s-h*d*s-_*r*m+i*d*m+h*r*p-i*f*p)*w,e[2]=(a*d*s-_*c*s+_*r*l-i*d*l-a*r*p+i*c*p)*w,e[3]=(h*c*s-a*f*s-h*r*l+i*f*l+a*r*m-i*c*m)*w,e[4]=v*w,e[5]=(u*d*s-g*f*s+g*r*m-t*d*m-u*r*p+t*f*p)*w,e[6]=(g*c*s-o*d*s-g*r*l+t*d*l+o*r*p-t*c*p)*w,e[7]=(o*f*s-u*c*s+u*r*l-t*f*l-o*r*m+t*c*m)*w,e[8]=E*w,e[9]=(g*h*s-u*_*s-g*i*m+t*_*m+u*i*p-t*h*p)*w,e[10]=(o*_*s-g*a*s+g*i*l-t*_*l-o*i*p+t*a*p)*w,e[11]=(u*a*s-o*h*s-u*i*l+t*h*l+o*i*m-t*a*m)*w,e[12]=I*w,e[13]=(u*_*r-g*h*r+g*i*f-t*_*f-u*i*d+t*h*d)*w,e[14]=(g*a*r-o*_*r-g*i*c+t*_*c+o*i*d-t*a*d)*w,e[15]=(o*h*r-u*a*r+u*i*c-t*h*c-o*i*f+t*a*f)*w,this}scale(e){let t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){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,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,c=e.z,l=s*o,u=s*a;return this.set(l*o+i,l*a-r*c,l*c+r*a,0,l*a+r*c,u*a+i,u*c-r*o,0,l*c-r*a,u*c+r*o,s*c*c+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){let r=this.elements,s=t._x,o=t._y,a=t._z,c=t._w,l=s+s,u=o+o,h=a+a,f=s*l,m=s*u,g=s*h,_=o*u,d=o*h,p=a*h,b=c*l,v=c*u,E=c*h,I=i.x,R=i.y,w=i.z;return r[0]=(1-(_+p))*I,r[1]=(m+E)*I,r[2]=(g-v)*I,r[3]=0,r[4]=(m-E)*R,r[5]=(1-(f+p))*R,r[6]=(d+b)*R,r[7]=0,r[8]=(g+v)*w,r[9]=(d-b)*w,r[10]=(1-(f+_))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){let r=this.elements,s=rr.set(r[0],r[1],r[2]).length(),o=rr.set(r[4],r[5],r[6]).length(),a=rr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],nn.copy(this);let l=1/s,u=1/o,h=1/a;return nn.elements[0]*=l,nn.elements[1]*=l,nn.elements[2]*=l,nn.elements[4]*=u,nn.elements[5]*=u,nn.elements[6]*=u,nn.elements[8]*=h,nn.elements[9]*=h,nn.elements[10]*=h,t.setFromRotationMatrix(nn),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Dn){let c=this.elements,l=2*s/(t-e),u=2*s/(i-r),h=(t+e)/(t-e),f=(i+r)/(i-r),m,g;if(a===Dn)m=-(o+s)/(o-s),g=-2*o*s/(o-s);else if(a===uo)m=-o/(o-s),g=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=l,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=m,c[14]=g,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Dn){let c=this.elements,l=1/(t-e),u=1/(i-r),h=1/(o-s),f=(t+e)*l,m=(i+r)*u,g,_;if(a===Dn)g=(o+s)*h,_=-2*h;else if(a===uo)g=s*h,_=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*l,c[4]=0,c[8]=0,c[12]=-f,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-m,c[2]=0,c[6]=0,c[10]=_,c[14]=-g,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},rr=new U,nn=new ft,pP=new U(0,0,0),mP=new U(1,1,1),Zn=new U,Oa=new U,kt=new U,l0=new ft,u0=new oi,Ui=class n{constructor(e=0,t=0,i=0,r=n.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}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,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,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,i=!0){let r=e.elements,s=r[0],o=r[4],a=r[8],c=r[1],l=r[5],u=r[9],h=r[2],f=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(At(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,l),this._z=0);break;case"YXZ":this._x=Math.asin(-At(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(At(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,m),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-At(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,m),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(At(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-At(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,l),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return l0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(l0,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return u0.setFromEuler(this),this.setFromQuaternion(u0,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],e[3]!==void 0&&(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}};Ui.DEFAULT_ORDER="XYZ";var go=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},gP=0,h0=new U,sr=new oi,Rn=new ft,Fa=new U,as=new U,vP=new U,_P=new oi,f0=new U(1,0,0),d0=new U(0,1,0),p0=new U(0,0,1),yP={type:"added"},xP={type:"removed"},xu={type:"childadded",child:null},Mu={type:"childremoved",child:null},cn=class n extends ai{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:gP++}),this.uuid=On(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=n.DEFAULT_UP.clone();let e=new U,t=new Ui,i=new oi,r=new U(1,1,1);function s(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new ft},normalMatrix:{value:new ze}}),this.matrix=new ft,this.matrixWorld=new ft,this.matrixAutoUpdate=n.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=n.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new go,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return sr.setFromAxisAngle(e,t),this.quaternion.multiply(sr),this}rotateOnWorldAxis(e,t){return sr.setFromAxisAngle(e,t),this.quaternion.premultiply(sr),this}rotateX(e){return this.rotateOnAxis(f0,e)}rotateY(e){return this.rotateOnAxis(d0,e)}rotateZ(e){return this.rotateOnAxis(p0,e)}translateOnAxis(e,t){return h0.copy(e).applyQuaternion(this.quaternion),this.position.add(h0.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(f0,e)}translateY(e){return this.translateOnAxis(d0,e)}translateZ(e){return this.translateOnAxis(p0,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Rn.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Fa.copy(e):Fa.set(e,t,i);let r=this.parent;this.updateWorldMatrix(!0,!1),as.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rn.lookAt(as,Fa,this.up):Rn.lookAt(Fa,as,this.up),this.quaternion.setFromRotationMatrix(Rn),r&&(Rn.extractRotation(r.matrixWorld),sr.setFromRotationMatrix(Rn),this.quaternion.premultiply(sr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(yP),xu.child=e,this.dispatchEvent(xu),xu.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(xP),Mu.child=e,this.dispatchEvent(Mu),Mu.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Rn.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Rn.multiply(e.parent.matrixWorld)),e.applyMatrix4(Rn),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){let o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);let r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(as,e,vP),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(as,_P,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,r=t.length;i<r;i++){let s=t[i];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){let i=this.parent;if(e===!0&&i!==null&&i.matrixWorldAutoUpdate===!0&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){let r=this.children;for(let s=0,o=r.length;s<o;s++){let a=r[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(e){let t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,c){return a[c.uuid]===void 0&&(a[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let c=a.shapes;if(Array.isArray(c))for(let l=0,u=c.length;l<u;l++){let h=c[l];s(e.shapes,h)}else s(e.shapes,c)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let c=0,l=this.material.length;c<l;c++)a.push(s(e.materials,this.material[c]));r.material=a}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let a=0;a<this.children.length;a++)r.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let a=0;a<this.animations.length;a++){let c=this.animations[a];r.animations.push(s(e.animations,c))}}if(t){let a=o(e.geometries),c=o(e.materials),l=o(e.textures),u=o(e.images),h=o(e.shapes),f=o(e.skeletons),m=o(e.animations),g=o(e.nodes);a.length>0&&(i.geometries=a),c.length>0&&(i.materials=c),l.length>0&&(i.textures=l),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),m.length>0&&(i.animations=m),g.length>0&&(i.nodes=g)}return i.object=r,i;function o(a){let c=[];for(let l in a){let u=a[l];delete u.metadata,c.push(u)}return c}}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)),t===!0)for(let i=0;i<e.children.length;i++){let r=e.children[i];this.add(r.clone())}return this}};cn.DEFAULT_UP=new U(0,1,0);cn.DEFAULT_MATRIX_AUTO_UPDATE=!0;cn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var rn=new U,Cn=new U,Su=new U,Pn=new U,ar=new U,or=new U,m0=new U,bu=new U,Eu=new U,Au=new U,Ri=class n{constructor(e=new U,t=new U,i=new U){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),rn.subVectors(e,t),r.cross(rn);let s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){rn.subVectors(r,t),Cn.subVectors(i,t),Su.subVectors(e,t);let o=rn.dot(rn),a=rn.dot(Cn),c=rn.dot(Su),l=Cn.dot(Cn),u=Cn.dot(Su),h=o*l-a*a;if(h===0)return s.set(0,0,0),null;let f=1/h,m=(l*c-a*u)*f,g=(o*u-a*c)*f;return s.set(1-m-g,g,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Pn)===null?!1:Pn.x>=0&&Pn.y>=0&&Pn.x+Pn.y<=1}static getInterpolation(e,t,i,r,s,o,a,c){return this.getBarycoord(e,t,i,r,Pn)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(s,Pn.x),c.addScaledVector(o,Pn.y),c.addScaledVector(a,Pn.z),c)}static isFrontFacing(e,t,i,r){return rn.subVectors(i,t),Cn.subVectors(e,t),rn.cross(Cn).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),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 rn.subVectors(this.c,this.b),Cn.subVectors(this.a,this.b),rn.cross(Cn).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return n.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return n.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return n.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return n.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return n.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,r=this.b,s=this.c,o,a;ar.subVectors(r,i),or.subVectors(s,i),bu.subVectors(e,i);let c=ar.dot(bu),l=or.dot(bu);if(c<=0&&l<=0)return t.copy(i);Eu.subVectors(e,r);let u=ar.dot(Eu),h=or.dot(Eu);if(u>=0&&h<=u)return t.copy(r);let f=c*h-u*l;if(f<=0&&c>=0&&u<=0)return o=c/(c-u),t.copy(i).addScaledVector(ar,o);Au.subVectors(e,s);let m=ar.dot(Au),g=or.dot(Au);if(g>=0&&m<=g)return t.copy(s);let _=m*l-c*g;if(_<=0&&l>=0&&g<=0)return a=l/(l-g),t.copy(i).addScaledVector(or,a);let d=u*g-m*h;if(d<=0&&h-u>=0&&m-g>=0)return m0.subVectors(s,r),a=(h-u)/(h-u+(m-g)),t.copy(r).addScaledVector(m0,a);let p=1/(d+_+f);return o=_*p,a=f*p,t.copy(i).addScaledVector(ar,o).addScaledVector(or,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},ly={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},Jn={h:0,s:0,l:0},Ba={h:0,s:0,l:0};function Tu(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}var Xe=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=vn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Je.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Je.workingColorSpace){return this.r=e,this.g=t,this.b=i,Je.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Je.workingColorSpace){if(e=cP(e,1),t=At(t,0,1),i=At(i,0,1),t===0)this.r=this.g=this.b=i;else{let s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=Tu(o,s,e+1/3),this.g=Tu(o,s,e),this.b=Tu(o,s,e-1/3)}return Je.toWorkingColorSpace(this,r),this}setStyle(e,t=vn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\\w+)\\(([^\\)]*)\\)/.exec(e)){let s,o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\\#([A-Fa-f\\d]+)$/.exec(e)){let s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,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=vn){let i=ly[e.toLowerCase()];return i!==void 0?this.setHex(i,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=Sr(e.r),this.g=Sr(e.g),this.b=Sr(e.b),this}copyLinearToSRGB(e){return this.r=fu(e.r),this.g=fu(e.g),this.b=fu(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=vn){return Je.fromWorkingColorSpace(Et.copy(this),e),Math.round(At(Et.r*255,0,255))*65536+Math.round(At(Et.g*255,0,255))*256+Math.round(At(Et.b*255,0,255))}getHexString(e=vn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Je.workingColorSpace){Je.fromWorkingColorSpace(Et.copy(this),t);let i=Et.r,r=Et.g,s=Et.b,o=Math.max(i,r,s),a=Math.min(i,r,s),c,l,u=(a+o)/2;if(a===o)c=0,l=0;else{let h=o-a;switch(l=u<=.5?h/(o+a):h/(2-o-a),o){case i:c=(r-s)/h+(r<s?6:0);break;case r:c=(s-i)/h+2;break;case s:c=(i-r)/h+4;break}c/=6}return e.h=c,e.s=l,e.l=u,e}getRGB(e,t=Je.workingColorSpace){return Je.fromWorkingColorSpace(Et.copy(this),t),e.r=Et.r,e.g=Et.g,e.b=Et.b,e}getStyle(e=vn){Je.fromWorkingColorSpace(Et.copy(this),e);let t=Et.r,i=Et.g,r=Et.b;return e!==vn?\`color(\${e} \${t.toFixed(3)} \${i.toFixed(3)} \${r.toFixed(3)})\`:\`rgb(\${Math.round(t*255)},\${Math.round(i*255)},\${Math.round(r*255)})\`}offsetHSL(e,t,i){return this.getHSL(Jn),this.setHSL(Jn.h+e,Jn.s+t,Jn.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Jn),e.getHSL(Ba);let i=uu(Jn.h,Ba.h,t),r=uu(Jn.s,Ba.s,t),s=uu(Jn.l,Ba.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},Et=new Xe;Xe.NAMES=ly;var MP=0,Ni=class extends ai{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:MP++}),this.uuid=On(),this.name="",this.type="Material",this.blending=Mr,this.side=si,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=zu,this.blendDst=ku,this.blendEquation=Ai,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Xe(0,0,0),this.blendAlpha=0,this.depthFunc=ro,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=n0,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Qi,this.stencilZFail=Qi,this.stencilZPass=Qi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(\`THREE.Material: parameter '\${t}' has value of undefined.\`);continue}let r=this[t];if(r===void 0){console.warn(\`THREE.Material: '\${t}' is not a property of THREE.\${this.type}.\`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Mr&&(i.blending=this.blending),this.side!==si&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==zu&&(i.blendSrc=this.blendSrc),this.blendDst!==ku&&(i.blendDst=this.blendDst),this.blendEquation!==Ai&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ro&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==n0&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Qi&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Qi&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Qi&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){let o=[];for(let a in s){let c=s[a];delete c.metadata,o.push(c)}return o}if(t){let s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}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;let t=e.clippingPlanes,i=null;if(t!==null){let r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,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){e===!0&&this.version++}},vo=class extends Ni{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Xe(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 Ui,this.combine=K0,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}};var ht=new U,za=new ie,rt=class{constructor(e,t,i=!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=e!==void 0?e.length/t:0,this.normalized=i,this.usage=qu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Nn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return cy("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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)za.fromBufferAttribute(this,t),za.applyMatrix3(e),this.setXY(t,za.x,za.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)ht.fromBufferAttribute(this,t),ht.applyMatrix3(e),this.setXYZ(t,ht.x,ht.y,ht.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)ht.fromBufferAttribute(this,t),ht.applyMatrix4(e),this.setXYZ(t,ht.x,ht.y,ht.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)ht.fromBufferAttribute(this,t),ht.applyNormalMatrix(e),this.setXYZ(t,ht.x,ht.y,ht.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)ht.fromBufferAttribute(this,t),ht.transformDirection(e),this.setXYZ(t,ht.x,ht.y,ht.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=yn(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ze(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=yn(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ze(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=yn(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ze(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=yn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ze(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=yn(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ze(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ze(t,this.array),i=Ze(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Ze(t,this.array),i=Ze(i,this.array),r=Ze(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=Ze(t,this.array),i=Ze(i,this.array),r=Ze(r,this.array),s=Ze(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==qu&&(e.usage=this.usage),e}};var _o=class extends rt{constructor(e,t,i){super(new Uint16Array(e),t,i)}};var yo=class extends rt{constructor(e,t,i){super(new Uint32Array(e),t,i)}};var xt=class extends rt{constructor(e,t,i){super(new Float32Array(e),t,i)}},SP=0,Yt=new ft,wu=new cn,cr=new U,Vt=new Li,os=new Li,gt=new U,Ot=class n extends ai{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:SP++}),this.uuid=On(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(oy(e)?yo:_o)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(i!==void 0){let s=new ze().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Yt.makeRotationFromQuaternion(e),this.applyMatrix4(Yt),this}rotateX(e){return Yt.makeRotationX(e),this.applyMatrix4(Yt),this}rotateY(e){return Yt.makeRotationY(e),this.applyMatrix4(Yt),this}rotateZ(e){return Yt.makeRotationZ(e),this.applyMatrix4(Yt),this}translate(e,t,i){return Yt.makeTranslation(e,t,i),this.applyMatrix4(Yt),this}scale(e,t,i){return Yt.makeScale(e,t,i),this.applyMatrix4(Yt),this}lookAt(e){return wu.lookAt(e),wu.updateMatrix(),this.applyMatrix4(wu.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(cr).negate(),this.translate(cr.x,cr.y,cr.z),this}setFromPoints(e){let t=[];for(let i=0,r=e.length;i<r;i++){let s=e[i];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new xt(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Li);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){let s=t[i];Vt.setFromBufferAttribute(s),this.morphTargetsRelative?(gt.addVectors(this.boundingBox.min,Vt.min),this.boundingBox.expandByPoint(gt),gt.addVectors(this.boundingBox.max,Vt.max),this.boundingBox.expandByPoint(gt)):(this.boundingBox.expandByPoint(Vt.min),this.boundingBox.expandByPoint(Vt.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ms);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new U,1/0);return}if(e){let i=this.boundingSphere.center;if(Vt.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){let a=t[s];os.setFromBufferAttribute(a),this.morphTargetsRelative?(gt.addVectors(Vt.min,os.min),Vt.expandByPoint(gt),gt.addVectors(Vt.max,os.max),Vt.expandByPoint(gt)):(Vt.expandByPoint(os.min),Vt.expandByPoint(os.max))}Vt.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)gt.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(gt));if(t)for(let s=0,o=t.length;s<o;s++){let a=t[s],c=this.morphTargetsRelative;for(let l=0,u=a.count;l<u;l++)gt.fromBufferAttribute(a,l),c&&(cr.fromBufferAttribute(e,l),gt.add(cr)),r=Math.max(r,i.distanceToSquared(gt))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new rt(new Float32Array(4*i.count),4));let o=this.getAttribute("tangent"),a=[],c=[];for(let B=0;B<i.count;B++)a[B]=new U,c[B]=new U;let l=new U,u=new U,h=new U,f=new ie,m=new ie,g=new ie,_=new U,d=new U;function p(B,j,x){l.fromBufferAttribute(i,B),u.fromBufferAttribute(i,j),h.fromBufferAttribute(i,x),f.fromBufferAttribute(s,B),m.fromBufferAttribute(s,j),g.fromBufferAttribute(s,x),u.sub(l),h.sub(l),m.sub(f),g.sub(f);let A=1/(m.x*g.y-g.x*m.y);isFinite(A)&&(_.copy(u).multiplyScalar(g.y).addScaledVector(h,-m.y).multiplyScalar(A),d.copy(h).multiplyScalar(m.x).addScaledVector(u,-g.x).multiplyScalar(A),a[B].add(_),a[j].add(_),a[x].add(_),c[B].add(d),c[j].add(d),c[x].add(d))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let B=0,j=b.length;B<j;++B){let x=b[B],A=x.start,re=x.count;for(let K=A,C=A+re;K<C;K+=3)p(e.getX(K+0),e.getX(K+1),e.getX(K+2))}let v=new U,E=new U,I=new U,R=new U;function w(B){I.fromBufferAttribute(r,B),R.copy(I);let j=a[B];v.copy(j),v.sub(I.multiplyScalar(I.dot(j))).normalize(),E.crossVectors(R,j);let A=E.dot(c[B])<0?-1:1;o.setXYZW(B,v.x,v.y,v.z,A)}for(let B=0,j=b.length;B<j;++B){let x=b[B],A=x.start,re=x.count;for(let K=A,C=A+re;K<C;K+=3)w(e.getX(K+0)),w(e.getX(K+1)),w(e.getX(K+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new rt(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,m=i.count;f<m;f++)i.setXYZ(f,0,0,0);let r=new U,s=new U,o=new U,a=new U,c=new U,l=new U,u=new U,h=new U;if(e)for(let f=0,m=e.count;f<m;f+=3){let g=e.getX(f+0),_=e.getX(f+1),d=e.getX(f+2);r.fromBufferAttribute(t,g),s.fromBufferAttribute(t,_),o.fromBufferAttribute(t,d),u.subVectors(o,s),h.subVectors(r,s),u.cross(h),a.fromBufferAttribute(i,g),c.fromBufferAttribute(i,_),l.fromBufferAttribute(i,d),a.add(u),c.add(u),l.add(u),i.setXYZ(g,a.x,a.y,a.z),i.setXYZ(_,c.x,c.y,c.z),i.setXYZ(d,l.x,l.y,l.z)}else for(let f=0,m=t.count;f<m;f+=3)r.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),o.fromBufferAttribute(t,f+2),u.subVectors(o,s),h.subVectors(r,s),u.cross(h),i.setXYZ(f+0,u.x,u.y,u.z),i.setXYZ(f+1,u.x,u.y,u.z),i.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)gt.fromBufferAttribute(e,t),gt.normalize(),e.setXYZ(t,gt.x,gt.y,gt.z)}toNonIndexed(){function e(a,c){let l=a.array,u=a.itemSize,h=a.normalized,f=new l.constructor(c.length*u),m=0,g=0;for(let _=0,d=c.length;_<d;_++){a.isInterleavedBufferAttribute?m=c[_]*a.data.stride+a.offset:m=c[_]*u;for(let p=0;p<u;p++)f[g++]=l[m++]}return new rt(f,u,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new n,i=this.index.array,r=this.attributes;for(let a in r){let c=r[a],l=e(c,i);t.setAttribute(a,l)}let s=this.morphAttributes;for(let a in s){let c=[],l=s[a];for(let u=0,h=l.length;u<h;u++){let f=l[u],m=e(f,i);c.push(m)}t.morphAttributes[a]=c}t.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,c=o.length;a<c;a++){let l=o[a];t.addGroup(l.start,l.count,l.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let l in c)c[l]!==void 0&&(e[l]=c[l]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let c in i){let l=i[c];e.data.attributes[c]=l.toJSON(e.data)}let r={},s=!1;for(let c in this.morphAttributes){let l=this.morphAttributes[c],u=[];for(let h=0,f=l.length;h<f;h++){let m=l[h];u.push(m.toJSON(e.data))}u.length>0&&(r[c]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.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;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let r=e.attributes;for(let l in r){let u=r[l];this.setAttribute(l,u.clone(t))}let s=e.morphAttributes;for(let l in s){let u=[],h=s[l];for(let f=0,m=h.length;f<m;f++)u.push(h[f].clone(t));this.morphAttributes[l]=u}this.morphTargetsRelative=e.morphTargetsRelative;let o=e.groups;for(let l=0,u=o.length;l<u;l++){let h=o[l];this.addGroup(h.start,h.count,h.materialIndex)}let a=e.boundingBox;a!==null&&(this.boundingBox=a.clone());let c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},g0=new ft,xi=new Ku,ka=new ms,v0=new U,lr=new U,ur=new U,hr=new U,Ru=new U,Va=new U,Ga=new ie,Ha=new ie,Wa=new ie,_0=new U,y0=new U,x0=new U,qa=new U,Xa=new U,on=class extends cn{constructor(e=new Ot,t=new vo){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){let a=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){let i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);let a=this.morphTargetInfluences;if(s&&a){Va.set(0,0,0);for(let c=0,l=s.length;c<l;c++){let u=a[c],h=s[c];u!==0&&(Ru.fromBufferAttribute(h,e),o?Va.addScaledVector(Ru,u):Va.addScaledVector(Ru.sub(t),u))}t.add(Va)}return t}raycast(e,t){let i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),ka.copy(i.boundingSphere),ka.applyMatrix4(s),xi.copy(e.ray).recast(e.near),!(ka.containsPoint(xi.origin)===!1&&(xi.intersectSphere(ka,v0)===null||xi.origin.distanceToSquared(v0)>(e.far-e.near)**2))&&(g0.copy(s).invert(),xi.copy(e.ray).applyMatrix4(g0),!(i.boundingBox!==null&&xi.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,xi)))}_computeIntersections(e,t,i){let r,s=this.geometry,o=this.material,a=s.index,c=s.attributes.position,l=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,_=f.length;g<_;g++){let d=f[g],p=o[d.materialIndex],b=Math.max(d.start,m.start),v=Math.min(a.count,Math.min(d.start+d.count,m.start+m.count));for(let E=b,I=v;E<I;E+=3){let R=a.getX(E),w=a.getX(E+1),B=a.getX(E+2);r=Ya(this,p,e,i,l,u,h,R,w,B),r&&(r.faceIndex=Math.floor(E/3),r.face.materialIndex=d.materialIndex,t.push(r))}}else{let g=Math.max(0,m.start),_=Math.min(a.count,m.start+m.count);for(let d=g,p=_;d<p;d+=3){let b=a.getX(d),v=a.getX(d+1),E=a.getX(d+2);r=Ya(this,o,e,i,l,u,h,b,v,E),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}else if(c!==void 0)if(Array.isArray(o))for(let g=0,_=f.length;g<_;g++){let d=f[g],p=o[d.materialIndex],b=Math.max(d.start,m.start),v=Math.min(c.count,Math.min(d.start+d.count,m.start+m.count));for(let E=b,I=v;E<I;E+=3){let R=E,w=E+1,B=E+2;r=Ya(this,p,e,i,l,u,h,R,w,B),r&&(r.faceIndex=Math.floor(E/3),r.face.materialIndex=d.materialIndex,t.push(r))}}else{let g=Math.max(0,m.start),_=Math.min(c.count,m.start+m.count);for(let d=g,p=_;d<p;d+=3){let b=d,v=d+1,E=d+2;r=Ya(this,o,e,i,l,u,h,b,v,E),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}}};function bP(n,e,t,i,r,s,o,a){let c;if(e.side===Dt?c=i.intersectTriangle(o,s,r,!0,a):c=i.intersectTriangle(r,s,o,e.side===si,a),c===null)return null;Xa.copy(a),Xa.applyMatrix4(n.matrixWorld);let l=t.ray.origin.distanceTo(Xa);return l<t.near||l>t.far?null:{distance:l,point:Xa.clone(),object:n}}function Ya(n,e,t,i,r,s,o,a,c,l){n.getVertexPosition(a,lr),n.getVertexPosition(c,ur),n.getVertexPosition(l,hr);let u=bP(n,e,t,i,lr,ur,hr,qa);if(u){r&&(Ga.fromBufferAttribute(r,a),Ha.fromBufferAttribute(r,c),Wa.fromBufferAttribute(r,l),u.uv=Ri.getInterpolation(qa,lr,ur,hr,Ga,Ha,Wa,new ie)),s&&(Ga.fromBufferAttribute(s,a),Ha.fromBufferAttribute(s,c),Wa.fromBufferAttribute(s,l),u.uv1=Ri.getInterpolation(qa,lr,ur,hr,Ga,Ha,Wa,new ie)),o&&(_0.fromBufferAttribute(o,a),y0.fromBufferAttribute(o,c),x0.fromBufferAttribute(o,l),u.normal=Ri.getInterpolation(qa,lr,ur,hr,_0,y0,x0,new U),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));let h={a,b:c,c:l,normal:new U,materialIndex:0};Ri.getNormal(lr,ur,hr,h.normal),u.face=h}return u}var gs=class n extends Ot{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};let a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);let c=[],l=[],u=[],h=[],f=0,m=0;g("z","y","x",-1,-1,i,t,e,o,s,0),g("z","y","x",1,-1,i,t,-e,o,s,1),g("x","z","y",1,1,e,i,t,r,o,2),g("x","z","y",1,-1,e,i,-t,r,o,3),g("x","y","z",1,-1,e,t,i,r,s,4),g("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(c),this.setAttribute("position",new xt(l,3)),this.setAttribute("normal",new xt(u,3)),this.setAttribute("uv",new xt(h,2));function g(_,d,p,b,v,E,I,R,w,B,j){let x=E/w,A=I/B,re=E/2,K=I/2,C=R/2,W=w+1,G=B+1,$=0,q=0,X=new U;for(let ne=0;ne<G;ne++){let te=ne*A-K;for(let ve=0;ve<W;ve++){let Ie=ve*x-re;X[_]=Ie*b,X[d]=te*v,X[p]=C,l.push(X.x,X.y,X.z),X[_]=0,X[d]=0,X[p]=R>0?1:-1,u.push(X.x,X.y,X.z),h.push(ve/w),h.push(1-ne/B),$+=1}}for(let ne=0;ne<B;ne++)for(let te=0;te<w;te++){let ve=f+te+W*ne,Ie=f+te+W*(ne+1),k=f+(te+1)+W*(ne+1),Q=f+(te+1)+W*ne;c.push(ve,Ie,Q),c.push(Ie,k,Q),q+=6}a.addGroup(m,q,j),m+=q,f+=$}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function wr(n){let e={};for(let t in n){e[t]={};for(let i in n[t]){let r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function It(n){let e={};for(let t=0;t<n.length;t++){let i=wr(n[t]);for(let r in i)e[r]=i[r]}return e}function EP(n){let e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function uy(n){return n.getRenderTarget()===null?n.outputColorSpace:Je.workingColorSpace}var AP={clone:wr,merge:It},TP=\`void main() {
@@ -3972,7 +3972,7 @@ void main() {
3972
3972
  }
3973
3973
 
3974
3974
  }\`,uh=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let r=new $t,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,r=new xn({extensions:{fragDepth:!0},vertexShader:tN,fragmentShader:nN,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new on(new bo(20,20),r)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}},hh=class extends ai{constructor(e,t){super();let i=this,r=null,s=1,o=null,a="local-floor",c=1,l=null,u=null,h=null,f=null,m=null,g=null,_=new uh,d=t.getContextAttributes(),p=null,b=null,v=[],E=[],I=new ie,R=null,w=new Gt;w.layers.enable(1),w.viewport=new yt;let B=new Gt;B.layers.enable(2),B.viewport=new yt;let j=[w,B],x=new lh;x.layers.enable(1),x.layers.enable(2);let A=null,re=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(k){let Q=v[k];return Q===void 0&&(Q=new hs,v[k]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(k){let Q=v[k];return Q===void 0&&(Q=new hs,v[k]=Q),Q.getGripSpace()},this.getHand=function(k){let Q=v[k];return Q===void 0&&(Q=new hs,v[k]=Q),Q.getHandSpace()};function K(k){let Q=E.indexOf(k.inputSource);if(Q===-1)return;let me=v[Q];me!==void 0&&(me.update(k.inputSource,k.frame,l||o),me.dispatchEvent({type:k.type,data:k.inputSource}))}function C(){r.removeEventListener("select",K),r.removeEventListener("selectstart",K),r.removeEventListener("selectend",K),r.removeEventListener("squeeze",K),r.removeEventListener("squeezestart",K),r.removeEventListener("squeezeend",K),r.removeEventListener("end",C),r.removeEventListener("inputsourceschange",W);for(let k=0;k<v.length;k++){let Q=E[k];Q!==null&&(E[k]=null,v[k].disconnect(Q))}A=null,re=null,_.reset(),e.setRenderTarget(p),m=null,f=null,h=null,r=null,b=null,Ie.stop(),i.isPresenting=!1,e.setPixelRatio(R),e.setSize(I.width,I.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(k){s=k,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(k){a=k,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||o},this.setReferenceSpace=function(k){l=k},this.getBaseLayer=function(){return f!==null?f:m},this.getBinding=function(){return h},this.getFrame=function(){return g},this.getSession=function(){return r},this.setSession=function(k){return Cs(this,null,function*(){if(r=k,r!==null){if(p=e.getRenderTarget(),r.addEventListener("select",K),r.addEventListener("selectstart",K),r.addEventListener("selectend",K),r.addEventListener("squeeze",K),r.addEventListener("squeezestart",K),r.addEventListener("squeezeend",K),r.addEventListener("end",C),r.addEventListener("inputsourceschange",W),d.xrCompatible!==!0&&(yield t.makeXRCompatible()),R=e.getPixelRatio(),e.getSize(I),r.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let Q={antialias:r.renderState.layers===void 0?d.antialias:!0,alpha:!0,depth:d.depth,stencil:d.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(r,t,Q),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),b=new Fn(m.framebufferWidth,m.framebufferHeight,{format:an,type:ii,colorSpace:e.outputColorSpace,stencilBuffer:d.stencil})}else{let Q=null,me=null,Ae=null;d.depth&&(Ae=d.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Q=d.stencil?Tr:Ii,me=d.stencil?Pi:ei);let Me={colorFormat:t.RGBA8,depthFormat:Ae,scaleFactor:s};h=new XRWebGLBinding(r,t),f=h.createProjectionLayer(Me),r.updateRenderState({layers:[f]}),e.setPixelRatio(1),e.setSize(f.textureWidth,f.textureHeight,!1),b=new Fn(f.textureWidth,f.textureHeight,{format:an,type:ii,depthTexture:new Ao(f.textureWidth,f.textureHeight,me,void 0,void 0,void 0,void 0,void 0,void 0,Q),stencilBuffer:d.stencil,colorSpace:e.outputColorSpace,samples:d.antialias?4:0});let ye=e.properties.get(b);ye.__ignoreDepthValues=f.ignoreDepthValues}b.isXRRenderTarget=!0,this.setFoveation(c),l=null,o=yield r.requestReferenceSpace(a),Ie.setContext(r),Ie.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode};function W(k){for(let Q=0;Q<k.removed.length;Q++){let me=k.removed[Q],Ae=E.indexOf(me);Ae>=0&&(E[Ae]=null,v[Ae].disconnect(me))}for(let Q=0;Q<k.added.length;Q++){let me=k.added[Q],Ae=E.indexOf(me);if(Ae===-1){for(let ye=0;ye<v.length;ye++)if(ye>=E.length){E.push(me),Ae=ye;break}else if(E[ye]===null){E[ye]=me,Ae=ye;break}if(Ae===-1)break}let Me=v[Ae];Me&&Me.connect(me)}}let G=new U,$=new U;function q(k,Q,me){G.setFromMatrixPosition(Q.matrixWorld),$.setFromMatrixPosition(me.matrixWorld);let Ae=G.distanceTo($),Me=Q.projectionMatrix.elements,ye=me.projectionMatrix.elements,ke=Me[14]/(Me[10]-1),Te=Me[14]/(Me[10]+1),T=(Me[9]+1)/Me[5],oe=(Me[9]-1)/Me[5],Y=(Me[8]-1)/Me[0],se=(ye[8]+1)/ye[0],Z=ke*Y,_e=ke*se,pe=Ae/(-Y+se),xe=pe*-Y;Q.matrixWorld.decompose(k.position,k.quaternion,k.scale),k.translateX(xe),k.translateZ(pe),k.matrixWorld.compose(k.position,k.quaternion,k.scale),k.matrixWorldInverse.copy(k.matrixWorld).invert();let Ge=ke+pe,S=Te+pe,y=Z-xe,V=_e+(Ae-xe),H=T*Te/S*Ge,ee=oe*Te/S*Ge;k.projectionMatrix.makePerspective(y,V,H,ee,Ge,S),k.projectionMatrixInverse.copy(k.projectionMatrix).invert()}function X(k,Q){Q===null?k.matrixWorld.copy(k.matrix):k.matrixWorld.multiplyMatrices(Q.matrixWorld,k.matrix),k.matrixWorldInverse.copy(k.matrixWorld).invert()}this.updateCamera=function(k){if(r===null)return;_.texture!==null&&(k.near=_.depthNear,k.far=_.depthFar),x.near=B.near=w.near=k.near,x.far=B.far=w.far=k.far,(A!==x.near||re!==x.far)&&(r.updateRenderState({depthNear:x.near,depthFar:x.far}),A=x.near,re=x.far,w.near=A,w.far=re,B.near=A,B.far=re,w.updateProjectionMatrix(),B.updateProjectionMatrix(),k.updateProjectionMatrix());let Q=k.parent,me=x.cameras;X(x,Q);for(let Ae=0;Ae<me.length;Ae++)X(me[Ae],Q);me.length===2?q(x,w,B):x.projectionMatrix.copy(w.projectionMatrix),ne(k,x,Q)};function ne(k,Q,me){me===null?k.matrix.copy(Q.matrixWorld):(k.matrix.copy(me.matrixWorld),k.matrix.invert(),k.matrix.multiply(Q.matrixWorld)),k.matrix.decompose(k.position,k.quaternion,k.scale),k.updateMatrixWorld(!0),k.projectionMatrix.copy(Q.projectionMatrix),k.projectionMatrixInverse.copy(Q.projectionMatrixInverse),k.isPerspectiveCamera&&(k.fov=Yu*2*Math.atan(1/k.projectionMatrix.elements[5]),k.zoom=1)}this.getCamera=function(){return x},this.getFoveation=function(){if(!(f===null&&m===null))return c},this.setFoveation=function(k){c=k,f!==null&&(f.fixedFoveation=k),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=k)},this.hasDepthSensing=function(){return _.texture!==null};let te=null;function ve(k,Q){if(u=Q.getViewerPose(l||o),g=Q,u!==null){let me=u.views;m!==null&&(e.setRenderTargetFramebuffer(b,m.framebuffer),e.setRenderTarget(b));let Ae=!1;me.length!==x.cameras.length&&(x.cameras.length=0,Ae=!0);for(let ye=0;ye<me.length;ye++){let ke=me[ye],Te=null;if(m!==null)Te=m.getViewport(ke);else{let oe=h.getViewSubImage(f,ke);Te=oe.viewport,ye===0&&(e.setRenderTargetTextures(b,oe.colorTexture,f.ignoreDepthValues?void 0:oe.depthStencilTexture),e.setRenderTarget(b))}let T=j[ye];T===void 0&&(T=new Gt,T.layers.enable(ye),T.viewport=new yt,j[ye]=T),T.matrix.fromArray(ke.transform.matrix),T.matrix.decompose(T.position,T.quaternion,T.scale),T.projectionMatrix.fromArray(ke.projectionMatrix),T.projectionMatrixInverse.copy(T.projectionMatrix).invert(),T.viewport.set(Te.x,Te.y,Te.width,Te.height),ye===0&&(x.matrix.copy(T.matrix),x.matrix.decompose(x.position,x.quaternion,x.scale)),Ae===!0&&x.cameras.push(T)}let Me=r.enabledFeatures;if(Me&&Me.includes("depth-sensing")){let ye=h.getDepthInformation(me[0]);ye&&ye.isValid&&ye.texture&&_.init(e,ye,r.renderState)}}for(let me=0;me<v.length;me++){let Ae=E[me],Me=v[me];Ae!==null&&Me!==void 0&&Me.update(Ae,Q,l||o)}_.render(e,x),te&&te(k,Q),Q.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:Q}),g=null}let Ie=new hy;Ie.setAnimationLoop(ve),this.setAnimationLoop=function(k){te=k},this.dispose=function(){}}},bi=new Ui,iN=new ft;function rN(n,e){function t(d,p){d.matrixAutoUpdate===!0&&d.updateMatrix(),p.value.copy(d.matrix)}function i(d,p){p.color.getRGB(d.fogColor.value,uy(n)),p.isFog?(d.fogNear.value=p.near,d.fogFar.value=p.far):p.isFogExp2&&(d.fogDensity.value=p.density)}function r(d,p,b,v,E){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(d,p):p.isMeshToonMaterial?(s(d,p),h(d,p)):p.isMeshPhongMaterial?(s(d,p),u(d,p)):p.isMeshStandardMaterial?(s(d,p),f(d,p),p.isMeshPhysicalMaterial&&m(d,p,E)):p.isMeshMatcapMaterial?(s(d,p),g(d,p)):p.isMeshDepthMaterial?s(d,p):p.isMeshDistanceMaterial?(s(d,p),_(d,p)):p.isMeshNormalMaterial?s(d,p):p.isLineBasicMaterial?(o(d,p),p.isLineDashedMaterial&&a(d,p)):p.isPointsMaterial?c(d,p,b,v):p.isSpriteMaterial?l(d,p):p.isShadowMaterial?(d.color.value.copy(p.color),d.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(d,p){d.opacity.value=p.opacity,p.color&&d.diffuse.value.copy(p.color),p.emissive&&d.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(d.map.value=p.map,t(p.map,d.mapTransform)),p.alphaMap&&(d.alphaMap.value=p.alphaMap,t(p.alphaMap,d.alphaMapTransform)),p.bumpMap&&(d.bumpMap.value=p.bumpMap,t(p.bumpMap,d.bumpMapTransform),d.bumpScale.value=p.bumpScale,p.side===Dt&&(d.bumpScale.value*=-1)),p.normalMap&&(d.normalMap.value=p.normalMap,t(p.normalMap,d.normalMapTransform),d.normalScale.value.copy(p.normalScale),p.side===Dt&&d.normalScale.value.negate()),p.displacementMap&&(d.displacementMap.value=p.displacementMap,t(p.displacementMap,d.displacementMapTransform),d.displacementScale.value=p.displacementScale,d.displacementBias.value=p.displacementBias),p.emissiveMap&&(d.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,d.emissiveMapTransform)),p.specularMap&&(d.specularMap.value=p.specularMap,t(p.specularMap,d.specularMapTransform)),p.alphaTest>0&&(d.alphaTest.value=p.alphaTest);let b=e.get(p),v=b.envMap,E=b.envMapRotation;if(v&&(d.envMap.value=v,bi.copy(E),bi.x*=-1,bi.y*=-1,bi.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(bi.y*=-1,bi.z*=-1),d.envMapRotation.value.setFromMatrix4(iN.makeRotationFromEuler(bi)),d.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,d.reflectivity.value=p.reflectivity,d.ior.value=p.ior,d.refractionRatio.value=p.refractionRatio),p.lightMap){d.lightMap.value=p.lightMap;let I=n._useLegacyLights===!0?Math.PI:1;d.lightMapIntensity.value=p.lightMapIntensity*I,t(p.lightMap,d.lightMapTransform)}p.aoMap&&(d.aoMap.value=p.aoMap,d.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,d.aoMapTransform))}function o(d,p){d.diffuse.value.copy(p.color),d.opacity.value=p.opacity,p.map&&(d.map.value=p.map,t(p.map,d.mapTransform))}function a(d,p){d.dashSize.value=p.dashSize,d.totalSize.value=p.dashSize+p.gapSize,d.scale.value=p.scale}function c(d,p,b,v){d.diffuse.value.copy(p.color),d.opacity.value=p.opacity,d.size.value=p.size*b,d.scale.value=v*.5,p.map&&(d.map.value=p.map,t(p.map,d.uvTransform)),p.alphaMap&&(d.alphaMap.value=p.alphaMap,t(p.alphaMap,d.alphaMapTransform)),p.alphaTest>0&&(d.alphaTest.value=p.alphaTest)}function l(d,p){d.diffuse.value.copy(p.color),d.opacity.value=p.opacity,d.rotation.value=p.rotation,p.map&&(d.map.value=p.map,t(p.map,d.mapTransform)),p.alphaMap&&(d.alphaMap.value=p.alphaMap,t(p.alphaMap,d.alphaMapTransform)),p.alphaTest>0&&(d.alphaTest.value=p.alphaTest)}function u(d,p){d.specular.value.copy(p.specular),d.shininess.value=Math.max(p.shininess,1e-4)}function h(d,p){p.gradientMap&&(d.gradientMap.value=p.gradientMap)}function f(d,p){d.metalness.value=p.metalness,p.metalnessMap&&(d.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,d.metalnessMapTransform)),d.roughness.value=p.roughness,p.roughnessMap&&(d.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,d.roughnessMapTransform)),e.get(p).envMap&&(d.envMapIntensity.value=p.envMapIntensity)}function m(d,p,b){d.ior.value=p.ior,p.sheen>0&&(d.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),d.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(d.sheenColorMap.value=p.sheenColorMap,t(p.sheenColorMap,d.sheenColorMapTransform)),p.sheenRoughnessMap&&(d.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,d.sheenRoughnessMapTransform))),p.clearcoat>0&&(d.clearcoat.value=p.clearcoat,d.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(d.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,d.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(d.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,d.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(d.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,d.clearcoatNormalMapTransform),d.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Dt&&d.clearcoatNormalScale.value.negate())),p.iridescence>0&&(d.iridescence.value=p.iridescence,d.iridescenceIOR.value=p.iridescenceIOR,d.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],d.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(d.iridescenceMap.value=p.iridescenceMap,t(p.iridescenceMap,d.iridescenceMapTransform)),p.iridescenceThicknessMap&&(d.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,d.iridescenceThicknessMapTransform))),p.transmission>0&&(d.transmission.value=p.transmission,d.transmissionSamplerMap.value=b.texture,d.transmissionSamplerSize.value.set(b.width,b.height),p.transmissionMap&&(d.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,d.transmissionMapTransform)),d.thickness.value=p.thickness,p.thicknessMap&&(d.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,d.thicknessMapTransform)),d.attenuationDistance.value=p.attenuationDistance,d.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(d.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(d.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,d.anisotropyMapTransform))),d.specularIntensity.value=p.specularIntensity,d.specularColor.value.copy(p.specularColor),p.specularColorMap&&(d.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,d.specularColorMapTransform)),p.specularIntensityMap&&(d.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,d.specularIntensityMapTransform))}function g(d,p){p.matcap&&(d.matcap.value=p.matcap)}function _(d,p){let b=e.get(p).light;d.referencePosition.value.setFromMatrixPosition(b.matrixWorld),d.nearDistance.value=b.shadow.camera.near,d.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function sN(n,e,t,i){let r={},s={},o=[],a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(b,v){let E=v.program;i.uniformBlockBinding(b,E)}function l(b,v){let E=r[b.id];E===void 0&&(g(b),E=u(b),r[b.id]=E,b.addEventListener("dispose",d));let I=v.program;i.updateUBOMapping(b,I);let R=e.render.frame;s[b.id]!==R&&(f(b),s[b.id]=R)}function u(b){let v=h();b.__bindingPointIndex=v;let E=n.createBuffer(),I=b.__size,R=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,E),n.bufferData(n.UNIFORM_BUFFER,I,R),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,v,E),E}function h(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(b){let v=r[b.id],E=b.uniforms,I=b.__cache;n.bindBuffer(n.UNIFORM_BUFFER,v);for(let R=0,w=E.length;R<w;R++){let B=Array.isArray(E[R])?E[R]:[E[R]];for(let j=0,x=B.length;j<x;j++){let A=B[j];if(m(A,R,j,I)===!0){let re=A.__offset,K=Array.isArray(A.value)?A.value:[A.value],C=0;for(let W=0;W<K.length;W++){let G=K[W],$=_(G);typeof G=="number"||typeof G=="boolean"?(A.__data[0]=G,n.bufferSubData(n.UNIFORM_BUFFER,re+C,A.__data)):G.isMatrix3?(A.__data[0]=G.elements[0],A.__data[1]=G.elements[1],A.__data[2]=G.elements[2],A.__data[3]=0,A.__data[4]=G.elements[3],A.__data[5]=G.elements[4],A.__data[6]=G.elements[5],A.__data[7]=0,A.__data[8]=G.elements[6],A.__data[9]=G.elements[7],A.__data[10]=G.elements[8],A.__data[11]=0):(G.toArray(A.__data,C),C+=$.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,re,A.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function m(b,v,E,I){let R=b.value,w=v+"_"+E;if(I[w]===void 0)return typeof R=="number"||typeof R=="boolean"?I[w]=R:I[w]=R.clone(),!0;{let B=I[w];if(typeof R=="number"||typeof R=="boolean"){if(B!==R)return I[w]=R,!0}else if(B.equals(R)===!1)return B.copy(R),!0}return!1}function g(b){let v=b.uniforms,E=0,I=16;for(let w=0,B=v.length;w<B;w++){let j=Array.isArray(v[w])?v[w]:[v[w]];for(let x=0,A=j.length;x<A;x++){let re=j[x],K=Array.isArray(re.value)?re.value:[re.value];for(let C=0,W=K.length;C<W;C++){let G=K[C],$=_(G),q=E%I;q!==0&&I-q<$.boundary&&(E+=I-q),re.__data=new Float32Array($.storage/Float32Array.BYTES_PER_ELEMENT),re.__offset=E,E+=$.storage}}}let R=E%I;return R>0&&(E+=I-R),b.__size=E,b.__cache={},this}function _(b){let v={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(v.boundary=4,v.storage=4):b.isVector2?(v.boundary=8,v.storage=8):b.isVector3||b.isColor?(v.boundary=16,v.storage=12):b.isVector4?(v.boundary=16,v.storage=16):b.isMatrix3?(v.boundary=48,v.storage=48):b.isMatrix4?(v.boundary=64,v.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),v}function d(b){let v=b.target;v.removeEventListener("dispose",d);let E=o.indexOf(v.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(r[v.id]),delete r[v.id],delete s[v.id]}function p(){for(let b in r)n.deleteBuffer(r[b]);o=[],r={},s={}}return{bind:c,update:l,dispose:p}}var fh=class{constructor(e={}){let{canvas:t=lP(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:l=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let f;i!==null?f=i.getContextAttributes().alpha:f=o;let m=new Uint32Array(4),g=new Int32Array(4),_=null,d=null,p=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=vn,this._useLegacyLights=!1,this.toneMapping=ni,this.toneMappingExposure=1;let v=this,E=!1,I=0,R=0,w=null,B=-1,j=null,x=new yt,A=new yt,re=null,K=new Xe(0),C=0,W=t.width,G=t.height,$=1,q=null,X=null,ne=new yt(0,0,W,G),te=new yt(0,0,W,G),ve=!1,Ie=new So,k=!1,Q=!1,me=null,Ae=new ft,Me=new ie,ye=new U,ke={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Te(){return w===null?$:1}let T=i;function oe(M,N){for(let F=0;F<M.length;F++){let z=M[F],D=t.getContext(z,N);if(D!==null)return D}return null}try{let M={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:c,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",\`three.js r\${Dh}\`),t.addEventListener("webglcontextlost",tt,!1),t.addEventListener("webglcontextrestored",P,!1),t.addEventListener("webglcontextcreationerror",fe,!1),T===null){let N=["webgl2","webgl","experimental-webgl"];if(v.isWebGL1Renderer===!0&&N.shift(),T=oe(N,M),T===null)throw oe(N)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&T instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),T.getShaderPrecisionFormat===void 0&&(T.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(M){throw console.error("THREE.WebGLRenderer: "+M.message),M}let Y,se,Z,_e,pe,xe,Ge,S,y,V,H,ee,J,Le,Re,le,he,Ue,ae,lt,He,we,Se,be;function Ye(){Y=new ML(T),se=new mL(T,Y,e),Y.init(se),we=new QU(T,Y,se),Z=new KU(T,Y,se),_e=new EL(T),pe=new zU,xe=new jU(T,Y,Z,pe,se,we,_e),Ge=new vL(v),S=new xL(v),y=new PP(T,se),Se=new dL(T,Y,y,se),V=new SL(T,y,_e,Se),H=new RL(T,V,y,_e),ae=new wL(T,se,xe),le=new gL(pe),ee=new BU(v,Ge,S,Y,se,Se,le),J=new rN(v,pe),Le=new VU,Re=new YU(Y,se),Ue=new fL(v,Ge,S,Z,H,f,c),he=new JU(v,H,se),be=new sN(T,_e,se,Z),lt=new pL(T,Y,_e,se),He=new bL(T,Y,_e,se),_e.programs=ee.programs,v.capabilities=se,v.extensions=Y,v.properties=pe,v.renderLists=Le,v.shadowMap=he,v.state=Z,v.info=_e}Ye();let De=new hh(v,T);this.xr=De,this.getContext=function(){return T},this.getContextAttributes=function(){return T.getContextAttributes()},this.forceContextLoss=function(){let M=Y.get("WEBGL_lose_context");M&&M.loseContext()},this.forceContextRestore=function(){let M=Y.get("WEBGL_lose_context");M&&M.restoreContext()},this.getPixelRatio=function(){return $},this.setPixelRatio=function(M){M!==void 0&&($=M,this.setSize(W,G,!1))},this.getSize=function(M){return M.set(W,G)},this.setSize=function(M,N,F=!0){if(De.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}W=M,G=N,t.width=Math.floor(M*$),t.height=Math.floor(N*$),F===!0&&(t.style.width=M+"px",t.style.height=N+"px"),this.setViewport(0,0,M,N)},this.getDrawingBufferSize=function(M){return M.set(W*$,G*$).floor()},this.setDrawingBufferSize=function(M,N,F){W=M,G=N,$=F,t.width=Math.floor(M*F),t.height=Math.floor(N*F),this.setViewport(0,0,M,N)},this.getCurrentViewport=function(M){return M.copy(x)},this.getViewport=function(M){return M.copy(ne)},this.setViewport=function(M,N,F,z){M.isVector4?ne.set(M.x,M.y,M.z,M.w):ne.set(M,N,F,z),Z.viewport(x.copy(ne).multiplyScalar($).round())},this.getScissor=function(M){return M.copy(te)},this.setScissor=function(M,N,F,z){M.isVector4?te.set(M.x,M.y,M.z,M.w):te.set(M,N,F,z),Z.scissor(A.copy(te).multiplyScalar($).round())},this.getScissorTest=function(){return ve},this.setScissorTest=function(M){Z.setScissorTest(ve=M)},this.setOpaqueSort=function(M){q=M},this.setTransparentSort=function(M){X=M},this.getClearColor=function(M){return M.copy(Ue.getClearColor())},this.setClearColor=function(){Ue.setClearColor.apply(Ue,arguments)},this.getClearAlpha=function(){return Ue.getClearAlpha()},this.setClearAlpha=function(){Ue.setClearAlpha.apply(Ue,arguments)},this.clear=function(M=!0,N=!0,F=!0){let z=0;if(M){let D=!1;if(w!==null){let ge=w.texture.format;D=ge===ry||ge===iy||ge===ny}if(D){let ge=w.texture.type,Ee=ge===ii||ge===ei||ge===Oh||ge===Pi||ge===ey||ge===ty,Ce=Ue.getClearColor(),Pe=Ue.getClearAlpha(),Ve=Ce.r,Ne=Ce.g,Oe=Ce.b;Ee?(m[0]=Ve,m[1]=Ne,m[2]=Oe,m[3]=Pe,T.clearBufferuiv(T.COLOR,0,m)):(g[0]=Ve,g[1]=Ne,g[2]=Oe,g[3]=Pe,T.clearBufferiv(T.COLOR,0,g))}else z|=T.COLOR_BUFFER_BIT}N&&(z|=T.DEPTH_BUFFER_BIT),F&&(z|=T.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),T.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",tt,!1),t.removeEventListener("webglcontextrestored",P,!1),t.removeEventListener("webglcontextcreationerror",fe,!1),Le.dispose(),Re.dispose(),pe.dispose(),Ge.dispose(),S.dispose(),H.dispose(),Se.dispose(),be.dispose(),ee.dispose(),he.dispose(),De.dispose(),De.removeEventListener("sessionstart",Ht),De.removeEventListener("sessionend",je),me&&(me.dispose(),me=null),Tt.stop()};function tt(M){M.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),E=!0}function P(){console.log("THREE.WebGLRenderer: Context Restored."),E=!1;let M=_e.autoReset,N=he.enabled,F=he.autoUpdate,z=he.needsUpdate,D=he.type;Ye(),_e.autoReset=M,he.enabled=N,he.autoUpdate=F,he.needsUpdate=z,he.type=D}function fe(M){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",M.statusMessage)}function O(M){let N=M.target;N.removeEventListener("dispose",O),ce(N)}function ce(M){de(M),pe.remove(M)}function de(M){let N=pe.get(M).programs;N!==void 0&&(N.forEach(function(F){ee.releaseProgram(F)}),M.isShaderMaterial&&ee.releaseShaderCache(M))}this.renderBufferDirect=function(M,N,F,z,D,ge){N===null&&(N=ke);let Ee=D.isMesh&&D.matrixWorld.determinant()<0,Ce=Yx(M,N,F,z,D);Z.setMaterial(z,Ee);let Pe=F.index,Ve=1;if(z.wireframe===!0){if(Pe=V.getWireframeAttribute(F),Pe===void 0)return;Ve=2}let Ne=F.drawRange,Oe=F.attributes.position,ct=Ne.start*Ve,Ft=(Ne.start+Ne.count)*Ve;ge!==null&&(ct=Math.max(ct,ge.start*Ve),Ft=Math.min(Ft,(ge.start+ge.count)*Ve)),Pe!==null?(ct=Math.max(ct,0),Ft=Math.min(Ft,Pe.count)):Oe!=null&&(ct=Math.max(ct,0),Ft=Math.min(Ft,Oe.count));let mt=Ft-ct;if(mt<0||mt===1/0)return;Se.setup(D,z,Ce,F,Pe);let Mn,st=lt;if(Pe!==null&&(Mn=y.get(Pe),st=He,st.setIndex(Mn)),D.isMesh)z.wireframe===!0?(Z.setLineWidth(z.wireframeLinewidth*Te()),st.setMode(T.LINES)):st.setMode(T.TRIANGLES);else if(D.isLine){let Fe=z.linewidth;Fe===void 0&&(Fe=1),Z.setLineWidth(Fe*Te()),D.isLineSegments?st.setMode(T.LINES):D.isLineLoop?st.setMode(T.LINE_LOOP):st.setMode(T.LINE_STRIP)}else D.isPoints?st.setMode(T.POINTS):D.isSprite&&st.setMode(T.TRIANGLES);if(D.isBatchedMesh)st.renderMultiDraw(D._multiDrawStarts,D._multiDrawCounts,D._multiDrawCount);else if(D.isInstancedMesh)st.renderInstances(ct,mt,D.count);else if(F.isInstancedBufferGeometry){let Fe=F._maxInstanceCount!==void 0?F._maxInstanceCount:1/0,Wo=Math.min(F.instanceCount,Fe);st.renderInstances(ct,mt,Wo)}else st.render(ct,mt)};function qe(M,N,F){M.transparent===!0&&M.side===Un&&M.forceSinglePass===!1?(M.side=Dt,M.needsUpdate=!0,Rs(M,N,F),M.side=si,M.needsUpdate=!0,Rs(M,N,F),M.side=Un):Rs(M,N,F)}this.compile=function(M,N,F=null){F===null&&(F=M),d=Re.get(F),d.init(),b.push(d),F.traverseVisible(function(D){D.isLight&&D.layers.test(N.layers)&&(d.pushLight(D),D.castShadow&&d.pushShadow(D))}),M!==F&&M.traverseVisible(function(D){D.isLight&&D.layers.test(N.layers)&&(d.pushLight(D),D.castShadow&&d.pushShadow(D))}),d.setupLights(v._useLegacyLights);let z=new Set;return M.traverse(function(D){let ge=D.material;if(ge)if(Array.isArray(ge))for(let Ee=0;Ee<ge.length;Ee++){let Ce=ge[Ee];qe(Ce,F,D),z.add(Ce)}else qe(ge,F,D),z.add(ge)}),b.pop(),d=null,z},this.compileAsync=function(M,N,F=null){let z=this.compile(M,N,F);return new Promise(D=>{function ge(){if(z.forEach(function(Ee){pe.get(Ee).currentProgram.isReady()&&z.delete(Ee)}),z.size===0){D(M);return}setTimeout(ge,10)}Y.get("KHR_parallel_shader_compile")!==null?ge():setTimeout(ge,10)})};let Ke=null;function vt(M){Ke&&Ke(M)}function Ht(){Tt.stop()}function je(){Tt.start()}let Tt=new hy;Tt.setAnimationLoop(vt),typeof self!="undefined"&&Tt.setContext(self),this.setAnimationLoop=function(M){Ke=M,De.setAnimationLoop(M),M===null?Tt.stop():Tt.start()},De.addEventListener("sessionstart",Ht),De.addEventListener("sessionend",je),this.render=function(M,N){if(N!==void 0&&N.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;M.matrixWorldAutoUpdate===!0&&M.updateMatrixWorld(),N.parent===null&&N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),De.enabled===!0&&De.isPresenting===!0&&(De.cameraAutoUpdate===!0&&De.updateCamera(N),N=De.getCamera()),M.isScene===!0&&M.onBeforeRender(v,M,N,w),d=Re.get(M,b.length),d.init(),b.push(d),Ae.multiplyMatrices(N.projectionMatrix,N.matrixWorldInverse),Ie.setFromProjectionMatrix(Ae),Q=this.localClippingEnabled,k=le.init(this.clippingPlanes,Q),_=Le.get(M,p.length),_.init(),p.push(_),un(M,N,0,v.sortObjects),_.finish(),v.sortObjects===!0&&_.sort(q,X),this.info.render.frame++,k===!0&&le.beginShadows();let F=d.state.shadowsArray;if(he.render(F,M,N),k===!0&&le.endShadows(),this.info.autoReset===!0&&this.info.reset(),(De.enabled===!1||De.isPresenting===!1||De.hasDepthSensing()===!1)&&Ue.render(_,M),d.setupLights(v._useLegacyLights),N.isArrayCamera){let z=N.cameras;for(let D=0,ge=z.length;D<ge;D++){let Ee=z[D];mf(_,M,Ee,Ee.viewport)}}else mf(_,M,N);w!==null&&(xe.updateMultisampleRenderTarget(w),xe.updateRenderTargetMipmap(w)),M.isScene===!0&&M.onAfterRender(v,M,N),Se.resetDefaultState(),B=-1,j=null,b.pop(),b.length>0?d=b[b.length-1]:d=null,p.pop(),p.length>0?_=p[p.length-1]:_=null};function un(M,N,F,z){if(M.visible===!1)return;if(M.layers.test(N.layers)){if(M.isGroup)F=M.renderOrder;else if(M.isLOD)M.autoUpdate===!0&&M.update(N);else if(M.isLight)d.pushLight(M),M.castShadow&&d.pushShadow(M);else if(M.isSprite){if(!M.frustumCulled||Ie.intersectsSprite(M)){z&&ye.setFromMatrixPosition(M.matrixWorld).applyMatrix4(Ae);let Ee=H.update(M),Ce=M.material;Ce.visible&&_.push(M,Ee,Ce,F,ye.z,null)}}else if((M.isMesh||M.isLine||M.isPoints)&&(!M.frustumCulled||Ie.intersectsObject(M))){let Ee=H.update(M),Ce=M.material;if(z&&(M.boundingSphere!==void 0?(M.boundingSphere===null&&M.computeBoundingSphere(),ye.copy(M.boundingSphere.center)):(Ee.boundingSphere===null&&Ee.computeBoundingSphere(),ye.copy(Ee.boundingSphere.center)),ye.applyMatrix4(M.matrixWorld).applyMatrix4(Ae)),Array.isArray(Ce)){let Pe=Ee.groups;for(let Ve=0,Ne=Pe.length;Ve<Ne;Ve++){let Oe=Pe[Ve],ct=Ce[Oe.materialIndex];ct&&ct.visible&&_.push(M,Ee,ct,F,ye.z,Oe)}}else Ce.visible&&_.push(M,Ee,Ce,F,ye.z,null)}}let ge=M.children;for(let Ee=0,Ce=ge.length;Ee<Ce;Ee++)un(ge[Ee],N,F,z)}function mf(M,N,F,z){let D=M.opaque,ge=M.transmissive,Ee=M.transparent;d.setupLightsView(F),k===!0&&le.setGlobalState(v.clippingPlanes,F),ge.length>0&&Xx(D,ge,N,F),z&&Z.viewport(x.copy(z)),D.length>0&&ws(D,N,F),ge.length>0&&ws(ge,N,F),Ee.length>0&&ws(Ee,N,F),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Xx(M,N,F,z){if((F.isScene===!0?F.overrideMaterial:null)!==null)return;let ge=se.isWebGL2;me===null&&(me=new Fn(1,1,{generateMipmaps:!0,type:Y.has("EXT_color_buffer_half_float")?ps:ii,minFilter:wi,samples:ge?4:0})),v.getDrawingBufferSize(Me),ge?me.setSize(Me.x,Me.y):me.setSize($u(Me.x),$u(Me.y));let Ee=v.getRenderTarget();v.setRenderTarget(me),v.getClearColor(K),C=v.getClearAlpha(),C<1&&v.setClearColor(16777215,.5),v.clear();let Ce=v.toneMapping;v.toneMapping=ni,ws(M,F,z),xe.updateMultisampleRenderTarget(me),xe.updateRenderTargetMipmap(me);let Pe=!1;for(let Ve=0,Ne=N.length;Ve<Ne;Ve++){let Oe=N[Ve],ct=Oe.object,Ft=Oe.geometry,mt=Oe.material,Mn=Oe.group;if(mt.side===Un&&ct.layers.test(z.layers)){let st=mt.side;mt.side=Dt,mt.needsUpdate=!0,gf(ct,F,z,Ft,mt,Mn),mt.side=st,mt.needsUpdate=!0,Pe=!0}}Pe===!0&&(xe.updateMultisampleRenderTarget(me),xe.updateRenderTargetMipmap(me)),v.setRenderTarget(Ee),v.setClearColor(K,C),v.toneMapping=Ce}function ws(M,N,F){let z=N.isScene===!0?N.overrideMaterial:null;for(let D=0,ge=M.length;D<ge;D++){let Ee=M[D],Ce=Ee.object,Pe=Ee.geometry,Ve=z===null?Ee.material:z,Ne=Ee.group;Ce.layers.test(F.layers)&&gf(Ce,N,F,Pe,Ve,Ne)}}function gf(M,N,F,z,D,ge){M.onBeforeRender(v,N,F,z,D,ge),M.modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,M.matrixWorld),M.normalMatrix.getNormalMatrix(M.modelViewMatrix),D.onBeforeRender(v,N,F,z,M,ge),D.transparent===!0&&D.side===Un&&D.forceSinglePass===!1?(D.side=Dt,D.needsUpdate=!0,v.renderBufferDirect(F,N,z,D,M,ge),D.side=si,D.needsUpdate=!0,v.renderBufferDirect(F,N,z,D,M,ge),D.side=Un):v.renderBufferDirect(F,N,z,D,M,ge),M.onAfterRender(v,N,F,z,D,ge)}function Rs(M,N,F){N.isScene!==!0&&(N=ke);let z=pe.get(M),D=d.state.lights,ge=d.state.shadowsArray,Ee=D.state.version,Ce=ee.getParameters(M,D.state,ge,N,F),Pe=ee.getProgramCacheKey(Ce),Ve=z.programs;z.environment=M.isMeshStandardMaterial?N.environment:null,z.fog=N.fog,z.envMap=(M.isMeshStandardMaterial?S:Ge).get(M.envMap||z.environment),z.envMapRotation=z.environment!==null&&M.envMap===null?N.environmentRotation:M.envMapRotation,Ve===void 0&&(M.addEventListener("dispose",O),Ve=new Map,z.programs=Ve);let Ne=Ve.get(Pe);if(Ne!==void 0){if(z.currentProgram===Ne&&z.lightsStateVersion===Ee)return _f(M,Ce),Ne}else Ce.uniforms=ee.getUniforms(M),M.onBuild(F,Ce,v),M.onBeforeCompile(Ce,v),Ne=ee.acquireProgram(Ce,Pe),Ve.set(Pe,Ne),z.uniforms=Ce.uniforms;let Oe=z.uniforms;return(!M.isShaderMaterial&&!M.isRawShaderMaterial||M.clipping===!0)&&(Oe.clippingPlanes=le.uniform),_f(M,Ce),z.needsLights=Zx(M),z.lightsStateVersion=Ee,z.needsLights&&(Oe.ambientLightColor.value=D.state.ambient,Oe.lightProbe.value=D.state.probe,Oe.directionalLights.value=D.state.directional,Oe.directionalLightShadows.value=D.state.directionalShadow,Oe.spotLights.value=D.state.spot,Oe.spotLightShadows.value=D.state.spotShadow,Oe.rectAreaLights.value=D.state.rectArea,Oe.ltc_1.value=D.state.rectAreaLTC1,Oe.ltc_2.value=D.state.rectAreaLTC2,Oe.pointLights.value=D.state.point,Oe.pointLightShadows.value=D.state.pointShadow,Oe.hemisphereLights.value=D.state.hemi,Oe.directionalShadowMap.value=D.state.directionalShadowMap,Oe.directionalShadowMatrix.value=D.state.directionalShadowMatrix,Oe.spotShadowMap.value=D.state.spotShadowMap,Oe.spotLightMatrix.value=D.state.spotLightMatrix,Oe.spotLightMap.value=D.state.spotLightMap,Oe.pointShadowMap.value=D.state.pointShadowMap,Oe.pointShadowMatrix.value=D.state.pointShadowMatrix),z.currentProgram=Ne,z.uniformsList=null,Ne}function vf(M){if(M.uniformsList===null){let N=M.currentProgram.getUniforms();M.uniformsList=br.seqWithValue(N.seq,M.uniforms)}return M.uniformsList}function _f(M,N){let F=pe.get(M);F.outputColorSpace=N.outputColorSpace,F.batching=N.batching,F.instancing=N.instancing,F.instancingColor=N.instancingColor,F.instancingMorph=N.instancingMorph,F.skinning=N.skinning,F.morphTargets=N.morphTargets,F.morphNormals=N.morphNormals,F.morphColors=N.morphColors,F.morphTargetsCount=N.morphTargetsCount,F.numClippingPlanes=N.numClippingPlanes,F.numIntersection=N.numClipIntersection,F.vertexAlphas=N.vertexAlphas,F.vertexTangents=N.vertexTangents,F.toneMapping=N.toneMapping}function Yx(M,N,F,z,D){N.isScene!==!0&&(N=ke),xe.resetTextureUnits();let ge=N.fog,Ee=z.isMeshStandardMaterial?N.environment:null,Ce=w===null?v.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:ci,Pe=(z.isMeshStandardMaterial?S:Ge).get(z.envMap||Ee),Ve=z.vertexColors===!0&&!!F.attributes.color&&F.attributes.color.itemSize===4,Ne=!!F.attributes.tangent&&(!!z.normalMap||z.anisotropy>0),Oe=!!F.morphAttributes.position,ct=!!F.morphAttributes.normal,Ft=!!F.morphAttributes.color,mt=ni;z.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(mt=v.toneMapping);let Mn=F.morphAttributes.position||F.morphAttributes.normal||F.morphAttributes.color,st=Mn!==void 0?Mn.length:0,Fe=pe.get(z),Wo=d.state.lights;if(k===!0&&(Q===!0||M!==j)){let Wt=M===j&&z.id===B;le.setState(z,M,Wt)}let nt=!1;z.version===Fe.__version?(Fe.needsLights&&Fe.lightsStateVersion!==Wo.state.version||Fe.outputColorSpace!==Ce||D.isBatchedMesh&&Fe.batching===!1||!D.isBatchedMesh&&Fe.batching===!0||D.isInstancedMesh&&Fe.instancing===!1||!D.isInstancedMesh&&Fe.instancing===!0||D.isSkinnedMesh&&Fe.skinning===!1||!D.isSkinnedMesh&&Fe.skinning===!0||D.isInstancedMesh&&Fe.instancingColor===!0&&D.instanceColor===null||D.isInstancedMesh&&Fe.instancingColor===!1&&D.instanceColor!==null||D.isInstancedMesh&&Fe.instancingMorph===!0&&D.morphTexture===null||D.isInstancedMesh&&Fe.instancingMorph===!1&&D.morphTexture!==null||Fe.envMap!==Pe||z.fog===!0&&Fe.fog!==ge||Fe.numClippingPlanes!==void 0&&(Fe.numClippingPlanes!==le.numPlanes||Fe.numIntersection!==le.numIntersection)||Fe.vertexAlphas!==Ve||Fe.vertexTangents!==Ne||Fe.morphTargets!==Oe||Fe.morphNormals!==ct||Fe.morphColors!==Ft||Fe.toneMapping!==mt||se.isWebGL2===!0&&Fe.morphTargetsCount!==st)&&(nt=!0):(nt=!0,Fe.__version=z.version);let li=Fe.currentProgram;nt===!0&&(li=Rs(z,N,D));let yf=!1,Fr=!1,qo=!1,Mt=li.getUniforms(),ui=Fe.uniforms;if(Z.useProgram(li.program)&&(yf=!0,Fr=!0,qo=!0),z.id!==B&&(B=z.id,Fr=!0),yf||j!==M){Mt.setValue(T,"projectionMatrix",M.projectionMatrix),Mt.setValue(T,"viewMatrix",M.matrixWorldInverse);let Wt=Mt.map.cameraPosition;Wt!==void 0&&Wt.setValue(T,ye.setFromMatrixPosition(M.matrixWorld)),se.logarithmicDepthBuffer&&Mt.setValue(T,"logDepthBufFC",2/(Math.log(M.far+1)/Math.LN2)),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&Mt.setValue(T,"isOrthographic",M.isOrthographicCamera===!0),j!==M&&(j=M,Fr=!0,qo=!0)}if(D.isSkinnedMesh){Mt.setOptional(T,D,"bindMatrix"),Mt.setOptional(T,D,"bindMatrixInverse");let Wt=D.skeleton;Wt&&(se.floatVertexTextures?(Wt.boneTexture===null&&Wt.computeBoneTexture(),Mt.setValue(T,"boneTexture",Wt.boneTexture,xe)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}D.isBatchedMesh&&(Mt.setOptional(T,D,"batchingTexture"),Mt.setValue(T,"batchingTexture",D._matricesTexture,xe));let Xo=F.morphAttributes;if((Xo.position!==void 0||Xo.normal!==void 0||Xo.color!==void 0&&se.isWebGL2===!0)&&ae.update(D,F,li),(Fr||Fe.receiveShadow!==D.receiveShadow)&&(Fe.receiveShadow=D.receiveShadow,Mt.setValue(T,"receiveShadow",D.receiveShadow)),z.isMeshGouraudMaterial&&z.envMap!==null&&(ui.envMap.value=Pe,ui.flipEnvMap.value=Pe.isCubeTexture&&Pe.isRenderTargetTexture===!1?-1:1),Fr&&(Mt.setValue(T,"toneMappingExposure",v.toneMappingExposure),Fe.needsLights&&$x(ui,qo),ge&&z.fog===!0&&J.refreshFogUniforms(ui,ge),J.refreshMaterialUniforms(ui,z,$,G,me),br.upload(T,vf(Fe),ui,xe)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(br.upload(T,vf(Fe),ui,xe),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&Mt.setValue(T,"center",D.center),Mt.setValue(T,"modelViewMatrix",D.modelViewMatrix),Mt.setValue(T,"normalMatrix",D.normalMatrix),Mt.setValue(T,"modelMatrix",D.matrixWorld),z.isShaderMaterial||z.isRawShaderMaterial){let Wt=z.uniformsGroups;for(let Yo=0,Jx=Wt.length;Yo<Jx;Yo++)if(se.isWebGL2){let xf=Wt[Yo];be.update(xf,li),be.bind(xf,li)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return li}function $x(M,N){M.ambientLightColor.needsUpdate=N,M.lightProbe.needsUpdate=N,M.directionalLights.needsUpdate=N,M.directionalLightShadows.needsUpdate=N,M.pointLights.needsUpdate=N,M.pointLightShadows.needsUpdate=N,M.spotLights.needsUpdate=N,M.spotLightShadows.needsUpdate=N,M.rectAreaLights.needsUpdate=N,M.hemisphereLights.needsUpdate=N}function Zx(M){return M.isMeshLambertMaterial||M.isMeshToonMaterial||M.isMeshPhongMaterial||M.isMeshStandardMaterial||M.isShadowMaterial||M.isShaderMaterial&&M.lights===!0}this.getActiveCubeFace=function(){return I},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(M,N,F){pe.get(M.texture).__webglTexture=N,pe.get(M.depthTexture).__webglTexture=F;let z=pe.get(M);z.__hasExternalTextures=!0,z.__autoAllocateDepthBuffer=F===void 0,z.__autoAllocateDepthBuffer||Y.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),z.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(M,N){let F=pe.get(M);F.__webglFramebuffer=N,F.__useDefaultFramebuffer=N===void 0},this.setRenderTarget=function(M,N=0,F=0){w=M,I=N,R=F;let z=!0,D=null,ge=!1,Ee=!1;if(M){let Pe=pe.get(M);Pe.__useDefaultFramebuffer!==void 0?(Z.bindFramebuffer(T.FRAMEBUFFER,null),z=!1):Pe.__webglFramebuffer===void 0?xe.setupRenderTarget(M):Pe.__hasExternalTextures&&xe.rebindTextures(M,pe.get(M.texture).__webglTexture,pe.get(M.depthTexture).__webglTexture);let Ve=M.texture;(Ve.isData3DTexture||Ve.isDataArrayTexture||Ve.isCompressedArrayTexture)&&(Ee=!0);let Ne=pe.get(M).__webglFramebuffer;M.isWebGLCubeRenderTarget?(Array.isArray(Ne[N])?D=Ne[N][F]:D=Ne[N],ge=!0):se.isWebGL2&&M.samples>0&&xe.useMultisampledRTT(M)===!1?D=pe.get(M).__webglMultisampledFramebuffer:Array.isArray(Ne)?D=Ne[F]:D=Ne,x.copy(M.viewport),A.copy(M.scissor),re=M.scissorTest}else x.copy(ne).multiplyScalar($).floor(),A.copy(te).multiplyScalar($).floor(),re=ve;if(Z.bindFramebuffer(T.FRAMEBUFFER,D)&&se.drawBuffers&&z&&Z.drawBuffers(M,D),Z.viewport(x),Z.scissor(A),Z.setScissorTest(re),ge){let Pe=pe.get(M.texture);T.framebufferTexture2D(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,T.TEXTURE_CUBE_MAP_POSITIVE_X+N,Pe.__webglTexture,F)}else if(Ee){let Pe=pe.get(M.texture),Ve=N||0;T.framebufferTextureLayer(T.FRAMEBUFFER,T.COLOR_ATTACHMENT0,Pe.__webglTexture,F||0,Ve)}B=-1},this.readRenderTargetPixels=function(M,N,F,z,D,ge,Ee){if(!(M&&M.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ce=pe.get(M).__webglFramebuffer;if(M.isWebGLCubeRenderTarget&&Ee!==void 0&&(Ce=Ce[Ee]),Ce){Z.bindFramebuffer(T.FRAMEBUFFER,Ce);try{let Pe=M.texture,Ve=Pe.format,Ne=Pe.type;if(Ve!==an&&we.convert(Ve)!==T.getParameter(T.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Oe=Ne===ps&&(Y.has("EXT_color_buffer_half_float")||se.isWebGL2&&Y.has("EXT_color_buffer_float"));if(Ne!==ii&&we.convert(Ne)!==T.getParameter(T.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ne===Nn&&(se.isWebGL2||Y.has("OES_texture_float")||Y.has("WEBGL_color_buffer_float")))&&!Oe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}N>=0&&N<=M.width-z&&F>=0&&F<=M.height-D&&T.readPixels(N,F,z,D,we.convert(Ve),we.convert(Ne),ge)}finally{let Pe=w!==null?pe.get(w).__webglFramebuffer:null;Z.bindFramebuffer(T.FRAMEBUFFER,Pe)}}},this.copyFramebufferToTexture=function(M,N,F=0){let z=Math.pow(2,-F),D=Math.floor(N.image.width*z),ge=Math.floor(N.image.height*z);xe.setTexture2D(N,0),T.copyTexSubImage2D(T.TEXTURE_2D,F,0,0,M.x,M.y,D,ge),Z.unbindTexture()},this.copyTextureToTexture=function(M,N,F,z=0){let D=N.image.width,ge=N.image.height,Ee=we.convert(F.format),Ce=we.convert(F.type);xe.setTexture2D(F,0),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,F.flipY),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),T.pixelStorei(T.UNPACK_ALIGNMENT,F.unpackAlignment),N.isDataTexture?T.texSubImage2D(T.TEXTURE_2D,z,M.x,M.y,D,ge,Ee,Ce,N.image.data):N.isCompressedTexture?T.compressedTexSubImage2D(T.TEXTURE_2D,z,M.x,M.y,N.mipmaps[0].width,N.mipmaps[0].height,Ee,N.mipmaps[0].data):T.texSubImage2D(T.TEXTURE_2D,z,M.x,M.y,Ee,Ce,N.image),z===0&&F.generateMipmaps&&T.generateMipmap(T.TEXTURE_2D),Z.unbindTexture()},this.copyTextureToTexture3D=function(M,N,F,z,D=0){if(v.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let ge=Math.round(M.max.x-M.min.x),Ee=Math.round(M.max.y-M.min.y),Ce=M.max.z-M.min.z+1,Pe=we.convert(z.format),Ve=we.convert(z.type),Ne;if(z.isData3DTexture)xe.setTexture3D(z,0),Ne=T.TEXTURE_3D;else if(z.isDataArrayTexture||z.isCompressedArrayTexture)xe.setTexture2DArray(z,0),Ne=T.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,z.flipY),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,z.premultiplyAlpha),T.pixelStorei(T.UNPACK_ALIGNMENT,z.unpackAlignment);let Oe=T.getParameter(T.UNPACK_ROW_LENGTH),ct=T.getParameter(T.UNPACK_IMAGE_HEIGHT),Ft=T.getParameter(T.UNPACK_SKIP_PIXELS),mt=T.getParameter(T.UNPACK_SKIP_ROWS),Mn=T.getParameter(T.UNPACK_SKIP_IMAGES),st=F.isCompressedTexture?F.mipmaps[D]:F.image;T.pixelStorei(T.UNPACK_ROW_LENGTH,st.width),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,st.height),T.pixelStorei(T.UNPACK_SKIP_PIXELS,M.min.x),T.pixelStorei(T.UNPACK_SKIP_ROWS,M.min.y),T.pixelStorei(T.UNPACK_SKIP_IMAGES,M.min.z),F.isDataTexture||F.isData3DTexture?T.texSubImage3D(Ne,D,N.x,N.y,N.z,ge,Ee,Ce,Pe,Ve,st.data):z.isCompressedArrayTexture?T.compressedTexSubImage3D(Ne,D,N.x,N.y,N.z,ge,Ee,Ce,Pe,st.data):T.texSubImage3D(Ne,D,N.x,N.y,N.z,ge,Ee,Ce,Pe,Ve,st),T.pixelStorei(T.UNPACK_ROW_LENGTH,Oe),T.pixelStorei(T.UNPACK_IMAGE_HEIGHT,ct),T.pixelStorei(T.UNPACK_SKIP_PIXELS,Ft),T.pixelStorei(T.UNPACK_SKIP_ROWS,mt),T.pixelStorei(T.UNPACK_SKIP_IMAGES,Mn),D===0&&z.generateMipmaps&&T.generateMipmap(Ne),Z.unbindTexture()},this.initTexture=function(M){M.isCubeTexture?xe.setTextureCube(M,0):M.isData3DTexture?xe.setTexture3D(M,0):M.isDataArrayTexture||M.isCompressedArrayTexture?xe.setTexture2DArray(M,0):xe.setTexture2D(M,0),Z.unbindTexture()},this.resetState=function(){I=0,R=0,w=null,Z.reset(),Se.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Dn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===Fh?"display-p3":"srgb",t.unpackColorSpace=Je.workingColorSpace===Lo?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}},dh=class extends fh{};dh.prototype.isWebGL1Renderer=!0;var To=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=qu,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=On()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return cy("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,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=On()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=On()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},Pt=new U,vs=class n{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Pt.fromBufferAttribute(this,t),Pt.applyMatrix4(e),this.setXYZ(t,Pt.x,Pt.y,Pt.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Pt.fromBufferAttribute(this,t),Pt.applyNormalMatrix(e),this.setXYZ(t,Pt.x,Pt.y,Pt.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Pt.fromBufferAttribute(this,t),Pt.transformDirection(e),this.setXYZ(t,Pt.x,Pt.y,Pt.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=yn(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ze(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Ze(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ze(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ze(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ze(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=yn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=yn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=yn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=yn(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ze(t,this.array),i=Ze(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ze(t,this.array),i=Ze(i,this.array),r=Ze(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ze(t,this.array),i=Ze(i,this.array),r=Ze(r,this.array),s=Ze(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let i=0;i<this.count;i++){let r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new rt(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new n(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let i=0;i<this.count;i++){let r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},ph=class extends Ni{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Xe(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},jn,cs=new U,mr=new U,gr=new U,vr=new ie,ls=new ie,vy=new ft,Ka=new U,us=new U,ja=new U,W0=new ie,Du=new ie,q0=new ie,mh=class extends cn{constructor(e=new ph){if(super(),this.isSprite=!0,this.type="Sprite",jn===void 0){jn=new Ot;let t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new To(t,5);jn.setIndex([0,1,2,0,2,3]),jn.setAttribute("position",new vs(i,3,0,!1)),jn.setAttribute("uv",new vs(i,2,3,!1))}this.geometry=jn,this.material=e,this.center=new ie(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),mr.setFromMatrixScale(this.matrixWorld),vy.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),gr.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&mr.multiplyScalar(-gr.z);let i=this.material.rotation,r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));let o=this.center;Qa(Ka.set(-.5,-.5,0),gr,o,mr,r,s),Qa(us.set(.5,-.5,0),gr,o,mr,r,s),Qa(ja.set(.5,.5,0),gr,o,mr,r,s),W0.set(0,0),Du.set(1,0),q0.set(1,1);let a=e.ray.intersectTriangle(Ka,us,ja,!1,cs);if(a===null&&(Qa(us.set(-.5,.5,0),gr,o,mr,r,s),Du.set(0,1),a=e.ray.intersectTriangle(Ka,ja,us,!1,cs),a===null))return;let c=e.ray.origin.distanceTo(cs);c<e.near||c>e.far||t.push({distance:c,point:cs.clone(),uv:Ri.getInterpolation(cs,Ka,us,ja,W0,Du,q0,new ie),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};mh.Dispose=function(){jn.dispose(),jn=void 0};function Qa(n,e,t,i,r,s){vr.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(ls.x=s*vr.x-r*vr.y,ls.y=r*vr.x+s*vr.y):ls.copy(vr),n.copy(e),n.x+=ls.x,n.y+=ls.y,n.applyMatrix4(vy)}var Zt=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let 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;let t=[],i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let i=this.getLengths(),r=0,s=i.length,o;t?o=t:o=e*i[s-1];let a=0,c=s-1,l;for(;a<=c;)if(r=Math.floor(a+(c-a)/2),l=i[r]-o,l<0)a=r+1;else if(l>0)c=r-1;else{c=r;break}if(r=c,i[r]===o)return r/(s-1);let u=i[r],f=i[r+1]-u,m=(o-u)/f;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);let o=this.getPoint(r),a=this.getPoint(s),c=t||(o.isVector2?new ie:new U);return c.copy(a).sub(o).normalize(),c}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new U,r=[],s=[],o=[],a=new U,c=new ft;for(let m=0;m<=e;m++){let g=m/e;r[m]=this.getTangentAt(g,new U)}s[0]=new U,o[0]=new U;let l=Number.MAX_VALUE,u=Math.abs(r[0].x),h=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=l&&(l=u,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),f<=l&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();let g=Math.acos(At(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(c.makeRotationAxis(a,g))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos(At(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let g=1;g<=e;g++)s[g].applyMatrix4(c.makeRotationAxis(r[g],m*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let 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}},_s=class extends Zt{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=c}getPoint(e,t=new ie){let i=t,r=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);let a=this.aStartAngle+e*s,c=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){let u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),f=c-this.aX,m=l-this.aY;c=f*u-m*h+this.aX,l=f*h+m*u+this.aY}return i.set(c,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},gh=class extends _s{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.isArcCurve=!0,this.type="ArcCurve"}};function zh(){let n=0,e=0,t=0,i=0;function r(s,o,a,c){n=s,e=a,t=-3*s+3*o-2*a-c,i=2*s-2*o+a+c}return{initCatmullRom:function(s,o,a,c,l){r(o,a,l*(a-s),l*(c-o))},initNonuniformCatmullRom:function(s,o,a,c,l,u,h){let f=(o-s)/l-(a-s)/(l+u)+(a-o)/u,m=(a-o)/u-(c-o)/(u+h)+(c-a)/h;f*=u,m*=u,r(o,a,f,m)},calc:function(s){let o=s*s,a=o*s;return n+e*s+t*o+i*a}}}var eo=new U,Ou=new zh,Fu=new zh,Bu=new zh,vh=class extends Zt{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new U){let i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e,a=Math.floor(o),c=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:c===0&&a===s-1&&(a=s-2,c=1);let l,u;this.closed||a>0?l=r[(a-1)%s]:(eo.subVectors(r[0],r[1]).add(r[0]),l=eo);let h=r[a%s],f=r[(a+1)%s];if(this.closed||a+2<s?u=r[(a+2)%s]:(eo.subVectors(r[s-1],r[s-2]).add(r[s-1]),u=eo),this.curveType==="centripetal"||this.curveType==="chordal"){let m=this.curveType==="chordal"?.5:.25,g=Math.pow(l.distanceToSquared(h),m),_=Math.pow(h.distanceToSquared(f),m),d=Math.pow(f.distanceToSquared(u),m);_<1e-4&&(_=1),g<1e-4&&(g=_),d<1e-4&&(d=_),Ou.initNonuniformCatmullRom(l.x,h.x,f.x,u.x,g,_,d),Fu.initNonuniformCatmullRom(l.y,h.y,f.y,u.y,g,_,d),Bu.initNonuniformCatmullRom(l.z,h.z,f.z,u.z,g,_,d)}else this.curveType==="catmullrom"&&(Ou.initCatmullRom(l.x,h.x,f.x,u.x,this.tension),Fu.initCatmullRom(l.y,h.y,f.y,u.y,this.tension),Bu.initCatmullRom(l.z,h.z,f.z,u.z,this.tension));return i.set(Ou.calc(c),Fu.calc(c),Bu.calc(c)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(new U().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};function X0(n,e,t,i,r){let s=(i-e)*.5,o=(r-t)*.5,a=n*n,c=n*a;return(2*t-2*i+s+o)*c+(-3*t+3*i-2*s-o)*a+s*n+t}function aN(n,e){let t=1-n;return t*t*e}function oN(n,e){return 2*(1-n)*n*e}function cN(n,e){return n*n*e}function fs(n,e,t,i){return aN(n,e)+oN(n,t)+cN(n,i)}function lN(n,e){let t=1-n;return t*t*t*e}function uN(n,e){let t=1-n;return 3*t*t*n*e}function hN(n,e){return 3*(1-n)*n*n*e}function fN(n,e){return n*n*n*e}function ds(n,e,t,i,r){return lN(n,e)+uN(n,t)+hN(n,i)+fN(n,r)}var wo=class extends Zt{constructor(e=new ie,t=new ie,i=new ie,r=new ie){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new ie){let i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(ds(e,r.x,s.x,o.x,a.x),ds(e,r.y,s.y,o.y,a.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},_h=class extends Zt{constructor(e=new U,t=new U,i=new U,r=new U){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new U){let i=t,r=this.v0,s=this.v1,o=this.v2,a=this.v3;return i.set(ds(e,r.x,s.x,o.x,a.x),ds(e,r.y,s.y,o.y,a.y),ds(e,r.z,s.z,o.z,a.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},Ro=class extends Zt{constructor(e=new ie,t=new ie){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ie){let i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new ie){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},yh=class extends Zt{constructor(e=new U,t=new U){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new U){let i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new U){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Co=class extends Zt{constructor(e=new ie,t=new ie,i=new ie){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new ie){let i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(fs(e,r.x,s.x,o.x),fs(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},xh=class extends Zt{constructor(e=new U,t=new U,i=new U){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new U){let i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(fs(e,r.x,s.x,o.x),fs(e,r.y,s.y,o.y),fs(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Po=class extends Zt{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new ie){let i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),a=s-o,c=r[o===0?o:o-1],l=r[o],u=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(X0(a,c.x,l.x,u.x,h.x),X0(a,c.y,l.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(r.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(new ie().fromArray(r))}return this}},Mh=Object.freeze({__proto__:null,ArcCurve:gh,CatmullRomCurve3:vh,CubicBezierCurve:wo,CubicBezierCurve3:_h,EllipseCurve:_s,LineCurve:Ro,LineCurve3:yh,QuadraticBezierCurve:Co,QuadraticBezierCurve3:xh,SplineCurve:Po}),Sh=class extends Zt{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Mh[i](t,e))}return this}getPoint(e,t){let i=e*this.getLength(),r=this.getCurveLengths(),s=0;for(;s<r.length;){if(r[s]>=i){let o=r[s]-i,a=this.curves[s],c=a.getLength(),l=c===0?0:1-o/c;return a.getPointAt(l,t)}s++}return null}getLength(){let 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;let e=[],t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t=[],i;for(let r=0,s=this.curves;r<s.length;r++){let o=s[r],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,c=o.getPoints(a);for(let l=0;l<c.length;l++){let u=c[l];i&&i.equals(u)||(t.push(u),i=u)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){let r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let r=e.curves[t];this.curves.push(new Mh[r.type]().fromJSON(r))}return this}},Rr=class extends Sh{constructor(e){super(),this.type="Path",this.currentPoint=new ie,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let i=new Ro(this.currentPoint.clone(),new ie(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){let s=new Co(this.currentPoint.clone(),new ie(e,t),new ie(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){let a=new wo(this.currentPoint.clone(),new ie(e,t),new ie(i,r),new ie(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),i=new Po(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){let a=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+a,t+c,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,a,c){let l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,i,r,s,o,a,c),this}absellipse(e,t,i,r,s,o,a,c){let l=new _s(e,t,i,r,s,o,a,c);if(this.curves.length>0){let h=l.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(l);let u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};var Cr=class extends Rr{constructor(e){super(e),this.uuid=On(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){let r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let r=e.holes[t];this.holes.push(new Rr().fromJSON(r))}return this}},dN={triangulate:function(n,e,t=2){let i=e&&e.length,r=i?e[0]*t:n.length,s=_y(n,0,r,t,!0),o=[];if(!s||s.next===s.prev)return o;let a,c,l,u,h,f,m;if(i&&(s=_N(n,e,s,t)),n.length>80*t){a=l=n[0],c=u=n[1];for(let g=t;g<r;g+=t)h=n[g],f=n[g+1],h<a&&(a=h),f<c&&(c=f),h>l&&(l=h),f>u&&(u=f);m=Math.max(l-a,u-c),m=m!==0?32767/m:0}return ys(s,o,t,a,c,m,0),o}};function _y(n,e,t,i,r){let s,o;if(r===CN(n,e,t,i)>0)for(s=e;s<t;s+=i)o=Y0(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=Y0(s,n[s],n[s+1],o);return o&&No(o,o.next)&&(Ms(o),o=o.next),o}function Di(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(No(t,t.next)||ot(t.prev,t,t.next)===0)){if(Ms(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function ys(n,e,t,i,r,s,o){if(!n)return;!o&&s&&bN(n,i,r,s);let a=n,c,l;for(;n.prev!==n.next;){if(c=n.prev,l=n.next,s?mN(n,i,r,s):pN(n)){e.push(c.i/t|0),e.push(n.i/t|0),e.push(l.i/t|0),Ms(n),n=l.next,a=l.next;continue}if(n=l,n===a){o?o===1?(n=gN(Di(n),e,t),ys(n,e,t,i,r,s,2)):o===2&&vN(n,e,t,i,r,s):ys(Di(n),e,t,i,r,s,1);break}}}function pN(n){let e=n.prev,t=n,i=n.next;if(ot(e,t,i)>=0)return!1;let r=e.x,s=t.x,o=i.x,a=e.y,c=t.y,l=i.y,u=r<s?r<o?r:o:s<o?s:o,h=a<c?a<l?a:l:c<l?c:l,f=r>s?r>o?r:o:s>o?s:o,m=a>c?a>l?a:l:c>l?c:l,g=i.next;for(;g!==e;){if(g.x>=u&&g.x<=f&&g.y>=h&&g.y<=m&&xr(r,a,s,c,o,l,g.x,g.y)&&ot(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function mN(n,e,t,i){let r=n.prev,s=n,o=n.next;if(ot(r,s,o)>=0)return!1;let a=r.x,c=s.x,l=o.x,u=r.y,h=s.y,f=o.y,m=a<c?a<l?a:l:c<l?c:l,g=u<h?u<f?u:f:h<f?h:f,_=a>c?a>l?a:l:c>l?c:l,d=u>h?u>f?u:f:h>f?h:f,p=bh(m,g,e,t,i),b=bh(_,d,e,t,i),v=n.prevZ,E=n.nextZ;for(;v&&v.z>=p&&E&&E.z<=b;){if(v.x>=m&&v.x<=_&&v.y>=g&&v.y<=d&&v!==r&&v!==o&&xr(a,u,c,h,l,f,v.x,v.y)&&ot(v.prev,v,v.next)>=0||(v=v.prevZ,E.x>=m&&E.x<=_&&E.y>=g&&E.y<=d&&E!==r&&E!==o&&xr(a,u,c,h,l,f,E.x,E.y)&&ot(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;v&&v.z>=p;){if(v.x>=m&&v.x<=_&&v.y>=g&&v.y<=d&&v!==r&&v!==o&&xr(a,u,c,h,l,f,v.x,v.y)&&ot(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;E&&E.z<=b;){if(E.x>=m&&E.x<=_&&E.y>=g&&E.y<=d&&E!==r&&E!==o&&xr(a,u,c,h,l,f,E.x,E.y)&&ot(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function gN(n,e,t){let i=n;do{let r=i.prev,s=i.next.next;!No(r,s)&&yy(r,i,i.next,s)&&xs(r,s)&&xs(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Ms(i),Ms(i.next),i=n=s),i=i.next}while(i!==n);return Di(i)}function vN(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&TN(o,a)){let c=xy(o,a);o=Di(o,o.next),c=Di(c,c.next),ys(o,e,t,i,r,s,0),ys(c,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function _N(n,e,t,i){let r=[],s,o,a,c,l;for(s=0,o=e.length;s<o;s++)a=e[s]*i,c=s<o-1?e[s+1]*i:n.length,l=_y(n,a,c,i,!1),l===l.next&&(l.steiner=!0),r.push(AN(l));for(r.sort(yN),s=0;s<r.length;s++)t=xN(r[s],t);return t}function yN(n,e){return n.x-e.x}function xN(n,e){let t=MN(n,e);if(!t)return e;let i=xy(t,n);return Di(i,i.next),Di(t,t.next)}function MN(n,e){let t=e,i=-1/0,r,s=n.x,o=n.y;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){let f=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=s&&f>i&&(i=f,r=t.x<t.next.x?t:t.next,f===s))return r}t=t.next}while(t!==e);if(!r)return null;let a=r,c=r.x,l=r.y,u=1/0,h;t=r;do s>=t.x&&t.x>=c&&s!==t.x&&xr(o<l?s:i,o,c,l,o<l?i:s,o,t.x,t.y)&&(h=Math.abs(o-t.y)/(s-t.x),xs(t,n)&&(h<u||h===u&&(t.x>r.x||t.x===r.x&&SN(r,t)))&&(r=t,u=h)),t=t.next;while(t!==a);return r}function SN(n,e){return ot(n.prev,n,e.prev)<0&&ot(e.next,n,n.next)<0}function bN(n,e,t,i){let r=n;do r.z===0&&(r.z=bh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,EN(r)}function EN(n){let e,t,i,r,s,o,a,c,l=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e<l&&(a++,i=i.nextZ,!!i);e++);for(c=l;a>0||c>0&&i;)a!==0&&(c===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,c--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,l*=2}while(o>1);return n}function bh(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function AN(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function xr(n,e,t,i,r,s,o,a){return(r-o)*(e-a)>=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function TN(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!wN(n,e)&&(xs(n,e)&&xs(e,n)&&RN(n,e)&&(ot(n.prev,n,e.prev)||ot(n,e.prev,e))||No(n,e)&&ot(n.prev,n,n.next)>0&&ot(e.prev,e,e.next)>0)}function ot(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function No(n,e){return n.x===e.x&&n.y===e.y}function yy(n,e,t,i){let r=no(ot(n,e,t)),s=no(ot(n,e,i)),o=no(ot(t,i,n)),a=no(ot(t,i,e));return!!(r!==s&&o!==a||r===0&&to(n,t,e)||s===0&&to(n,i,e)||o===0&&to(t,n,i)||a===0&&to(t,e,i))}function to(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function no(n){return n>0?1:n<0?-1:0}function wN(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&yy(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function xs(n,e){return ot(n.prev,n,n.next)<0?ot(n,e,n.next)>=0&&ot(n,n.prev,e)>=0:ot(n,e,n.prev)<0||ot(n,n.next,e)<0}function RN(n,e){let t=n,i=!1,r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function xy(n,e){let t=new Eh(n.i,n.x,n.y),i=new Eh(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Y0(n,e,t,i){let r=new Eh(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Ms(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Eh(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function CN(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}var ri=class n{static area(e){let t=e.length,i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return n.area(e)<0}static triangulateShape(e,t){let i=[],r=[],s=[];$0(e),Z0(i,e);let o=e.length;t.forEach($0);for(let c=0;c<t.length;c++)r.push(o),o+=t[c].length,Z0(i,t[c]);let a=dN.triangulate(i,r);for(let c=0;c<a.length;c+=3)s.push(a.slice(c,c+3));return s}};function $0(n){let e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Z0(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}var Pr=class n extends Ot{constructor(e=new Cr([new ie(.5,.5),new ie(-.5,.5),new ie(-.5,-.5),new ie(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let i=this,r=[],s=[];for(let a=0,c=e.length;a<c;a++){let l=e[a];o(l)}this.setAttribute("position",new xt(r,3)),this.setAttribute("uv",new xt(s,2)),this.computeVertexNormals();function o(a){let c=[],l=t.curveSegments!==void 0?t.curveSegments:12,u=t.steps!==void 0?t.steps:1,h=t.depth!==void 0?t.depth:1,f=t.bevelEnabled!==void 0?t.bevelEnabled:!0,m=t.bevelThickness!==void 0?t.bevelThickness:.2,g=t.bevelSize!==void 0?t.bevelSize:m-.1,_=t.bevelOffset!==void 0?t.bevelOffset:0,d=t.bevelSegments!==void 0?t.bevelSegments:3,p=t.extrudePath,b=t.UVGenerator!==void 0?t.UVGenerator:PN,v,E=!1,I,R,w,B;p&&(v=p.getSpacedPoints(u),E=!0,f=!1,I=p.computeFrenetFrames(u,!1),R=new U,w=new U,B=new U),f||(d=0,m=0,g=0,_=0);let j=a.extractPoints(l),x=j.shape,A=j.holes;if(!ri.isClockWise(x)){x=x.reverse();for(let T=0,oe=A.length;T<oe;T++){let Y=A[T];ri.isClockWise(Y)&&(A[T]=Y.reverse())}}let K=ri.triangulateShape(x,A),C=x;for(let T=0,oe=A.length;T<oe;T++){let Y=A[T];x=x.concat(Y)}function W(T,oe,Y){return oe||console.error("THREE.ExtrudeGeometry: vec does not exist"),T.clone().addScaledVector(oe,Y)}let G=x.length,$=K.length;function q(T,oe,Y){let se,Z,_e,pe=T.x-oe.x,xe=T.y-oe.y,Ge=Y.x-T.x,S=Y.y-T.y,y=pe*pe+xe*xe,V=pe*S-xe*Ge;if(Math.abs(V)>Number.EPSILON){let H=Math.sqrt(y),ee=Math.sqrt(Ge*Ge+S*S),J=oe.x-xe/H,Le=oe.y+pe/H,Re=Y.x-S/ee,le=Y.y+Ge/ee,he=((Re-J)*S-(le-Le)*Ge)/(pe*S-xe*Ge);se=J+pe*he-T.x,Z=Le+xe*he-T.y;let Ue=se*se+Z*Z;if(Ue<=2)return new ie(se,Z);_e=Math.sqrt(Ue/2)}else{let H=!1;pe>Number.EPSILON?Ge>Number.EPSILON&&(H=!0):pe<-Number.EPSILON?Ge<-Number.EPSILON&&(H=!0):Math.sign(xe)===Math.sign(S)&&(H=!0),H?(se=-xe,Z=pe,_e=Math.sqrt(y)):(se=pe,Z=xe,_e=Math.sqrt(y/2))}return new ie(se/_e,Z/_e)}let X=[];for(let T=0,oe=C.length,Y=oe-1,se=T+1;T<oe;T++,Y++,se++)Y===oe&&(Y=0),se===oe&&(se=0),X[T]=q(C[T],C[Y],C[se]);let ne=[],te,ve=X.concat();for(let T=0,oe=A.length;T<oe;T++){let Y=A[T];te=[];for(let se=0,Z=Y.length,_e=Z-1,pe=se+1;se<Z;se++,_e++,pe++)_e===Z&&(_e=0),pe===Z&&(pe=0),te[se]=q(Y[se],Y[_e],Y[pe]);ne.push(te),ve=ve.concat(te)}for(let T=0;T<d;T++){let oe=T/d,Y=m*Math.cos(oe*Math.PI/2),se=g*Math.sin(oe*Math.PI/2)+_;for(let Z=0,_e=C.length;Z<_e;Z++){let pe=W(C[Z],X[Z],se);Ae(pe.x,pe.y,-Y)}for(let Z=0,_e=A.length;Z<_e;Z++){let pe=A[Z];te=ne[Z];for(let xe=0,Ge=pe.length;xe<Ge;xe++){let S=W(pe[xe],te[xe],se);Ae(S.x,S.y,-Y)}}}let Ie=g+_;for(let T=0;T<G;T++){let oe=f?W(x[T],ve[T],Ie):x[T];E?(w.copy(I.normals[0]).multiplyScalar(oe.x),R.copy(I.binormals[0]).multiplyScalar(oe.y),B.copy(v[0]).add(w).add(R),Ae(B.x,B.y,B.z)):Ae(oe.x,oe.y,0)}for(let T=1;T<=u;T++)for(let oe=0;oe<G;oe++){let Y=f?W(x[oe],ve[oe],Ie):x[oe];E?(w.copy(I.normals[T]).multiplyScalar(Y.x),R.copy(I.binormals[T]).multiplyScalar(Y.y),B.copy(v[T]).add(w).add(R),Ae(B.x,B.y,B.z)):Ae(Y.x,Y.y,h/u*T)}for(let T=d-1;T>=0;T--){let oe=T/d,Y=m*Math.cos(oe*Math.PI/2),se=g*Math.sin(oe*Math.PI/2)+_;for(let Z=0,_e=C.length;Z<_e;Z++){let pe=W(C[Z],X[Z],se);Ae(pe.x,pe.y,h+Y)}for(let Z=0,_e=A.length;Z<_e;Z++){let pe=A[Z];te=ne[Z];for(let xe=0,Ge=pe.length;xe<Ge;xe++){let S=W(pe[xe],te[xe],se);E?Ae(S.x,S.y+v[u-1].y,v[u-1].x+Y):Ae(S.x,S.y,h+Y)}}}k(),Q();function k(){let T=r.length/3;if(f){let oe=0,Y=G*oe;for(let se=0;se<$;se++){let Z=K[se];Me(Z[2]+Y,Z[1]+Y,Z[0]+Y)}oe=u+d*2,Y=G*oe;for(let se=0;se<$;se++){let Z=K[se];Me(Z[0]+Y,Z[1]+Y,Z[2]+Y)}}else{for(let oe=0;oe<$;oe++){let Y=K[oe];Me(Y[2],Y[1],Y[0])}for(let oe=0;oe<$;oe++){let Y=K[oe];Me(Y[0]+G*u,Y[1]+G*u,Y[2]+G*u)}}i.addGroup(T,r.length/3-T,0)}function Q(){let T=r.length/3,oe=0;me(C,oe),oe+=C.length;for(let Y=0,se=A.length;Y<se;Y++){let Z=A[Y];me(Z,oe),oe+=Z.length}i.addGroup(T,r.length/3-T,1)}function me(T,oe){let Y=T.length;for(;--Y>=0;){let se=Y,Z=Y-1;Z<0&&(Z=T.length-1);for(let _e=0,pe=u+d*2;_e<pe;_e++){let xe=G*_e,Ge=G*(_e+1),S=oe+se+xe,y=oe+Z+xe,V=oe+Z+Ge,H=oe+se+Ge;ye(S,y,V,H)}}}function Ae(T,oe,Y){c.push(T),c.push(oe),c.push(Y)}function Me(T,oe,Y){ke(T),ke(oe),ke(Y);let se=r.length/3,Z=b.generateTopUV(i,r,se-3,se-2,se-1);Te(Z[0]),Te(Z[1]),Te(Z[2])}function ye(T,oe,Y,se){ke(T),ke(oe),ke(se),ke(oe),ke(Y),ke(se);let Z=r.length/3,_e=b.generateSideWallUV(i,r,Z-6,Z-3,Z-2,Z-1);Te(_e[0]),Te(_e[1]),Te(_e[3]),Te(_e[1]),Te(_e[2]),Te(_e[3])}function ke(T){r.push(c[T*3+0]),r.push(c[T*3+1]),r.push(c[T*3+2])}function Te(T){s.push(T.x),s.push(T.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return IN(t,i,e)}static fromJSON(e,t){let i=[];for(let s=0,o=e.shapes.length;s<o;s++){let a=t[e.shapes[s]];i.push(a)}let r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Mh[r.type]().fromJSON(r)),new n(i,e.options)}},PN={generateTopUV:function(n,e,t,i,r){let s=e[t*3],o=e[t*3+1],a=e[i*3],c=e[i*3+1],l=e[r*3],u=e[r*3+1];return[new ie(s,o),new ie(a,c),new ie(l,u)]},generateSideWallUV:function(n,e,t,i,r,s){let o=e[t*3],a=e[t*3+1],c=e[t*3+2],l=e[i*3],u=e[i*3+1],h=e[i*3+2],f=e[r*3],m=e[r*3+1],g=e[r*3+2],_=e[s*3],d=e[s*3+1],p=e[s*3+2];return Math.abs(a-u)<Math.abs(o-l)?[new ie(o,1-c),new ie(l,1-h),new ie(f,1-g),new ie(_,1-p)]:[new ie(a,1-c),new ie(u,1-h),new ie(m,1-g),new ie(d,1-p)]}};function IN(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){let s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}var Ss=class n extends Ot{constructor(e=new Cr([new ie(0,.5),new ie(-.5,-.5),new ie(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let i=[],r=[],s=[],o=[],a=0,c=0;if(Array.isArray(e)===!1)l(e);else for(let u=0;u<e.length;u++)l(e[u]),this.addGroup(a,c,u),a+=c,c=0;this.setIndex(i),this.setAttribute("position",new xt(r,3)),this.setAttribute("normal",new xt(s,3)),this.setAttribute("uv",new xt(o,2));function l(u){let h=r.length/3,f=u.extractPoints(t),m=f.shape,g=f.holes;ri.isClockWise(m)===!1&&(m=m.reverse());for(let d=0,p=g.length;d<p;d++){let b=g[d];ri.isClockWise(b)===!0&&(g[d]=b.reverse())}let _=ri.triangulateShape(m,g);for(let d=0,p=g.length;d<p;d++){let b=g[d];m=m.concat(b)}for(let d=0,p=m.length;d<p;d++){let b=m[d];r.push(b.x,b.y,0),s.push(0,0,1),o.push(b.x,b.y)}for(let d=0,p=_.length;d<p;d++){let b=_[d],v=b[0]+h,E=b[1]+h,I=b[2]+h;i.push(v,E,I),c+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes;return LN(t,e)}static fromJSON(e,t){let i=[];for(let r=0,s=e.shapes.length;r<s;r++){let o=t[e.shapes[r]];i.push(o)}return new n(i,e.curveSegments)}};function LN(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){let r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}function io(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function UN(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Ir=class{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,r=t[i],s=t[i-1];n:{e:{let o;t:{i:if(!(e<r)){for(let a=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(s=r,r=t[++i],e<r)break e}o=t.length;break t}if(!(e>=s)){let a=t[1];e<a&&(i=2,s=a);for(let c=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===c)break;if(r=s,s=t[--i-1],e>=s)break e}o=i,i=0;break t}break n}for(;i<o;){let a=i+o>>>1;e<t[a]?o=a:i=a+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Ah=class extends Ir{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Q_,endingEnd:Q_}}intervalChanged_(e,t,i){let r=this.parameterPositions,s=e-2,o=e+1,a=r[s],c=r[o];if(a===void 0)switch(this.getSettings_().endingStart){case e0:s=e,a=2*t-i;break;case t0:s=r.length-2,a=t+r[s]-r[s+1];break;default:s=e,a=i}if(c===void 0)switch(this.getSettings_().endingEnd){case e0:o=e,c=2*i-t;break;case t0:o=1,c=i+r[1]-r[0];break;default:o=e-1,c=t}let l=(i-t)*.5,u=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(c-i),this._offsetPrev=s*u,this._offsetNext=o*u}interpolate_(e,t,i,r){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,l=c-a,u=this._offsetPrev,h=this._offsetNext,f=this._weightPrev,m=this._weightNext,g=(i-t)/(r-t),_=g*g,d=_*g,p=-f*d+2*f*_-f*g,b=(1+f)*d+(-1.5-2*f)*_+(-.5+f)*g+1,v=(-1-m)*d+(1.5+m)*_+.5*g,E=m*d-m*_;for(let I=0;I!==a;++I)s[I]=p*o[u+I]+b*o[l+I]+v*o[c+I]+E*o[h+I];return s}},Th=class extends Ir{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,l=c-a,u=(i-t)/(r-t),h=1-u;for(let f=0;f!==a;++f)s[f]=o[l+f]*h+o[c+f]*u;return s}},wh=class extends Ir{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}},ln=class{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=io(t,this.TimeBufferType),this.values=io(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:io(e.times,Array),values:io(e.values,Array)};let r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new wh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Th(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Ah(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case so:t=this.InterpolantFactoryMethodDiscrete;break;case ao:t=this.InterpolantFactoryMethodLinear;break;case cu:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return so;case this.InterpolantFactoryMethodLinear:return ao;case this.InterpolantFactoryMethodSmooth:return cu}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){let i=this.times,r=i.length,s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let c=i[a];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,c),e=!1;break}if(o!==null&&o>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,c,o),e=!1;break}o=c}if(r!==void 0&&UN(r))for(let a=0,c=r.length;a!==c;++a){let l=r[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===cu,s=e.length-1,o=1;for(let a=1;a<s;++a){let c=!1,l=e[a],u=e[a+1];if(l!==u&&(a!==1||l!==e[0]))if(r)c=!0;else{let h=a*i,f=h-i,m=h+i;for(let g=0;g!==i;++g){let _=t[h+g];if(_!==t[f+g]||_!==t[m+g]){c=!0;break}}}if(c){if(a!==o){e[o]=e[a];let h=a*i,f=o*i;for(let m=0;m!==i;++m)t[f+m]=t[h+m]}++o}}if(s>0){e[o]=e[s];for(let a=s*i,c=o*i,l=0;l!==i;++l)t[c+l]=t[a+l];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};ln.prototype.TimeBufferType=Float32Array;ln.prototype.ValueBufferType=Float32Array;ln.prototype.DefaultInterpolation=ao;var Oi=class extends ln{};Oi.prototype.ValueTypeName="bool";Oi.prototype.ValueBufferType=Array;Oi.prototype.DefaultInterpolation=so;Oi.prototype.InterpolantFactoryMethodLinear=void 0;Oi.prototype.InterpolantFactoryMethodSmooth=void 0;var Rh=class extends ln{};Rh.prototype.ValueTypeName="color";var Ch=class extends ln{};Ch.prototype.ValueTypeName="number";var Ph=class extends Ir{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=(i-t)/(r-t),l=e*a;for(let u=l+a;l!==u;l+=4)oi.slerpFlat(s,0,o,l-a,o,l,c);return s}},bs=class extends ln{InterpolantFactoryMethodLinear(e){return new Ph(this.times,this.values,this.getValueSize(),e)}};bs.prototype.ValueTypeName="quaternion";bs.prototype.DefaultInterpolation=ao;bs.prototype.InterpolantFactoryMethodSmooth=void 0;var Fi=class extends ln{};Fi.prototype.ValueTypeName="string";Fi.prototype.ValueBufferType=Array;Fi.prototype.DefaultInterpolation=so;Fi.prototype.InterpolantFactoryMethodLinear=void 0;Fi.prototype.InterpolantFactoryMethodSmooth=void 0;var Ih=class extends ln{};Ih.prototype.ValueTypeName="vector";var Lh=class{constructor(e,t,i){let r=this,s=!1,o=0,a=0,c,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return c?c(u):u},this.setURLModifier=function(u){return c=u,this},this.addHandler=function(u,h){return l.push(u,h),this},this.removeHandler=function(u){let h=l.indexOf(u);return h!==-1&&l.splice(h,2),this},this.getHandler=function(u){for(let h=0,f=l.length;h<f;h+=2){let m=l[h],g=l[h+1];if(m.global&&(m.lastIndex=0),m.test(u))return g}return null}}},NN=new Lh,Uh=class{constructor(e){this.manager=e!==void 0?e:NN,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};Uh.DEFAULT_MATERIAL_NAME="__DEFAULT";var kh="\\\\[\\\\]\\\\.:\\\\/",DN=new RegExp("["+kh+"]","g"),Vh="[^"+kh+"]",ON="[^"+kh.replace("\\\\.","")+"]",FN=/((?:WC+[\\/:])*)/.source.replace("WC",Vh),BN=/(WCOD+)?/.source.replace("WCOD",ON),zN=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Vh),kN=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Vh),VN=new RegExp("^"+FN+BN+zN+kN+"$"),GN=["material","materials","bones","map"],Nh=class{constructor(e,t,i){let r=i||it.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},it=class n{constructor(e,t,i){this.path=t,this.parsedPath=i||n.parseTrackName(t),this.node=n.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new n.Composite(e,t,i):new n(e,t,i)}static sanitizeNodeName(e){return e.replace(/\\s/g,"_").replace(DN,"")}static parseTrackName(e){let t=VN.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){let s=i.nodeName.substring(r+1);GN.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){let i=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===t||a.uuid===t)return a;let c=i(a.children);if(c)return c}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,i=t.objectName,r=t.propertyName,s=t.propertyIndex;if(e||(e=n.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let l=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===l){l=u;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(l!==void 0){if(e[l]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[l]}}let o=e[r];if(o===void 0){let l=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+r+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};it.Composite=Nh;it.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};it.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};it.prototype.GetterByBindingType=[it.prototype._getValue_direct,it.prototype._getValue_array,it.prototype._getValue_arrayElement,it.prototype._getValue_toArray];it.prototype.SetterByBindingTypeAndVersioning=[[it.prototype._setValue_direct,it.prototype._setValue_direct_setNeedsUpdate,it.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[it.prototype._setValue_array,it.prototype._setValue_array_setNeedsUpdate,it.prototype._setValue_array_setMatrixWorldNeedsUpdate],[it.prototype._setValue_arrayElement,it.prototype._setValue_arrayElement_setNeedsUpdate,it.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[it.prototype._setValue_fromArray,it.prototype._setValue_fromArray_setNeedsUpdate,it.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var ZB=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Dh}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Dh);var uz=We(nx(),1),hz=We(ta(),1);function Ur(n,e){e===void 0&&(e=[]);let t=new Cr(n.map(i=>new ie(...i)));return e.length&&e.forEach(i=>{var r=new Rr(i.map(s=>new ie(...s)));t.holes.push(r)}),t}var Pz=We(Vx(),1),Iz=We(of(),1);function Gx(n){return n.replace(/[A-Z]/g,e=>"_"+e.toLowerCase()).replace(/^_/,"")}function Hx(n){let e={};for(let i in n)i.startsWith("on")&&(e[Gx(i.slice(2))]=n[i]);let t=i=>Cs(this,null,function*(){let{data:r}=i;if(e[r.type])try{let s=yield e[r.type](r.data);if(s!=null&&s.$transfer&&Array.isArray(s.$transfer)){let o=s.$transfer;delete s.$transfer,self.postMessage({type:""+r.type+"_result",key:r.key,data:s},o)}else self.postMessage({type:""+r.type+"_result",key:r.key,data:s})}catch(s){self.postMessage({type:""+r.type+"_result",key:r.key,error:s})}else self.postMessage({type:""+r.type+"_result",key:r.key,error:"no_event"})});return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}var Gz=We(dl(),1),Hz=We(pl(),1),Wz=We(ml(),1),qz=We(vl(),1),Xz=We(_l(),1),Yz=We(Sl(),1),$z=We(Al(),1),Zz=We(wl(),1),Jz=We(Rl(),1),Kz=We(Pl(),1),jz=We(Ll(),1),Qz=We(Ol(),1),ek=We(zl(),1),tk=We(eu(),1),nk=We(tu(),1),ik=We(ta(),1);function Or(n,e=!1){let t=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),r=new Set(Object.keys(n[0].morphAttributes)),s={},o={},a=n[0].morphTargetsRelative,c=new Ot,l=0;for(let u=0;u<n.length;++u){let h=n[u],f=0;if(t!==(h.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let m in h.attributes){if(!i.has(m))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;s[m]===void 0&&(s[m]=[]),s[m].push(h.attributes[m]),f++}if(f!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". Make sure all geometries have the same number of attributes."),null;if(a!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let m in h.morphAttributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". .morphAttributes must be consistent throughout all geometries."),null;o[m]===void 0&&(o[m]=[]),o[m].push(h.morphAttributes[m])}if(e){let m;if(t)m=h.index.count;else if(h.attributes.position!==void 0)m=h.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+u+". The geometry must have either an index or a position attribute"),null;c.addGroup(l,m,u),l+=m}}if(t){let u=0,h=[];for(let f=0;f<n.length;++f){let m=n[f].index;for(let g=0;g<m.count;++g)h.push(m.getX(g)+u);u+=n[f].attributes.position.count}c.setIndex(h)}for(let u in s){let h=Wx(s[u]);if(!h)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+u+" attribute."),null;c.setAttribute(u,h)}for(let u in o){let h=o[u][0].length;if(h===0)break;c.morphAttributes=c.morphAttributes||{},c.morphAttributes[u]=[];for(let f=0;f<h;++f){let m=[];for(let _=0;_<o[u].length;++_)m.push(o[u][_][f]);let g=Wx(m);if(!g)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+u+" morphAttribute."),null;c.morphAttributes[u].push(g)}}return c}function Wx(n){let e,t,i,r=-1,s=0;for(let l=0;l<n.length;++l){let u=n[l];if(e===void 0&&(e=u.array.constructor),e!==u.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=u.itemSize),t!==u.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=u.normalized),i!==u.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(r===-1&&(r=u.gpuType),r!==u.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=u.count*t}let o=new e(s),a=new rt(o,t,i),c=0;for(let l=0;l<n.length;++l){let u=n[l];if(u.isInterleavedBufferAttribute){let h=c/t;for(let f=0,m=u.count;f<m;f++)for(let g=0;g<t;g++){let _=u.getComponent(f,g);a.setComponent(f+h,g,_)}}else o.set(u.array,c);c+=u.count*t}return r!==void 0&&(a.gpuType=r),a}function qx(n,e,t){e===void 0&&(e=!0),t===void 0&&(t=!1);let i=n.filter(a=>a.geometry.type==="polygon");if(!i.length)return null;let r=i.map(a=>{var c;let l=a.geometry.coords,u=Ur(l[0],l.slice(1)),h=new Pr(u,{steps:1,bevelEnabled:!1,depth:a.height,curveSegments:4});(c=a).deltaHeight||(c.deltaHeight=0),h.translate(0,0,a.airHeight+a.deltaHeight);let f=h.attributes.position.count,m=new Float32Array(f).fill(a.height+a.airHeight+a.deltaHeight);if(h.setAttribute("maxZ",new rt(m,1)),h.setAttribute("opacity",new rt(new Float32Array(f).fill(a.fillOpacity),1)),t){let d=new Float32Array(f).fill(a.airHeight+a.deltaHeight);h.setAttribute("minZ",new rt(d,1))}let g=new Xe(a.fillColor).convertLinearToSRGB(),_=new Float32Array(f*3);for(let d=0;d<f;d++)_[d*3]=g.r,_[d*3+1]=g.g,_[d*3+2]=g.b;return h.setAttribute("color",new rt(_,3)),h}),s=Or(r);r.forEach(a=>a.dispose());let o={geometry:s};return s.dispose(),e&&(o.lineGeometry=BO(i)||void 0),o}function BO(n){let{points:e,colors:t,opacities:i}=zO(n);if(!e.length)return null;let r=new Ot().setFromPoints(e);return r.setAttribute("color",new rt(new Float32Array(t),3)),r.setAttribute("opacity",new rt(new Float32Array(i),1)),r}function zO(n){let e=[],t=[],i=[];return n.filter(r=>r.strokeOpacity>0).map(r=>{let s=r.height+(r.deltaHeight||0)+r.airHeight,{coords:o}=r.geometry,{strokeColor:a,strokeOpacity:c}=r,l=new Xe(a).convertLinearToSRGB();for(let u=0;u<o.length;u++){let h=o[u];for(let f=0;f<h.length;f++){let m=h[f],g=f+1===h.length?h[0]:h[f+1];e.push(new U(m[0],m[1],s)),e.push(new U(g[0],g[1],s)),t.push(l.r,l.g,l.b),t.push(l.r,l.g,l.b),i.push(c),i.push(c)}}}),{points:e,colors:t,opacities:i}}Hx({onGetMergedGeometryAttributes(n){let{data:e}=n,t=e.map(s=>{let o=s.geometry.coords,a=Ur(o[0],o.slice(1));return new Pr(a,{steps:1,bevelEnabled:!1,depth:s.height,curveSegments:4})}),i=Or(t);t.forEach(s=>s.dispose());let r={attributes:i.attributes,index:i.index,morphAttributes:i.morphAttributes,morphTargetsRelative:i.morphTargetsRelative,groups:i.groups,boundingSphere:i.boundingSphere};return i.dispose(),r},onGetMergedShapeGeometryAttributes(n){let{data:e}=n,t=e.map(s=>{let o=Ur(s.geometry.coords[0].slice(0,-1),s.geometry.coords.slice(1)),a=new Ss(o,4),c=a.getAttribute("position"),l=[],u=new Xe(s.fillColor);for(let f=0;f<c.count;f++){c.setZ(f,s.airHeight+(s.deltaHeight||0));var h;l.push(u.r,u.g,u.b,(h=s.fillOpacity)!=null?h:1)}return a.setAttribute("color",new rt(new Float32Array(l),4)),a}),i=Or(t);t.forEach(s=>s.dispose());let r={attributes:i.attributes,index:i.index,morphAttributes:i.morphAttributes,morphTargetsRelative:i.morphTargetsRelative,groups:i.groups,boundingSphere:i.boundingSphere};return i.dispose(),r},onGetMergedTexture2dShapeGeometryAttributes(n){let{data:e}=n,t=e.map(s=>{let o=Ur(s.geometry.coords[0].slice(0,-1),s.geometry.coords.slice(1)),a=new Ss(o,4),c=a.getAttribute("position"),l=[1,1,1,0,0,0,0,1];a.setAttribute("uv",new xt(l,2));let u=s.height+(s.deltaHeight||0)+s.airHeight;for(let h=0;h<c.count;h++)c.setZ(h,u);return a}),i=Or(t);t.forEach(s=>s.dispose());let r={attributes:i.attributes,index:i.index,morphAttributes:i.morphAttributes,morphTargetsRelative:i.morphTargetsRelative,groups:i.groups,boundingSphere:i.boundingSphere};return i.dispose(),r},onGetMergedGeometriesJson(n){let{data:e}=n,t=qx(e);if(t){var i;return{mergedGeometry:t.geometry.toJSON(),lineGeometry:(i=t.lineGeometry)==null?void 0:i.toJSON()}}else return null}});
3975
- `],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var En=require("three");var $t=class{static GetMergeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedShapeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedTexture2dGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_texture2d_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetBufferGeometryByData(t){let e=new En.BufferGeometry;return Object.keys(t.attributes).forEach(n=>{e.setAttribute(n,new En.BufferAttribute(t.attributes[n].array,t.attributes[n].itemSize))}),t.index&&e.setIndex(new En.BufferAttribute(t.index.array,t.index.itemSize)),e.morphAttributes=t.morphAttributes,e.morphTargetsRelative=t.morphTargetsRelative,e.groups=t.groups,e.boundingSphere=t.boundingSphere,e}static GetMergedGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_geometries_json",{data:t});return this.WorkerPool.releaseWorker(e),n?x({},t[0],n):null})}static dispose(){this.WorkerPool.dispose()}};$t.WorkerPool=new vn(10,wi);var gs=require("lodash"),_e={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9,center_x:0,center_y:0,center_coord_x:0,center_coord_y:0,dashed:!1},pt=class extends P.Object3D{getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new P.Vector3,e=new P.Box3;return e.setFromObject(this),e.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new P.Vector3(0,0,0);let t=new P.Box3,e=new P.Vector3;return t.setFromObject(this),t.getSize(e),e}getPosition(){let{center_coord_x:t,center_coord_y:e}=this.options,n=this.getCenter();return n.setZ(n.z+this.options.height/2),new P.Vector3(t,e,n.z+this.options.height/2)}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){var t;if((t=this.options.doors)!=null&&t.length&&this.options.geometry.type==="polygon"){let e=this.options.geometry.coords[0];this.options.doors.forEach(n=>{let r=n.type==="single"?.5:1,i=.5,o=Qt(e,n.coord),s=new P.Vector2(...n.coord),u=new P.Vector2(...e[o]).sub(new P.Vector2(...n.coord)).normalize(),l=new P.Vector2().addVectors(s,u.clone().multiplyScalar(r)),c=new P.Vector2().addVectors(s,u.clone().multiplyScalar(-r)),h=new P.Vector2(-u.y,u.x),p=new P.Vector2().addVectors(l,h.clone().multiplyScalar(i));oi([p.x,p.y],e)||(h.multiplyScalar(-1),p=new P.Vector2().addVectors(l,h.clone().multiplyScalar(i)));let f=new P.Vector2().addVectors(c,h.clone().multiplyScalar(i)),d=[[l.x,l.y],[p.x,p.y],[f.x,f.y],[c.x,c.y]];e=this.options.geometry.coords[0]=[...e.slice(0,o+1),...d,...e.slice(o+1)]})}}initGeometry(){let t=cn(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new P.ExtrudeGeometry(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=L.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.secondUrl&&ht.getTextureByUrl(this.options.secondUrl).then(n=>{n.wrapS=P.RepeatWrapping,n.wrapT=P.RepeatWrapping,n.needsUpdate=!0,t.map=n,t.side=P.DoubleSide}),this.options.height<=.1)return this.material=t,t;let e=L.createMeshBasicMaterial({color:te(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,e],[t,e]}getMaxAndMin(t,e){let n=new P.Box3().setFromObject(this),r=t.clone().add(e.clone().multiplyScalar(1e3)),i=new P.Ray(r,e.clone().multiplyScalar(-1)),o=new P.Vector3;i.intersectBox(n,o);let s=t.clone().add(e.clone().multiplyScalar(-1e3)),u=new P.Ray(s,e.clone()),l=new P.Vector3;return u.intersectBox(n,l),{max:l,min:o}}initGradualMaterial(){let{max:t,min:e}=new P.Box3().setFromObject(this),n=t.clone().sub(e),r=Math.max(n.x,n.y,n.z)/2,i=this.getPosition(),o=new P.Vector3(-1,.2,0).normalize(),{max:s,min:u}=this.getMaxAndMin(i,o),l=L.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:r,opacity:this.options.fillOpacity,direction:new P.Vector3(-1,.2,0),max:s,min:u});if(this.options.height<=.1)return this.material=l,l;let c=this.getCenter(),h=new P.Vector3(-1,.2,1).normalize(),{max:p,min:f}=this.getMaxAndMin(c,h),d=L.createShaderMaterial({gradualColor:[te(this.options.gradualColor[0],this.options.colorFactor),te(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:r,opacity:this.options.fillOpacity,direction:new P.Vector3(-1,.2,1),max:p,min:f});return this.material=[l,d],[l,d]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){if(this.options.dashed){let t=L.createLineDashedMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}else{let t=L.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new P.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options.height+this.options.deltaHeight,{coords:n}=this.options.geometry;for(let r=0;r<n.length;r++){let i=n[r];for(let o=0;o<i.length;o++){let s=i[o],u=o+1===i.length?i[0]:i[o+1];t.push(new P.Vector3(s[0],s[1],e)),t.push(new P.Vector3(u[0],u[1],e))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new P.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new P.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.options.dashed&&t.computeLineDistances(),this.line=t,this.add(t),t}setOpacity(t,e){if(e===void 0&&(e=!1),e)this.options.fillOpacity=t,this.options.strokeOpacity=t;else{let{fillOpacity:n,strokeOpacity:r}=this.originOptions;this.options.fillOpacity=Math.min(n,t),this.options.strokeOpacity=Math.min(r,t)}}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let e=t.intersectObject(this.mesh);if(e[0]){let{point:n,distance:r}=e[0];return{position:n,distance:r}}return!1}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){if(super(),this.context=t,this.line=null,this.options=Ae((0,gs.cloneDeep)(x({},_e,e)),this),this.originOptions={fillOpacity:this.options.fillOpacity,strokeOpacity:this.options.strokeOpacity},this.options.geometry.type==="point"){let[n,r]=this.options.geometry.coords;return this.position.set(n,r,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",n=>{let{value:r}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",n=>{let{value:r}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",n=>{let{value:r}=n;this.dispose(),this.init()}),this.addEventListener("change-strokeColor",n=>{let{value:r}=n;!this.options.stroke||!this.options.strokeOpacity||(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",n=>{let{value:r}=n;if(this.options.stroke)if(r)this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder();else{var i;this.line&&(this.remove(this.line),this.line=null),(i=this.lineGeometry)==null||i.dispose(),this.lineGeometry=void 0}}),this.addEventListener("change-airHeight",n=>{let{value:r}=n;this.position.z=r}),this.addEventListener("change-visible",n=>{let{value:r}=n;this.visible=r}),this.addEventListener("change-stroke",n=>{let{value:r}=n;if(r){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else if(this.line){var i;this.remove(this.line),(i=this.lineGeometry)==null||i.dispose()}}),this.addEventListener("change-dashed",()=>{!this.options.stroke||!this.options.strokeOpacity||(this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}};var jt=require("three");var Sn=class extends jt.Object3D{initLight(){let t=ri(16777215,.5);return t.position.set(0,0,100),this.add(t),t}changeLightCamera(t){let e=t.x,n=t.y;this.directionalLight.shadow.camera.left=-e,this.directionalLight.shadow.camera.right=e,this.directionalLight.shadow.camera.top=n,this.directionalLight.shadow.camera.bottom=-n,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(e,n)}changeLightColor(t){this.directionalLight.color=new jt.Color(t)}setPosition(t){this.position.copy(t),this.directionalLight.position.set(-t.x/2,-t.y/2,100)}initPlane(t,e){t===void 0&&(t=1e3),e===void 0&&(e=1e3);let n=new jt.PlaneGeometry(t,e),r=new jt.ShadowMaterial({transparent:!0,opacity:0,side:jt.DoubleSide}),i=new jt.Mesh(n,r);return i.receiveShadow=!0,i.position.z=-10,this.add(i),this.plane=i,i}setTarget(t){this.directionalLight.target=t}transformOpacity(t){return t*this.basicOpacity}setOpacity(t){this.plane.material.opacity=this.transformOpacity(t)}dispose(){B(this,!0)}constructor(){super(),this.basicOpacity=.07,this.directionalLight=this.initLight(),this.initPlane()}};var Op=require("core-js/modules/web.dom-collections.iterator.js");var gr=require("three");var J=require("three");var ms=require("lodash");var au={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},Oe=class extends it{initObserver(){let t=new MutationObserver((0,ms.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){var t,e;if(this.element instanceof pt&&this.element.options.geometry.type==="polygon"){let{max:o,min:s}=new J.Box3().setFromObject(this.element),u=(o.x+s.x)/2,l=(o.y+s.y)/2;return{left:new J.Vector3(s.x,l,o.z),leftTop:new J.Vector3(s.x,o.y,o.z),top:new J.Vector3(u,o.y,o.z),rightTop:new J.Vector3(o.x,o.y,o.z),right:new J.Vector3(o.x,l,o.z),rightBottom:new J.Vector3(o.x,s.y,o.z),bottom:new J.Vector3(u,s.y,o.z),leftBottom:new J.Vector3(s.x,s.y,o.z),center:new J.Vector3(u,l,o.z)}}let{x:n,y:r,z:i}=((e=this.element)==null||(t=e.getPosition)==null?void 0:t.call(e))||this.position;return{left:new J.Vector3(n,r,i),leftTop:new J.Vector3(n,r,i),top:new J.Vector3(n,r,i),rightTop:new J.Vector3(n,r,i),right:new J.Vector3(n,r,i),rightBottom:new J.Vector3(n,r,i),bottom:new J.Vector3(n,r,i),leftBottom:new J.Vector3(n,r,i),center:new J.Vector3(n,r,i)}}getPlacementScreenPosition(){let{width:t,height:e}=this.context.clientSize,n=this.getPlacementPosition();return Object.keys(n).reduce((r,i)=>{let{x:o,y:s}=I(n[i],this.context.camera,t,e);return r[i]={x:o,y:s},r},{})}checkOverflow(t,e){let{width:n,height:r}=this.context.clientSize;return e.x>0&&t.x<n&&e.y<r&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:e}=this.div,n=this.getPlacementScreenPosition(),r=t/2,i=e/2,o=[{type:"center",getBox(s,u){return{max:{x:r+s,y:u-e},min:{x:s-r,y:u}}}},{type:"left",getBox(s,u){return{max:{x:s,y:u-i},min:{x:s-t,y:u+i}}}},{type:"leftTop",getBox(s,u){return{max:{x:s,y:u-e},min:{x:s-t,y:u}}}},{type:"top",getBox(s,u){return{max:{x:s+r,y:u-e},min:{x:s-r,y:u}}}},{type:"rightTop",getBox(s,u){return{max:{x:s+t,y:u-e},min:{x:s,y:u}}}},{type:"right",getBox(s,u){return{max:{x:s+t,y:u-i},min:{x:s,y:u+i}}}},{type:"rightBottom",getBox(s,u){return{max:{x:s+t,y:u},min:{x:s,y:u+e}}}},{type:"bottom",getBox(s,u){return{max:{x:s+r,y:u},min:{x:s-r,y:u+e}}}},{type:"leftBottom",getBox(s,u){return{max:{x:s,y:u},min:{x:s-t,y:u+i}}}}];for(let s=0;s<o.length;s++){let u=o[s],l=n[u.type],{max:c,min:h}=u.getBox(l.x,l.y);if(this.checkOverflow(c,h))return{type:u.type,position:l}}return{type:"center",position:n.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className="overlay_"+t.type,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,e){e===void 0&&(e="block"),t!==this.visible&&(this.div.style.display=t?e:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=""+t}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new J.Box3().setFromObject(this.element).getCenter(new J.Vector3):this.position}get withinDisplayRange(){let{x:t,y:e}=this.clientPos,{width:n,height:r}=this.context.clientSize;return t>=0&&t<=n&&e>=0&&e<=r}_updatePosition(t,e){this.clientPos={x:t,y:e};let{width:n,height:r,x:i,y:o}=this.context.clientSize;if(this.div){if(this.options.appendToBody){this.div.style.left=""+i+"px",this.div.style.top=""+(o+r)+"px";return}this.options.autoUpdate?(this.div.style.left=""+t+"px",this.div.style.bottom=""+(r-e)+"px"):this.dispatchEvent({type:"update-position",x:t,y:e,width:n,height:r})}}updatePosition(t){t===void 0&&(t=!1);let e=this.getPosition(),{width:n,height:r}=this.context.clientSize,{x:i,y:o}=I(e,this.context.camera,n,r);this.clientPos.x===i&&this.clientPos.y===o&&!t||this._updatePosition(i,o)}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){var t,e;super.dispose(),this.unRegistryEvent(),this.unBindElement(),(t=this.observer)==null||t.disconnect(),(e=this.div)==null||e.remove(),this.div=null}constructor(t,e={}){super(),this.context=t,this.position=new J.Vector3,this.clientPos={x:0,y:0},this.visible=!0,this.placement="top",this.observer=null,this.onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()},this.options=x({},au,e),this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}};var uu={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},ve=class extends gr.EventDispatcher{get withinDisplayRange(){return this.overlay.withinDisplayRange}resetSize(){return g(this,null,function*(){if(yield ai(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:e}=this.img.getBoundingClientRect();this.size={width:t+2,height:e+2}}else{let{width:t,height:e}=this.div.getBoundingClientRect();this.size={width:t+2,height:e+2}}})}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(e=>{let n=document.createElement("div");if(n.style.whiteSpace="nowrap",e.styles)for(let[r,i]of Object.entries(e.styles))n.style[r]=i;n.textContent=e.text,t.appendChild(n)}),t}initIcon(){var t,e;let n=document.createElement("img");return n.setAttribute("src",this.options.icon),n.style.width=""+(((t=this.options.icon_size)==null?void 0:t[0])||32)+"px",n.style.height=""+(((e=this.options.icon_size)==null?void 0:e[1])||32)+"px",n.style.opacity=""+this.options.icon_opacity+"px",n.style.borderRadius="50%",this.options.icon_border.width&&(n.style.border=this.options.icon_border.width+"px solid "+this.options.icon_border.color),n.onload=()=>{this.resetSize()},this.img=n,n}registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t){t===void 0&&(t=this.context.config.poi.boxScale);let{width:e,height:n}=this.size,r=e*t,i=n*t,{x:o,y:s}=this.overlay.clientPos;return{left:o-r/2,right:o+r/2,top:this.options.icon?s-i:s-i/2,bottom:this.options.icon?s:s+i/2}}getOriginBox(){return this.getBox(1)}isContain(t,e){if(!this.overlay.visible||!this.visible)return!1;let n=this.getOriginBox();return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}constructor(t,e){var n,r,i;super(),this.context=t,this.visible=!0,this.size={width:0,height:0},this.position=new gr.Vector3,this.userData={},this.showTextStatus=!0,this.disposed=!1,this._changePosition=()=>{this.overlay.updatePosition(!0)},this.options=Ae(x({},uu,e),this),this.position.set(((n=e.position)==null?void 0:n.x)||0,((r=e.position)==null?void 0:r.y)||0,((i=e.position)==null?void 0:i.z)||0),this.overlay=new Oe(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",o=>{let{x:s,y:u,height:l}=o;this.overlay.div.style.transform="translate3d(calc("+s+"px - 50%), calc("+(-l+u)+"px - "+(this.options.icon&&this.options.icon_position!=="center"?"100%":"50%")+"), 0)"}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",o=>{let{value:s}=o;s?this.img?this.img.setAttribute("src",s):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",o=>{let{value:s}=o,u=this.textDiv;if(u){let l=this.initText();this.div.replaceChild(l,u)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",o=>{let{value:s}=o;this.overlay.setOpacity(s)}),this.addEventListener("change-icon_size",o=>{let{value:s}=o;this.img&&(this.img.style.width=""+((s==null?void 0:s[0])||32)+"px",this.img.style.height=""+((s==null?void 0:s[1])||32)+"px",this.resetSize())}),this.addEventListener("change-icon_opacity",o=>{let{value:s}=o;this.img&&(this.img.style.opacity=""+s)}),this.addEventListener("change-icon_border",o=>{let{value:s}=o;this.img&&(this.img.style.border=s.width+"px solid "+s.color)}),this.addEventListener("change-background",o=>{let{value:s}=o;this.div.style.background=s})}};var ed=require("core-js/modules/web.dom-collections.iterator.js"),nd=require("core-js/modules/es.set.difference.v2.js"),rd=require("core-js/modules/es.set.intersection.v2.js"),id=require("core-js/modules/es.set.is-disjoint-from.v2.js"),od=require("core-js/modules/es.set.is-subset-of.v2.js"),sd=require("core-js/modules/es.set.is-superset-of.v2.js"),ad=require("core-js/modules/es.set.symmetric-difference.v2.js"),ud=require("core-js/modules/es.set.union.v2.js"),Lt=require("three");var Et=require("three"),_s=require("@mars3d/heatmap.js"),mr=require("@turf/turf");var bn=class extends Et.Object3D{clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){var e;this.clearHeatmap();let{width:n,height:r,leftTop:i,center:o,scale:s}=this.box,u=((e=this.context.config.heatMap)==null?void 0:e.radius)||1,l=x({width:n,height:r,container:this.div},this.context.config.heatMap,{radius:u});this.heatmap=(0,_s.create)(l);let c=this.transformData(t,i,s);t.maxValue!==void 0&&(c.max=t.maxValue),t.minValue!==void 0&&(c.min=t.minValue),this.heatmap.setData(c),this.initPlane(n/s,r/s);let h=this.context.center;this.position.set(o[0]-h[0],o[1]-h[1],this.position.z)}initPlane(t,e){this.plane&&this.remove(this.plane);let n=new Et.PlaneGeometry(t,e),r=new Et.Texture(this.div.firstChild);r.needsUpdate=!0;let i=new Et.MeshBasicMaterial({transparent:!0,side:Et.FrontSide,map:r});i.needsUpdate=!0,this.plane=new Et.Mesh(n,i),this.plane.renderOrder=1e5,this.add(this.plane)}getTransMatrix(t){let{x:e,y:n}=t;return new Et.Matrix3().makeScale(this.box.scale,-this.box.scale).multiply(new Et.Matrix3().makeTranslation(-e,-n))}transformData(t,e,n){var r,i;let o=this.getTransMatrix(e);var s;let u=(s=(r=t.data[0])==null?void 0:r.value)!=null?s:0;var l;let c=(l=(i=t.data[0])==null?void 0:i.value)!=null?l:0;return{data:t.data.map(p=>{let f=new Et.Vector2(p.x,p.y).applyMatrix3(o);return p.value>u&&(u=p.value),p.value<c&&(c=p.value),{x:Math.ceil(f.x),y:Math.ceil(f.y),value:p.value}}),max:u,min:c}}getBox(){let t=this.context.range,e=(0,mr.bbox)(t),n=Math.ceil(e[2]-e[0]),r=Math.ceil(e[3]-e[1]),i=4e3,o=4e3,s=i/n,u=o/r,l=Math.min(s,u);this.scaleRatio=l;let c=n*l,h=r*l,p={x:Math.ceil(e[0]),y:Math.ceil(e[3])},f=(0,mr.center)(t).geometry.coordinates;return{width:c,height:h,leftTop:p,center:f,scale:l}}dispose(){this.clearHeatmap(),this.div.remove(),this.div=null,this.plane&&(this.remove(this.plane),B(this.plane))}constructor(t){super(),this.context=t,this.scaleRatio=1,this.div=document.createElement("div"),this.box=this.getBox()}};var _r=require("three");var Mn=class extends _r.Object3D{loadModel(){return g(this,null,function*(){let t=yield Tt.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t})}dispose(){B(this),this.model=null}constructor(t,e){super(),this.context=t,this.options=e,this.model=null,this.position.copy(e.position||new _r.Vector3(0,0,0)),this.loadModel()}};var Zp=require("core-js/modules/web.dom-collections.iterator.js");var vr=require("three");var vs=require("three");var ot=class extends vs.Object3D{setOpacity(t,e){e===void 0&&(e=!1),this.children.forEach(n=>{n.setOpacity==null||n.setOpacity.call(n,t,e)})}dispose(){B(this),this.children.forEach(t=>t.dispose==null?void 0:t.dispose.call(t)),this.clear()}constructor(t){super(),this.context=t}};var wn=class extends ot{getCenter(){return new vr.Box3().setFromObject(this).getCenter(new vr.Vector3)}createGraphic(t){let e=new pt(this.context,t);return e.userData.data=t,this.add(e),this.graphicMap.set(t.id,e),e}removeGraphic(t){this.remove(t),this.graphicMap.delete(t.options.id),t.dispose()}removeGraphicById(t){this.graphicMap.has(t)&&this.removeGraphic(this.graphicMap.get(t))}getGraphicByNodeId(t){return this.graphicMap.get(t)||null}getGraphicByRaycaster(t){let e={distance:1e4,graphic:null,position:null},n=this.children.reduce((r,i)=>{if(i instanceof pt){let o=i.raycast(t);if(o){let{distance:s}=o;if(s<r.distance)return{distance:o.distance,position:o.position,graphic:i}}return r}else return r},e);return n===e?{graphics:[],position:null}:{graphics:[n.graphic],position:n.position}}setGraphicOptions(t,e){let n,r=this.graphicMap.get(t);r&&(typeof e=="function"?n=e(r.options):n=x({},r.options,e),Object.keys(n).forEach(i=>{r.options[i]=n[i]}))}getGraphicPosition(t){let e=this.graphicMap.get(t);return e?[e.options.center_x,e.options.center_y]:null}setOpacity(t,e){e===void 0&&(e=!1),this.graphicMap.forEach(n=>{n.setOpacity(t,e)})}constructor(t){super(t),this.graphicMap=new Map}};var Qp=require("core-js/modules/es.array.unshift.js"),tf=require("core-js/modules/es.array.push.js");var ys=require("lodash");var Tn=class extends ot{clear(t){return t===void 0&&(t=!1),this.pois.forEach(e=>{e.options.built_in&&!t||e.dispose()}),this.pois=t?[]:this.pois.filter(e=>e.options.built_in),this}createPoi(t){let e=new ve(this.context,t);return this.pushPoi(e),e.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(e)),e.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(e)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),e}changePoiLevelOrCollisionEnable(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),this.pushPoi(t))}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}pushPoi(t){if(!t.options.collision_enable){this.pois.unshift(t);return}if(t.options.level===0){this.pois.push(t);return}for(let e=0;e<this.pois.length;e++){let n=this.pois[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.pois.splice(e,0,t);return}}this.pois.push(t)}getPoiByDeviceXy(t,e){return this.pois.filter(r=>r instanceof ve&&r.isContain(t,e))}collisionDetection(){let t=[];this.pois.filter(n=>n.visible&&n.withinDisplayRange).forEach((n,r)=>{let{left:i,right:o,top:s,bottom:u}=n.getBox();if(r===0||!n.options.collision_enable){t.push({left:i,right:o,top:s,bottom:u}),n.parentSetVisible(!0);return}let l=t.some(c=>c.left<o&&c.right>i&&c.top<u&&c.bottom>s);n.parentSetVisible(!l),l||t.push({left:i,right:o,top:s,bottom:u})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(t=>t.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}constructor(t){super(t),this.pois=[],this.timer=new K,this.onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})},this.registryEvent(),this.debounceCollisionDetection=(0,ys.debounce)(this.collisionDetection,10)}};var sf=require("core-js/modules/es.array.unshift.js"),af=require("core-js/modules/es.array.push.js");var yr=require("three"),De=class extends ot{clear(){return this.pois.forEach(t=>{t.dispose()}),this.pois=[],this}createPoi(t){let e=new et(this.context,t);return this.pushPoi(e),e}changePoiLevelOrCollisionEnable(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),this.pushPoi(t))}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.remove(t),this.pois.splice(e,1),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}add(t){return this.children.some(e=>e.options.id===t.options.id)||(t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t))),super.add(t),this}pushPoi(t){if(t.parentSetVisible(!1),t.userData.type==="parkingSpace"&&(this.needChangeParkingSpaceVisibleByZoom=!0),this.add(t),!t.options.collision_enable){this.pois.unshift(t);return}if(t.options.level===0){this.pois.push(t);return}for(let e=0;e<this.pois.length;e++){let n=this.pois[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.pois.splice(e,0,t);return}}this.pois.push(t)}getPoiByDeviceXy(t,e){let n=new yr.Vector2(t,e);return this.pois.filter(i=>i instanceof et&&i.canSelect&&i.box.containsPoint(n))}collisionDetection(){let t=[],{camera:e}=this.context;e.updateMatrixWorld();let n=l=>l<=1&&l>=-1,r=e.projectionMatrix.clone();r.multiply(e.matrixWorldInverse);let i=e.zoom/this.context.basicZoom,o=25/30,s=Math.min(25,Math.max(1,i*o));this.pois.filter(l=>{if(l.visible){var c,h;if(!(s<=l.options.maxWeight&&s>=l.options.minWeight))return l.parentSetVisible(!1),!1;let p=l.spriteIcon?(c=l.spriteIcon)==null?void 0:c.matrixWorld:((h=l.spriteText)==null?void 0:h.matrixWorld)||l.matrixWorld,f=new yr.Vector3().setFromMatrixPosition(p);return f.applyMatrix4(r),l.screenPosition=f,n(f.x)&&n(f.y)&&n(f.z)?!0:(l.parentSetVisible(!1),!1)}return!1}).forEach((l,c)=>{let h=l.getBox(l.screenPosition);if(c===0||!l.options.collision_enable){t.push(h),l.parentSetVisible(!0);return}let p=t.some(f=>f.intersectsBox(h));l.parentSetVisible(!p),p||t.push(h)})}setOpacity(t){this.pois.forEach(e=>{e.options.icon_opacity=t,e.options.text_opacity=t})}registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}onAddToScene(){this.registryEvent()}onRemoveFromScene(){this.unRegistryEvent()}dispose(){this.timer.dispose(),this.pois.forEach(t=>t.dispose()),this.pois.length=0,super.dispose(),this.unRegistryEvent()}constructor(t){super(t),this.pois=[],this.needChangeParkingSpaceVisibleByZoom=!1,this.timer=new K,this.changeParkingSpaceVisibleByZoom=()=>{var e;let n=(e=this.parent)==null?void 0:e.parent;if(n&&n instanceof Bt){let{clientSize:{width:r,height:i}}=this.context,{max:o,min:s}=n.box,l=Math.min(r/(o.x-s.x),i/(o.y-s.y))*(o.x-s.x)/60,c=this.context.camera.zoom>=l;this.pois.filter(h=>h.userData.type==="parkingSpace").map(h=>{h.visible=c,c||h.parentSetVisible(c)})}},this.onUpdate=()=>{this.needChangeParkingSpaceVisibleByZoom&&(this.changeParkingSpaceVisibleByZoom(),this.needChangeParkingSpaceVisibleByZoom=!1),this.timer.requestAnimationFrame(()=>{this.collisionDetection()})}}};var pf=require("core-js/modules/es.regexp.exec.js"),ff=require("core-js/modules/web.dom-collections.iterator.js");var xr=require("three"),xs=require("lodash");var An=class extends ot{createParkings(t,e,n){e===void 0&&(e=!0),this.parkingOptions=t,this.merged=e,e?(n?this.createMergedParkingByMergedElements(n):this.createMergedParking(t),t.map((r,i)=>{var o;(o=r.texts[0])==null||o.split(/[,,]/).map(s=>{this.parkingNoIndexMap.set(s,i)}),this.nodeIdIndexMap.set(r.id,i)})):this.createIndependentParking(t)}load(t,e){e===void 0&&(e=!0);var n;this.createParkings(t.elements,e,t.mergedElements),(n=t.mergedParkingTexture)!=null&&n.length?this.createMergedParkingTexture(t.mergedParkingTexture):this.createParkingTexture(t.elements)}createMergedParking(t){return g(this,null,function*(){let e=new Ve(this.context,t);this.mergedParkingSpace=e,this.add(e)})}createMergedParkingByMergedElements(t){let e=new Cn(this.context,t);this.mergedParkingSpace=e,this.add(e)}createIndependentParking(t){t.forEach(e=>{var n;let r=new pt(this.context,e);this.add(r),(n=e.texts[0])==null||n.split(/[,,]/).map(i=>{this.parkingNoGraphicMap.set(i,r)}),this.graphicMap.set(r.options.id,r)})}createParkingTexture(t){let e=t.filter(n=>pr[n.parkingType]).map(n=>{let r=new xr.Vector2(...n.geometry.coords[0][0]),i=new xr.Vector2(...n.geometry.coords[0][1]),o=new xr.Vector2(...n.geometry.coords[0][2]),s=Math.min(r.distanceTo(i),i.distanceTo(o)),u=0;return s===r.distanceTo(i)?u=i.sub(r).angle()-Math.PI/2:u=o.sub(i).angle()-Math.PI/2,{uuid:n.id,iconUrl:pr[n.parkingType],name:n.texts[0],deltaHeight:(n.deltaHeight||0)+.001,airHeight:n.airHeight,height:n.height,geometry:n.geometry,opacity:n.fillOpacity,visible:!0,secondWidth:s-1,secondHeight:s-1,secondRotate:u,centerCoords:[n.center_coord_x,n.center_coord_y]}});if(e.length){let n=new ye(this.context,e);this.add(n)}}createMergedParkingTexture(t){t.map(e=>{e.iconUrl=pr[e.iconUrl];let n=new xe(this.context,e);this.add(n)})}changeParkingColor(t){this.merged?Object.keys(t).map(e=>{let n=this.parkingNoIndexMap.get(e);if(!(0,xs.isNil)(n)){var r;(r=this.mergedParkingSpace)==null||r.setParkingColorByIndex(n,t[e])}}):Object.keys(t).map(e=>{let n=this.parkingNoGraphicMap.get(e);n&&(n.options.fillColor=t[e])})}setOpacity(t,e){if(e===void 0&&(e=!1),this.parkingOptions.forEach(r=>{if(e)r.fillOpacity=t,r.strokeOpacity=t;else{let s=this.parkingOriginOptions.get(r.id);var i;r.fillOpacity=Math.min(t,(i=s==null?void 0:s.fillOpacity)!=null?i:1);var o;r.strokeOpacity=Math.min(t,(o=s==null?void 0:s.strokeOpacity)!=null?o:1)}}),this.merged)if(this.mergedParkingSpace instanceof Ve)this.mergedParkingSpace.setOpacity(t,e);else{var n;(n=this.mergedParkingSpace)==null||n.setOpacity(t,e)}else this.graphicMap.forEach(r=>{r.setOpacity(t,e)});this.children.filter(r=>r instanceof ye||r instanceof xe).map(r=>r.setOpacity(t))}getParkingOptionsByParkingNo(t){return this.parkingOptions.find(n=>n.texts[0]===t)||null}getGraphicPosition(t){if(this.merged){let e=this.parkingOptions.find(n=>n.id===t);return e?[e.center_x,e.center_y]:null}}dispose(){var t;(t=this.mergedParkingSpace)==null||t.dispose(),this.mergedParkingSpace=null,B(this),this.graphicMap.clear(),this.parkingNoGraphicMap.clear(),this.parkingNoIndexMap.clear(),this.nodeIdIndexMap.clear(),this.parkingOptions=[],super.dispose()}constructor(t){super(t),this.graphicMap=new Map,this.parkingNoGraphicMap=new Map,this.parkingOriginOptions=new Map,this.parkingOptions=[],this.merged=!1,this.parkingNoIndexMap=new Map,this.nodeIdIndexMap=new Map,this.mergedParkingSpace=null}};var xf=require("core-js/modules/es.array.push.js");var Rn=class extends ot{addModels(t){let e=t.reduce((n,r)=>{let{url:i}=r;return n[i]?n[i].push(r):n[i]=[r],n},{});Object.values(e).forEach(n=>{let r=new Pn(this.context,n);this.add(r)})}constructor(t){super(t)}};var kf=require("core-js/modules/web.dom-collections.iterator.js");var We=require("three");var Ss=require("three/examples/jsm/lines/LineMaterial.js"),nt=require("three");function Es(a){return`${a.x}-${a.y}-${a.z}`}var It=class{static generateLineMaterialKey({color:t,opacity:e}){return`${t}-${e}`}static createLineMaterial({color:t,opacity:e,vertexColors:n}){let r=this.generateLineMaterialKey({color:t,opacity:e,vertexColors:n});if(this.lineMaterialMap.has(r))return this.lineMaterialMap.get(r);let i=new nt.LineBasicMaterial({color:new nt.Color(t).convertLinearToSRGB(),transparent:!0,opacity:e,vertexColors:n!=null?n:!1});return this.lineMaterialMap.set(r,i),i}static createMeshStandardMaterial({color:t,opacity:e}){let n=`${t}-${e}`;if(this.meshStandardMaterialMap.has(n))return this.meshStandardMaterialMap.get(n);let r=new nt.MeshStandardMaterial({color:new nt.Color(t).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:e,depthWrite:!0});return this.meshStandardMaterialMap.set(n,r),r}static createMeshBasicMaterial({color:t,opacity:e,vertexColors:n}){let r=`${t}-${e}-${n}`;if(this.meshBasicMaterialMap.has(r))return this.meshBasicMaterialMap.get(r);let i=new nt.MeshBasicMaterial({color:t,transparent:!0,opacity:e,depthWrite:!0,vertexColors:n!=null?n:!1});return this.meshBasicMaterialMap.set(r,i),i}static createShaderMaterial({gradualColor:t,center:e,maxValue:n,opacity:r,direction:i,max:o,min:s}){let u=`${t.toString()}-${Es(e)}-${n}-${r}-${Es(i)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let l=`
3975
+ `],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var En=require("three");var $t=class{static GetMergeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedShapeGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetMergedTexture2dGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_texture2d_shape_geometry_attributes",{data:t}),r=this.GetBufferGeometryByData(n);return this.WorkerPool.releaseWorker(e),r})}static GetBufferGeometryByData(t){let e=new En.BufferGeometry;return Object.keys(t.attributes).forEach(n=>{e.setAttribute(n,new En.BufferAttribute(t.attributes[n].array,t.attributes[n].itemSize))}),t.index&&e.setIndex(new En.BufferAttribute(t.index.array,t.index.itemSize)),e.morphAttributes=t.morphAttributes,e.morphTargetsRelative=t.morphTargetsRelative,e.groups=t.groups,e.boundingSphere=t.boundingSphere,e}static GetMergedGeometry(t){return g(this,null,function*(){let e=yield this.WorkerPool.getWorker(),n=yield $(e,"get_merged_geometries_json",{data:t});return this.WorkerPool.releaseWorker(e),n?x({},t[0],n):null})}static dispose(){this.WorkerPool.dispose()}};$t.WorkerPool=new vn(10,wi);var gs=require("lodash"),_e={id:"",height:.1,airHeight:0,area:0,group:"",fillColor:"#EFF4FB",strokeColor:"#ffffff",fillOpacity:1,strokeOpacity:1,strokeWidth:1,doors:[],visible:!0,geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},layerType:"",zIndex:0,stroke:!0,deltaHeight:0,userData:{},gradualColor:[],renderType:"single",colorFactor:.9,center_x:0,center_y:0,center_coord_x:0,center_coord_y:0,dashed:!1},pt=class extends P.Object3D{getCenter(){if(this.options.geometry.type==="point")return this.position.clone();let t=new P.Vector3,e=new P.Box3;return e.setFromObject(this),e.getCenter(t),t}getSize(){if(this.options.geometry.type==="point")return new P.Vector3(0,0,0);let t=new P.Box3,e=new P.Vector3;return t.setFromObject(this),t.getSize(e),e}getPosition(){let{center_coord_x:t,center_coord_y:e}=this.options,n=this.getCenter();return n.setZ(n.z+this.options.height/2),new P.Vector3(t,e,n.z+this.options.height/2)}init(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.airHeight+this.options.deltaHeight,this.options.stroke&&this.options.strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())}initDoor(){var t;if((t=this.options.doors)!=null&&t.length&&this.options.geometry.type==="polygon"){let e=this.options.geometry.coords[0];this.options.doors.forEach(n=>{let r=n.type==="single"?.5:1,i=.5,o=Qt(e,n.coord),s=new P.Vector2(...n.coord),u=new P.Vector2(...e[o]).sub(new P.Vector2(...n.coord)).normalize(),l=new P.Vector2().addVectors(s,u.clone().multiplyScalar(r)),c=new P.Vector2().addVectors(s,u.clone().multiplyScalar(-r)),h=new P.Vector2(-u.y,u.x),p=new P.Vector2().addVectors(l,h.clone().multiplyScalar(i));oi([p.x,p.y],e)||(h.multiplyScalar(-1),p=new P.Vector2().addVectors(l,h.clone().multiplyScalar(i)));let f=new P.Vector2().addVectors(c,h.clone().multiplyScalar(i)),d=[[l.x,l.y],[p.x,p.y],[f.x,f.y],[c.x,c.y]];e=this.options.geometry.coords[0]=[...e.slice(0,o+1),...d,...e.slice(o+1)]})}}initGeometry(){let t=cn(this.options.geometry.coords[0],this.options.geometry.coords.slice(1));return new P.ExtrudeGeometry(t,{steps:1,bevelEnabled:!1,depth:this.options.height,curveSegments:4})}initSingleMaterial(){let t=L.createMeshBasicMaterial({color:this.options.fillColor,opacity:this.options.fillOpacity});if(this.options.secondUrl&&ht.getTextureByUrl(this.options.secondUrl).then(n=>{n.wrapS=P.RepeatWrapping,n.wrapT=P.RepeatWrapping,n.needsUpdate=!0,t.map=n,t.side=P.DoubleSide}),this.options.height<=.1)return this.material=t,t;let e=L.createMeshBasicMaterial({color:te(this.options.fillColor),opacity:this.options.fillOpacity});return this.material=[t,e],[t,e]}getMaxAndMin(t,e){let n=new P.Box3().setFromObject(this),r=t.clone().add(e.clone().multiplyScalar(1e3)),i=new P.Ray(r,e.clone().multiplyScalar(-1)),o=new P.Vector3;i.intersectBox(n,o);let s=t.clone().add(e.clone().multiplyScalar(-1e3)),u=new P.Ray(s,e.clone()),l=new P.Vector3;return u.intersectBox(n,l),{max:l,min:o}}initGradualMaterial(){let{max:t,min:e}=new P.Box3().setFromObject(this),n=t.clone().sub(e),r=Math.max(n.x,n.y,n.z)/2,i=this.getPosition(),o=new P.Vector3(-1,.2,0).normalize(),{max:s,min:u}=this.getMaxAndMin(i,o),l=L.createShaderMaterial({gradualColor:this.options.gradualColor,center:this.getPosition(),maxValue:r,opacity:this.options.fillOpacity,direction:new P.Vector3(-1,.2,0),max:s,min:u});if(this.options.height<=.1)return this.material=l,l;let c=this.getCenter(),h=new P.Vector3(-1,.2,1).normalize(),{max:p,min:f}=this.getMaxAndMin(c,h),d=L.createShaderMaterial({gradualColor:[te(this.options.gradualColor[0],this.options.colorFactor),te(this.options.gradualColor[1],this.options.colorFactor)],center:this.getCenter(),maxValue:r,opacity:this.options.fillOpacity,direction:new P.Vector3(-1,.2,1),max:p,min:f});return this.material=[l,d],[l,d]}initMaterial(){return this.options.renderType==="gradual"?this.initGradualMaterial():this.initSingleMaterial()}initLineMaterial(){if(this.options.dashed){let t=L.createLineDashedMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}else{let t=L.createLineMaterial({color:this.options.strokeColor,opacity:this.options.strokeOpacity});return this.lineMaterial=t,t}}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new P.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options.height+this.options.deltaHeight,{coords:n}=this.options.geometry;for(let r=0;r<n.length;r++){let i=n[r];for(let o=0;o<i.length;o++){let s=i[o],u=o+1===i.length?i[0]:i[o+1];t.push(new P.Vector3(s[0],s[1],e)),t.push(new P.Vector3(u[0],u[1],e))}}return t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new P.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new P.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=this.options.airHeight+.01,this.options.dashed&&t.computeLineDistances(),this.line=t,this.add(t),t}setOpacity(t,e){if(e===void 0&&(e=!1),e)this.options.fillOpacity=t,this.options.strokeOpacity=t;else{let{fillOpacity:n,strokeOpacity:r}=this.originOptions;this.options.fillOpacity=Math.min(n,t),this.options.strokeOpacity=Math.min(r,t)}}raycast(t){if(!this.visible||this.options.geometry.type==="point")return!1;this.mesh.updateMatrixWorld(!0);let e=t.intersectObject(this.mesh);if(e[0]){let{point:n,distance:r}=e[0];return{position:n,distance:r}}return!1}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){if(super(),this.context=t,this.line=null,this.options=Ae((0,gs.cloneDeep)(x({},_e,e)),this),this.originOptions={fillOpacity:this.options.fillOpacity,strokeOpacity:this.options.strokeOpacity},this.options.geometry.type==="point"){let[n,r]=this.options.geometry.coords;return this.position.set(n,r,this.options.height+this.options.airHeight),this}this.initDoor(),this.init(),this.visible=this.options.visible,this.addEventListener("change-fillColor",n=>{let{value:r}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-fillOpacity",n=>{let{value:r}=n;this.initMaterial(),this.initMesh()}),this.addEventListener("change-height",n=>{let{value:r}=n;this.dispose(),this.init()}),this.addEventListener("change-strokeColor",n=>{let{value:r}=n;!this.options.stroke||!this.options.strokeOpacity||(this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-strokeOpacity",n=>{let{value:r}=n;if(this.options.stroke)if(r)this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder();else{var i;this.line&&(this.remove(this.line),this.line=null),(i=this.lineGeometry)==null||i.dispose(),this.lineGeometry=void 0}}),this.addEventListener("change-airHeight",n=>{let{value:r}=n;this.position.z=r}),this.addEventListener("change-visible",n=>{let{value:r}=n;this.visible=r}),this.addEventListener("change-stroke",n=>{let{value:r}=n;if(r){if(this.line)return;this.initLineGeometry(),this.initLineMaterial(),this.createBorder()}else if(this.line){var i;this.remove(this.line),(i=this.lineGeometry)==null||i.dispose()}}),this.addEventListener("change-dashed",()=>{!this.options.stroke||!this.options.strokeOpacity||(this.lineGeometry||this.initLineGeometry(),this.initLineMaterial(),this.createBorder())}),this.addEventListener("change-renderType",()=>{this.initMaterial(),this.initMesh()}),this.addEventListener("change-gradualColor",()=>{this.initMaterial(),this.initMesh()})}};var Yt=require("three");var Sn=class extends Yt.Object3D{initLight(){let t=ri(16777215,.5);return t.position.set(0,0,100),this.add(t),t}changeLightCamera(t){let e=t.x,n=t.y;this.directionalLight.shadow.camera.left=-e,this.directionalLight.shadow.camera.right=e,this.directionalLight.shadow.camera.top=n,this.directionalLight.shadow.camera.bottom=-n,this.directionalLight.shadow.camera.near=.5,this.directionalLight.shadow.camera.far=Math.max(e,n)}changeLightColor(t){this.directionalLight.color=new Yt.Color(t)}setPosition(t){this.position.copy(t),this.directionalLight.position.set(-t.x/2,-t.y/2,100)}initPlane(t,e){t===void 0&&(t=1e3),e===void 0&&(e=1e3);let n=new Yt.PlaneGeometry(t,e),r=new Yt.ShadowMaterial({transparent:!0,opacity:0,side:Yt.DoubleSide}),i=new Yt.Mesh(n,r);return i.receiveShadow=!0,i.position.z=-10,this.add(i),this.plane=i,i}setTarget(t){this.directionalLight.target=t}transformOpacity(t){return t*this.basicOpacity}setOpacity(t){this.plane.material.opacity=this.transformOpacity(t)}dispose(){B(this,!0)}constructor(){super(),this.basicOpacity=.07,this.directionalLight=this.initLight(),this.initPlane()}};var Op=require("core-js/modules/web.dom-collections.iterator.js");var gr=require("three");var J=require("three");var ms=require("lodash");var au={autoUpdate:!0,appendToBody:!1,autoChangePlacement:!1},Oe=class extends it{initObserver(){let t=new MutationObserver((0,ms.debounce)(()=>{this.div&&this.usePlacement()},100));t.observe(this.div,{childList:!0,subtree:!0,attributes:!0}),this.observer=t}getPlacementPosition(){var t,e;if(this.element instanceof pt&&this.element.options.geometry.type==="polygon"){let{max:o,min:s}=new J.Box3().setFromObject(this.element),u=(o.x+s.x)/2,l=(o.y+s.y)/2;return{left:new J.Vector3(s.x,l,o.z),leftTop:new J.Vector3(s.x,o.y,o.z),top:new J.Vector3(u,o.y,o.z),rightTop:new J.Vector3(o.x,o.y,o.z),right:new J.Vector3(o.x,l,o.z),rightBottom:new J.Vector3(o.x,s.y,o.z),bottom:new J.Vector3(u,s.y,o.z),leftBottom:new J.Vector3(s.x,s.y,o.z),center:new J.Vector3(u,l,o.z)}}let{x:n,y:r,z:i}=((e=this.element)==null||(t=e.getPosition)==null?void 0:t.call(e))||this.position;return{left:new J.Vector3(n,r,i),leftTop:new J.Vector3(n,r,i),top:new J.Vector3(n,r,i),rightTop:new J.Vector3(n,r,i),right:new J.Vector3(n,r,i),rightBottom:new J.Vector3(n,r,i),bottom:new J.Vector3(n,r,i),leftBottom:new J.Vector3(n,r,i),center:new J.Vector3(n,r,i)}}getPlacementScreenPosition(){let{width:t,height:e}=this.context.clientSize,n=this.getPlacementPosition();return Object.keys(n).reduce((r,i)=>{let{x:o,y:s}=I(n[i],this.context.camera,t,e);return r[i]={x:o,y:s},r},{})}checkOverflow(t,e){let{width:n,height:r}=this.context.clientSize;return e.x>0&&t.x<n&&e.y<r&&t.y>0}getPlacement(){let{clientWidth:t,clientHeight:e}=this.div,n=this.getPlacementScreenPosition(),r=t/2,i=e/2,o=[{type:"center",getBox(s,u){return{max:{x:r+s,y:u-e},min:{x:s-r,y:u}}}},{type:"left",getBox(s,u){return{max:{x:s,y:u-i},min:{x:s-t,y:u+i}}}},{type:"leftTop",getBox(s,u){return{max:{x:s,y:u-e},min:{x:s-t,y:u}}}},{type:"top",getBox(s,u){return{max:{x:s+r,y:u-e},min:{x:s-r,y:u}}}},{type:"rightTop",getBox(s,u){return{max:{x:s+t,y:u-e},min:{x:s,y:u}}}},{type:"right",getBox(s,u){return{max:{x:s+t,y:u-i},min:{x:s,y:u+i}}}},{type:"rightBottom",getBox(s,u){return{max:{x:s+t,y:u},min:{x:s,y:u+e}}}},{type:"bottom",getBox(s,u){return{max:{x:s+r,y:u},min:{x:s-r,y:u+e}}}},{type:"leftBottom",getBox(s,u){return{max:{x:s,y:u},min:{x:s-t,y:u+i}}}}];for(let s=0;s<o.length;s++){let u=o[s],l=n[u.type],{max:c,min:h}=u.getBox(l.x,l.y);if(this.checkOverflow(c,h))return{type:u.type,position:l}}return{type:"center",position:n.center}}initDiv(){let t=document.createElement("div");return t.style.position="absolute",t}usePlacement(){let t=this.getPlacement();this.div.className="overlay_"+t.type,this._updatePosition(t.position.x,t.position.y)}bindElement(t){this.element=t,this.options.autoChangePlacement&&this.initObserver(),this.onUpdate()}unBindElement(){this.element=void 0}setVisible(t,e){e===void 0&&(e="block"),t!==this.visible&&(this.div.style.display=t?e:"none",this.visible=t)}setOpacity(t){this.div.style.opacity=""+t}getPosition(){return this.element?typeof this.element.getPosition=="function"?this.element.getPosition():new J.Box3().setFromObject(this.element).getCenter(new J.Vector3):this.position}get withinDisplayRange(){let{x:t,y:e}=this.clientPos,{width:n,height:r}=this.context.clientSize;return t>=0&&t<=n&&e>=0&&e<=r}_updatePosition(t,e){this.clientPos={x:t,y:e};let{width:n,height:r,x:i,y:o}=this.context.clientSize;if(this.div){if(this.options.appendToBody){this.div.style.left=""+i+"px",this.div.style.top=""+(o+r)+"px";return}this.options.autoUpdate?(this.div.style.left=""+t+"px",this.div.style.bottom=""+(r-e)+"px"):this.dispatchEvent({type:"update-position",x:t,y:e,width:n,height:r})}}updatePosition(t){t===void 0&&(t=!1);let e=this.getPosition(),{width:n,height:r}=this.context.clientSize,{x:i,y:o}=I(e,this.context.camera,n,r);this.clientPos.x===i&&this.clientPos.y===o&&!t||this._updatePosition(i,o)}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){var t,e;super.dispose(),this.unRegistryEvent(),this.unBindElement(),(t=this.observer)==null||t.disconnect(),(e=this.div)==null||e.remove(),this.div=null}constructor(t,e={}){super(),this.context=t,this.position=new J.Vector3,this.clientPos={x:0,y:0},this.visible=!0,this.placement="top",this.observer=null,this.onUpdate=()=>{this.options.autoChangePlacement?this.usePlacement():this.updatePosition()},this.options=x({},au,e),this.registryEvent(),this.div=this.initDiv(),this.options.appendToBody?document.body.appendChild(this.div):this.context.container.appendChild(this.div)}};var uu={texts:[{text:""}],level:1,icon_position:"bottom",collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},icon_opacity:1,icon_border:{color:"#586EE0",width:0},background:"",collision_hide_icon:!0,built_in:!1,box_only_icon:!1},ve=class extends gr.EventDispatcher{get withinDisplayRange(){return this.overlay.withinDisplayRange}resetSize(){return g(this,null,function*(){if(yield ai(),!this.disposed)if(this.options.box_only_icon){if(!this.img)return;let{width:t,height:e}=this.img.getBoundingClientRect();this.size={width:t+2,height:e+2}}else{let{width:t,height:e}=this.div.getBoundingClientRect();this.size={width:t+2,height:e+2}}})}renderHelperBox(){}get clientPos(){return this.overlay.clientPos}initDiv(){let t=document.createElement("div");return this.div=t,this.addText(),this.options.icon&&this.addIcon(),t.style.fontSize="12px",t.style.textShadow="#fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0",t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.padding="4px",this.overlay.setOpacity(this.options.opacity),this.overlay.div.style.pointerEvents="none",this.overlay.div.style.userSelect="none",this.overlay.div.appendChild(t),this.resetSize(),t}addIcon(){if(!this.img){let t=this.initIcon();this.options.icon_position==="top"?this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t):this.div.appendChild(t)}}addText(){let t=this.initText();this.options.icon_position==="top"?this.div.appendChild(t):this.div.firstChild?this.div.insertBefore(t,this.div.firstChild):this.div.appendChild(t)}getPosition(){return this.position}initText(){let t=document.createElement("div");return t.appendChild(this.createTextFragment()),t.style.textAlign="center",this.textDiv=t,t}createTextFragment(){let t=document.createDocumentFragment();return this.options.texts.forEach(e=>{let n=document.createElement("div");if(n.style.whiteSpace="nowrap",e.styles)for(let[r,i]of Object.entries(e.styles))n.style[r]=i;n.textContent=e.text,t.appendChild(n)}),t}initIcon(){var t,e;let n=document.createElement("img");return n.setAttribute("src",this.options.icon),n.style.width=""+(((t=this.options.icon_size)==null?void 0:t[0])||32)+"px",n.style.height=""+(((e=this.options.icon_size)==null?void 0:e[1])||32)+"px",n.style.opacity=""+this.options.icon_opacity+"px",n.style.borderRadius="50%",this.options.icon_border.width&&(n.style.border=this.options.icon_border.width+"px solid "+this.options.icon_border.color),n.onload=()=>{this.resetSize()},this.img=n,n}registryEvent(){}unRegistryEvent(){}setVisible(t){t!==this.visible&&(this.visible=t,this.changeOverlayVisible(t))}changeOverlayVisible(t){if(!(t===this.overlay.visible&&this.options.collision_hide_icon))if(this.options.collision_hide_icon)this.overlay.visible=t,this.overlay.div.style.visibility=t?"visible":"hidden";else{if(this.showTextStatus===t)return;this.textDiv.style.visibility=t?"visible":"hidden",this.showTextStatus=t}}parentSetVisible(t){this.visible&&this.changeOverlayVisible(t)}getBox(t){t===void 0&&(t=this.context.config.poi.boxScale);let{width:e,height:n}=this.size,r=e*t,i=n*t,{x:o,y:s}=this.overlay.clientPos;return{left:o-r/2,right:o+r/2,top:this.options.icon?s-i:s-i/2,bottom:this.options.icon?s:s+i/2}}getOriginBox(){return this.getBox(1)}isContain(t,e){if(!this.overlay.visible||!this.visible)return!1;let n=this.getOriginBox();return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}dispose(){this.unRegistryEvent(),this.div=null,this.textDiv=null,this.img=void 0,this.overlay.dispose(),this.disposed=!0}constructor(t,e){var n,r,i;super(),this.context=t,this.visible=!0,this.size={width:0,height:0},this.position=new gr.Vector3,this.userData={},this.showTextStatus=!0,this.disposed=!1,this._changePosition=()=>{this.overlay.updatePosition(!0)},this.options=Ae(x({},uu,e),this),this.position.set(((n=e.position)==null?void 0:n.x)||0,((r=e.position)==null?void 0:r.y)||0,((i=e.position)==null?void 0:i.z)||0),this.overlay=new Oe(this.context,{autoUpdate:!1}),this.overlay.addEventListener("update-position",o=>{let{x:s,y:u,height:l}=o;this.overlay.div.style.transform="translate3d(calc("+s+"px - 50%), calc("+(-l+u)+"px - "+(this.options.icon&&this.options.icon_position!=="center"?"100%":"50%")+"), 0)"}),this.overlay.bindElement(this),this.registryEvent(),this.initDiv(),this.addEventListener("change-icon",o=>{let{value:s}=o;s?this.img?this.img.setAttribute("src",s):(this.addIcon(),this._changePosition()):(this.img&&this.div.removeChild(this.img),this.img=void 0,this._changePosition(),this.resetSize())}),this.addEventListener("change-texts",o=>{let{value:s}=o,u=this.textDiv;if(u){let l=this.initText();this.div.replaceChild(l,u)}else this.addText();this.resetSize()}),this.addEventListener("change-opacity",o=>{let{value:s}=o;this.overlay.setOpacity(s)}),this.addEventListener("change-icon_size",o=>{let{value:s}=o;this.img&&(this.img.style.width=""+((s==null?void 0:s[0])||32)+"px",this.img.style.height=""+((s==null?void 0:s[1])||32)+"px",this.resetSize())}),this.addEventListener("change-icon_opacity",o=>{let{value:s}=o;this.img&&(this.img.style.opacity=""+s)}),this.addEventListener("change-icon_border",o=>{let{value:s}=o;this.img&&(this.img.style.border=s.width+"px solid "+s.color)}),this.addEventListener("change-background",o=>{let{value:s}=o;this.div.style.background=s})}};var ed=require("core-js/modules/web.dom-collections.iterator.js"),nd=require("core-js/modules/es.set.difference.v2.js"),rd=require("core-js/modules/es.set.intersection.v2.js"),id=require("core-js/modules/es.set.is-disjoint-from.v2.js"),od=require("core-js/modules/es.set.is-subset-of.v2.js"),sd=require("core-js/modules/es.set.is-superset-of.v2.js"),ad=require("core-js/modules/es.set.symmetric-difference.v2.js"),ud=require("core-js/modules/es.set.union.v2.js"),Lt=require("three");var Et=require("three"),_s=require("@mars3d/heatmap.js"),mr=require("@turf/turf");var bn=class extends Et.Object3D{clearHeatmap(){this.div.firstChild&&this.div.removeChild(this.div.firstChild),this.heatmap=void 0}loadData(t){var e;this.clearHeatmap();let{width:n,height:r,leftTop:i,center:o,scale:s}=this.box,u=((e=this.context.config.heatMap)==null?void 0:e.radius)||1,l=x({width:n,height:r,container:this.div},this.context.config.heatMap,{radius:u});this.heatmap=(0,_s.create)(l);let c=this.transformData(t,i,s);t.maxValue!==void 0&&(c.max=t.maxValue),t.minValue!==void 0&&(c.min=t.minValue),this.heatmap.setData(c),this.initPlane(n/s,r/s);let h=this.context.center;this.position.set(o[0]-h[0],o[1]-h[1],this.position.z)}initPlane(t,e){this.plane&&this.remove(this.plane);let n=new Et.PlaneGeometry(t,e),r=new Et.Texture(this.div.firstChild);r.needsUpdate=!0;let i=new Et.MeshBasicMaterial({transparent:!0,side:Et.FrontSide,map:r});i.needsUpdate=!0,this.plane=new Et.Mesh(n,i),this.plane.renderOrder=1e5,this.add(this.plane)}getTransMatrix(t){let{x:e,y:n}=t;return new Et.Matrix3().makeScale(this.box.scale,-this.box.scale).multiply(new Et.Matrix3().makeTranslation(-e,-n))}transformData(t,e,n){var r,i;let o=this.getTransMatrix(e);var s;let u=(s=(r=t.data[0])==null?void 0:r.value)!=null?s:0;var l;let c=(l=(i=t.data[0])==null?void 0:i.value)!=null?l:0;return{data:t.data.map(p=>{let f=new Et.Vector2(p.x,p.y).applyMatrix3(o);return p.value>u&&(u=p.value),p.value<c&&(c=p.value),{x:Math.ceil(f.x),y:Math.ceil(f.y),value:p.value}}),max:u,min:c}}getBox(){let t=this.context.range,e=(0,mr.bbox)(t),n=Math.ceil(e[2]-e[0]),r=Math.ceil(e[3]-e[1]),i=4e3,o=4e3,s=i/n,u=o/r,l=Math.min(s,u);this.scaleRatio=l;let c=n*l,h=r*l,p={x:Math.ceil(e[0]),y:Math.ceil(e[3])},f=(0,mr.center)(t).geometry.coordinates;return{width:c,height:h,leftTop:p,center:f,scale:l}}dispose(){this.clearHeatmap(),this.div.remove(),this.div=null,this.plane&&(this.remove(this.plane),B(this.plane))}constructor(t){super(),this.context=t,this.scaleRatio=1,this.div=document.createElement("div"),this.box=this.getBox()}};var _r=require("three");var Mn=class extends _r.Object3D{loadModel(){return g(this,null,function*(){let t=yield Tt.loadModel(this.options.modelUrl);t.scene.rotation.set(Math.PI/2,Math.PI/2,0),this.add(t.scene),this.model=t})}dispose(){B(this),this.model=null}constructor(t,e){super(),this.context=t,this.options=e,this.model=null,this.position.copy(e.position||new _r.Vector3(0,0,0)),this.loadModel()}};var Zp=require("core-js/modules/web.dom-collections.iterator.js");var vr=require("three");var vs=require("three");var ot=class extends vs.Object3D{setOpacity(t,e){e===void 0&&(e=!1),this.children.forEach(n=>{n.setOpacity==null||n.setOpacity.call(n,t,e)})}dispose(){B(this),this.children.forEach(t=>t.dispose==null?void 0:t.dispose.call(t)),this.clear()}constructor(t){super(),this.context=t}};var wn=class extends ot{getCenter(){return new vr.Box3().setFromObject(this).getCenter(new vr.Vector3)}createGraphic(t){let e=new pt(this.context,t);return e.userData.data=t,this.add(e),this.graphicMap.set(t.id,e),e}removeGraphic(t){this.remove(t),this.graphicMap.delete(t.options.id),t.dispose()}removeGraphicById(t){this.graphicMap.has(t)&&this.removeGraphic(this.graphicMap.get(t))}getGraphicByNodeId(t){return this.graphicMap.get(t)||null}getGraphicByRaycaster(t){let e={distance:1e4,graphic:null,position:null},n=this.children.reduce((r,i)=>{if(i instanceof pt){let o=i.raycast(t);if(o){let{distance:s}=o;if(s<r.distance)return{distance:o.distance,position:o.position,graphic:i}}return r}else return r},e);return n===e?{graphics:[],position:null}:{graphics:[n.graphic],position:n.position}}setGraphicOptions(t,e){let n,r=this.graphicMap.get(t);r&&(typeof e=="function"?n=e(r.options):n=x({},r.options,e),Object.keys(n).forEach(i=>{r.options[i]=n[i]}))}getGraphicPosition(t){let e=this.graphicMap.get(t);return e?[e.options.center_x,e.options.center_y]:null}setOpacity(t,e){e===void 0&&(e=!1),this.graphicMap.forEach(n=>{n.setOpacity(t,e)})}constructor(t){super(t),this.graphicMap=new Map}};var Qp=require("core-js/modules/es.array.unshift.js"),tf=require("core-js/modules/es.array.push.js");var ys=require("lodash");var Tn=class extends ot{clear(t){return t===void 0&&(t=!1),this.pois.forEach(e=>{e.options.built_in&&!t||e.dispose()}),this.pois=t?[]:this.pois.filter(e=>e.options.built_in),this}createPoi(t){let e=new ve(this.context,t);return this.pushPoi(e),e.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(e)),e.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(e)),Promise.resolve().then(()=>{this.debounceCollisionDetection()}),e}changePoiLevelOrCollisionEnable(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),this.pushPoi(t))}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}pushPoi(t){if(!t.options.collision_enable){this.pois.unshift(t);return}if(t.options.level===0){this.pois.push(t);return}for(let e=0;e<this.pois.length;e++){let n=this.pois[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.pois.splice(e,0,t);return}}this.pois.push(t)}getPoiByDeviceXy(t,e){return this.pois.filter(r=>r instanceof ve&&r.isContain(t,e))}collisionDetection(){let t=[];this.pois.filter(n=>n.visible&&n.withinDisplayRange).forEach((n,r)=>{let{left:i,right:o,top:s,bottom:u}=n.getBox();if(r===0||!n.options.collision_enable){t.push({left:i,right:o,top:s,bottom:u}),n.parentSetVisible(!0);return}let l=t.some(c=>c.left<o&&c.right>i&&c.top<u&&c.bottom>s);n.parentSetVisible(!l),l||t.push({left:i,right:o,top:s,bottom:u})})}registryEvent(){this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate)}dispose(){this.timer.dispose(),this.pois.forEach(t=>t.dispose()),this.pois.length=0,this.debounceCollisionDetection=()=>{},super.dispose(),this.unRegistryEvent()}constructor(t){super(t),this.pois=[],this.timer=new K,this.onUpdate=()=>{this.timer.requestAnimationFrame(()=>{this.collisionDetection()})},this.registryEvent(),this.debounceCollisionDetection=(0,ys.debounce)(this.collisionDetection,10)}};var sf=require("core-js/modules/es.array.unshift.js"),af=require("core-js/modules/es.array.push.js");var yr=require("three"),De=class extends ot{clear(){return this.pois.forEach(t=>{t.dispose()}),this.pois=[],this}createPoi(t){let e=new et(this.context,t);return this.pushPoi(e),e}changePoiLevelOrCollisionEnable(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.pois.splice(e,1),this.pushPoi(t))}removePoi(t){let e=this.pois.findIndex(n=>n===t);e!==-1&&(this.remove(t),this.pois.splice(e,1),t.dispose())}removePoiById(t){let e=this.pois.find(n=>n.options.id===t);e&&this.removePoi(e)}getPoiById(t){return this.pois.find(n=>n.options.id===t)||null}add(t){return this.children.some(e=>e.options.id===t.options.id)||(t.addEventListener("change-level",()=>this.changePoiLevelOrCollisionEnable(t)),t.addEventListener("change-collision_enable",()=>this.changePoiLevelOrCollisionEnable(t))),super.add(t),this}pushPoi(t){if(t.parentSetVisible(!1),t.userData.type==="parkingSpace"&&(this.needChangeParkingSpaceVisibleByZoom=!0),this.add(t),!t.options.collision_enable){this.pois.unshift(t);return}if(t.options.level===0){this.pois.push(t);return}for(let e=0;e<this.pois.length;e++){let n=this.pois[e];if(n.options.collision_enable&&n.options.level<=t.options.level){this.pois.splice(e,0,t);return}}this.pois.push(t)}getPoiByDeviceXy(t,e){let n=new yr.Vector2(t,e);return this.pois.filter(i=>i instanceof et&&i.canSelect&&i.box.containsPoint(n))}collisionDetection(){let t=[],{camera:e}=this.context;e.updateMatrixWorld();let n=l=>l<=1&&l>=-1,r=e.projectionMatrix.clone();r.multiply(e.matrixWorldInverse);let i=e.zoom/this.context.basicZoom,o=25/30,s=Math.min(25,Math.max(1,i*o));this.pois.filter(l=>{if(l.visible){var c,h;if(!(s<=l.options.maxWeight&&s>=l.options.minWeight))return l.parentSetVisible(!1),!1;let p=l.spriteIcon?(c=l.spriteIcon)==null?void 0:c.matrixWorld:((h=l.spriteText)==null?void 0:h.matrixWorld)||l.matrixWorld,f=new yr.Vector3().setFromMatrixPosition(p);return f.applyMatrix4(r),l.screenPosition=f,n(f.x)&&n(f.y)&&n(f.z)?!0:(l.parentSetVisible(!1),!1)}return!1}).forEach((l,c)=>{let h=l.getBox(l.screenPosition);if(c===0||!l.options.collision_enable){t.push(h),l.parentSetVisible(!0);return}let p=t.some(f=>f.intersectsBox(h));l.parentSetVisible(!p),p||t.push(h)})}setOpacity(t){this.pois.forEach(e=>{e.options.icon_opacity=t,e.options.text_opacity=t})}registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-zoom-change",this.changeParkingSpaceVisibleByZoom)}onAddToScene(){this.registryEvent()}onRemoveFromScene(){this.unRegistryEvent()}dispose(){this.timer.dispose(),this.pois.forEach(t=>t.dispose()),this.pois.length=0,super.dispose(),this.unRegistryEvent()}constructor(t){super(t),this.pois=[],this.needChangeParkingSpaceVisibleByZoom=!1,this.timer=new K,this.changeParkingSpaceVisibleByZoom=()=>{var e;let n=(e=this.parent)==null?void 0:e.parent;if(n&&n instanceof Bt){let{clientSize:{width:r,height:i}}=this.context,{max:o,min:s}=n.box,l=Math.min(r/(o.x-s.x),i/(o.y-s.y))*(o.x-s.x)/60,c=this.context.camera.zoom>=l;this.pois.filter(h=>h.userData.type==="parkingSpace").map(h=>{h.visible=c,c||h.parentSetVisible(c)})}},this.onUpdate=()=>{this.needChangeParkingSpaceVisibleByZoom&&(this.changeParkingSpaceVisibleByZoom(),this.needChangeParkingSpaceVisibleByZoom=!1),this.timer.requestAnimationFrame(()=>{this.collisionDetection()})}}};var pf=require("core-js/modules/es.regexp.exec.js"),ff=require("core-js/modules/web.dom-collections.iterator.js");var xr=require("three"),xs=require("lodash");var An=class extends ot{createParkings(t,e,n){e===void 0&&(e=!0),this.parkingOptions=t,this.merged=e,e?(n?this.createMergedParkingByMergedElements(n):this.createMergedParking(t),t.map((r,i)=>{var o;(o=r.texts[0])==null||o.split(/[,,]/).map(s=>{this.parkingNoIndexMap.set(s,i)}),this.nodeIdIndexMap.set(r.id,i)})):this.createIndependentParking(t)}load(t,e){e===void 0&&(e=!0);var n;this.createParkings(t.elements,e,t.mergedElements),(n=t.mergedParkingTexture)!=null&&n.length?this.createMergedParkingTexture(t.mergedParkingTexture):this.createParkingTexture(t.elements)}createMergedParking(t){return g(this,null,function*(){let e=new Ve(this.context,t);this.mergedParkingSpace=e,this.add(e)})}createMergedParkingByMergedElements(t){let e=new Cn(this.context,t);this.mergedParkingSpace=e,this.add(e)}createIndependentParking(t){t.forEach(e=>{var n;let r=new pt(this.context,e);this.add(r),(n=e.texts[0])==null||n.split(/[,,]/).map(i=>{this.parkingNoGraphicMap.set(i,r)}),this.graphicMap.set(r.options.id,r)})}createParkingTexture(t){let e=t.filter(n=>pr[n.parkingType]).map(n=>{let r=new xr.Vector2(...n.geometry.coords[0][0]),i=new xr.Vector2(...n.geometry.coords[0][1]),o=new xr.Vector2(...n.geometry.coords[0][2]),s=Math.min(r.distanceTo(i),i.distanceTo(o)),u=0;return s===r.distanceTo(i)?u=i.sub(r).angle()-Math.PI/2:u=o.sub(i).angle()-Math.PI/2,{uuid:n.id,iconUrl:pr[n.parkingType],name:n.texts[0],deltaHeight:(n.deltaHeight||0)+.001,airHeight:n.airHeight,height:n.height,geometry:n.geometry,opacity:n.fillOpacity,visible:!0,secondWidth:s-1,secondHeight:s-1,secondRotate:u,centerCoords:[n.center_coord_x,n.center_coord_y]}});if(e.length){let n=new ye(this.context,e);this.add(n)}}createMergedParkingTexture(t){t.map(e=>{e.iconUrl=pr[e.iconUrl];let n=new xe(this.context,e);this.add(n)})}changeParkingColor(t){this.merged?Object.keys(t).map(e=>{let n=this.parkingNoIndexMap.get(e);if(!(0,xs.isNil)(n)){var r;(r=this.mergedParkingSpace)==null||r.setParkingColorByIndex(n,t[e])}}):Object.keys(t).map(e=>{let n=this.parkingNoGraphicMap.get(e);n&&(n.options.fillColor=t[e])})}setOpacity(t,e){if(e===void 0&&(e=!1),this.parkingOptions.forEach(r=>{if(e)r.fillOpacity=t,r.strokeOpacity=t;else{let s=this.parkingOriginOptions.get(r.id);var i;r.fillOpacity=Math.min(t,(i=s==null?void 0:s.fillOpacity)!=null?i:1);var o;r.strokeOpacity=Math.min(t,(o=s==null?void 0:s.strokeOpacity)!=null?o:1)}}),this.merged)if(this.mergedParkingSpace instanceof Ve)this.mergedParkingSpace.setOpacity(t,e);else{var n;(n=this.mergedParkingSpace)==null||n.setOpacity(t,e)}else this.graphicMap.forEach(r=>{r.setOpacity(t,e)});this.children.filter(r=>r instanceof ye||r instanceof xe).map(r=>r.setOpacity(t))}getParkingOptionsByParkingNo(t){return this.parkingOptions.find(n=>n.texts[0]===t)||null}getGraphicPosition(t){if(this.merged){let e=this.parkingOptions.find(n=>n.id===t);return e?[e.center_x,e.center_y]:null}}dispose(){var t;(t=this.mergedParkingSpace)==null||t.dispose(),this.mergedParkingSpace=null,B(this),this.graphicMap.clear(),this.parkingNoGraphicMap.clear(),this.parkingNoIndexMap.clear(),this.nodeIdIndexMap.clear(),this.parkingOptions=[],super.dispose()}constructor(t){super(t),this.graphicMap=new Map,this.parkingNoGraphicMap=new Map,this.parkingOriginOptions=new Map,this.parkingOptions=[],this.merged=!1,this.parkingNoIndexMap=new Map,this.nodeIdIndexMap=new Map,this.mergedParkingSpace=null}};var xf=require("core-js/modules/es.array.push.js");var Rn=class extends ot{addModels(t){let e=t.reduce((n,r)=>{let{url:i}=r;return n[i]?n[i].push(r):n[i]=[r],n},{});Object.values(e).forEach(n=>{let r=new Pn(this.context,n);this.add(r)})}constructor(t){super(t)}};var kf=require("core-js/modules/web.dom-collections.iterator.js");var We=require("three");var Ss=require("three/examples/jsm/lines/LineMaterial.js"),nt=require("three");function Es(a){return`${a.x}-${a.y}-${a.z}`}var It=class{static generateLineMaterialKey({color:t,opacity:e}){return`${t}-${e}`}static createLineMaterial({color:t,opacity:e,vertexColors:n}){let r=this.generateLineMaterialKey({color:t,opacity:e,vertexColors:n});if(this.lineMaterialMap.has(r))return this.lineMaterialMap.get(r);let i=new nt.LineBasicMaterial({color:new nt.Color(t).convertLinearToSRGB(),transparent:!0,opacity:e,vertexColors:n!=null?n:!1});return this.lineMaterialMap.set(r,i),i}static createMeshStandardMaterial({color:t,opacity:e}){let n=`${t}-${e}`;if(this.meshStandardMaterialMap.has(n))return this.meshStandardMaterialMap.get(n);let r=new nt.MeshStandardMaterial({color:new nt.Color(t).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:e,depthWrite:!0});return this.meshStandardMaterialMap.set(n,r),r}static createMeshBasicMaterial({color:t,opacity:e,vertexColors:n}){let r=`${t}-${e}-${n}`;if(this.meshBasicMaterialMap.has(r))return this.meshBasicMaterialMap.get(r);let i=new nt.MeshBasicMaterial({color:t,transparent:!0,opacity:e,depthWrite:!0,vertexColors:n!=null?n:!1});return this.meshBasicMaterialMap.set(r,i),i}static createShaderMaterial({gradualColor:t,center:e,maxValue:n,opacity:r,direction:i,max:o,min:s}){let u=`${t.toString()}-${Es(e)}-${n}-${r}-${Es(i)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let l=`
3976
3976
  uniform vec3 uColor;
3977
3977
  uniform vec3 uGradualColor;
3978
3978
  uniform vec3 center;
@@ -8002,7 +8002,7 @@ void main() {
8002
8002
  gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
8003
8003
  }
8004
8004
  }
8005
- `,n=-1/0,r=this.geometry.getAttribute("position");if(r)for(let o=0;o<r.count;o++){let s=r.getZ(o);s>n&&(n=s)}let i=new ft.ShaderMaterial({uniforms:{maxZ:{value:n},uColor:{value:new ft.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new ft.Color(te(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=i}initLineMaterial(){let t=L.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new ft.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(n=>{let{coords:r}=n.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let s=0;s<o.length;s++){let u=o[s],l=s+1===o.length?o[0]:o[s+1];t.push(new ft.Vector3(u[0],u[1],e)),t.push(new ft.Vector3(l[0],l[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new ft.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new ft.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var n;(n=this.geometry)==null||n.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,n){super(),this.context=t,this.mergedElement=n,this.options=[],n?(this.options=[n],this.initMergedElement()):(this.options=e.map(r=>x({},_e,r)),this.init())}};var ig=require("core-js/modules/web.dom-collections.iterator.js"),og=require("core-js/modules/es.string.trim.js");var Gt=require("three"),Rs=require("three/examples/jsm/utils/BufferGeometryUtils.js");var Ps={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},zn=class extends Gt.Object3D{init(){return g(this,null,function*(){let t=yield Promise.all(this.options.map(o=>tt.getTextureByText(o.texts[0],{fillStyle:or(o.fillColor,o.fillOpacity),strokeStyle:or(o.strokeColor,o.strokeOpacity),lineWidth:6,font:"bold 54px sans-serif",maxWidth:2048}))),e=t.map((o,s)=>{let u=this.options[s],{width:l,height:c}=o.texture.image,h=l/c,p=u.secondHeight*h,f=new Gt.PlaneGeometry(p,u.secondHeight),d=new Gt.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Gt.Matrix4().makeRotationZ(u.secondRotate));return f.applyMatrix4(d),f}),n=(0,Rs.mergeGeometries)(e,!0);e.forEach(o=>o.dispose());let r=t.map(o=>{let{texture:s}=o,u=new Gt.MeshBasicMaterial({map:s,alphaTest:1,side:Gt.DoubleSide});return s.needsUpdate=!0,u}),i=new Gt.Mesh(n,r);this.mesh=i,this.position.z+=.04,this.add(i)})}setOpacity(t){var e,n;(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>{r.opacity=t,r.needsUpdate=!0})}dispose(){var t,e,n;(t=this.mesh)==null||t.geometry.dispose(),(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>r.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>x({},Ps,n)).filter(n=>n.texts[0].trim()),this.options.length&&this.init()}};var Is=require("three"),Ls=require("three/examples/jsm/lines/Line2.js"),Ns=require("three/examples/jsm/lines/LineGeometry.js"),Os=require("three/examples/jsm/lines/LineMaterial.js"),qe=class extends Is.Object3D{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Ls.Line2(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&B(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,n){super(),this.context=t,this.lineGeometry=new Ns.LineGeometry,this.lineMaterial=new Os.LineMaterial({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:r,height:i}=this.context.clientSize;this.lineMaterial.resolution.set(r,i)},this.onResize(),this.registryEvent(),e&&n&&this.setPosition(e,n)}};var pg=require("core-js/modules/es.array.push.js"),fg=require("core-js/modules/web.dom-collections.iterator.js"),be=require("three");var je=require("three");var Pn=class extends be.Object3D{loadModel(){return g(this,null,function*(){let t=yield Tt.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(u=>{if(u.isMesh){let l=e.clone().multiply(u.matrixWorld),c=u.material;this.subMeshes.push({geometry:u.geometry,material:u.material,initialMatrix:l}),Array.isArray(c)?c.forEach(h=>{h.transparent=!0,this.materialOriginParams.set(h,{opacity:h.opacity})}):(c.transparent=!0,this.materialOriginParams.set(c,{opacity:c.opacity}))}});let n=this.subMeshes.map(u=>{let{geometry:l,material:c}=u;return new be.InstancedMesh(l,c,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let i=new be.Box3().setFromObject(t.scene).getSize(new be.Vector3),o=Math.max(i.x,i.y);this.options.map(u=>{let l=new je.Matrix4,c=u.width/o;return l.multiply(new je.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight)).multiply(new je.Matrix4().makeScale(c,c,c)).multiply(new je.Matrix4().makeRotationZ(u.rotate)).multiply(new je.Matrix4().makeRotationX(Math.PI/2)),u.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(u,l),l}).forEach((u,l)=>{n.forEach((c,h)=>{let p=u.clone().multiply(this.subMeshes[h].initialMatrix);c.setMatrixAt(l,p)})}),n.forEach(u=>{u.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(u),this.add(u)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95,e.emissive=e.color,e.emissiveMap=e.map}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(n=>{let{material:r}=n;if(Array.isArray(r))r.forEach(i=>{if(e)i.opacity=t;else{let o=this.materialOriginParams.get(i)||{opacity:1};t>o.opacity?i.opacity=o.opacity:i.opacity=t}i.needsUpdate=!0});else{let i=this.materialOriginParams.get(r)||{opacity:1};t>i.opacity?r.opacity=i.opacity:r.opacity=t,r.needsUpdate=!0}}),this.children.forEach(n=>{n.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),B(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var Me=require("three");var Ee=class extends Me.Object3D{init(){return g(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=L.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=L.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Me.Mesh(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new Me.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new Me.ObjectLoader,this.options=x({},_e,e),this.init()}};var Ye=require("three");var Gn=class extends Ye.Object3D{initGeometry(){return g(this,null,function*(){let t=new Ye.ObjectLoader().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return g(this,null,function*(){var t;yield this.initGeometry();let e=new Ye.Mesh(this.geometry,It.GetMergeAttributeWallMaterial());this.add(e);let n=(t=this.geometry)==null?void 0:t.getAttribute("opacity");n&&(this.originOpacities=Array.from(n.array))})}setOpacity(t,e){e===void 0&&(e=!1);var n;let r=(n=this.geometry)==null?void 0:n.getAttribute("opacity");if(r){for(let o=0;o<r.count;o++)if(e)r.setX(o,t);else{var i;r.setX(o,Math.min(t,(i=this.originOpacities[o])!=null?i:1))}r.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var Ag=require("core-js/modules/es.typed-array.float32-array.js"),Cg=require("core-js/modules/es.typed-array.at.js"),Rg=require("core-js/modules/es.typed-array.fill.js"),Pg=require("core-js/modules/es.typed-array.find-last.js"),Ig=require("core-js/modules/es.typed-array.find-last-index.js"),Lg=require("core-js/modules/es.typed-array.set.js"),Ng=require("core-js/modules/es.typed-array.sort.js"),Og=require("core-js/modules/es.typed-array.to-reversed.js"),Dg=require("core-js/modules/es.typed-array.to-sorted.js"),Ug=require("core-js/modules/es.typed-array.with.js"),Fg=require("core-js/modules/es.array-buffer.constructor.js"),Bg=require("core-js/modules/es.array-buffer.slice.js"),zg=require("core-js/modules/es.array-buffer.detached.js"),Gg=require("core-js/modules/es.array-buffer.transfer.js"),kg=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js");var st=require("three");var xe=class extends st.Object3D{init(){return g(this,null,function*(){let t=this.options.iconUrl,e=yield ht.getTextureByUrl(t),n=new st.MeshBasicMaterial({map:e,transparent:!0,alphaTest:.2,side:st.FrontSide}),r=new st.InstancedMesh(this.geometry,n,this.options.mergedMatrixes.size);r.instanceMatrix=new st.InstancedBufferAttribute(new Float32Array(this.options.mergedMatrixes.array),16),this.add(r),this.mesh=r,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&B(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new st.ShapeGeometry(new st.Shape([new st.Vector2(-.5,-.5),new st.Vector2(-.5,.5),new st.Vector2(.5,.5),new st.Vector2(.5,-.5)])),this.options=x({},br,e);let n=new st.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var jg=require("core-js/modules/es.array.push.js"),he=require("three");var Pi=require("three/examples/jsm/lines/LineSegments2.js"),Ii=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var kn=class extends he.Object3D{initGeometry(){return g(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=L.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=L.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new he.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new Ii.LineSegmentsGeometry;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let n=new Pi.LineSegments2(e,t);n.computeLineDistances(),n.position.z+=.01,this.add(n),this.doubleLines.push(n)}if(this.options.lineGeometry){let t=L.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new he.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new Ii.LineSegmentsGeometry;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let n=new Pi.LineSegments2(e,t);n.position.z+=.01,this.add(n),this.doubleLines.push(n)}}init(){return g(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new he.Mesh(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new he.ObjectLoader,this.init()}};var Jg=require("core-js/modules/es.typed-array.float32-array.js"),Qg=require("core-js/modules/es.typed-array.at.js"),tm=require("core-js/modules/es.typed-array.fill.js"),em=require("core-js/modules/es.typed-array.find-last.js"),nm=require("core-js/modules/es.typed-array.find-last-index.js"),rm=require("core-js/modules/es.typed-array.set.js"),im=require("core-js/modules/es.typed-array.sort.js"),om=require("core-js/modules/es.typed-array.to-reversed.js"),sm=require("core-js/modules/es.typed-array.to-sorted.js"),am=require("core-js/modules/es.typed-array.with.js"),um=require("core-js/modules/es.array-buffer.constructor.js"),lm=require("core-js/modules/es.array-buffer.slice.js"),cm=require("core-js/modules/es.array-buffer.detached.js"),hm=require("core-js/modules/es.array-buffer.transfer.js"),pm=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),fm=require("core-js/modules/web.dom-collections.iterator.js"),q=require("three");var Ve=class extends q.Object3D{setParkingColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new q.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return g(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=L.GetInstancedParkingSpaceMaterial()}initLineMaterial(){let t=L.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new q.InstancedMesh(this.geometry,this.material,this.options.length);let t=new q.InstancedBufferAttribute(new Float32Array(this.options.length),1),e=new q.InstancedBufferAttribute(new Float32Array(this.options.length),1);this.options.forEach((n,r)=>{let i=n.geometry.coords[0],[o,s,u]=i.slice(0,3),l=Math.sqrt((s[0]-o[0])**2+(s[1]-o[1])**2),c=Math.sqrt((u[0]-s[0])**2+(u[1]-s[1])**2),h=[l,c],p=Math.max(...h),f=Math.min(...h),d;p===l?d=[s[0]-o[0],s[1]-o[1]]:d=[u[0]-s[0],u[1]-s[1]];let[m,v]=d,y=Math.atan2(v,m)-Math.PI/2,S=new q.Matrix4().compose(new q.Vector3(n.center_coord_x,n.center_coord_y,(n.deltaHeight||0)+n.airHeight+n.height/2),new q.Quaternion().setFromAxisAngle(new q.Vector3(0,0,1),y),new q.Vector3(f,p,n.height));this.mesh.setMatrixAt(r,S),this.mesh.setColorAt(r,new q.Color(n.fillColor).convertLinearToSRGB()),t.array[r]=n.fillOpacity||1,e.array[r]=(n.deltaHeight||0)+n.airHeight+n.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:n}=lr(this.options),r=new q.BufferGeometry().setFromPoints(t);r.setAttribute("color",new q.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new q.BufferAttribute(new Float32Array(n),1)),this.lineOriginOpacity=[...n],this.lineGeometry=r}createBorder(){this.line&&this.remove(this.line);let t=new q.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var r;n.array[o]=Math.min(t,(r=this.originOpacity[o])!=null?r:1)}if(n.needsUpdate=!0,this.lineGeometry){let o=this.lineGeometry.getAttribute("opacity");for(let s=0;s<o.count;s++)if(e)o.array[s]=t;else{var i;o.array[s]=Math.min(t,(i=this.lineOriginOpacity[s])!=null?i:1)}o.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new q.BoxGeometry(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(n=>x({},_e,n)),this.init()}};var ym=require("core-js/modules/es.typed-array.float32-array.js"),xm=require("core-js/modules/es.typed-array.at.js"),Em=require("core-js/modules/es.typed-array.fill.js"),Sm=require("core-js/modules/es.typed-array.find-last.js"),bm=require("core-js/modules/es.typed-array.find-last-index.js"),Mm=require("core-js/modules/es.typed-array.set.js"),wm=require("core-js/modules/es.typed-array.sort.js"),Tm=require("core-js/modules/es.typed-array.to-reversed.js"),Am=require("core-js/modules/es.typed-array.to-sorted.js"),Cm=require("core-js/modules/es.typed-array.with.js"),Rm=require("core-js/modules/es.array-buffer.constructor.js"),Pm=require("core-js/modules/es.array-buffer.slice.js"),Im=require("core-js/modules/es.array-buffer.detached.js"),Lm=require("core-js/modules/es.array-buffer.transfer.js"),Nm=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Om=require("core-js/modules/web.dom-collections.iterator.js"),Mt=require("three");var Cn=class extends Mt.Object3D{init(){return g(this,null,function*(){this.initMaterial(),this.initMesh(),this.option.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}setParkingColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new Mt.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}initMaterial(){this.material=L.GetInstancedParkingSpaceMaterial()}initLineMaterial(){return this.lineMaterial=L.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Mt.InstancedMesh(this.geometry,this.material,this.option.size);let t=new Mt.InstancedBufferAttribute(new Float32Array(this.option.opacities),1),e=new Mt.InstancedBufferAttribute(new Float32Array(this.option.maxZ),1);this.mesh.instanceMatrix=new Mt.InstancedBufferAttribute(new Float32Array(this.option.matrixes),16),this.mesh.instanceColor=new Mt.InstancedBufferAttribute(new Float32Array(this.option.colors),3),this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.needsUpdate=!0,this.originOpacity=[...this.option.opacities],this.add(this.mesh)}initLineGeometry(){if(this.lineGeometry&&this.lineGeometry.dispose(),this.option.lineGeometry){let t=new Mt.ObjectLoader().parseGeometries([this.option.lineGeometry]);this.lineGeometry=t[this.option.lineGeometry.uuid];let e=this.lineGeometry.getAttribute("opacity");this.lineOriginOpacity=[...e.array]}}createBorder(){this.line&&this.remove(this.line);let t=new Mt.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var r;n.array[o]=Math.min(t,(r=this.originOpacity[o])!=null?r:1)}if(n.needsUpdate=!0,this.lineGeometry){let o=this.lineGeometry.getAttribute("opacity");for(let s=0;s<o.count;s++)if(e)o.array[s]=t;else{var i;o.array[s]=Math.min(t,(i=this.lineOriginOpacity[s])!=null?i:1)}o.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new Mt.BoxGeometry(1,1,1),this.originOpacity=[],this.lineOriginOpacity=[],this.option=e,this.init()}};var Ds=require("three"),Mr=class extends zt{setEnable(t){super.setEnable(t),wt(this.rect,0,0,0,0),t?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:e,container:{clientWidth:n,clientHeight:r}}}=this,i=I(this.startPoint,e,n,r),o=I(this.endPoint,e,n,r),s={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},u={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},l=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:l})}}searchMapInFrustum(t,e){var n;let{context:r}=this;return((n=r.currentFloor)==null?void 0:n.graphicLayer.children.filter(i=>i instanceof pt&&this.searchChildInFrustum(i,t,e)))||[]}searchChildInFrustum(t,e,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!t)return!1;if(!t.mesh){let p=t.getPosition();if(p){let f=I(p,r,i,o);return ae(f,e,n)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let s=t.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:l}=s,c=I(u,r,i,o),h=I(l,r,i,o);return!(!ae(c,e,n)||!ae(h,e,n))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new Ds.Frustum,this.onPointerDown=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.startPoint=i),this.endPoint=void 0},this.onPointerMove=r=>{if(!this.enable||!this.startPoint)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i)},this.onPointerUp=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i),this.doSelect(),this.startPoint=void 0},this.onUpdate=()=>{if(this.startPoint){let r=this.getSvgCoordinate(this.startPoint),i=x({},r);this.endPoint&&(i=this.getSvgCoordinate(this.endPoint));let o={x:Math.min(r.x,i.x),y:Math.min(r.y,i.y)},s=Math.abs(i.x-r.x),u=Math.abs(i.y-r.y);wt(this.rect,o.x,o.y,s,u)}else wt(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:n}}}=t;this.rect=ue(n,e),this.svg.appendChild(this.rect),this.registryEvent()}};var Vn=class extends Us.EventDispatcher{get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.context=t,this._list=new Set,this.downPoint=null,this.downTime=0,this.isMultipleSelect=!1,this.onPointerDown=e=>{Date.now()-this.downTime<200||(this.downPoint={x:e.offsetX,y:e.offsetY},this.downTime=Date.now())},this.onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:s}=this.context.getGraphicsByDeviceXy(n,r),u=new Set(s.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!u.has(c.options.id)){var h;let p=((h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id))||null;p&&p.options.geometry.type==="point"&&(s.push(p),u.add(c.options.id))}}),(Ce?e.metaKey:e.ctrlKey)||this._list.clear(),s.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{Re(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{Re(e.key)&&this.disableBoxSelection()},this.onBoxSelected=e=>{let{list:n}=e;this._list.clear(),n.forEach(r=>{this._list.add(r)}),this.selectEnd()},this.boxSelection=new Mr(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var t_=require("core-js/modules/es.set.difference.v2.js"),e_=require("core-js/modules/es.set.intersection.v2.js"),n_=require("core-js/modules/es.set.is-disjoint-from.v2.js"),r_=require("core-js/modules/es.set.is-subset-of.v2.js"),i_=require("core-js/modules/es.set.is-superset-of.v2.js"),o_=require("core-js/modules/es.set.symmetric-difference.v2.js"),s_=require("core-js/modules/es.set.union.v2.js"),a_=require("core-js/modules/web.dom-collections.iterator.js");var wr=require("three");var Hn=class extends wr.EventDispatcher{handleHoverGraphicsChange(t){t===void 0&&(t=this.curGraphics),this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}constructor(t){super(),this.context=t,this.curGraphics=new Set,this.timer=new K,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:n,pois:r,e:i}=e,o=r.map(c=>{var h;return(h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id)}).filter(c=>c&&c.options.geometry.type==="point");if(!n.length&&!o.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,u=new Set;if(o.length){let c,h=1e4;o.forEach(p=>{let f=r.find(d=>d.options.id===p.options.id);if(f instanceof ve){let{x:d,y:m}=f.clientPos,v=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);v<h&&(h=v,c=p)}else if(f instanceof et){let{x:d,y:m}=f.box.getCenter(new wr.Vector2),v=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);v<h&&(h=v,c=p)}}),u.add(c)}u.size||n.forEach(c=>u.add(c)),u.forEach(c=>{if(this.graphicTimerMap.get(c)||this.curGraphics.has(c))return;let h=this.timer.setTimeout(()=>{this.curGraphics.add(c),this.graphicTimerMap.delete(c),this.timer.clearTimeout(h),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(c,h)}),this.graphicTimerMap.forEach((c,h)=>{u.has(h)||(this.timer.clearTimeout(c),this.graphicTimerMap.delete(h))});let l=this.curGraphics.size;this.curGraphics.forEach(c=>{u.has(c)||this.curGraphics.delete(c)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()},this.onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()},this.onBodyPointerMove=e=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&this.onPointerLevel()}},this.registryEvent()}};var h_=require("core-js/modules/web.dom-collections.iterator.js"),kt=require("three");var Wn=require("@turf/turf"),Tr=class{updateBox(){this.box.setFromObject(this.context.scene)}setEnable(t){this.enable=t,t?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(d=>d instanceof Bt).length)return null;let e=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:s}=e,l=[new kt.Vector3(o.x,o.y,o.z),new kt.Vector3(s.x,o.y,o.z),new kt.Vector3(o.x,s.y,o.z),new kt.Vector3(s.x,s.y,o.z),new kt.Vector3(o.x,o.y,s.z),new kt.Vector3(s.x,o.y,s.z),new kt.Vector3(o.x,s.y,s.z),new kt.Vector3(s.x,s.y,s.z)].map(d=>I(d,n,r,i)),c=Math.min(...l.map(d=>d.x)),h=Math.max(...l.map(d=>d.x)),p=Math.min(...l.map(d=>d.y)),f=Math.max(...l.map(d=>d.y));return{left:c,right:h,top:p,bottom:f}}checkDistanceToScreenEdge(t){let{left:e,right:n,top:r,bottom:i}=t,{width:o,height:s}=this.context.clientSize,[u,l,c,h]=this.context.config.cameraBound.padding,p=(0,Wn.polygon)([[[e,r],[n,r],[n,i],[e,i],[e,r]]]),f=(0,Wn.polygon)([[[h,u],[o-l,u],[o-l,s-c],[h,s-c],[h,u]]]);try{return(0,Wn.intersect)(p,f)!==null}catch(d){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",d),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new kt.Vector3,zoom:1,target:new kt.Vector3},this.enable=!0,this.box=new kt.Box3,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:n,right:r,top:i,bottom:o}=e;this.checkDistanceToScreenEdge({left:n,right:r,top:i,bottom:o})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var v_=require("core-js/modules/es.promise.finally.js"),Li=require("three"),Ue=require("@tweenjs/tween.js");var g_=require("core-js/modules/web.dom-collections.iterator.js"),m_=require("core-js/modules/es.array.push.js"),b=require("three"),Ar=new b.Ray,Fs=new b.Plane,hu=Math.cos(70*b.MathUtils.DEG2RAD),Cr=class extends b.EventDispatcher{dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerUp),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null)}constructor(t,e){super(),this.rotateLineStart=new b.Vector2,this.rotateLineEnd=new b.Vector2,this.spherical=new b.Spherical,this.sphericalDelta=new b.Spherical,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new b.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.screenSpacePanning=!1,this.mouseButtons={LEFT:b.MOUSE.PAN,MIDDLE:b.MOUSE.DOLLY,RIGHT:b.MOUSE.ROTATE},this.touches={ONE:b.TOUCH.PAN,TWO:b.TOUCH.DOLLY_ROTATE},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(_){_.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=_},this.stopListenToKeyEvents=function(){var _;(_=this._domElementKeyEvents)==null||_.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent({type:"change"}),n.update(),i=r.NONE},this.update=function(){let _=new b.Vector3,E=new b.Quaternion().setFromUnitVectors(t.up,new b.Vector3(0,1,0)),j=E.clone().invert(),rt=new b.Vector3,Dt=new b.Quaternion,Jt=new b.Vector3,Zt=2*Math.PI;return function(sn){sn===void 0&&(sn=null);let ie=n.object.position;_.copy(ie).sub(n.target),_.applyQuaternion(E),s.setFromVector3(_),n.autoRotate&&i===r.NONE&&M(T(sn)),n.enableDamping?(s.theta+=u.theta*n.dampingFactor,s.phi+=u.phi*n.dampingFactor):(s.theta+=u.theta,s.phi+=u.phi);let oe=n.minAzimuthAngle,se=n.maxAzimuthAngle;isFinite(oe)&&isFinite(se)&&(oe<-Math.PI?oe+=Zt:oe>Math.PI&&(oe-=Zt),se<-Math.PI?se+=Zt:se>Math.PI&&(se-=Zt),oe<=se?s.theta=Math.max(oe,Math.min(se,s.theta)):s.theta=s.theta>(oe+se)/2?Math.max(oe,s.theta):Math.min(se,s.theta)),s.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,s.phi)),s.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(c,n.dampingFactor):n.target.add(c),n.zoomToCursor&&Y||n.object.isOrthographicCamera?s.radius=Kr(s.radius):s.radius=Kr(s.radius*l),_.setFromSpherical(s),_.applyQuaternion(j),ie.copy(n.target).add(_),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,c.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),c.set(0,0,0));let nr=!1;if(n.zoomToCursor&&Y){let an=null;if(n.object.isPerspectiveCamera){let un=_.length();an=Kr(un*l);let rr=un-an;n.object.position.addScaledVector(O,rr),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let un=new b.Vector3(N.x,N.y,0);un.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),nr=!0;let rr=new b.Vector3(N.x,N.y,0);rr.unproject(n.object),n.object.position.sub(rr).add(un),n.object.updateMatrixWorld(),an=_.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;an!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(an).add(n.object.position):(Ar.origin.copy(n.object.position),Ar.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Ar.direction))<hu?t.lookAt(n.target):(Fs.setFromNormalAndCoplanarPoint(n.object.up,n.target),Ar.intersectPlane(Fs,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),nr=!0);return l=1,Y=!1,nr||rt.distanceToSquared(n.object.position)>o||8*(1-Dt.dot(n.object.quaternion))>o||Jt.distanceToSquared(n.target)>0?(n.dispatchEvent({type:"change"}),rt.copy(n.object.position),Dt.copy(n.object.quaternion),Jt.copy(n.target),nr=!1,!0):!1}}();let n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},i=r.NONE,o=1e-6,s=new b.Spherical,u=new b.Spherical,l=1,c=new b.Vector3,h=new b.Vector2,p=new b.Vector2,f=new b.Vector2,d=new b.Vector2,m=new b.Vector2,v=new b.Vector2,y=new b.Vector2,S=new b.Vector2,w=new b.Vector2,O=new b.Vector3,N=new b.Vector2,Y=!1,C=[],U={};function T(_){return _!==null?2*Math.PI/60*n.autoRotateSpeed*_:2*Math.PI/60/60*n.autoRotateSpeed}function R(){return Math.pow(.95,n.zoomSpeed)}function M(_){u.theta-=_}function V(_){u.phi-=_}let Z=function(){let _=new b.Vector3;return function(j,rt){_.setFromMatrixColumn(rt,0),_.multiplyScalar(-j),c.add(_)}}(),W=function(){let _=new b.Vector3;return function(j,rt){n.screenSpacePanning===!0?_.setFromMatrixColumn(rt,1):(_.setFromMatrixColumn(rt,0),_.crossVectors(n.object.up,_)),_.multiplyScalar(j),c.add(_)}}(),F=function(){let _=new b.Vector3;return function(j,rt){let Dt=n.domElement;if(n.object.isPerspectiveCamera){let Jt=n.object.position;_.copy(Jt).sub(n.target);let Zt=_.length();Zt*=Math.tan(n.object.fov/2*Math.PI/180),Z(2*j*Zt/Dt.clientHeight,n.object.matrix),W(2*rt*Zt/Dt.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(Z(j*(n.object.right-n.object.left)/n.object.zoom/Dt.clientWidth,n.object.matrix),W(rt*(n.object.top-n.object.bottom)/n.object.zoom/Dt.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function fe(_){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l/=_:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function on(_){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l*=_:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Zr(_){if(!n.zoomToCursor)return;Y=!0;let E=n.domElement.getBoundingClientRect(),j=_.clientX-E.left,rt=_.clientY-E.top,Dt=E.width,Jt=E.height;N.x=j/Dt*2-1,N.y=-(rt/Jt)*2+1,O.set(N.x,N.y,1).unproject(n.object).sub(n.object.position).normalize()}function Kr(_){return Math.max(n.minDistance,Math.min(n.maxDistance,_))}function so(_){h.set(_.clientX,_.clientY)}function sa(_){Zr(_),y.set(_.clientX,_.clientY)}function ao(_){d.set(_.clientX,_.clientY)}function aa(_){p.set(_.clientX,_.clientY),f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let E=n.domElement;M(2*Math.PI*f.x/E.clientHeight),V(2*Math.PI*f.y/E.clientHeight),h.copy(p),n.update()}function ua(_){S.set(_.clientX,_.clientY),w.subVectors(S,y),w.y>0?fe(R()):w.y<0&&on(R()),y.copy(S),n.update()}function la(_){m.set(_.clientX,_.clientY),v.subVectors(m,d).multiplyScalar(n.panSpeed),F(v.x,v.y),d.copy(m),n.update()}function ca(_){Zr(_),_.deltaY<0?on(R()):_.deltaY>0&&fe(R()),n.update()}function ha(_){let E=!1;switch(_.code){case n.keys.UP:_.ctrlKey||_.metaKey||_.shiftKey?V(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(0,n.keyPanSpeed),E=!0;break;case n.keys.BOTTOM:_.ctrlKey||_.metaKey||_.shiftKey?V(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(0,-n.keyPanSpeed),E=!0;break;case n.keys.LEFT:_.ctrlKey||_.metaKey||_.shiftKey?M(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(n.keyPanSpeed,0),E=!0;break;case n.keys.RIGHT:_.ctrlKey||_.metaKey||_.shiftKey?M(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(-n.keyPanSpeed,0),E=!0;break}E&&(_.preventDefault(),n.update())}function uo(){if(C.length===1)h.set(C[0].pageX,C[0].pageY);else{let _=(C[0].pageX-C[0].pageY)/(C[1].pageX-C[1].pageY),E=C[0].pageY-_*C[0].pageX;n.rotateLineStart.set(_,E);let j=.5*(C[0].pageX+C[1].pageX),rt=.5*(C[0].pageY+C[1].pageY);h.set(j,rt)}}function lo(){if(C.length===1)d.set(C[0].pageX,C[0].pageY);else{let _=.5*(C[0].pageX+C[1].pageX),E=.5*(C[0].pageY+C[1].pageY);d.set(_,E)}}function co(){let _=C[0].pageX-C[1].pageX,E=C[0].pageY-C[1].pageY,j=Math.sqrt(_*_+E*E);y.set(0,j)}function pa(){n.enableZoom&&co(),n.enablePan&&lo()}function fa(){n.enableZoom&&co(),n.enableRotate&&uo()}function ho(_){if(C.length==1)p.set(_.pageX,_.pageY);else{let j=$r(_),rt=.5*(_.pageX+j.x),Dt=.5*(_.pageY+j.y);p.set(rt,Dt);let Jt=(_.pageY-j.y)/(_.pageX-j.x),Zt=j.y-Jt*j.x;if(n.rotateLineEnd.set(Jt,Zt),Number.isFinite(n.rotateLineEnd.x)&&Number.isFinite(n.rotateLineStart.x)){let Jr=(n.rotateLineStart.y-n.rotateLineEnd.y)/(n.rotateLineEnd.x-n.rotateLineStart.x),sn=Jt*Jr+Zt;if(Number.isFinite(Jr)&&Number.isFinite(sn)){let ie=Math.atan(n.rotateLineEnd.x)-Math.atan(n.rotateLineStart.x);Math.PI-Math.abs(ie)<.5&&(ie=-Math.sign(ie)*(Math.PI-Math.abs(ie))),Math.abs(ie)<.1&&(u.theta+=ie)}}n.rotateLineStart.copy(n.rotateLineEnd)}f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let E=n.domElement;V(2*Math.PI*f.y/E.clientHeight),h.copy(p)}function po(_){if(C.length===1)m.set(_.pageX,_.pageY);else{let E=$r(_),j=.5*(_.pageX+E.x),rt=.5*(_.pageY+E.y);m.set(j,rt)}v.subVectors(m,d).multiplyScalar(n.panSpeed),F(v.x,v.y),d.copy(m)}function fo(_){let E=$r(_),j=_.pageX-E.x,rt=_.pageY-E.y,Dt=Math.sqrt(j*j+rt*rt);S.set(0,Dt),w.set(0,Math.pow(S.y/y.y,n.zoomSpeed)),fe(w.y),y.copy(S)}function da(_){n.enableZoom&&fo(_),n.enablePan&&po(_)}function ga(_){n.enableZoom&&fo(_),n.enableRotate&&ho(_)}this.onPointerDown=function(E){n.enabled!==!1&&(C.length===0&&(n.domElement.setPointerCapture(E.pointerId),n.domElement.addEventListener("pointermove",n.onPointerMove),n.domElement.addEventListener("pointerup",n.onPointerUp)),xa(E),E.pointerType==="touch"?va(E):ma(E))},this.onPointerMove=function(E){n.enabled!==!1&&(E.pointerType==="touch"?ya(E):_a(E))},this.onPointerUp=function(E){Ea(E),C.length===0&&(n.domElement.releasePointerCapture(E.pointerId),n.domElement.removeEventListener("pointermove",n.onPointerMove),n.domElement.removeEventListener("pointerup",n.onPointerUp)),n.dispatchEvent({type:"end"}),i=r.NONE};function ma(_){let E;switch(_.button){case 0:E=n.mouseButtons.LEFT;break;case 1:E=n.mouseButtons.MIDDLE;break;case 2:E=n.mouseButtons.RIGHT;break;default:E=-1}switch(E){case b.MOUSE.DOLLY:if(n.enableZoom===!1)return;sa(_),i=r.DOLLY;break;case b.MOUSE.ROTATE:if(_.ctrlKey||_.metaKey||_.shiftKey){if(n.enablePan===!1)return;ao(_),i=r.PAN}else{if(n.enableRotate===!1)return;so(_),i=r.ROTATE}break;case b.MOUSE.PAN:if(_.ctrlKey||_.metaKey||_.shiftKey){if(n.enableRotate===!1)return;so(_),i=r.ROTATE}else{if(n.enablePan===!1)return;ao(_),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function _a(_){switch(i){case r.ROTATE:if(n.enableRotate===!1)return;aa(_);break;case r.DOLLY:if(n.enableZoom===!1)return;ua(_);break;case r.PAN:if(n.enablePan===!1)return;la(_);break}}this.onMouseWheel=function(E){n.enabled===!1||n.enableZoom===!1||i!==r.NONE||(E.preventDefault(),n.dispatchEvent({type:"start"}),ca(E),n.dispatchEvent({type:"end"}))},this.onKeyDown=function(E){n.enabled===!1||n.enablePan===!1||ha(E)};function va(_){switch(go(_),C.length){case 1:switch(n.touches.ONE){case b.TOUCH.ROTATE:if(n.enableRotate===!1)return;uo(),i=r.TOUCH_ROTATE;break;case b.TOUCH.PAN:if(n.enablePan===!1)return;lo(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case b.TOUCH.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;pa(),i=r.TOUCH_DOLLY_PAN;break;case b.TOUCH.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;fa(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function ya(_){switch(go(_),i){case r.TOUCH_ROTATE:if(n.enableRotate===!1)return;ho(_),n.update();break;case r.TOUCH_PAN:if(n.enablePan===!1)return;po(_),n.update();break;case r.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;da(_),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ga(_),n.update();break;default:i=r.NONE}}this.onContextMenu=function(E){n.enabled!==!1&&E.preventDefault()};function xa(_){C.push(_)}function Ea(_){delete U[_.pointerId];for(let E=0;E<C.length;E++)if(C[E].pointerId==_.pointerId){C.splice(E,1);return}}function go(_){let E=U[_.pointerId];E===void 0&&(E=new b.Vector2,U[_.pointerId]=E),E.set(_.pageX,_.pageY)}function $r(_){let E=_.pointerId===C[0].pointerId?C[1]:C[0];return U[E.pointerId]}n.domElement.addEventListener("contextmenu",this.onContextMenu),n.domElement.addEventListener("pointerdown",this.onPointerDown),n.domElement.addEventListener("pointercancel",this.onPointerUp),n.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}};var Rr=class extends Cr{registryEvent(){this.addEventListener("change",this.onChange),this.context.addEventListener("update",this.tweenUpdate)}unRegistryEvent(){this.removeEventListener("change",this.onChange),this.context.removeEventListener("update",this.tweenUpdate)}setPolarAngle(t,e){e===void 0&&(e=!1);let{maxPolarAngle:n,minPolarAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),i||(this.maxPolarAngle=n,this.minPolarAngle=r)}setPolarAngleByDuration(t,e,n){return g(this,null,function*(){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setPolarAngle(t,e):Ft(new Promise(r=>{let i={polar:this.getPolarAngle()},o={polar:t},s=new Ue.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setPolarAngle(i.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)})}setAzimuthalAngle(t,e){let{maxAzimuthAngle:n,minAzimuthAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxAzimuthAngle=t,this.minAzimuthAngle=t,this.update()),i||(this.maxAzimuthAngle=n,this.minAzimuthAngle=r)}setAzimuthalAngleDuration(t,e,n){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setAzimuthalAngle(t,e):Ft(new Promise(r=>{let i={azimuthal:this.getAzimuthalAngle()},o={azimuthal:t},s=new Ue.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setAzimuthalAngle(i.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}getCameraLookAt(){return new Li.Vector3().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return g(this,null,function*(){let n=this.target.clone(),r=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(r)),this.target.copy(t.clone()),this.update();return}return Ft(new Promise(i=>{let o=new Ue.Tween(n,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(n.clone().sub(r)),this.target.copy(n.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(o),this.enabled=!0,i(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)})}setZoom(t,e,n){n===void 0&&(n=!1);let{minZoom:r,maxZoom:i}=this;(n||t>=r&&t<=i)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,n,r){return g(this,null,function*(){n===void 0&&(n=!1),r===void 0&&(r=500);let i={zoom:this.camera.zoom,target:this.target.clone()};if(t!==this.camera.zoom)return r?Ft(new Promise(o=>{let s=new Ue.Tween(i,this.tweenGroup).to({zoom:t,target:e},r).onUpdate(()=>{this.setZoom(i.zoom,i.target,n)}).onComplete(()=>{this.tweenGroup.remove(s),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500).finally(()=>{this.enabled=!0}):this.setZoom(t,e,n)})}setTargetByOffset(t,e){if(e===void 0&&(e=this.target.clone()),this.camera.updateMatrix(),t){let n=new Li.Vector3;n.setFromMatrixColumn(this.camera.matrix,1),n.normalize(),n.multiplyScalar(t/this.camera.zoom),e.add(n)}this.setCameraPositionByTarget(e,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){super.dispose(),this.unRegistryEvent(),this.clearTween()}constructor(t,e,n){super(e,n),this.context=t,this.camera=e,this.domElement=n,this.prevCameraZoom=1,this.tweenGroup=new Ue.Group,this.offsetY=0,this.onChange=()=>{let r=this.camera.zoom;r!==this.prevCameraZoom&&(this.prevCameraZoom=r,this.dispatchEvent({type:"change-zoom",zoom:r}))},this.tweenUpdate=()=>{this.tweenGroup.update()},this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}};var Ze=require("three");var Pr=class extends Ze.WebGLRenderer{setCameraAndScene(t,e){this.scene=t,this.camera=e}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(t,e){this.event.addEventListener(t,e)}removeEventListener(t,e){this.event.removeEventListener(t,e)}constructor(t){super(x({antialias:!0,alpha:!0},t)),this.event=new Ze.EventDispatcher,this.enable=!0,this.timer=new K,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=Ze.PCFSoftShadowMap;let e=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,e.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var we=require("three"),Bs=require("three/examples/jsm/loaders/RGBELoader.js");var Ir=class extends we.Scene{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,B(this),this.clear()}constructor(){super(),new Bs.RGBELoader().load(fs,t=>{t.mapping=we.EquirectangularReflectionMapping,this.environment=t;let e=new we.Matrix4;e.makeRotationX(Math.PI/2),this.environmentRotation=new we.Euler().setFromRotationMatrix(e)})}};var zs=require("three"),Lr=class extends zs.OrthographicCamera{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var Ni=require("@turf/turf");var Xn=class extends H.EventDispatcher{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=(0,Ni.polygon)([t])}resizeClientSize(){let{x:t,y:e,width:n,height:r}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:r||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new Lr(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Rr(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new Tr(this)}getRatio(t,e){t===void 0&&(t=new H.Vector3(0,0,0)),e===void 0&&(e=new H.Vector3(100,0,0));let{clientWidth:n,clientHeight:r}=this.container,i=I(t,this.camera,n,r),o=I(e,this.camera,n,r);return Math.ceil(Math.sqrt((o.x-i.x)**2+(o.y-i.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof H.AmbientLight&&(e.color=new H.Color(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.currentFloor.onRemoveFromScene(),this.scene.remove(this.currentFloor),e&&this.currentFloor.dispose()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene();let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let r=new H.Vector2;r.x=t/this.clientSize.width*2-1,r.y=e/this.clientSize.height*-2+1;let i=new H.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(i))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,r;let i=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),o=(r=this.currentFloor)==null?void 0:r.poiLayer2.getPoiByDeviceXy(t,e);return(i||[]).concat(o||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new H.Box3().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[r,i,o,s]=e,{clientSize:{width:u,height:l}}=this,c=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(c,0);let{max:h,min:p}=t,f=new H.Vector3(p.x,h.y,h.z),d=new H.Vector3(h.x,h.y,h.z),m=new H.Vector3(h.x,p.y,p.z),v=new H.Vector3(p.x,p.y,p.z),y=I(f,this.camera,u,l),S=I(d,this.camera,u,l),w=I(v,this.camera,u,l),O=I(m,this.camera,u,l),Y=new H.Box2().setFromPoints([new H.Vector2(y.x,y.y),new H.Vector2(S.x,S.y),new H.Vector2(w.x,w.y),new H.Vector2(O.x,O.y)]).getSize(new H.Vector2),C=(u-i-s)/Y.x,U=(l-r-o)/Y.y,T=Math.min(C,U),R=new H.Vector3((h.x+p.x)/2,(h.y+p.y)/2,(h.z+p.z)/2),M=T*this.camera.zoom,V=this.camera.clone();V.zoom=M,V.updateMatrix();let Z=(i-s)/2,W=(r-o)/2;if(Z){let F=new H.Vector3;F.setFromMatrixColumn(V.matrix,0),F.normalize(),F.multiplyScalar(Z/M),R.add(F)}if(W){let F=new H.Vector3;F.setFromMatrixColumn(V.matrix,1),F.normalize(),F.multiplyScalar(W/M),R.add(F)}return{zoom:T*this.camera.zoom,center:R}}fitCameraToObject(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToObjectZoom(t,e,r);return this.setZoom(i,o,n)}fitCameraToBox(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToBoxZoom(t,e,r);return this.setZoom(i,o,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return g(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){var t;(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.scene=new Ir,this.renderer=new Pr,this.lights=ni(),this.range=(0,Ni.polygon)([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:r}=n;this.dispatchEvent({type:"control-zoom-change",zoom:r})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:r,renderer:i}=this,{clientWidth:o,clientHeight:s}=n;o=Math.max(1,o),s=Math.max(1,s),r.left=-o/2,r.right=o/2,r.top=s/2,r.bottom=-s/2,r.updateProjectionMatrix(),i.setSize(o,s),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:o,height:s})},this.onClick=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);r.length&&this.dispatchEvent({type:"graphic-click",graphics:r,position:i});let o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);o.length&&this.dispatchEvent({type:"poi-click",pois:o})},this.onPointerover=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:r,pois:o,position:i})},this.onPointermove=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:r,pois:o,position:i})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:r,isMultipleSelect:i}=n;this.dispatchEvent({type:"select-graphic",graphics:r,isMultipleSelect:i})},this.onHoverChange=n=>{let{graphics:r}=n;this.dispatchEvent({type:"hover",graphics:r})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new Vn(this),this.hoverHelper=new Hn(this),this.resizeClientSize(),this.registryEvent()}};var Gs=require("lodash"),ks={placeId:0,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14}};function Oi(a){return(0,Gs.merge)({},ks,a)}var Xs=require("lodash");var ev=require("core-js/modules/web.dom-collections.iterator.js");var Dr=require("three");var q_=require("core-js/modules/es.array.push.js"),j_=require("core-js/modules/web.dom-collections.iterator.js");var V_=require("core-js/modules/es.array.sort.js");var Ke=function(a){return a.LAYERED_RENDER_VERSION="layeredRender",a.MERGED_RENDER_VERSION="mergedRender",a}({});function Nr(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.store_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.store_info_ext)==null?void 0:r.traditional_name)||e}}function Or(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.infra_info_ext)==null?void 0:r.traditional_name)||e}}var Di=["range","ground","store","facility","parkingSpace"];function Vs(a){return Di.indexOf(a.l_type)===-1?Di.length:Di.indexOf(a.l_type)}function pu(a){a.layers.sort((t,e)=>Vs(t)-Vs(e))}function fu(a){let t=a.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];a.layers.map(n=>{if(n.l_type!=="range")return mn(n.elements,e)})}function qn(a){pu(a),fu(a)}function $e(a,t){return t===void 0&&(t=4),a.floor_id+"_"+a.version_id+(t?"_"+t:"")}function Hs(a,t,e){switch(a.l_type){case"ground":return Ui(a,t);case"graph":return du(a,t);case"wall":return gu(a,t);case"lane":return mu(a,t);case"texture2d":case"texture3d":return _u(a,t);case"glb":return vu(a,t);case"store":return yu(a,t,e);case"facility":return Eu(a,t,e);case"parkingSpace":return bu(a,t,e);case"text":return wu(a,t)}}function Ws(a,t,e,n,r){switch(a.l_type){case"store":return xu(a,t,e,n,r);case"facility":return Su(a,t,e,n,r);case"parkingSpace":return Mu(a,t,n,r)}}function du(a,t){t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements)}function Ui(a,t){if(a.mergedElements){let e=a.mergedElements.map(n=>new Ee(t.context,x({},n,{dashed:!1})));t.addGrounds(e)}else{let e=a.elements.map(n=>new pt(t.context,x({},n,{dashed:!1})));t.addGrounds(e)}}function gu(a,t){if(a.mergedElements)a.mergedElements.map(e=>{let n=new Gn(t.context,e);t.wallLayer.add(n)});else{let e=a.elements.reduce((n,r)=>{let{fillColor:i,fillOpacity:o,strokeColor:s,strokeOpacity:u,height:l}=r,c=i.toLowerCase()+"-"+o+"-"+s.toLowerCase()+"-"+u+"-"+l;return u===0&&(c=i.toLowerCase()+"-"+o+"-"+l),n[c]?n[c].push(r):n[c]=[r],n},{});Object.values(e).forEach(n=>{let r=new Fn(t.context,n);t.wallLayer.add(r)})}}function mu(a,t){if(a.mergedElements){let e=new kn(t.context,a.mergedElements);t.laneLayer.add(e)}else{let e=new Bn(t.context,a.elements);t.laneLayer.add(e)}}function _u(a,t){if(a.mergedMatrixes)a.mergedMatrixes.map(e=>{let n=new xe(t.context,e);t.textureLayer.add(n)});else if(a.elements.length){let e=new ye(t.context,a.elements);t.textureLayer.add(e)}}function vu(a,t){t.glbModelLayer.addModels(a.elements.map(e=>x({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function yu(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(x({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function xu(a,t,e,n,r){a.elements.filter(i=>r.filterPoi(i)).map(i=>{try{let o=Nr(i,e),s=new et(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s&&(s.userData.type="store",s.userData.data=i,s.userData.floor=t.name)}catch(o){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",o,i)}})}function Eu(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(x({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function Su(a,t,e,n,r){a.elements.filter(i=>i.poi_info).filter(i=>r.filterPoi(i)).map(i=>{try{let o=Or(i,e),s=new et(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s.userData.type="facility",s.userData.data=i,s.userData.floor=t.name}catch(o){console.log("\u6DFB\u52A0facility\u5931\u8D25",o,i)}})}function bu(a,t,e){t.parkingSpaceLayer.load(a,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Mu(a,t,e,n){return g(this,null,function*(){let r=a.elements.filter(s=>s.texts[0]).filter(s=>n.filterPoi(s)),i=r.map(s=>s.displayName||s.texts[0]),o=yield tt.lazyGetTextureByTexts(i,{height:64});r.forEach(s=>{try{let u=s.displayName||s.texts[0],l=new et(t.context,{id:s.id,text:u,position:{x:s.center_coord_x,y:s.center_coord_y,z:s.airHeight+s.height},text_texture:o[u].texture,text_texture_width:o[u].width,text_texture_height:o[u].height,text_texture_offset_x:o[u].x,text_texture_offset_y:o[u].y,text_font_size:e.textFontSize});l&&(l.userData.type="parkingSpace",l.userData.data=s,l.userData.floor=t.name),t.poiLayer2.pushPoi(l)}catch(u){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",u,s)}}),Object.values(o).forEach(s=>{s.texture.dispose()})})}function wu(a,t){let e=new zn(t.context,a.elements.map(n=>x({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function Fi(){let a=new Blob([`var VD=Object.create;var D1=Object.defineProperty;var HD=Object.getOwnPropertyDescriptor;var WD=Object.getOwnPropertyNames;var XD=Object.getPrototypeOf,YD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var $D=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of WD(t))!YD.call(n,s)&&s!==e&&D1(n,s,{get:()=>t[s],enumerable:!(i=HD(t,s))||i.enumerable});return n};var Qt=(n,t,e)=>(e=n!=null?VD(XD(n)):{},$D(t||!n||!n.__esModule?D1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((Ug,F1)=>{"use strict";var Ec=function(n){return n&&n.Math===Math&&n};F1.exports=Ec(typeof globalThis=="object"&&globalThis)||Ec(typeof window=="object"&&window)||Ec(typeof self=="object"&&self)||Ec(typeof global=="object"&&global)||Ec(typeof Ug=="object"&&Ug)||function(){return this}()||Function("return this")()});var An=X((pet,U1)=>{"use strict";U1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((det,B1)=>{"use strict";var ZD=An();B1.exports=!ZD(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Sc=X((get,z1)=>{"use strict";var JD=An();z1.exports=!JD(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((met,G1)=>{"use strict";var jD=Sc(),Kf=Function.prototype.call;G1.exports=jD?Kf.bind(Kf):function(){return Kf.apply(Kf,arguments)}});var H1=X(V1=>{"use strict";var k1={}.propertyIsEnumerable,q1=Object.getOwnPropertyDescriptor,KD=q1&&!k1.call({1:2},1);V1.f=KD?function(t){var e=q1(this,t);return!!e&&e.enumerable}:k1});var wc=X((vet,W1)=>{"use strict";W1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((_et,$1)=>{"use strict";var X1=Sc(),Y1=Function.prototype,Bg=Y1.call,QD=X1&&Y1.bind.bind(Bg,Bg);$1.exports=X1?QD:function(n){return function(){return Bg.apply(n,arguments)}}});var vs=X((xet,J1)=>{"use strict";var Z1=In(),t3=Z1({}.toString),e3=Z1("".slice);J1.exports=function(n){return e3(t3(n),8,-1)}});var Qf=X((Eet,j1)=>{"use strict";var n3=In(),r3=An(),i3=vs(),zg=Object,o3=n3("".split);j1.exports=r3(function(){return!zg("z").propertyIsEnumerable(0)})?function(n){return i3(n)==="String"?o3(n,""):zg(n)}:zg});var th=X((wet,K1)=>{"use strict";K1.exports=function(n){return n==null}});var Fu=X((Met,Q1)=>{"use strict";var s3=th(),a3=TypeError;Q1.exports=function(n){if(s3(n))throw new a3("Can't call method on "+n);return n}});var Uu=X((bet,tE)=>{"use strict";var u3=Qf(),l3=Fu();tE.exports=function(n){return u3(l3(n))}});var er=X((Aet,eE)=>{"use strict";var Gg=typeof document=="object"&&document.all;eE.exports=typeof Gg=="undefined"&&Gg!==void 0?function(n){return typeof n=="function"||n===Gg}:function(n){return typeof n=="function"}});var xi=X((Tet,nE)=>{"use strict";var c3=er();nE.exports=function(n){return typeof n=="object"?n!==null:c3(n)}});var $s=X((Cet,rE)=>{"use strict";var kg=Sn(),f3=er(),h3=function(n){return f3(n)?n:void 0};rE.exports=function(n,t){return arguments.length<2?h3(kg[n]):kg[n]&&kg[n][t]}});var Mc=X((Iet,iE)=>{"use strict";var p3=In();iE.exports=p3({}.isPrototypeOf)});var Bu=X((Pet,aE)=>{"use strict";var d3=Sn(),oE=d3.navigator,sE=oE&&oE.userAgent;aE.exports=sE?String(sE):""});var bc=X((Ret,pE)=>{"use strict";var hE=Sn(),qg=Bu(),uE=hE.process,lE=hE.Deno,cE=uE&&uE.versions||lE&&lE.version,fE=cE&&cE.v8,So,eh;fE&&(So=fE.split("."),eh=So[0]>0&&So[0]<4?1:+(So[0]+So[1]));!eh&&qg&&(So=qg.match(/Edge\\/(\\d+)/),(!So||So[1]>=74)&&(So=qg.match(/Chrome\\/(\\d+)/),So&&(eh=+So[1])));pE.exports=eh});var nh=X((Let,gE)=>{"use strict";var dE=bc(),g3=An(),m3=Sn(),y3=m3.String;gE.exports=!!Object.getOwnPropertySymbols&&!g3(function(){var n=Symbol("symbol detection");return!y3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&dE&&dE<41})});var Vg=X((Net,mE)=>{"use strict";var v3=nh();mE.exports=v3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ac=X((Oet,yE)=>{"use strict";var _3=$s(),x3=er(),E3=Mc(),S3=Vg(),w3=Object;yE.exports=S3?function(n){return typeof n=="symbol"}:function(n){var t=_3("Symbol");return x3(t)&&E3(t.prototype,w3(n))}});var zu=X((Det,vE)=>{"use strict";var M3=String;vE.exports=function(n){try{return M3(n)}catch(t){return"Object"}}});var _s=X((Fet,_E)=>{"use strict";var b3=er(),A3=zu(),T3=TypeError;_E.exports=function(n){if(b3(n))return n;throw new T3(A3(n)+" is not a function")}});var Tc=X((Uet,xE)=>{"use strict";var C3=_s(),I3=th();xE.exports=function(n,t){var e=n[t];return I3(e)?void 0:C3(e)}});var SE=X((Bet,EE)=>{"use strict";var Hg=vr(),Wg=er(),Xg=xi(),P3=TypeError;EE.exports=function(n,t){var e,i;if(t==="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n))||Wg(e=n.valueOf)&&!Xg(i=Hg(e,n))||t!=="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n)))return i;throw new P3("Can't convert object to primitive value")}});var Cc=X((zet,wE)=>{"use strict";wE.exports=!1});var rh=X((Get,bE)=>{"use strict";var ME=Sn(),R3=Object.defineProperty;bE.exports=function(n,t){try{R3(ME,n,{value:t,configurable:!0,writable:!0})}catch(e){ME[n]=t}return t}});var ih=X((ket,CE)=>{"use strict";var L3=Cc(),N3=Sn(),O3=rh(),AE="__core-js_shared__",TE=CE.exports=N3[AE]||O3(AE,{});(TE.versions||(TE.versions=[])).push({version:"3.42.0",mode:L3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var oh=X((qet,PE)=>{"use strict";var IE=ih();PE.exports=function(n,t){return IE[n]||(IE[n]=t||{})}});var Vi=X((Vet,RE)=>{"use strict";var D3=Fu(),F3=Object;RE.exports=function(n){return F3(D3(n))}});var oo=X((Het,LE)=>{"use strict";var U3=In(),B3=Vi(),z3=U3({}.hasOwnProperty);LE.exports=Object.hasOwn||function(t,e){return z3(B3(t),e)}});var sh=X((Wet,NE)=>{"use strict";var G3=In(),k3=0,q3=Math.random(),V3=G3(1 .toString);NE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+V3(++k3+q3,36)}});var Xr=X((Xet,DE)=>{"use strict";var H3=Sn(),W3=oh(),OE=oo(),X3=sh(),Y3=nh(),$3=Vg(),Gu=H3.Symbol,Yg=W3("wks"),Z3=$3?Gu.for||Gu:Gu&&Gu.withoutSetter||X3;DE.exports=function(n){return OE(Yg,n)||(Yg[n]=Y3&&OE(Gu,n)?Gu[n]:Z3("Symbol."+n)),Yg[n]}});var $g=X((Yet,BE)=>{"use strict";var J3=vr(),FE=xi(),UE=Ac(),j3=Tc(),K3=SE(),Q3=Xr(),tF=TypeError,eF=Q3("toPrimitive");BE.exports=function(n,t){if(!FE(n)||UE(n))return n;var e=j3(n,eF),i;if(e){if(t===void 0&&(t="default"),i=J3(e,n,t),!FE(i)||UE(i))return i;throw new tF("Can't convert object to primitive value")}return t===void 0&&(t="number"),K3(n,t)}});var ah=X(($et,zE)=>{"use strict";var nF=$g(),rF=Ac();zE.exports=function(n){var t=nF(n,"string");return rF(t)?t:t+""}});var uh=X((Zet,kE)=>{"use strict";var iF=Sn(),GE=xi(),Zg=iF.document,oF=GE(Zg)&&GE(Zg.createElement);kE.exports=function(n){return oF?Zg.createElement(n):{}}});var Jg=X((Jet,qE)=>{"use strict";var sF=ri(),aF=An(),uF=uh();qE.exports=!sF&&!aF(function(){return Object.defineProperty(uF("div"),"a",{get:function(){return 7}}).a!==7})});var lh=X(HE=>{"use strict";var lF=ri(),cF=vr(),fF=H1(),hF=wc(),pF=Uu(),dF=ah(),gF=oo(),mF=Jg(),VE=Object.getOwnPropertyDescriptor;HE.f=lF?VE:function(t,e){if(t=pF(t),e=dF(e),mF)try{return VE(t,e)}catch(i){}if(gF(t,e))return hF(!cF(fF.f,t,e),t[e])}});var jg=X((Ket,WE)=>{"use strict";var yF=ri(),vF=An();WE.exports=yF&&vF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((Qet,XE)=>{"use strict";var _F=xi(),xF=String,EF=TypeError;XE.exports=function(n){if(_F(n))return n;throw new EF(xF(n)+" is not an object")}});var Wo=X($E=>{"use strict";var SF=ri(),wF=Jg(),MF=jg(),ch=so(),YE=ah(),bF=TypeError,Kg=Object.defineProperty,AF=Object.getOwnPropertyDescriptor,Qg="enumerable",tm="configurable",em="writable";$E.f=SF?MF?function(t,e,i){if(ch(t),e=YE(e),ch(i),typeof t=="function"&&e==="prototype"&&"value"in i&&em in i&&!i[em]){var s=AF(t,e);s&&s[em]&&(t[e]=i.value,i={configurable:tm in i?i[tm]:s[tm],enumerable:Qg in i?i[Qg]:s[Qg],writable:!1})}return Kg(t,e,i)}:Kg:function(t,e,i){if(ch(t),e=YE(e),ch(i),wF)try{return Kg(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new bF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((ent,ZE)=>{"use strict";var TF=ri(),CF=Wo(),IF=wc();ZE.exports=TF?function(n,t,e){return CF.f(n,t,IF(1,e))}:function(n,t,e){return n[t]=e,n}});var fh=X((nnt,jE)=>{"use strict";var nm=ri(),PF=oo(),JE=Function.prototype,RF=nm&&Object.getOwnPropertyDescriptor,rm=PF(JE,"name"),LF=rm&&function(){}.name==="something",NF=rm&&(!nm||nm&&RF(JE,"name").configurable);jE.exports={EXISTS:rm,PROPER:LF,CONFIGURABLE:NF}});var om=X((rnt,KE)=>{"use strict";var OF=In(),DF=er(),im=ih(),FF=OF(Function.toString);DF(im.inspectSource)||(im.inspectSource=function(n){return FF(n)});KE.exports=im.inspectSource});var eS=X((int,tS)=>{"use strict";var UF=Sn(),BF=er(),QE=UF.WeakMap;tS.exports=BF(QE)&&/native code/.test(String(QE))});var hh=X((ont,rS)=>{"use strict";var zF=oh(),GF=sh(),nS=zF("keys");rS.exports=function(n){return nS[n]||(nS[n]=GF(n))}});var ph=X((snt,iS)=>{"use strict";iS.exports={}});var Va=X((ant,aS)=>{"use strict";var kF=eS(),sS=Sn(),qF=xi(),VF=xs(),sm=oo(),am=ih(),HF=hh(),WF=ph(),oS="Object already initialized",um=sS.TypeError,XF=sS.WeakMap,dh,Ic,gh,YF=function(n){return gh(n)?Ic(n):dh(n,{})},$F=function(n){return function(t){var e;if(!qF(t)||(e=Ic(t)).type!==n)throw new um("Incompatible receiver, "+n+" required");return e}};kF||am.state?(wo=am.state||(am.state=new XF),wo.get=wo.get,wo.has=wo.has,wo.set=wo.set,dh=function(n,t){if(wo.has(n))throw new um(oS);return t.facade=n,wo.set(n,t),t},Ic=function(n){return wo.get(n)||{}},gh=function(n){return wo.has(n)}):(qa=HF("state"),WF[qa]=!0,dh=function(n,t){if(sm(n,qa))throw new um(oS);return t.facade=n,VF(n,qa,t),t},Ic=function(n){return sm(n,qa)?n[qa]:{}},gh=function(n){return sm(n,qa)});var wo,qa;aS.exports={set:dh,get:Ic,has:gh,enforce:YF,getterFor:$F}});var fm=X((unt,cS)=>{"use strict";var cm=In(),ZF=An(),JF=er(),mh=oo(),lm=ri(),jF=fh().CONFIGURABLE,KF=om(),lS=Va(),QF=lS.enforce,tU=lS.get,uS=String,yh=Object.defineProperty,eU=cm("".slice),nU=cm("".replace),rU=cm([].join),iU=lm&&!ZF(function(){return yh(function(){},"length",{value:8}).length!==8}),oU=String(String).split("String"),sU=cS.exports=function(n,t,e){eU(uS(t),0,7)==="Symbol("&&(t="["+nU(uS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!mh(n,"name")||jF&&n.name!==t)&&(lm?yh(n,"name",{value:t,configurable:!0}):n.name=t),iU&&e&&mh(e,"arity")&&n.length!==e.arity&&yh(n,"length",{value:e.arity});try{e&&mh(e,"constructor")&&e.constructor?lm&&yh(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=QF(n);return mh(i,"source")||(i.source=rU(oU,typeof t=="string"?t:"")),n};Function.prototype.toString=sU(function(){return JF(this)&&tU(this).source||KF(this)},"toString")});var Ha=X((lnt,fS)=>{"use strict";var aU=er(),uU=Wo(),lU=fm(),cU=rh();fS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(aU(e)&&lU(e,u,i),i.global)s?n[t]=e:cU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:uU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var pS=X((cnt,hS)=>{"use strict";var fU=Math.ceil,hU=Math.floor;hS.exports=Math.trunc||function(t){var e=+t;return(e>0?hU:fU)(e)}});var Hi=X((fnt,dS)=>{"use strict";var pU=pS();dS.exports=function(n){var t=+n;return t!==t||t===0?0:pU(t)}});var vh=X((hnt,gS)=>{"use strict";var dU=Hi(),gU=Math.max,mU=Math.min;gS.exports=function(n,t){var e=dU(n);return e<0?gU(e+t,0):mU(e,t)}});var Wa=X((pnt,mS)=>{"use strict";var yU=Hi(),vU=Math.min;mS.exports=function(n){var t=yU(n);return t>0?vU(t,9007199254740991):0}});var ii=X((dnt,yS)=>{"use strict";var _U=Wa();yS.exports=function(n){return _U(n.length)}});var xS=X((gnt,_S)=>{"use strict";var xU=Uu(),EU=vh(),SU=ii(),vS=function(n){return function(t,e,i){var s=xU(t),u=SU(s);if(u===0)return!n&&-1;var c=EU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};_S.exports={includes:vS(!0),indexOf:vS(!1)}});var pm=X((mnt,SS)=>{"use strict";var wU=In(),hm=oo(),MU=Uu(),bU=xS().indexOf,AU=ph(),ES=wU([].push);SS.exports=function(n,t){var e=MU(n),i=0,s=[],u;for(u in e)!hm(AU,u)&&hm(e,u)&&ES(s,u);for(;t.length>i;)hm(e,u=t[i++])&&(~bU(s,u)||ES(s,u));return s}});var _h=X((ynt,wS)=>{"use strict";wS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var dm=X(MS=>{"use strict";var TU=pm(),CU=_h(),IU=CU.concat("length","prototype");MS.f=Object.getOwnPropertyNames||function(t){return TU(t,IU)}});var AS=X(bS=>{"use strict";bS.f=Object.getOwnPropertySymbols});var CS=X((xnt,TS)=>{"use strict";var PU=$s(),RU=In(),LU=dm(),NU=AS(),OU=so(),DU=RU([].concat);TS.exports=PU("Reflect","ownKeys")||function(t){var e=LU.f(OU(t)),i=NU.f;return i?DU(e,i(t)):e}});var gm=X((Ent,PS)=>{"use strict";var IS=oo(),FU=CS(),UU=lh(),BU=Wo();PS.exports=function(n,t,e){for(var i=FU(t),s=BU.f,u=UU.f,c=0;c<i.length;c++){var f=i[c];!IS(n,f)&&!(e&&IS(e,f))&&s(n,f,u(t,f))}}});var LS=X((Snt,RS)=>{"use strict";var zU=An(),GU=er(),kU=/#|\\.prototype\\./,Pc=function(n,t){var e=VU[qU(n)];return e===WU?!0:e===HU?!1:GU(t)?zU(t):!!t},qU=Pc.normalize=function(n){return String(n).replace(kU,".").toLowerCase()},VU=Pc.data={},HU=Pc.NATIVE="N",WU=Pc.POLYFILL="P";RS.exports=Pc});var sr=X((wnt,NS)=>{"use strict";var xh=Sn(),XU=lh().f,YU=xs(),$U=Ha(),ZU=rh(),JU=gm(),jU=LS();NS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=xh:s?c=xh[e]||ZU(e,{}):c=xh[e]&&xh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=XU(c,f),p=g&&g.value):p=c[f],u=jU(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;JU(d,p)}(n.sham||p&&p.sham)&&YU(d,"sham",!0),$U(c,f,d,n)}}});var Rc=X((Mnt,OS)=>{"use strict";var KU=vs();OS.exports=Array.isArray||function(t){return KU(t)==="Array"}});var mm=X((bnt,DS)=>{"use strict";var QU=ri(),tB=Rc(),eB=TypeError,nB=Object.getOwnPropertyDescriptor,rB=QU&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();DS.exports=rB?function(n,t){if(tB(n)&&!nB(n,"length").writable)throw new eB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var Eh=X((Ant,FS)=>{"use strict";var iB=TypeError,oB=9007199254740991;FS.exports=function(n){if(n>oB)throw iB("Maximum allowed index exceeded");return n}});var Sh=X(()=>{"use strict";var sB=sr(),aB=Vi(),uB=ii(),lB=mm(),cB=Eh(),fB=An(),hB=fB(function(){return[].push.call({length:4294967296},1)!==4294967297}),pB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},dB=hB||!pB();sB({target:"Array",proto:!0,arity:1,forced:dB},{push:function(t){var e=aB(this),i=uB(e),s=arguments.length;cB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return lB(e,i),i}})});var US=X(()=>{"use strict";var gB=sr(),mB=vr();gB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return mB(URL.prototype.toString,this)}})});var zS=X((Rnt,BS)=>{"use strict";BS.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}});var qS=X((Lnt,kS)=>{"use strict";var yB=uh(),ym=yB("span").classList,GS=ym&&ym.constructor&&ym.constructor.prototype;kS.exports=GS===Object.prototype?void 0:GS});var HS=X((Nnt,VS)=>{"use strict";var vB=pm(),_B=_h();VS.exports=Object.keys||function(t){return vB(t,_B)}});var XS=X(WS=>{"use strict";var xB=ri(),EB=jg(),SB=Wo(),wB=so(),MB=Uu(),bB=HS();WS.f=xB&&!EB?Object.defineProperties:function(t,e){wB(t);for(var i=MB(e),s=bB(e),u=s.length,c=0,f;u>c;)SB.f(t,f=s[c++],i[f]);return t}});var $S=X((Dnt,YS)=>{"use strict";var AB=$s();YS.exports=AB("document","documentElement")});var ku=X((Fnt,ew)=>{"use strict";var TB=so(),CB=XS(),ZS=_h(),IB=ph(),PB=$S(),RB=uh(),LB=hh(),JS=">",jS="<",_m="prototype",xm="script",QS=LB("IE_PROTO"),vm=function(){},tw=function(n){return jS+xm+JS+n+jS+"/"+xm+JS},KS=function(n){n.write(tw("")),n.close();var t=n.parentWindow.Object;return n=null,t},NB=function(){var n=RB("iframe"),t="java"+xm+":",e;return n.style.display="none",PB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(tw("document.F=Object")),e.close(),e.F},wh,Mh=function(){try{wh=new ActiveXObject("htmlfile")}catch(t){}Mh=typeof document!="undefined"?document.domain&&wh?KS(wh):NB():KS(wh);for(var n=ZS.length;n--;)delete Mh[_m][ZS[n]];return Mh()};IB[QS]=!0;ew.exports=Object.create||function(t,e){var i;return t!==null?(vm[_m]=TB(t),i=new vm,vm[_m]=null,i[QS]=t):i=Mh(),e===void 0?i:CB.f(i,e)}});var wm=X((Unt,nw)=>{"use strict";var OB=Xr(),DB=ku(),FB=Wo().f,Em=OB("unscopables"),Sm=Array.prototype;Sm[Em]===void 0&&FB(Sm,Em,{configurable:!0,value:DB(null)});nw.exports=function(n){Sm[Em][n]=!0}});var qu=X((Bnt,rw)=>{"use strict";rw.exports={}});var ow=X((znt,iw)=>{"use strict";var UB=An();iw.exports=!UB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Lc=X((Gnt,aw)=>{"use strict";var BB=oo(),zB=er(),GB=Vi(),kB=hh(),qB=ow(),sw=kB("IE_PROTO"),Mm=Object,VB=Mm.prototype;aw.exports=qB?Mm.getPrototypeOf:function(n){var t=GB(n);if(BB(t,sw))return t[sw];var e=t.constructor;return zB(e)&&t instanceof e?e.prototype:t instanceof Mm?VB:null}});var Cm=X((knt,cw)=>{"use strict";var HB=An(),WB=er(),XB=xi(),YB=ku(),uw=Lc(),$B=Ha(),ZB=Xr(),JB=Cc(),Tm=ZB("iterator"),lw=!1,Es,bm,Am;[].keys&&(Am=[].keys(),"next"in Am?(bm=uw(uw(Am)),bm!==Object.prototype&&(Es=bm)):lw=!0);var jB=!XB(Es)||HB(function(){var n={};return Es[Tm].call(n)!==n});jB?Es={}:JB&&(Es=YB(Es));WB(Es[Tm])||$B(Es,Tm,function(){return this});cw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:lw}});var Nc=X((qnt,hw)=>{"use strict";var KB=Wo().f,QB=oo(),tz=Xr(),fw=tz("toStringTag");hw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!QB(n,fw)&&KB(n,fw,{configurable:!0,value:t})}});var dw=X((Vnt,pw)=>{"use strict";var ez=Cm().IteratorPrototype,nz=ku(),rz=wc(),iz=Nc(),oz=qu(),sz=function(){return this};pw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=nz(ez,{next:rz(+!i,e)}),iz(n,s,!1,!0),oz[s]=sz,n}});var Oc=X((Hnt,gw)=>{"use strict";var az=In(),uz=_s();gw.exports=function(n,t,e){try{return az(uz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var yw=X((Wnt,mw)=>{"use strict";var lz=xi();mw.exports=function(n){return lz(n)||n===null}});var _w=X((Xnt,vw)=>{"use strict";var cz=yw(),fz=String,hz=TypeError;vw.exports=function(n){if(cz(n))return n;throw new hz("Can't set "+fz(n)+" as a prototype")}});var Vu=X((Ynt,xw)=>{"use strict";var pz=Oc(),dz=xi(),gz=Fu(),mz=_w();xw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=pz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return gz(s),mz(u),dz(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Rw=X(($nt,Pw)=>{"use strict";var yz=sr(),vz=vr(),bh=Cc(),Cw=fh(),_z=er(),xz=dw(),Ew=Lc(),Sw=Vu(),Ez=Nc(),Sz=xs(),Im=Ha(),wz=Xr(),ww=qu(),Iw=Cm(),Mz=Cw.PROPER,bz=Cw.CONFIGURABLE,Mw=Iw.IteratorPrototype,Ah=Iw.BUGGY_SAFARI_ITERATORS,Dc=wz("iterator"),bw="keys",Fc="values",Aw="entries",Tw=function(){return this};Pw.exports=function(n,t,e,i,s,u,c){xz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ah&&x&&x in g)return g[x];switch(x){case bw:return function(){return new e(this,x)};case Fc:return function(){return new e(this,x)};case Aw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Dc]||g["@@iterator"]||s&&g[s],v=!Ah&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=Ew(E.call(new n)),M!==Object.prototype&&M.next&&(!bh&&Ew(M)!==Mw&&(Sw?Sw(M,Mw):_z(M[Dc])||Im(M,Dc,Tw)),Ez(M,p,!0,!0),bh&&(ww[p]=Tw))),Mz&&s===Fc&&y&&y.name!==Fc&&(!bh&&bz?Sz(g,"name",Fc):(d=!0,v=function(){return vz(y,this)})),s)if(A={values:f(Fc),keys:u?v:f(bw),entries:f(Aw)},c)for(_ in A)(Ah||d||!(_ in g))&&Im(g,_,A[_]);else yz({target:t,proto:!0,forced:Ah||d},A);return(!bh||c)&&g[Dc]!==v&&Im(g,Dc,v,{name:s}),ww[t]=v,A}});var Nw=X((Znt,Lw)=>{"use strict";Lw.exports=function(n,t){return{value:n,done:t}}});var zw=X((Jnt,Bw)=>{"use strict";var Az=Uu(),Pm=wm(),Ow=qu(),Fw=Va(),Tz=Wo().f,Cz=Rw(),Th=Nw(),Iz=Cc(),Pz=ri(),Uw="Array Iterator",Rz=Fw.set,Lz=Fw.getterFor(Uw);Bw.exports=Cz(Array,"Array",function(n,t){Rz(this,{type:Uw,target:Az(n),index:0,kind:t})},function(){var n=Lz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Th(void 0,!0);switch(n.kind){case"keys":return Th(e,!1);case"values":return Th(t[e],!1)}return Th([e,t[e]],!1)},"values");var Dw=Ow.Arguments=Ow.Array;Pm("keys");Pm("values");Pm("entries");if(!Iz&&Pz&&Dw.name!=="values")try{Tz(Dw,"name",{value:"values"})}catch(n){}});var Bc=X(()=>{"use strict";var Gw=Sn(),qw=zS(),Nz=qS(),Uc=zw(),kw=xs(),Oz=Nc(),Dz=Xr(),Rm=Dz("iterator"),Lm=Uc.values,Vw=function(n,t){if(n){if(n[Rm]!==Lm)try{kw(n,Rm,Lm)}catch(i){n[Rm]=Lm}if(Oz(n,t,!0),qw[t]){for(var e in Uc)if(n[e]!==Uc[e])try{kw(n,e,Uc[e])}catch(i){n[e]=Uc[e]}}}};for(Ch in qw)Vw(Gw[Ch]&&Gw[Ch].prototype,Ch);var Ch;Vw(Nz,"DOMTokenList")});var Ih=X((Qnt,Hw)=>{"use strict";var Fz=vs(),Uz=In();Hw.exports=function(n){if(Fz(n)==="Function")return Uz(n)}});var zc=X((trt,Xw)=>{"use strict";var Ww=Ih(),Bz=_s(),zz=Sc(),Gz=Ww(Ww.bind);Xw.exports=function(n,t){return Bz(n),t===void 0?n:zz?Gz(n,t):function(){return n.apply(t,arguments)}}});var Zw=X((ert,$w)=>{"use strict";var kz=Rc(),qz=ii(),Vz=Eh(),Hz=zc(),Yw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Hz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&kz(y)?(v=qz(y),p=Yw(n,t,y,v,p,u-1)-1):(Vz(p+1),n[p]=y),p++),d++;return p};$w.exports=Yw});var Kw=X((nrt,jw)=>{"use strict";var Wz=Xr(),Xz=Wz("toStringTag"),Jw={};Jw[Xz]="z";jw.exports=String(Jw)==="[object z]"});var Zs=X((rrt,Qw)=>{"use strict";var Yz=Kw(),$z=er(),Ph=vs(),Zz=Xr(),Jz=Zz("toStringTag"),jz=Object,Kz=Ph(function(){return arguments}())==="Arguments",Qz=function(n,t){try{return n[t]}catch(e){}};Qw.exports=Yz?Ph:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=Qz(t=jz(n),Jz))=="string"?e:Kz?Ph(t):(i=Ph(t))==="Object"&&$z(t.callee)?"Arguments":i}});var Om=X((irt,iM)=>{"use strict";var tG=In(),eG=An(),tM=er(),nG=Zs(),rG=$s(),iG=om(),eM=function(){},nM=rG("Reflect","construct"),Nm=/^\\s*(?:class|function)\\b/,oG=tG(Nm.exec),sG=!Nm.test(eM),Gc=function(t){if(!tM(t))return!1;try{return nM(eM,[],t),!0}catch(e){return!1}},rM=function(t){if(!tM(t))return!1;switch(nG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sG||!!oG(Nm,iG(t))}catch(e){return!0}};rM.sham=!0;iM.exports=!nM||eG(function(){var n;return Gc(Gc.call)||!Gc(Object)||!Gc(function(){n=!0})||n})?rM:Gc});var uM=X((ort,aM)=>{"use strict";var oM=Rc(),aG=Om(),uG=xi(),lG=Xr(),cG=lG("species"),sM=Array;aM.exports=function(n){var t;return oM(n)&&(t=n.constructor,aG(t)&&(t===sM||oM(t.prototype))?t=void 0:uG(t)&&(t=t[cG],t===null&&(t=void 0))),t===void 0?sM:t}});var Dm=X((srt,lM)=>{"use strict";var fG=uM();lM.exports=function(n,t){return new(fG(n))(t===0?0:t)}});var cM=X(()=>{"use strict";var hG=sr(),pG=Zw(),dG=Vi(),gG=ii(),mG=Hi(),yG=Dm();hG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=dG(this),i=gG(e),s=yG(e,0);return s.length=pG(s,e,e,i,0,t===void 0?1:mG(t)),s}})});var fM=X(()=>{"use strict";var vG=wm();vG("flat")});var mM=X((frt,gM)=>{"use strict";var _G=Xr(),pM=_G("iterator"),dM=!1;try{hM=0,Fm={next:function(){return{done:!!hM++}},return:function(){dM=!0}},Fm[pM]=function(){return this},Array.from(Fm,function(){throw 2})}catch(n){}var hM,Fm;gM.exports=function(n,t){try{if(!t&&!dM)return!1}catch(s){return!1}var e=!1;try{var i={};i[pM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Rh=X((hrt,yM)=>{"use strict";yM.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var Hu=X((prt,_M)=>{"use strict";var vM=fm(),xG=Wo();_M.exports=function(n,t,e){return e.get&&vM(e.get,t,{getter:!0}),e.set&&vM(e.set,t,{setter:!0}),xG.f(n,t,e)}});var Wi=X((drt,IM)=>{"use strict";var EG=Rh(),Gm=ri(),Ei=Sn(),wM=er(),Oh=xi(),js=oo(),km=Zs(),SG=zu(),wG=xs(),Um=Ha(),MG=Hu(),bG=Mc(),Dh=Lc(),Xu=Vu(),AG=Xr(),TG=sh(),MM=Va(),bM=MM.enforce,CG=MM.get,Lh=Ei.Int8Array,Bm=Lh&&Lh.prototype,xM=Ei.Uint8ClampedArray,EM=xM&&xM.prototype,Xo=Lh&&Dh(Lh),Mo=Bm&&Dh(Bm),IG=Object.prototype,qm=Ei.TypeError,SM=AG("toStringTag"),zm=TG("TYPED_ARRAY_TAG"),Nh="TypedArrayConstructor",Ss=EG&&!!Xu&&km(Ei.opera)!=="Opera",AM=!1,Li,Js,Wu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vm={BigInt64Array:8,BigUint64Array:8},PG=function(t){if(!Oh(t))return!1;var e=km(t);return e==="DataView"||js(ws,e)||js(Vm,e)},TM=function(n){var t=Dh(n);if(Oh(t)){var e=CG(t);return e&&js(e,Nh)?e[Nh]:TM(t)}},CM=function(n){if(!Oh(n))return!1;var t=km(n);return js(ws,t)||js(Vm,t)},RG=function(n){if(CM(n))return n;throw new qm("Target is not a typed array")},LG=function(n){if(wM(n)&&(!Xu||bG(Xo,n)))return n;throw new qm(SG(n)+" is not a typed array constructor")},NG=function(n,t,e,i){if(Gm){if(e)for(var s in ws){var u=Ei[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!Mo[n]||e)&&Um(Mo,n,e?t:Ss&&Bm[n]||t,i)}},OG=function(n,t,e){var i,s;if(Gm){if(Xu){if(e){for(i in ws)if(s=Ei[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return Um(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Ei[i],s&&(!s[n]||e)&&Um(s,n,t)}};for(Li in ws)Js=Ei[Li],Wu=Js&&Js.prototype,Wu?bM(Wu)[Nh]=Js:Ss=!1;for(Li in Vm)Js=Ei[Li],Wu=Js&&Js.prototype,Wu&&(bM(Wu)[Nh]=Js);if((!Ss||!wM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new qm("Incorrect invocation")},Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li],Xo);if((!Ss||!Mo||Mo===IG)&&(Mo=Xo.prototype,Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li].prototype,Mo);Ss&&Dh(EM)!==Mo&&Xu(EM,Mo);if(Gm&&!js(Mo,SM)){AM=!0,MG(Mo,SM,{configurable:!0,get:function(){return Oh(this)?this[zm]:void 0}});for(Li in ws)Ei[Li]&&wG(Ei[Li],zm,Li)}IM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:AM&&zm,aTypedArray:RG,aTypedArrayConstructor:LG,exportTypedArrayMethod:NG,exportTypedArrayStaticMethod:OG,getTypedArrayConstructor:TM,isView:PG,isTypedArray:CM,TypedArray:Xo,TypedArrayPrototype:Mo}});var LM=X((grt,RM)=>{"use strict";var PM=Sn(),Hm=An(),DG=mM(),FG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,UG=PM.ArrayBuffer,Xa=PM.Int8Array;RM.exports=!FG||!Hm(function(){Xa(1)})||!Hm(function(){new Xa(-1)})||!DG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Hm(function(){return new Xa(new UG(2),1,void 0).length!==1})});var OM=X((mrt,NM)=>{"use strict";var BG=Ha();NM.exports=function(n,t,e){for(var i in t)BG(n,i,t[i],e);return n}});var Wm=X((yrt,DM)=>{"use strict";var zG=Mc(),GG=TypeError;DM.exports=function(n,t){if(zG(t,n))return n;throw new GG("Incorrect invocation")}});var Fh=X((vrt,FM)=>{"use strict";var kG=Hi(),qG=Wa(),VG=RangeError;FM.exports=function(n){if(n===void 0)return 0;var t=kG(n),e=qG(t);if(t!==e)throw new VG("Wrong length or index");return e}});var BM=X((_rt,UM)=>{"use strict";UM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var kM=X((xrt,GM)=>{"use strict";var HG=2220446049250313e-31,zM=1/HG;GM.exports=function(n){return n+zM-zM}});var VM=X((Ert,qM)=>{"use strict";var WG=BM(),XG=kM(),YG=Math.abs,$G=2220446049250313e-31;qM.exports=function(n,t,e,i){var s=+n,u=YG(s),c=WG(s);if(u<i)return c*XG(u/i/t)*i*t;var f=(1+t/$G)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var WM=X((Srt,HM)=>{"use strict";var ZG=VM(),JG=11920928955078125e-23,jG=34028234663852886e22,KG=11754943508222875e-54;HM.exports=Math.fround||function(t){return ZG(t,JG,jG,KG)}});var YM=X((wrt,XM)=>{"use strict";var QG=Array,t4=Math.abs,Ms=Math.pow,e4=Math.floor,n4=Math.log,r4=Math.LN2,i4=function(n,t,e){var i=QG(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=t4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=e4(n4(n)/r4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},o4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};XM.exports={pack:i4,unpack:o4}});var Xm=X((Mrt,ZM)=>{"use strict";var s4=Vi(),$M=vh(),a4=ii();ZM.exports=function(t){for(var e=s4(this),i=a4(e),s=arguments.length,u=$M(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:$M(c,i);f>u;)e[u++]=t;return e}});var Uh=X((brt,JM)=>{"use strict";var u4=In();JM.exports=u4([].slice)});var Ym=X((Art,KM)=>{"use strict";var l4=er(),c4=xi(),jM=Vu();KM.exports=function(n,t,e){var i,s;return jM&&l4(i=t.constructor)&&i!==e&&c4(s=i.prototype)&&s!==e.prototype&&jM(n,s),n}});var Hh=X((Trt,gb)=>{"use strict";var qh=Sn(),Km=In(),$m=ri(),f4=Rh(),cb=fh(),h4=xs(),p4=Hu(),QM=OM(),Zm=An(),Bh=Wm(),d4=Hi(),g4=Wa(),Gh=Fh(),m4=WM(),fb=YM(),y4=Lc(),tb=Vu(),v4=Xm(),_4=Uh(),x4=Ym(),E4=gm(),hb=Nc(),Qm=Va(),S4=cb.PROPER,eb=cb.CONFIGURABLE,$u="ArrayBuffer",Vh="DataView",Zu="prototype",w4="Wrong length",pb="Wrong index",nb=Qm.getterFor($u),qc=Qm.getterFor(Vh),rb=Qm.set,bo=qh[$u],Xi=bo,Yu=Xi&&Xi[Zu],Yo=qh[Vh],Ya=Yo&&Yo[Zu],ib=Object.prototype,M4=qh.Array,kh=qh.RangeError,b4=Km(v4),A4=Km([].reverse),db=fb.pack,ob=fb.unpack,sb=function(n){return[n&255]},ab=function(n){return[n&255,n>>8&255]},ub=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},lb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},T4=function(n){return db(m4(n),23,4)},C4=function(n){return db(n,52,8)},zh=function(n,t,e){p4(n[Zu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=qc(n),u=Gh(e),c=!!i;if(u+t>s.byteLength)throw new kh(pb);var f=s.bytes,p=u+s.byteOffset,d=_4(f,p,p+t);return c?d:A4(d)},Qs=function(n,t,e,i,s,u){var c=qc(n),f=Gh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new kh(pb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};f4?(Jm=S4&&bo.name!==$u,!Zm(function(){bo(1)})||!Zm(function(){new bo(-1)})||Zm(function(){return new bo,new bo(1.5),new bo(NaN),bo.length!==1||Jm&&!eb})?(Xi=function(t){return Bh(this,Yu),x4(new bo(Gh(t)),this,Xi)},Xi[Zu]=Yu,Yu.constructor=Xi,E4(Xi,bo)):Jm&&eb&&h4(bo,"name",$u),tb&&y4(Ya)!==ib&&tb(Ya,ib),kc=new Yo(new Xi(2)),jm=Km(Ya.setInt8),kc.setInt8(0,2147483648),kc.setInt8(1,2147483649),(kc.getInt8(0)||!kc.getInt8(1))&&QM(Ya,{setInt8:function(t,e){jm(this,t,e<<24>>24)},setUint8:function(t,e){jm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Bh(this,Yu);var e=Gh(t);rb(this,{type:$u,bytes:b4(M4(e),0),byteLength:e}),$m||(this.byteLength=e,this.detached=!1)},Yu=Xi[Zu],Yo=function(t,e,i){Bh(this,Ya),Bh(t,Yu);var s=nb(t),u=s.byteLength,c=d4(e);if(c<0||c>u)throw new kh("Wrong offset");if(i=i===void 0?u-c:g4(i),c+i>u)throw new kh(w4);rb(this,{type:Vh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),$m||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Zu],$m&&(zh(Xi,"byteLength",nb),zh(Yo,"buffer",qc),zh(Yo,"byteLength",qc),zh(Yo,"byteOffset",qc)),QM(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ob(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ob(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,sb,e)},setUint8:function(t,e){Qs(this,1,t,sb,e)},setInt16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,T4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,C4,e,arguments.length>2?arguments[2]:!1)}}));var Jm,kc,jm;hb(Xi,$u);hb(Yo,Vh);gb.exports={ArrayBuffer:Xi,DataView:Yo}});var yb=X((Crt,mb)=>{"use strict";var I4=xi(),P4=Math.floor;mb.exports=Number.isInteger||function(t){return!I4(t)&&isFinite(t)&&P4(t)===t}});var _b=X((Irt,vb)=>{"use strict";var R4=Hi(),L4=RangeError;vb.exports=function(n){var t=R4(n);if(t<0)throw new L4("The argument can't be less than 0");return t}});var t0=X((Prt,xb)=>{"use strict";var N4=_b(),O4=RangeError;xb.exports=function(n,t){var e=N4(n);if(e%t)throw new O4("Wrong offset");return e}});var Sb=X((Rrt,Eb)=>{"use strict";var D4=Math.round;Eb.exports=function(n){var t=D4(n);return t<0?0:t>255?255:t&255}});var Mb=X((Lrt,wb)=>{"use strict";var F4=Om(),U4=zu(),B4=TypeError;wb.exports=function(n){if(F4(n))return n;throw new B4(U4(n)+" is not a constructor")}});var e0=X((Nrt,Ab)=>{"use strict";var z4=Zs(),bb=Tc(),G4=th(),k4=qu(),q4=Xr(),V4=q4("iterator");Ab.exports=function(n){if(!G4(n))return bb(n,V4)||bb(n,"@@iterator")||k4[z4(n)]}});var Cb=X((Ort,Tb)=>{"use strict";var H4=vr(),W4=_s(),X4=so(),Y4=zu(),$4=e0(),Z4=TypeError;Tb.exports=function(n,t){var e=arguments.length<2?$4(n):t;if(W4(e))return X4(H4(e,n));throw new Z4(Y4(n)+" is not iterable")}});var Pb=X((Drt,Ib)=>{"use strict";var J4=Xr(),j4=qu(),K4=J4("iterator"),Q4=Array.prototype;Ib.exports=function(n){return n!==void 0&&(j4.Array===n||Q4[K4]===n)}});var n0=X((Frt,Rb)=>{"use strict";var tk=Zs();Rb.exports=function(n){var t=tk(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Wh=X((Urt,Lb)=>{"use strict";var ek=$g(),nk=TypeError;Lb.exports=function(n){var t=ek(n,"number");if(typeof t=="number")throw new nk("Can't convert number to bigint");return BigInt(t)}});var Ob=X((Brt,Nb)=>{"use strict";var rk=zc(),ik=vr(),ok=Mb(),sk=Vi(),ak=ii(),uk=Cb(),lk=e0(),ck=Pb(),fk=n0(),hk=Wi().aTypedArrayConstructor,pk=Wh();Nb.exports=function(t){var e=ok(this),i=sk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=lk(i),p,d,g,y,v,E,M,A;if(f&&!ck(f))for(M=uk(i,f),A=M.next,i=[];!(E=ik(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=rk(u,arguments[2])),d=ak(i),g=new(hk(e))(d),y=fk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?pk(v):+v;return g}});var Ub=X((zrt,Fb)=>{"use strict";var dk=zc(),gk=In(),mk=Qf(),yk=Vi(),vk=ii(),_k=Dm(),Db=gk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=yk(p),E=mk(v),M=vk(E),A=dk(d,g),_=0,x=y||_k,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Db(T,w)}else switch(n){case 4:return!1;case 7:Db(T,w)}return u?-1:i||s?s:T}};Fb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var r0=X((Grt,zb)=>{"use strict";var xk=$s(),Ek=Hu(),Sk=Xr(),wk=ri(),Bb=Sk("species");zb.exports=function(n){var t=xk(n);wk&&t&&!t[Bb]&&Ek(t,Bb,{configurable:!0,get:function(){return this}})}});var i0=X((krt,Gb)=>{"use strict";var Mk=ii();Gb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Mk(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var sA=X((qrt,f0)=>{"use strict";var kb=sr(),Kb=Sn(),qb=vr(),bk=ri(),Ak=LM(),Xc=Wi(),Qb=Hh(),Vb=Wm(),Tk=wc(),Vc=xs(),Ck=yb(),Ik=Wa(),Hb=Fh(),o0=t0(),Pk=Sb(),tA=ah(),Hc=oo(),Rk=Zs(),u0=xi(),Lk=Ac(),Nk=ku(),Ok=Mc(),Xh=Vu(),Dk=dm().f,Wb=Ob(),Fk=Ub().forEach,Uk=r0(),Bk=Hu(),eA=Wo(),nA=lh(),Xb=i0(),h0=Va(),zk=Ym(),l0=h0.get,Gk=h0.set,kk=h0.enforce,rA=eA.f,qk=nA.f,s0=Kb.RangeError,iA=Qb.ArrayBuffer,Vk=iA.prototype,Hk=Qb.DataView,Yh=Xc.NATIVE_ARRAY_BUFFER_VIEWS,Yb=Xc.TYPED_ARRAY_TAG,$b=Xc.TypedArray,Wc=Xc.TypedArrayPrototype,c0=Xc.isTypedArray,$h="BYTES_PER_ELEMENT",a0="Wrong length",Zh=function(n,t){Bk(n,t,{configurable:!0,get:function(){return l0(this)[t]}})},Zb=function(n){var t;return Ok(Vk,n)||(t=Rk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},oA=function(n,t){return c0(n)&&!Lk(t)&&t in n&&Ck(+t)&&t>=0},Jb=function(t,e){return e=tA(e),oA(t,e)?Tk(2,t[e]):qk(t,e)},jb=function(t,e,i){return e=tA(e),oA(t,e)&&u0(i)&&Hc(i,"value")&&!Hc(i,"get")&&!Hc(i,"set")&&!i.configurable&&(!Hc(i,"writable")||i.writable)&&(!Hc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):rA(t,e,i)};bk?(Yh||(nA.f=Jb,eA.f=jb,Zh(Wc,"buffer"),Zh(Wc,"byteOffset"),Zh(Wc,"byteLength"),Zh(Wc,"length")),kb({target:"Object",stat:!0,forced:!Yh},{getOwnPropertyDescriptor:Jb,defineProperty:jb}),f0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=Kb[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=l0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=l0(A);T.view[c](_*i+T.byteOffset,e?Pk(x):x,!0)},E=function(A,_){rA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Yh?Ak&&(p=t(function(A,_,x,T){return Vb(A,d),zk(function(){return u0(_)?Zb(_)?T!==void 0?new f(_,o0(x,i),T):x!==void 0?new f(_,o0(x,i)):new f(_):c0(_)?Xb(p,_):qb(Wb,p,_):new f(Hb(_))}(),A,p)}),Xh&&Xh(p,$b),Fk(Dk(f),function(A){A in p||Vc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Vb(A,d);var w=0,R=0,B,U,D;if(!u0(_))D=Hb(_),U=D*i,B=new iA(U);else if(Zb(_)){B=_,R=o0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new s0(a0);if(U=P-R,U<0)throw new s0(a0)}else if(U=Ik(T)*i,U+R>P)throw new s0(a0);D=U/i}else return c0(_)?Xb(p,_):qb(Wb,p,_);for(Gk(A,{buffer:B,byteOffset:R,byteLength:U,length:D,view:new Hk(B)});w<D;)E(A,w++)}),Xh&&Xh(p,$b),d=p.prototype=Nk(Wc)),d.constructor!==p&&Vc(d,"constructor",p),kk(d).TypedArrayConstructor=p,Yb&&Vc(d,Yb,s);var M=p!==f;g[s]=p,kb({global:!0,constructor:!0,forced:M,sham:!Yh},g),$h in p||Vc(p,$h,i),$h in d||Vc(d,$h,i),Uk(s)}):f0.exports=function(){}});var p0=X(()=>{"use strict";var Wk=sA();Wk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var d0=X(()=>{"use strict";var aA=Wi(),Xk=ii(),Yk=Hi(),$k=aA.aTypedArray,Zk=aA.exportTypedArrayMethod;Zk("at",function(t){var e=$k(this),i=Xk(e),s=Yk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var g0=X(()=>{"use strict";var uA=Wi(),Jk=Xm(),jk=Wh(),Kk=Zs(),Qk=vr(),tq=In(),eq=An(),nq=uA.aTypedArray,rq=uA.exportTypedArrayMethod,iq=tq("".slice),oq=eq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});rq("fill",function(t){var e=arguments.length;nq(this);var i=iq(Kk(this),0,3)==="Big"?jk(t):+t;return Qk(Jk,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},oq)});var m0=X((Zrt,cA)=>{"use strict";var sq=zc(),aq=Qf(),uq=Vi(),lq=ii(),lA=function(n){var t=n===1;return function(e,i,s){for(var u=uq(e),c=aq(u),f=lq(c),p=sq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};cA.exports={findLast:lA(0),findLastIndex:lA(1)}});var y0=X(()=>{"use strict";var fA=Wi(),cq=m0().findLast,fq=fA.aTypedArray,hq=fA.exportTypedArrayMethod;hq("findLast",function(t){return cq(fq(this),t,arguments.length>1?arguments[1]:void 0)})});var v0=X(()=>{"use strict";var hA=Wi(),pq=m0().findLastIndex,dq=hA.aTypedArray,gq=hA.exportTypedArrayMethod;gq("findLastIndex",function(t){return pq(dq(this),t,arguments.length>1?arguments[1]:void 0)})});var S0=X(()=>{"use strict";var dA=Sn(),gA=vr(),E0=Wi(),mq=ii(),yq=t0(),vq=Vi(),mA=An(),_q=dA.RangeError,_0=dA.Int8Array,pA=_0&&_0.prototype,yA=pA&&pA.set,xq=E0.aTypedArray,Eq=E0.exportTypedArrayMethod,x0=!mA(function(){var n=new Uint8ClampedArray(2);return gA(yA,n,{length:1,0:3},1),n[1]!==3}),Sq=x0&&E0.NATIVE_ARRAY_BUFFER_VIEWS&&mA(function(){var n=new _0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Eq("set",function(t){xq(this);var e=yq(arguments.length>1?arguments[1]:void 0,1),i=vq(t);if(x0)return gA(yA,this,i,e);var s=this.length,u=mq(i),c=0;if(u+e>s)throw new _q("Wrong length");for(;c<u;)this[e+c]=i[c++]},!x0||Sq)});var M0=X((nit,_A)=>{"use strict";var vA=Uh(),wq=Math.floor,w0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=wq(e/2),f=w0(vA(n,0,c),t),p=w0(vA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};_A.exports=w0});var b0=X((rit,EA)=>{"use strict";var Mq=Bu(),xA=Mq.match(/firefox\\/(\\d+)/i);EA.exports=!!xA&&+xA[1]});var A0=X((iit,SA)=>{"use strict";var bq=Bu();SA.exports=/MSIE|Trident/.test(bq)});var T0=X((oit,MA)=>{"use strict";var Aq=Bu(),wA=Aq.match(/AppleWebKit\\/(\\d+)\\./);MA.exports=!!wA&&+wA[1]});var I0=X(()=>{"use strict";var Tq=Sn(),Cq=Ih(),C0=An(),Iq=_s(),Pq=M0(),IA=Wi(),bA=b0(),Rq=A0(),AA=bc(),TA=T0(),Lq=IA.aTypedArray,Nq=IA.exportTypedArrayMethod,Yc=Tq.Uint16Array,Ju=Yc&&Cq(Yc.prototype.sort),Oq=!!Ju&&!(C0(function(){Ju(new Yc(2),null)})&&C0(function(){Ju(new Yc(2),{})})),CA=!!Ju&&!C0(function(){if(AA)return AA<74;if(bA)return bA<67;if(Rq)return!0;if(TA)return TA<602;var n=new Yc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(Ju(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Dq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Nq("sort",function(t){return t!==void 0&&Iq(t),CA?Ju(this,t):Pq(Lq(this),Dq(t))},!CA||Oq)});var RA=X((uit,PA)=>{"use strict";var Fq=ii();PA.exports=function(n,t){for(var e=Fq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var R0=X(()=>{"use strict";var Uq=RA(),P0=Wi(),Bq=P0.aTypedArray,zq=P0.exportTypedArrayMethod,Gq=P0.getTypedArrayConstructor;zq("toReversed",function(){return Uq(Bq(this),Gq(this))})});var L0=X(()=>{"use strict";var Jh=Wi(),kq=In(),qq=_s(),Vq=i0(),Hq=Jh.aTypedArray,Wq=Jh.getTypedArrayConstructor,Xq=Jh.exportTypedArrayMethod,Yq=kq(Jh.TypedArrayPrototype.sort);Xq("toSorted",function(t){t!==void 0&&qq(t);var e=Hq(this),i=Vq(Wq(e),e);return Yq(i,t)})});var NA=X((pit,LA)=>{"use strict";var $q=ii(),Zq=Hi(),Jq=RangeError;LA.exports=function(n,t,e,i){var s=$q(n),u=Zq(e),c=u<0?s+u:u;if(c>=s||c<0)throw new Jq("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var O0=X(()=>{"use strict";var jq=NA(),N0=Wi(),Kq=n0(),Qq=Hi(),t5=Wh(),e5=N0.aTypedArray,n5=N0.getTypedArrayConstructor,r5=N0.exportTypedArrayMethod,i5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();r5("with",function(n,t){var e=e5(this),i=Qq(n),s=Kq(e)?t5(t):+t;return jq(e,n5(e),i,s)},!i5)});var F0=X(()=>{"use strict";var o5=sr(),s5=Sn(),a5=Hh(),u5=r0(),D0="ArrayBuffer",OA=a5[D0],l5=s5[D0];o5({global:!0,constructor:!0,forced:l5!==OA},{ArrayBuffer:OA});u5(D0)});var G0=X(()=>{"use strict";var c5=sr(),B0=Ih(),f5=An(),BA=Hh(),DA=so(),FA=vh(),h5=Wa(),z0=BA.ArrayBuffer,U0=BA.DataView,zA=U0.prototype,UA=B0(z0.prototype.slice),p5=B0(zA.getUint8),d5=B0(zA.setUint8),g5=f5(function(){return!new z0(2).slice(1,void 0).byteLength});c5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:g5},{slice:function(t,e){if(UA&&e===void 0)return UA(DA(this),t);for(var i=DA(this).byteLength,s=FA(t,i),u=FA(e===void 0?i:e,i),c=new z0(h5(u-s)),f=new U0(this),p=new U0(c),d=0;s<u;)d5(p,d++,p5(f,s++));return c}})});var k0=X((xit,qA)=>{"use strict";var kA=Sn(),m5=Oc(),y5=vs(),GA=kA.ArrayBuffer,v5=kA.TypeError;qA.exports=GA&&m5(GA.prototype,"byteLength","get")||function(n){if(y5(n)!=="ArrayBuffer")throw new v5("ArrayBuffer expected");return n.byteLength}});var q0=X((Eit,VA)=>{"use strict";var _5=Sn(),x5=Rh(),E5=k0(),S5=_5.DataView;VA.exports=function(n){if(!x5||E5(n)!==0)return!1;try{return new S5(n),!1}catch(t){return!0}}});var V0=X(()=>{"use strict";var w5=ri(),M5=Hu(),b5=q0(),HA=ArrayBuffer.prototype;w5&&!("detached"in HA)&&M5(HA,"detached",{configurable:!0,get:function(){return b5(this)}})});var XA=X((Mit,WA)=>{"use strict";var A5=q0(),T5=TypeError;WA.exports=function(n){if(A5(n))throw new T5("ArrayBuffer is detached");return n}});var H0=X((bit,YA)=>{"use strict";var $c=Sn(),C5=Bu(),I5=vs(),jh=function(n){return C5.slice(0,n.length)===n};YA.exports=function(){return jh("Bun/")?"BUN":jh("Cloudflare-Workers")?"CLOUDFLARE":jh("Deno/")?"DENO":jh("Node.js/")?"NODE":$c.Bun&&typeof Bun.version=="string"?"BUN":$c.Deno&&typeof Deno.version=="object"?"DENO":I5($c.process)==="process"?"NODE":$c.window&&$c.document?"BROWSER":"REST"}()});var ZA=X((Ait,$A)=>{"use strict";var P5=H0();$A.exports=P5==="NODE"});var jA=X((Tit,JA)=>{"use strict";var R5=Sn(),L5=ZA();JA.exports=function(n){if(L5){try{return R5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Y0=X((Cit,QA)=>{"use strict";var N5=Sn(),O5=An(),W0=bc(),X0=H0(),KA=N5.structuredClone;QA.exports=!!KA&&!O5(function(){if(X0==="DENO"&&W0>92||X0==="NODE"&&W0>94||X0==="BROWSER"&&W0>97)return!1;var n=new ArrayBuffer(8),t=KA(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var rT=X((Iit,nT)=>{"use strict";var j0=Sn(),D5=jA(),F5=Y0(),U5=j0.structuredClone,tT=j0.ArrayBuffer,Kh=j0.MessageChannel,J0=!1,$0,eT,Qh,Z0;if(F5)J0=function(n){U5(n,{transfer:[n]})};else if(tT)try{Kh||($0=D5("worker_threads"),$0&&(Kh=$0.MessageChannel)),Kh&&(eT=new Kh,Qh=new tT(2),Z0=function(n){eT.port1.postMessage(null,[n])},Qh.byteLength===2&&(Z0(Qh),Qh.byteLength===0&&(J0=Z0)))}catch(n){}nT.exports=J0});var ry=X((Pit,cT)=>{"use strict";var ty=Sn(),ey=In(),aT=Oc(),B5=Fh(),z5=XA(),G5=k0(),iT=rT(),K0=Y0(),k5=ty.structuredClone,uT=ty.ArrayBuffer,Q0=ty.DataView,q5=Math.min,ny=uT.prototype,lT=Q0.prototype,V5=ey(ny.slice),oT=aT(ny,"resizable","get"),sT=aT(ny,"maxByteLength","get"),H5=ey(lT.getInt8),W5=ey(lT.setInt8);cT.exports=(K0||iT)&&function(n,t,e){var i=G5(n),s=t===void 0?i:B5(t),u=!oT||!oT(n),c;if(z5(n),K0&&(n=k5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=V5(n,0,s);else{var f=e&&!u&&sT?{maxByteLength:sT(n)}:void 0;c=new uT(s,f);for(var p=new Q0(n),d=new Q0(c),g=q5(s,i),y=0;y<g;y++)W5(d,y,H5(p,y))}return K0||iT(n),c}});var iy=X(()=>{"use strict";var X5=sr(),fT=ry();fT&&X5({target:"ArrayBuffer",proto:!0},{transfer:function(){return fT(this,arguments.length?arguments[0]:void 0,!0)}})});var oy=X(()=>{"use strict";var Y5=sr(),hT=ry();hT&&Y5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return hT(this,arguments.length?arguments[0]:void 0,!1)}})});var Ao=X((Dit,pT)=>{"use strict";var sy=In(),tp=Set.prototype;pT.exports={Set,add:sy(tp.add),has:sy(tp.has),remove:sy(tp.delete),proto:tp}});var ea=X((Fit,dT)=>{"use strict";var $5=Ao().has;dT.exports=function(n){return $5(n),n}});var na=X((Uit,gT)=>{"use strict";var Z5=vr();gT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=Z5(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var ju=X((Bit,xT)=>{"use strict";var mT=In(),J5=na(),yT=Ao(),j5=yT.Set,vT=yT.proto,K5=mT(vT.forEach),_T=mT(vT.keys),Q5=_T(new j5).next;xT.exports=function(n,t,e){return e?J5({iterator:_T(n),next:Q5},t):K5(n,t)}});var ep=X((zit,ST)=>{"use strict";var ET=Ao(),tV=ju(),eV=ET.Set,nV=ET.add;ST.exports=function(n){var t=new eV;return tV(n,function(e){nV(t,e)}),t}});var Ku=X((Git,wT)=>{"use strict";var rV=Oc(),iV=Ao();wT.exports=rV(iV.proto,"size","get")||function(n){return n.size}});var bT=X((kit,MT)=>{"use strict";MT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((qit,RT)=>{"use strict";var AT=_s(),IT=so(),TT=vr(),oV=Hi(),sV=bT(),CT="Invalid size",aV=RangeError,uV=TypeError,lV=Math.max,PT=function(n,t){this.set=n,this.size=lV(t,0),this.has=AT(n.has),this.keys=AT(n.keys)};PT.prototype={getIterator:function(){return sV(IT(TT(this.keys,this.set)))},includes:function(n){return TT(this.has,this.set,n)}};RT.exports=function(n){IT(n);var t=+n.size;if(t!==t)throw new uV(CT);var e=oV(t);if(e<0)throw new aV(CT);return new PT(n,e)}});var DT=X((Vit,OT)=>{"use strict";var cV=ea(),NT=Ao(),fV=ep(),hV=Ku(),pV=ra(),dV=ju(),gV=na(),mV=NT.has,LT=NT.remove;OT.exports=function(t){var e=cV(this),i=pV(t),s=fV(e);return hV(e)<=i.size?dV(e,function(u){i.includes(u)&&LT(s,u)}):gV(i.getIterator(),function(u){mV(e,u)&&LT(s,u)}),s}});var ia=X((Hit,BT)=>{"use strict";var yV=$s(),FT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},UT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};BT.exports=function(n,t){var e=yV("Set");try{new e()[n](FT(0));try{return new e()[n](FT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](UT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](UT(1/0)))}}}catch(s){return!1}}});var zT=X(()=>{"use strict";var vV=sr(),_V=DT(),xV=ia(),EV=!xV("difference",function(n){return n.size===0});vV({target:"Set",proto:!0,real:!0,forced:EV},{difference:_V})});var qT=X((Yit,kT)=>{"use strict";var SV=ea(),ay=Ao(),wV=Ku(),MV=ra(),bV=ju(),AV=na(),TV=ay.Set,GT=ay.add,CV=ay.has;kT.exports=function(t){var e=SV(this),i=MV(t),s=new TV;return wV(e)>i.size?AV(i.getIterator(),function(u){CV(e,u)&&GT(s,u)}):bV(e,function(u){i.includes(u)&&GT(s,u)}),s}});var VT=X(()=>{"use strict";var IV=sr(),PV=An(),RV=qT(),LV=ia(),NV=!LV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||PV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});IV({target:"Set",proto:!0,real:!0,forced:NV},{intersection:RV})});var uy=X((Jit,WT)=>{"use strict";var OV=vr(),HT=so(),DV=Tc();WT.exports=function(n,t,e){var i,s;HT(n);try{if(i=DV(n,"return"),!i){if(t==="throw")throw e;return e}i=OV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return HT(i),e}});var YT=X((jit,XT)=>{"use strict";var FV=ea(),UV=Ao().has,BV=Ku(),zV=ra(),GV=ju(),kV=na(),qV=uy();XT.exports=function(t){var e=FV(this),i=zV(t);if(BV(e)<=i.size)return GV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return kV(s,function(u){if(UV(e,u))return qV(s,"normal",!1)})!==!1}});var $T=X(()=>{"use strict";var VV=sr(),HV=YT(),WV=ia(),XV=!WV("isDisjointFrom",function(n){return!n});VV({target:"Set",proto:!0,real:!0,forced:XV},{isDisjointFrom:HV})});var JT=X((tot,ZT)=>{"use strict";var YV=ea(),$V=Ku(),ZV=ju(),JV=ra();ZT.exports=function(t){var e=YV(this),i=JV(t);return $V(e)>i.size?!1:ZV(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var jT=X(()=>{"use strict";var jV=sr(),KV=JT(),QV=ia(),tH=!QV("isSubsetOf",function(n){return n});jV({target:"Set",proto:!0,real:!0,forced:tH},{isSubsetOf:KV})});var QT=X((rot,KT)=>{"use strict";var eH=ea(),nH=Ao().has,rH=Ku(),iH=ra(),oH=na(),sH=uy();KT.exports=function(t){var e=eH(this),i=iH(t);if(rH(e)<i.size)return!1;var s=i.getIterator();return oH(s,function(u){if(!nH(e,u))return sH(s,"normal",!1)})!==!1}});var tC=X(()=>{"use strict";var aH=sr(),uH=QT(),lH=ia(),cH=!lH("isSupersetOf",function(n){return!n});aH({target:"Set",proto:!0,real:!0,forced:cH},{isSupersetOf:uH})});var nC=X((sot,eC)=>{"use strict";var fH=ea(),ly=Ao(),hH=ep(),pH=ra(),dH=na(),gH=ly.add,mH=ly.has,yH=ly.remove;eC.exports=function(t){var e=fH(this),i=pH(t).getIterator(),s=hH(e);return dH(i,function(u){mH(e,u)?yH(s,u):gH(s,u)}),s}});var rC=X(()=>{"use strict";var vH=sr(),_H=nC(),xH=ia();vH({target:"Set",proto:!0,real:!0,forced:!xH("symmetricDifference")},{symmetricDifference:_H})});var oC=X((lot,iC)=>{"use strict";var EH=ea(),SH=Ao().add,wH=ep(),MH=ra(),bH=na();iC.exports=function(t){var e=EH(this),i=MH(t).getIterator(),s=wH(e);return bH(i,function(u){SH(s,u)}),s}});var sC=X(()=>{"use strict";var AH=sr(),TH=oC(),CH=ia();AH({target:"Set",proto:!0,real:!0,forced:!CH("union")},{union:TH})});var cy=X((hot,uC)=>{"use strict";var aC=zu(),IH=TypeError;uC.exports=function(n,t){if(!delete n[t])throw new IH("Cannot delete property "+aC(t)+" of "+aC(n))}});var lC=X(()=>{"use strict";var PH=sr(),RH=Vi(),LH=ii(),NH=mm(),OH=cy(),DH=Eh(),FH=[].unshift(0)!==1,UH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},BH=FH||!UH();PH({target:"Array",proto:!0,arity:1,forced:BH},{unshift:function(t){var e=RH(this),i=LH(e),s=arguments.length;if(s){DH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:OH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return NH(e,i+s)}})});var Ll=X((Cot,pP)=>{"use strict";var xY=Zs(),EY=String;pP.exports=function(n){if(xY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return EY(n)}});var gP=X((Iot,dP)=>{"use strict";var SY=so();dP.exports=function(){var n=SY(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var yP=X((Pot,mP)=>{"use strict";var Kv=An(),wY=Sn(),Qv=wY.RegExp,t_=Kv(function(){var n=Qv("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),MY=t_||Kv(function(){return!Qv("a","y").sticky}),bY=t_||Kv(function(){var n=Qv("^r","gy");return n.lastIndex=2,n.exec("str")!==null});mP.exports={BROKEN_CARET:bY,MISSED_STICKY:MY,UNSUPPORTED_Y:t_}});var _P=X((Rot,vP)=>{"use strict";var AY=An(),TY=Sn(),CY=TY.RegExp;vP.exports=AY(function(){var n=CY(".","s");return!(n.dotAll&&n.test(\`
8005
+ `,n=-1/0,r=this.geometry.getAttribute("position");if(r)for(let o=0;o<r.count;o++){let s=r.getZ(o);s>n&&(n=s)}let i=new ft.ShaderMaterial({uniforms:{maxZ:{value:n},uColor:{value:new ft.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new ft.Color(te(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=i}initLineMaterial(){let t=L.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new ft.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(n=>{let{coords:r}=n.geometry;for(let i=0;i<r.length;i++){let o=r[i];for(let s=0;s<o.length;s++){let u=o[s],l=s+1===o.length?o[0]:o[s+1];t.push(new ft.Vector3(u[0],u[1],e)),t.push(new ft.Vector3(l[0],l[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new ft.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new ft.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var n;(n=this.geometry)==null||n.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,n){super(),this.context=t,this.mergedElement=n,this.options=[],n?(this.options=[n],this.initMergedElement()):(this.options=e.map(r=>x({},_e,r)),this.init())}};var ig=require("core-js/modules/web.dom-collections.iterator.js"),og=require("core-js/modules/es.string.trim.js");var Gt=require("three"),Rs=require("three/examples/jsm/utils/BufferGeometryUtils.js");var Ps={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},zn=class extends Gt.Object3D{init(){return g(this,null,function*(){let t=yield Promise.all(this.options.map(o=>tt.getTextureByText(o.texts[0],{fillStyle:or(o.fillColor,o.fillOpacity),strokeStyle:or(o.strokeColor,o.strokeOpacity),lineWidth:6,font:"bold 54px sans-serif",maxWidth:2048}))),e=t.map((o,s)=>{let u=this.options[s],{width:l,height:c}=o.texture.image,h=l/c,p=u.secondHeight*h,f=new Gt.PlaneGeometry(p,u.secondHeight),d=new Gt.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Gt.Matrix4().makeRotationZ(u.secondRotate));return f.applyMatrix4(d),f}),n=(0,Rs.mergeGeometries)(e,!0);e.forEach(o=>o.dispose());let r=t.map(o=>{let{texture:s}=o,u=new Gt.MeshBasicMaterial({map:s,alphaTest:1,side:Gt.DoubleSide});return s.needsUpdate=!0,u}),i=new Gt.Mesh(n,r);this.mesh=i,this.position.z+=.04,this.add(i)})}setOpacity(t){var e,n;(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>{r.opacity=t,r.needsUpdate=!0})}dispose(){var t,e,n;(t=this.mesh)==null||t.geometry.dispose(),(n=this.mesh)==null||(e=n.material)==null||e.forEach(r=>r.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(n=>x({},Ps,n)).filter(n=>n.texts[0].trim()),this.options.length&&this.init()}};var Is=require("three"),Ls=require("three/examples/jsm/lines/Line2.js"),Ns=require("three/examples/jsm/lines/LineGeometry.js"),Os=require("three/examples/jsm/lines/LineMaterial.js"),qe=class extends Is.Object3D{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Ls.Line2(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&B(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,n){super(),this.context=t,this.lineGeometry=new Ns.LineGeometry,this.lineMaterial=new Os.LineMaterial({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:r,height:i}=this.context.clientSize;this.lineMaterial.resolution.set(r,i)},this.onResize(),this.registryEvent(),e&&n&&this.setPosition(e,n)}};var pg=require("core-js/modules/es.array.push.js"),fg=require("core-js/modules/web.dom-collections.iterator.js"),be=require("three");var je=require("three");var Pn=class extends be.Object3D{loadModel(){return g(this,null,function*(){let t=yield Tt.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(u=>{if(u.isMesh){let l=e.clone().multiply(u.matrixWorld),c=u.material;this.subMeshes.push({geometry:u.geometry,material:u.material,initialMatrix:l}),Array.isArray(c)?c.forEach(h=>{h.transparent=!0,this.materialOriginParams.set(h,{opacity:h.opacity})}):(c.transparent=!0,this.materialOriginParams.set(c,{opacity:c.opacity}))}});let n=this.subMeshes.map(u=>{let{geometry:l,material:c}=u;return new be.InstancedMesh(l,c,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let i=new be.Box3().setFromObject(t.scene).getSize(new be.Vector3),o=Math.max(i.x,i.y);this.options.map(u=>{let l=new je.Matrix4,c=u.width/o;return l.multiply(new je.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight)).multiply(new je.Matrix4().makeScale(c,c,c)).multiply(new je.Matrix4().makeRotationZ(u.rotate)).multiply(new je.Matrix4().makeRotationX(Math.PI/2)),u.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(u,l),l}).forEach((u,l)=>{n.forEach((c,h)=>{let p=u.clone().multiply(this.subMeshes[h].initialMatrix);c.setMatrixAt(l,p)})}),n.forEach(u=>{u.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(u),this.add(u)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95,e.emissive=e.color,e.emissiveMap=e.map}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(n=>{let{material:r}=n;if(Array.isArray(r))r.forEach(i=>{if(e)i.opacity=t;else{let o=this.materialOriginParams.get(i)||{opacity:1};t>o.opacity?i.opacity=o.opacity:i.opacity=t}i.needsUpdate=!0});else{let i=this.materialOriginParams.get(r)||{opacity:1};t>i.opacity?r.opacity=i.opacity:r.opacity=t,r.needsUpdate=!0}}),this.children.forEach(n=>{n.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),B(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var Me=require("three");var Ee=class extends Me.Object3D{init(){return g(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=L.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=L.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Me.Mesh(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new Me.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new Me.ObjectLoader,this.options=x({},_e,e),this.init()}};var Ye=require("three");var Gn=class extends Ye.Object3D{initGeometry(){return g(this,null,function*(){let t=new Ye.ObjectLoader().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return g(this,null,function*(){var t;yield this.initGeometry();let e=new Ye.Mesh(this.geometry,It.GetMergeAttributeWallMaterial());this.add(e);let n=(t=this.geometry)==null?void 0:t.getAttribute("opacity");n&&(this.originOpacities=Array.from(n.array))})}setOpacity(t,e){e===void 0&&(e=!1);var n;let r=(n=this.geometry)==null?void 0:n.getAttribute("opacity");if(r){for(let o=0;o<r.count;o++)if(e)r.setX(o,t);else{var i;r.setX(o,Math.min(t,(i=this.originOpacities[o])!=null?i:1))}r.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var Ag=require("core-js/modules/es.typed-array.float32-array.js"),Cg=require("core-js/modules/es.typed-array.at.js"),Rg=require("core-js/modules/es.typed-array.fill.js"),Pg=require("core-js/modules/es.typed-array.find-last.js"),Ig=require("core-js/modules/es.typed-array.find-last-index.js"),Lg=require("core-js/modules/es.typed-array.set.js"),Ng=require("core-js/modules/es.typed-array.sort.js"),Og=require("core-js/modules/es.typed-array.to-reversed.js"),Dg=require("core-js/modules/es.typed-array.to-sorted.js"),Ug=require("core-js/modules/es.typed-array.with.js"),Fg=require("core-js/modules/es.array-buffer.constructor.js"),Bg=require("core-js/modules/es.array-buffer.slice.js"),zg=require("core-js/modules/es.array-buffer.detached.js"),Gg=require("core-js/modules/es.array-buffer.transfer.js"),kg=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js");var st=require("three");var xe=class extends st.Object3D{init(){return g(this,null,function*(){let t=this.options.iconUrl,e=yield ht.getTextureByUrl(t),n=new st.MeshBasicMaterial({map:e,transparent:!0,alphaTest:.2,side:st.FrontSide}),r=new st.InstancedMesh(this.geometry,n,this.options.mergedMatrixes.size);r.instanceMatrix=new st.InstancedBufferAttribute(new Float32Array(this.options.mergedMatrixes.array),16),this.add(r),this.mesh=r,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&B(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new st.ShapeGeometry(new st.Shape([new st.Vector2(-.5,-.5),new st.Vector2(-.5,.5),new st.Vector2(.5,.5),new st.Vector2(.5,-.5)])),this.options=x({},br,e);let n=new st.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};var jg=require("core-js/modules/es.array.push.js"),he=require("three");var Pi=require("three/examples/jsm/lines/LineSegments2.js"),Ii=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var kn=class extends he.Object3D{initGeometry(){return g(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=L.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=L.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new he.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new Ii.LineSegmentsGeometry;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let n=new Pi.LineSegments2(e,t);n.computeLineDistances(),n.position.z+=.01,this.add(n),this.doubleLines.push(n)}if(this.options.lineGeometry){let t=L.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new he.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new Ii.LineSegmentsGeometry;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let n=new Pi.LineSegments2(e,t);n.position.z+=.01,this.add(n),this.doubleLines.push(n)}}init(){return g(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new he.Mesh(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new he.ObjectLoader,this.init()}};var Jg=require("core-js/modules/es.typed-array.float32-array.js"),Qg=require("core-js/modules/es.typed-array.at.js"),tm=require("core-js/modules/es.typed-array.fill.js"),em=require("core-js/modules/es.typed-array.find-last.js"),nm=require("core-js/modules/es.typed-array.find-last-index.js"),rm=require("core-js/modules/es.typed-array.set.js"),im=require("core-js/modules/es.typed-array.sort.js"),om=require("core-js/modules/es.typed-array.to-reversed.js"),sm=require("core-js/modules/es.typed-array.to-sorted.js"),am=require("core-js/modules/es.typed-array.with.js"),um=require("core-js/modules/es.array-buffer.constructor.js"),lm=require("core-js/modules/es.array-buffer.slice.js"),cm=require("core-js/modules/es.array-buffer.detached.js"),hm=require("core-js/modules/es.array-buffer.transfer.js"),pm=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),fm=require("core-js/modules/web.dom-collections.iterator.js"),q=require("three");var Ve=class extends q.Object3D{setParkingColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new q.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return g(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=L.GetInstancedParkingSpaceMaterial()}initLineMaterial(){let t=L.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new q.InstancedMesh(this.geometry,this.material,this.options.length);let t=new q.InstancedBufferAttribute(new Float32Array(this.options.length),1),e=new q.InstancedBufferAttribute(new Float32Array(this.options.length),1);this.options.forEach((n,r)=>{let i=n.geometry.coords[0],[o,s,u]=i.slice(0,3),l=Math.sqrt((s[0]-o[0])**2+(s[1]-o[1])**2),c=Math.sqrt((u[0]-s[0])**2+(u[1]-s[1])**2),h=[l,c],p=Math.max(...h),f=Math.min(...h),d;p===l?d=[s[0]-o[0],s[1]-o[1]]:d=[u[0]-s[0],u[1]-s[1]];let[m,v]=d,y=Math.atan2(v,m)-Math.PI/2,S=new q.Matrix4().compose(new q.Vector3(n.center_coord_x,n.center_coord_y,(n.deltaHeight||0)+n.airHeight+n.height/2),new q.Quaternion().setFromAxisAngle(new q.Vector3(0,0,1),y),new q.Vector3(f,p,n.height));this.mesh.setMatrixAt(r,S),this.mesh.setColorAt(r,new q.Color(n.fillColor).convertLinearToSRGB()),t.array[r]=n.fillOpacity||1,e.array[r]=(n.deltaHeight||0)+n.airHeight+n.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:n}=lr(this.options),r=new q.BufferGeometry().setFromPoints(t);r.setAttribute("color",new q.BufferAttribute(new Float32Array(e),3)),r.setAttribute("opacity",new q.BufferAttribute(new Float32Array(n),1)),this.lineOriginOpacity=[...n],this.lineGeometry=r}createBorder(){this.line&&this.remove(this.line);let t=new q.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var r;n.array[o]=Math.min(t,(r=this.originOpacity[o])!=null?r:1)}if(n.needsUpdate=!0,this.lineGeometry){let o=this.lineGeometry.getAttribute("opacity");for(let s=0;s<o.count;s++)if(e)o.array[s]=t;else{var i;o.array[s]=Math.min(t,(i=this.lineOriginOpacity[s])!=null?i:1)}o.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new q.BoxGeometry(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(n=>x({},_e,n)),this.init()}};var ym=require("core-js/modules/es.typed-array.float32-array.js"),xm=require("core-js/modules/es.typed-array.at.js"),Em=require("core-js/modules/es.typed-array.fill.js"),Sm=require("core-js/modules/es.typed-array.find-last.js"),bm=require("core-js/modules/es.typed-array.find-last-index.js"),Mm=require("core-js/modules/es.typed-array.set.js"),wm=require("core-js/modules/es.typed-array.sort.js"),Tm=require("core-js/modules/es.typed-array.to-reversed.js"),Am=require("core-js/modules/es.typed-array.to-sorted.js"),Cm=require("core-js/modules/es.typed-array.with.js"),Rm=require("core-js/modules/es.array-buffer.constructor.js"),Pm=require("core-js/modules/es.array-buffer.slice.js"),Im=require("core-js/modules/es.array-buffer.detached.js"),Lm=require("core-js/modules/es.array-buffer.transfer.js"),Nm=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Om=require("core-js/modules/web.dom-collections.iterator.js"),Mt=require("three");var Cn=class extends Mt.Object3D{init(){return g(this,null,function*(){this.initMaterial(),this.initMesh(),this.option.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}setParkingColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new Mt.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}initMaterial(){this.material=L.GetInstancedParkingSpaceMaterial()}initLineMaterial(){return this.lineMaterial=L.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Mt.InstancedMesh(this.geometry,this.material,this.option.size);let t=new Mt.InstancedBufferAttribute(new Float32Array(this.option.opacities),1),e=new Mt.InstancedBufferAttribute(new Float32Array(this.option.maxZ),1);this.mesh.instanceMatrix=new Mt.InstancedBufferAttribute(new Float32Array(this.option.matrixes),16),this.mesh.instanceColor=new Mt.InstancedBufferAttribute(new Float32Array(this.option.colors),3),this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.needsUpdate=!0,this.originOpacity=[...this.option.opacities],this.add(this.mesh)}initLineGeometry(){if(this.lineGeometry&&this.lineGeometry.dispose(),this.option.lineGeometry){let t=new Mt.ObjectLoader().parseGeometries([this.option.lineGeometry]);this.lineGeometry=t[this.option.lineGeometry.uuid];let e=this.lineGeometry.getAttribute("opacity");this.lineOriginOpacity=[...e.array]}}createBorder(){this.line&&this.remove(this.line);let t=new Mt.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let n=this.geometry.getAttribute("opacity");for(let o=0;o<n.count;o++)if(e)n.array[o]=t;else{var r;n.array[o]=Math.min(t,(r=this.originOpacity[o])!=null?r:1)}if(n.needsUpdate=!0,this.lineGeometry){let o=this.lineGeometry.getAttribute("opacity");for(let s=0;s<o.count;s++)if(e)o.array[s]=t;else{var i;o.array[s]=Math.min(t,(i=this.lineOriginOpacity[s])!=null?i:1)}o.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new Mt.BoxGeometry(1,1,1),this.originOpacity=[],this.lineOriginOpacity=[],this.option=e,this.init()}};var Ds=require("three"),Mr=class extends zt{setEnable(t){super.setEnable(t),wt(this.rect,0,0,0,0),t?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:e,container:{clientWidth:n,clientHeight:r}}}=this,i=I(this.startPoint,e,n,r),o=I(this.endPoint,e,n,r),s={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},u={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},l=this.searchMapInFrustum(s,u);this.dispatchEvent({type:"selected",list:l})}}searchMapInFrustum(t,e){var n;let{context:r}=this;return((n=r.currentFloor)==null?void 0:n.graphicLayer.children.filter(i=>i instanceof pt&&this.searchChildInFrustum(i,t,e)))||[]}searchChildInFrustum(t,e,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!t)return!1;if(!t.mesh){let p=t.getPosition();if(p){let f=I(p,r,i,o);return ae(f,e,n)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let s=t.mesh.geometry.boundingBox;if(!s)return!1;let{min:u,max:l}=s,c=I(u,r,i,o),h=I(l,r,i,o);return!(!ae(c,e,n)||!ae(h,e,n))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new Ds.Frustum,this.onPointerDown=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.startPoint=i),this.endPoint=void 0},this.onPointerMove=r=>{if(!this.enable||!this.startPoint)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i)},this.onPointerUp=r=>{if(!this.enable)return;let i=this.getIntersectByPointerEvent(r);i&&(this.endPoint=i),this.doSelect(),this.startPoint=void 0},this.onUpdate=()=>{if(this.startPoint){let r=this.getSvgCoordinate(this.startPoint),i=x({},r);this.endPoint&&(i=this.getSvgCoordinate(this.endPoint));let o={x:Math.min(r.x,i.x),y:Math.min(r.y,i.y)},s=Math.abs(i.x-r.x),u=Math.abs(i.y-r.y);wt(this.rect,o.x,o.y,s,u)}else wt(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:n}}}=t;this.rect=ue(n,e),this.svg.appendChild(this.rect),this.registryEvent()}};var Vn=class extends Us.EventDispatcher{get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.context=t,this._list=new Set,this.downPoint=null,this.downTime=0,this.isMultipleSelect=!1,this.onPointerDown=e=>{Date.now()-this.downTime<200||(this.downPoint={x:e.offsetX,y:e.offsetY},this.downTime=Date.now())},this.onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=e,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:s}=this.context.getGraphicsByDeviceXy(n,r),u=new Set(s.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!u.has(c.options.id)){var h;let p=((h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id))||null;p&&p.options.geometry.type==="point"&&(s.push(p),u.add(c.options.id))}}),(Ce?e.metaKey:e.ctrlKey)||this._list.clear(),s.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{Re(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{Re(e.key)&&this.disableBoxSelection()},this.onBoxSelected=e=>{let{list:n}=e;this._list.clear(),n.forEach(r=>{this._list.add(r)}),this.selectEnd()},this.boxSelection=new Mr(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var t_=require("core-js/modules/es.set.difference.v2.js"),e_=require("core-js/modules/es.set.intersection.v2.js"),n_=require("core-js/modules/es.set.is-disjoint-from.v2.js"),r_=require("core-js/modules/es.set.is-subset-of.v2.js"),i_=require("core-js/modules/es.set.is-superset-of.v2.js"),o_=require("core-js/modules/es.set.symmetric-difference.v2.js"),s_=require("core-js/modules/es.set.union.v2.js"),a_=require("core-js/modules/web.dom-collections.iterator.js");var wr=require("three");var Hn=class extends wr.EventDispatcher{handleHoverGraphicsChange(t){t===void 0&&(t=this.curGraphics),this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}constructor(t){super(),this.context=t,this.curGraphics=new Set,this.timer=new K,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:n,pois:r,e:i}=e,o=r.map(c=>{var h;return(h=this.context.currentFloor)==null?void 0:h.graphicLayer.graphicMap.get(c.options.id)}).filter(c=>c&&c.options.geometry.type==="point");if(!n.length&&!o.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,u=new Set;if(o.length){let c,h=1e4;o.forEach(p=>{let f=r.find(d=>d.options.id===p.options.id);if(f instanceof ve){let{x:d,y:m}=f.clientPos,v=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);v<h&&(h=v,c=p)}else if(f instanceof et){let{x:d,y:m}=f.box.getCenter(new wr.Vector2),v=Math.sqrt((d-i.offsetX)**2+(m-i.offsetY)**2);v<h&&(h=v,c=p)}}),u.add(c)}u.size||n.forEach(c=>u.add(c)),u.forEach(c=>{if(this.graphicTimerMap.get(c)||this.curGraphics.has(c))return;let h=this.timer.setTimeout(()=>{this.curGraphics.add(c),this.graphicTimerMap.delete(c),this.timer.clearTimeout(h),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(c,h)}),this.graphicTimerMap.forEach((c,h)=>{u.has(h)||(this.timer.clearTimeout(c),this.graphicTimerMap.delete(h))});let l=this.curGraphics.size;this.curGraphics.forEach(c=>{u.has(c)||this.curGraphics.delete(c)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()},this.onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()},this.onBodyPointerMove=e=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&this.onPointerLevel()}},this.registryEvent()}};var h_=require("core-js/modules/web.dom-collections.iterator.js"),kt=require("three");var Wn=require("@turf/turf"),Tr=class{updateBox(){this.box.setFromObject(this.context.scene)}setEnable(t){this.enable=t,t?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(d=>d instanceof Bt).length)return null;let e=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:s}=e,l=[new kt.Vector3(o.x,o.y,o.z),new kt.Vector3(s.x,o.y,o.z),new kt.Vector3(o.x,s.y,o.z),new kt.Vector3(s.x,s.y,o.z),new kt.Vector3(o.x,o.y,s.z),new kt.Vector3(s.x,o.y,s.z),new kt.Vector3(o.x,s.y,s.z),new kt.Vector3(s.x,s.y,s.z)].map(d=>I(d,n,r,i)),c=Math.min(...l.map(d=>d.x)),h=Math.max(...l.map(d=>d.x)),p=Math.min(...l.map(d=>d.y)),f=Math.max(...l.map(d=>d.y));return{left:c,right:h,top:p,bottom:f}}checkDistanceToScreenEdge(t){let{left:e,right:n,top:r,bottom:i}=t,{width:o,height:s}=this.context.clientSize,[u,l,c,h]=this.context.config.cameraBound.padding,p=(0,Wn.polygon)([[[e,r],[n,r],[n,i],[e,i],[e,r]]]),f=(0,Wn.polygon)([[[h,u],[o-l,u],[o-l,s-c],[h,s-c],[h,u]]]);try{return(0,Wn.intersect)(p,f)!==null}catch(d){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",d),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new kt.Vector3,zoom:1,target:new kt.Vector3},this.enable=!0,this.box=new kt.Box3,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:n,right:r,top:i,bottom:o}=e;this.checkDistanceToScreenEdge({left:n,right:r,top:i,bottom:o})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var v_=require("core-js/modules/es.promise.finally.js"),Li=require("three"),Ue=require("@tweenjs/tween.js");var g_=require("core-js/modules/web.dom-collections.iterator.js"),m_=require("core-js/modules/es.array.push.js"),b=require("three"),Ar=new b.Ray,Fs=new b.Plane,hu=Math.cos(70*b.MathUtils.DEG2RAD),Cr=class extends b.EventDispatcher{dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerUp),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null)}constructor(t,e){super(),this.rotateLineStart=new b.Vector2,this.rotateLineEnd=new b.Vector2,this.spherical=new b.Spherical,this.sphericalDelta=new b.Spherical,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new b.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.screenSpacePanning=!1,this.mouseButtons={LEFT:b.MOUSE.PAN,MIDDLE:b.MOUSE.DOLLY,RIGHT:b.MOUSE.ROTATE},this.touches={ONE:b.TOUCH.PAN,TWO:b.TOUCH.DOLLY_ROTATE},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(_){_.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=_},this.stopListenToKeyEvents=function(){var _;(_=this._domElementKeyEvents)==null||_.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent({type:"change"}),n.update(),i=r.NONE},this.update=function(){let _=new b.Vector3,E=new b.Quaternion().setFromUnitVectors(t.up,new b.Vector3(0,1,0)),j=E.clone().invert(),rt=new b.Vector3,Dt=new b.Quaternion,Jt=new b.Vector3,Kt=2*Math.PI;return function(sn){sn===void 0&&(sn=null);let ie=n.object.position;_.copy(ie).sub(n.target),_.applyQuaternion(E),s.setFromVector3(_),n.autoRotate&&i===r.NONE&&M(T(sn)),n.enableDamping?(s.theta+=u.theta*n.dampingFactor,s.phi+=u.phi*n.dampingFactor):(s.theta+=u.theta,s.phi+=u.phi);let oe=n.minAzimuthAngle,se=n.maxAzimuthAngle;isFinite(oe)&&isFinite(se)&&(oe<-Math.PI?oe+=Kt:oe>Math.PI&&(oe-=Kt),se<-Math.PI?se+=Kt:se>Math.PI&&(se-=Kt),oe<=se?s.theta=Math.max(oe,Math.min(se,s.theta)):s.theta=s.theta>(oe+se)/2?Math.max(oe,s.theta):Math.min(se,s.theta)),s.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,s.phi)),s.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(c,n.dampingFactor):n.target.add(c),n.zoomToCursor&&Y||n.object.isOrthographicCamera?s.radius=Kr(s.radius):s.radius=Kr(s.radius*l),_.setFromSpherical(s),_.applyQuaternion(j),ie.copy(n.target).add(_),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,c.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),c.set(0,0,0));let nr=!1;if(n.zoomToCursor&&Y){let an=null;if(n.object.isPerspectiveCamera){let un=_.length();an=Kr(un*l);let rr=un-an;n.object.position.addScaledVector(O,rr),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let un=new b.Vector3(N.x,N.y,0);un.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),nr=!0;let rr=new b.Vector3(N.x,N.y,0);rr.unproject(n.object),n.object.position.sub(rr).add(un),n.object.updateMatrixWorld(),an=_.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;an!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(an).add(n.object.position):(Ar.origin.copy(n.object.position),Ar.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Ar.direction))<hu?t.lookAt(n.target):(Fs.setFromNormalAndCoplanarPoint(n.object.up,n.target),Ar.intersectPlane(Fs,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/l)),n.object.updateProjectionMatrix(),nr=!0);return l=1,Y=!1,nr||rt.distanceToSquared(n.object.position)>o||8*(1-Dt.dot(n.object.quaternion))>o||Jt.distanceToSquared(n.target)>0?(n.dispatchEvent({type:"change"}),rt.copy(n.object.position),Dt.copy(n.object.quaternion),Jt.copy(n.target),nr=!1,!0):!1}}();let n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},i=r.NONE,o=1e-6,s=new b.Spherical,u=new b.Spherical,l=1,c=new b.Vector3,h=new b.Vector2,p=new b.Vector2,f=new b.Vector2,d=new b.Vector2,m=new b.Vector2,v=new b.Vector2,y=new b.Vector2,S=new b.Vector2,w=new b.Vector2,O=new b.Vector3,N=new b.Vector2,Y=!1,C=[],U={};function T(_){return _!==null?2*Math.PI/60*n.autoRotateSpeed*_:2*Math.PI/60/60*n.autoRotateSpeed}function R(){return Math.pow(.95,n.zoomSpeed)}function M(_){u.theta-=_}function V(_){u.phi-=_}let Z=function(){let _=new b.Vector3;return function(j,rt){_.setFromMatrixColumn(rt,0),_.multiplyScalar(-j),c.add(_)}}(),W=function(){let _=new b.Vector3;return function(j,rt){n.screenSpacePanning===!0?_.setFromMatrixColumn(rt,1):(_.setFromMatrixColumn(rt,0),_.crossVectors(n.object.up,_)),_.multiplyScalar(j),c.add(_)}}(),F=function(){let _=new b.Vector3;return function(j,rt){let Dt=n.domElement;if(n.object.isPerspectiveCamera){let Jt=n.object.position;_.copy(Jt).sub(n.target);let Kt=_.length();Kt*=Math.tan(n.object.fov/2*Math.PI/180),Z(2*j*Kt/Dt.clientHeight,n.object.matrix),W(2*rt*Kt/Dt.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(Z(j*(n.object.right-n.object.left)/n.object.zoom/Dt.clientWidth,n.object.matrix),W(rt*(n.object.top-n.object.bottom)/n.object.zoom/Dt.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function fe(_){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l/=_:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function on(_){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?l*=_:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function Zr(_){if(!n.zoomToCursor)return;Y=!0;let E=n.domElement.getBoundingClientRect(),j=_.clientX-E.left,rt=_.clientY-E.top,Dt=E.width,Jt=E.height;N.x=j/Dt*2-1,N.y=-(rt/Jt)*2+1,O.set(N.x,N.y,1).unproject(n.object).sub(n.object.position).normalize()}function Kr(_){return Math.max(n.minDistance,Math.min(n.maxDistance,_))}function so(_){h.set(_.clientX,_.clientY)}function sa(_){Zr(_),y.set(_.clientX,_.clientY)}function ao(_){d.set(_.clientX,_.clientY)}function aa(_){p.set(_.clientX,_.clientY),f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let E=n.domElement;M(2*Math.PI*f.x/E.clientHeight),V(2*Math.PI*f.y/E.clientHeight),h.copy(p),n.update()}function ua(_){S.set(_.clientX,_.clientY),w.subVectors(S,y),w.y>0?fe(R()):w.y<0&&on(R()),y.copy(S),n.update()}function la(_){m.set(_.clientX,_.clientY),v.subVectors(m,d).multiplyScalar(n.panSpeed),F(v.x,v.y),d.copy(m),n.update()}function ca(_){Zr(_),_.deltaY<0?on(R()):_.deltaY>0&&fe(R()),n.update()}function ha(_){let E=!1;switch(_.code){case n.keys.UP:_.ctrlKey||_.metaKey||_.shiftKey?V(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(0,n.keyPanSpeed),E=!0;break;case n.keys.BOTTOM:_.ctrlKey||_.metaKey||_.shiftKey?V(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(0,-n.keyPanSpeed),E=!0;break;case n.keys.LEFT:_.ctrlKey||_.metaKey||_.shiftKey?M(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(n.keyPanSpeed,0),E=!0;break;case n.keys.RIGHT:_.ctrlKey||_.metaKey||_.shiftKey?M(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(-n.keyPanSpeed,0),E=!0;break}E&&(_.preventDefault(),n.update())}function uo(){if(C.length===1)h.set(C[0].pageX,C[0].pageY);else{let _=(C[0].pageX-C[0].pageY)/(C[1].pageX-C[1].pageY),E=C[0].pageY-_*C[0].pageX;n.rotateLineStart.set(_,E);let j=.5*(C[0].pageX+C[1].pageX),rt=.5*(C[0].pageY+C[1].pageY);h.set(j,rt)}}function lo(){if(C.length===1)d.set(C[0].pageX,C[0].pageY);else{let _=.5*(C[0].pageX+C[1].pageX),E=.5*(C[0].pageY+C[1].pageY);d.set(_,E)}}function co(){let _=C[0].pageX-C[1].pageX,E=C[0].pageY-C[1].pageY,j=Math.sqrt(_*_+E*E);y.set(0,j)}function pa(){n.enableZoom&&co(),n.enablePan&&lo()}function fa(){n.enableZoom&&co(),n.enableRotate&&uo()}function ho(_){if(C.length==1)p.set(_.pageX,_.pageY);else{let j=$r(_),rt=.5*(_.pageX+j.x),Dt=.5*(_.pageY+j.y);p.set(rt,Dt);let Jt=(_.pageY-j.y)/(_.pageX-j.x),Kt=j.y-Jt*j.x;if(n.rotateLineEnd.set(Jt,Kt),Number.isFinite(n.rotateLineEnd.x)&&Number.isFinite(n.rotateLineStart.x)){let Jr=(n.rotateLineStart.y-n.rotateLineEnd.y)/(n.rotateLineEnd.x-n.rotateLineStart.x),sn=Jt*Jr+Kt;if(Number.isFinite(Jr)&&Number.isFinite(sn)){let ie=Math.atan(n.rotateLineEnd.x)-Math.atan(n.rotateLineStart.x);Math.PI-Math.abs(ie)<.5&&(ie=-Math.sign(ie)*(Math.PI-Math.abs(ie))),Math.abs(ie)<.1&&(u.theta+=ie)}}n.rotateLineStart.copy(n.rotateLineEnd)}f.subVectors(p,h).multiplyScalar(n.rotateSpeed);let E=n.domElement;V(2*Math.PI*f.y/E.clientHeight),h.copy(p)}function po(_){if(C.length===1)m.set(_.pageX,_.pageY);else{let E=$r(_),j=.5*(_.pageX+E.x),rt=.5*(_.pageY+E.y);m.set(j,rt)}v.subVectors(m,d).multiplyScalar(n.panSpeed),F(v.x,v.y),d.copy(m)}function fo(_){let E=$r(_),j=_.pageX-E.x,rt=_.pageY-E.y,Dt=Math.sqrt(j*j+rt*rt);S.set(0,Dt),w.set(0,Math.pow(S.y/y.y,n.zoomSpeed)),fe(w.y),y.copy(S)}function da(_){n.enableZoom&&fo(_),n.enablePan&&po(_)}function ga(_){n.enableZoom&&fo(_),n.enableRotate&&ho(_)}this.onPointerDown=function(E){n.enabled!==!1&&(C.length===0&&(n.domElement.setPointerCapture(E.pointerId),n.domElement.addEventListener("pointermove",n.onPointerMove),n.domElement.addEventListener("pointerup",n.onPointerUp)),xa(E),E.pointerType==="touch"?va(E):ma(E))},this.onPointerMove=function(E){n.enabled!==!1&&(E.pointerType==="touch"?ya(E):_a(E))},this.onPointerUp=function(E){Ea(E),C.length===0&&(n.domElement.releasePointerCapture(E.pointerId),n.domElement.removeEventListener("pointermove",n.onPointerMove),n.domElement.removeEventListener("pointerup",n.onPointerUp)),n.dispatchEvent({type:"end"}),i=r.NONE};function ma(_){let E;switch(_.button){case 0:E=n.mouseButtons.LEFT;break;case 1:E=n.mouseButtons.MIDDLE;break;case 2:E=n.mouseButtons.RIGHT;break;default:E=-1}switch(E){case b.MOUSE.DOLLY:if(n.enableZoom===!1)return;sa(_),i=r.DOLLY;break;case b.MOUSE.ROTATE:if(_.ctrlKey||_.metaKey||_.shiftKey){if(n.enablePan===!1)return;ao(_),i=r.PAN}else{if(n.enableRotate===!1)return;so(_),i=r.ROTATE}break;case b.MOUSE.PAN:if(_.ctrlKey||_.metaKey||_.shiftKey){if(n.enableRotate===!1)return;so(_),i=r.ROTATE}else{if(n.enablePan===!1)return;ao(_),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function _a(_){switch(i){case r.ROTATE:if(n.enableRotate===!1)return;aa(_);break;case r.DOLLY:if(n.enableZoom===!1)return;ua(_);break;case r.PAN:if(n.enablePan===!1)return;la(_);break}}this.onMouseWheel=function(E){n.enabled===!1||n.enableZoom===!1||i!==r.NONE||(E.preventDefault(),n.dispatchEvent({type:"start"}),ca(E),n.dispatchEvent({type:"end"}))},this.onKeyDown=function(E){n.enabled===!1||n.enablePan===!1||ha(E)};function va(_){switch(go(_),C.length){case 1:switch(n.touches.ONE){case b.TOUCH.ROTATE:if(n.enableRotate===!1)return;uo(),i=r.TOUCH_ROTATE;break;case b.TOUCH.PAN:if(n.enablePan===!1)return;lo(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case b.TOUCH.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;pa(),i=r.TOUCH_DOLLY_PAN;break;case b.TOUCH.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;fa(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent({type:"start"})}function ya(_){switch(go(_),i){case r.TOUCH_ROTATE:if(n.enableRotate===!1)return;ho(_),n.update();break;case r.TOUCH_PAN:if(n.enablePan===!1)return;po(_),n.update();break;case r.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;da(_),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ga(_),n.update();break;default:i=r.NONE}}this.onContextMenu=function(E){n.enabled!==!1&&E.preventDefault()};function xa(_){C.push(_)}function Ea(_){delete U[_.pointerId];for(let E=0;E<C.length;E++)if(C[E].pointerId==_.pointerId){C.splice(E,1);return}}function go(_){let E=U[_.pointerId];E===void 0&&(E=new b.Vector2,U[_.pointerId]=E),E.set(_.pageX,_.pageY)}function $r(_){let E=_.pointerId===C[0].pointerId?C[1]:C[0];return U[E.pointerId]}n.domElement.addEventListener("contextmenu",this.onContextMenu),n.domElement.addEventListener("pointerdown",this.onPointerDown),n.domElement.addEventListener("pointercancel",this.onPointerUp),n.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}};var Rr=class extends Cr{registryEvent(){this.addEventListener("change",this.onChange),this.context.addEventListener("update",this.tweenUpdate)}unRegistryEvent(){this.removeEventListener("change",this.onChange),this.context.removeEventListener("update",this.tweenUpdate)}setPolarAngle(t,e){e===void 0&&(e=!1);let{maxPolarAngle:n,minPolarAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),i||(this.maxPolarAngle=n,this.minPolarAngle=r)}setPolarAngleByDuration(t,e,n){return g(this,null,function*(){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setPolarAngle(t,e):Ft(new Promise(r=>{let i={polar:this.getPolarAngle()},o={polar:t},s=new Ue.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setPolarAngle(i.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)})}setAzimuthalAngle(t,e){let{maxAzimuthAngle:n,minAzimuthAngle:r}=this,i=n===r;(e||t<=n&&t>=r)&&(this.maxAzimuthAngle=t,this.minAzimuthAngle=t,this.update()),i||(this.maxAzimuthAngle=n,this.minAzimuthAngle=r)}setAzimuthalAngleDuration(t,e,n){return e===void 0&&(e=!1),n===void 0&&(n=500),n<=0?this.setAzimuthalAngle(t,e):Ft(new Promise(r=>{let i={azimuthal:this.getAzimuthalAngle()},o={azimuthal:t},s=new Ue.Tween(i,this.tweenGroup).to(o,n).onUpdate(()=>{this.setAzimuthalAngle(i.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(s),r(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}getCameraLookAt(){return new Li.Vector3().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return g(this,null,function*(){let n=this.target.clone(),r=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(r)),this.target.copy(t.clone()),this.update();return}return Ft(new Promise(i=>{let o=new Ue.Tween(n,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(n.clone().sub(r)),this.target.copy(n.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(o),this.enabled=!0,i(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)})}setZoom(t,e,n){n===void 0&&(n=!1);let{minZoom:r,maxZoom:i}=this;(n||t>=r&&t<=i)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,n,r){return g(this,null,function*(){n===void 0&&(n=!1),r===void 0&&(r=500);let i={zoom:this.camera.zoom,target:this.target.clone()};if(t!==this.camera.zoom)return r?Ft(new Promise(o=>{let s=new Ue.Tween(i,this.tweenGroup).to({zoom:t,target:e},r).onUpdate(()=>{this.setZoom(i.zoom,i.target,n)}).onComplete(()=>{this.tweenGroup.remove(s),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500).finally(()=>{this.enabled=!0}):this.setZoom(t,e,n)})}setTargetByOffset(t,e){if(e===void 0&&(e=this.target.clone()),this.camera.updateMatrix(),t){let n=new Li.Vector3;n.setFromMatrixColumn(this.camera.matrix,1),n.normalize(),n.multiplyScalar(t/this.camera.zoom),e.add(n)}this.setCameraPositionByTarget(e,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){super.dispose(),this.unRegistryEvent(),this.clearTween()}constructor(t,e,n){super(e,n),this.context=t,this.camera=e,this.domElement=n,this.prevCameraZoom=1,this.tweenGroup=new Ue.Group,this.offsetY=0,this.onChange=()=>{let r=this.camera.zoom;r!==this.prevCameraZoom&&(this.prevCameraZoom=r,this.dispatchEvent({type:"change-zoom",zoom:r}))},this.tweenUpdate=()=>{this.tweenGroup.update()},this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}};var Ze=require("three");var Pr=class extends Ze.WebGLRenderer{setCameraAndScene(t,e){this.scene=t,this.camera=e}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(t,e){this.event.addEventListener(t,e)}removeEventListener(t,e){this.event.removeEventListener(t,e)}constructor(t){super(x({antialias:!0,alpha:!0},t)),this.event=new Ze.EventDispatcher,this.enable=!0,this.timer=new K,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=Ze.PCFSoftShadowMap;let e=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,e.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var we=require("three"),Bs=require("three/examples/jsm/loaders/RGBELoader.js");var Ir=class extends we.Scene{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,B(this),this.clear()}constructor(){super(),new Bs.RGBELoader().load(fs,t=>{t.mapping=we.EquirectangularReflectionMapping,this.environment=t;let e=new we.Matrix4;e.makeRotationX(Math.PI/2),this.environmentRotation=new we.Euler().setFromRotationMatrix(e)})}};var zs=require("three"),Lr=class extends zs.OrthographicCamera{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var Ni=require("@turf/turf");var Xn=class extends H.EventDispatcher{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=(0,Ni.polygon)([t])}resizeClientSize(){let{x:t,y:e,width:n,height:r}=this.container.getBoundingClientRect();this.clientSize={width:n||this.container.clientWidth,height:r||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new Lr(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Rr(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new Tr(this)}getRatio(t,e){t===void 0&&(t=new H.Vector3(0,0,0)),e===void 0&&(e=new H.Vector3(100,0,0));let{clientWidth:n,clientHeight:r}=this.container,i=I(t,this.camera,n,r),o=I(e,this.camera,n,r);return Math.ceil(Math.sqrt((o.x-i.x)**2+(o.y-i.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof H.AmbientLight&&(e.color=new H.Color(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.currentFloor.onRemoveFromScene(),this.scene.remove(this.currentFloor),e&&this.currentFloor.dispose()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene();let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var n;let r=new H.Vector2;r.x=t/this.clientSize.width*2-1,r.y=e/this.clientSize.height*-2+1;let i=new H.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),((n=this.currentFloor)==null?void 0:n.graphicLayer.getGraphicByRaycaster(i))||{graphics:[],position:null}}getPoisByDeviceXy(t,e){var n,r;let i=(n=this.currentFloor)==null?void 0:n.poiLayer.getPoiByDeviceXy(t,e),o=(r=this.currentFloor)==null?void 0:r.poiLayer2.getPoiByDeviceXy(t,e);return(i||[]).concat(o||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,n){return n===void 0&&(n=500),this.control.setZoomByDuration(t,e,!0,n)}getFitCameraToObjectZoom(t,e,n){return e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0),this.getFitCameraToBoxZoom(new H.Box3().setFromObject(t),e,n)}getFitCameraToBoxZoom(t,e,n){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=!0);let[r,i,o,s]=e,{clientSize:{width:u,height:l}}=this,c=this.control.getPolarAngle();n&&this.setPolarAngle(0,0),this.setPolarAngle(c,0);let{max:h,min:p}=t,f=new H.Vector3(p.x,h.y,h.z),d=new H.Vector3(h.x,h.y,h.z),m=new H.Vector3(h.x,p.y,p.z),v=new H.Vector3(p.x,p.y,p.z),y=I(f,this.camera,u,l),S=I(d,this.camera,u,l),w=I(v,this.camera,u,l),O=I(m,this.camera,u,l),Y=new H.Box2().setFromPoints([new H.Vector2(y.x,y.y),new H.Vector2(S.x,S.y),new H.Vector2(w.x,w.y),new H.Vector2(O.x,O.y)]).getSize(new H.Vector2),C=(u-i-s)/Y.x,U=(l-r-o)/Y.y,T=Math.min(C,U),R=new H.Vector3((h.x+p.x)/2,(h.y+p.y)/2,(h.z+p.z)/2),M=T*this.camera.zoom,V=this.camera.clone();V.zoom=M,V.updateMatrix();let Z=(i-s)/2,W=(r-o)/2;if(Z){let F=new H.Vector3;F.setFromMatrixColumn(V.matrix,0),F.normalize(),F.multiplyScalar(Z/M),R.add(F)}if(W){let F=new H.Vector3;F.setFromMatrixColumn(V.matrix,1),F.normalize(),F.multiplyScalar(W/M),R.add(F)}return{zoom:T*this.camera.zoom,center:R}}fitCameraToObject(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToObjectZoom(t,e,r);return this.setZoom(i,o,n)}fitCameraToBox(t,e,n,r){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),r===void 0&&(r=!0);let{zoom:i,center:o}=this.getFitCameraToBoxZoom(t,e,r);return this.setZoom(i,o,n)}getFitCameraToGroundZoom(t,e,n){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n).zoom}fitCameraToGround(t,e,n){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),n===void 0&&(n=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,n):Promise.resolve(!1)}setCameraPosition(t,e){return g(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){var t;(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.scene=new Ir,this.renderer=new Pr,this.lights=ni(),this.range=(0,Ni.polygon)([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=n=>{let{zoom:r}=n;this.dispatchEvent({type:"control-zoom-change",zoom:r})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:n,camera:r,renderer:i}=this,{clientWidth:o,clientHeight:s}=n;o=Math.max(1,o),s=Math.max(1,s),r.left=-o/2,r.right=o/2,r.top=s/2,r.bottom=-s/2,r.updateProjectionMatrix(),i.setSize(o,s),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:o,height:s})},this.onClick=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY);r.length&&this.dispatchEvent({type:"graphic-click",graphics:r,position:i});let o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);o.length&&this.dispatchEvent({type:"poi-click",pois:o})},this.onPointerover=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-over",e:n,graphics:r,pois:o,position:i})},this.onPointermove=n=>{let{graphics:r,position:i}=this.getGraphicsByDeviceXy(n.offsetX,n.offsetY),o=this.getPoisByDeviceXy(n.offsetX,n.offsetY);this.dispatchEvent({type:"pointer-move",e:n,graphics:r,pois:o,position:i})},this.onPointerleave=n=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=n=>{let{graphics:r,isMultipleSelect:i}=n;this.dispatchEvent({type:"select-graphic",graphics:r,isMultipleSelect:i})},this.onHoverChange=n=>{let{graphics:r}=n;this.dispatchEvent({type:"hover",graphics:r})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new Vn(this),this.hoverHelper=new Hn(this),this.resizeClientSize(),this.registryEvent()}};var Gs=require("lodash"),ks={placeId:0,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14}};function Oi(a){return(0,Gs.merge)({},ks,a)}var Xs=require("lodash");var ev=require("core-js/modules/web.dom-collections.iterator.js");var Dr=require("three");var q_=require("core-js/modules/es.array.push.js"),j_=require("core-js/modules/web.dom-collections.iterator.js");var V_=require("core-js/modules/es.array.sort.js");var Ke=function(a){return a.LAYERED_RENDER_VERSION="layeredRender",a.MERGED_RENDER_VERSION="mergedRender",a}({});function Nr(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.store_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.store_info_ext)==null?void 0:r.traditional_name)||e}}function Or(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var n;return((n=a.infra_info_ext)==null?void 0:n.poi_name)||e;case"zh-hk":var r;return((r=a.infra_info_ext)==null?void 0:r.traditional_name)||e}}var Di=["range","ground","store","facility","parkingSpace"];function Vs(a){return Di.indexOf(a.l_type)===-1?Di.length:Di.indexOf(a.l_type)}function pu(a){a.layers.sort((t,e)=>Vs(t)-Vs(e))}function fu(a){let t=a.layers.find(n=>n.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];a.layers.map(n=>{if(n.l_type!=="range")return mn(n.elements,e)})}function qn(a){pu(a),fu(a)}function $e(a,t){return t===void 0&&(t=4),a.floor_id+"_"+a.version_id+(t?"_"+t:"")}function Hs(a,t,e){switch(a.l_type){case"ground":return Ui(a,t);case"graph":return du(a,t);case"wall":return gu(a,t);case"lane":return mu(a,t);case"texture2d":case"texture3d":return _u(a,t);case"glb":return vu(a,t);case"store":return yu(a,t,e);case"facility":return Eu(a,t,e);case"parkingSpace":return bu(a,t,e);case"text":return wu(a,t)}}function Ws(a,t,e,n,r){switch(a.l_type){case"store":return xu(a,t,e,n,r);case"facility":return Su(a,t,e,n,r);case"parkingSpace":return Mu(a,t,n,r)}}function du(a,t){t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements)}function Ui(a,t){if(a.mergedElements){let e=a.mergedElements.map(n=>new Ee(t.context,x({},n,{dashed:!1})));t.addGrounds(e)}else{let e=a.elements.map(n=>new pt(t.context,x({},n,{dashed:!1})));t.addGrounds(e)}}function gu(a,t){if(a.mergedElements)a.mergedElements.map(e=>{let n=new Gn(t.context,e);t.wallLayer.add(n)});else{let e=a.elements.reduce((n,r)=>{let{fillColor:i,fillOpacity:o,strokeColor:s,strokeOpacity:u,height:l}=r,c=i.toLowerCase()+"-"+o+"-"+s.toLowerCase()+"-"+u+"-"+l;return u===0&&(c=i.toLowerCase()+"-"+o+"-"+l),n[c]?n[c].push(r):n[c]=[r],n},{});Object.values(e).forEach(n=>{let r=new Fn(t.context,n);t.wallLayer.add(r)})}}function mu(a,t){if(a.mergedElements){let e=new kn(t.context,a.mergedElements);t.laneLayer.add(e)}else{let e=new Bn(t.context,a.elements);t.laneLayer.add(e)}}function _u(a,t){if(a.mergedMatrixes)a.mergedMatrixes.map(e=>{let n=new xe(t.context,e);t.textureLayer.add(n)});else if(a.elements.length){let e=new ye(t.context,a.elements);t.textureLayer.add(e)}}function vu(a,t){t.glbModelLayer.addModels(a.elements.map(e=>x({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function yu(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(x({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function xu(a,t,e,n,r){a.elements.filter(i=>r.filterPoi(i)).map(i=>{try{let o=Nr(i,e),s=new et(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showStoreName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s&&(s.userData.type="store",s.userData.data=i,s.userData.floor=t.name)}catch(o){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",o,i)}})}function Eu(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(n=>{let r=t.addGraphic(x({},n,{dashed:!1}));t.userData.graphics.push(r),t.userData.graphicMap.set(n.id,r)})}function Su(a,t,e,n,r){a.elements.filter(i=>i.poi_info).filter(i=>r.filterPoi(i)).map(i=>{try{let o=Or(i,e),s=new et(t.context,{id:i.id,icon:i.poi_info.showImageUrl||i.poi_info.icon,text:o,position:{x:i.center_coord_x,y:i.center_coord_y,z:i.airHeight+i.height},icon_size:[24,24],level:i.poi_info.level||0,hide_text:!n.showFacilityName,maxWeight:i.poi_info.maxWeight||25,minWeight:i.poi_info.minWeight||1,text_font_size:n.textFontSize});t.poiLayer2.pushPoi(s),s.userData.type="facility",s.userData.data=i,s.userData.floor=t.name}catch(o){console.log("\u6DFB\u52A0facility\u5931\u8D25",o,i)}})}function bu(a,t,e){t.parkingSpaceLayer.load(a,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Mu(a,t,e,n){return g(this,null,function*(){let r=a.elements.filter(s=>s.texts[0]).filter(s=>n.filterPoi(s)),i=r.map(s=>s.displayName||s.texts[0]),o=yield tt.lazyGetTextureByTexts(i,{height:64});r.forEach(s=>{try{let u=s.displayName||s.texts[0],l=new et(t.context,{id:s.id,text:u,position:{x:s.center_coord_x,y:s.center_coord_y,z:s.airHeight+s.height},text_texture:o[u].texture,text_texture_width:o[u].width,text_texture_height:o[u].height,text_texture_offset_x:o[u].x,text_texture_offset_y:o[u].y,text_font_size:e.textFontSize});l&&(l.userData.type="parkingSpace",l.userData.data=s,l.userData.floor=t.name),t.poiLayer2.pushPoi(l)}catch(u){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",u,s)}}),Object.values(o).forEach(s=>{s.texture.dispose()})})}function wu(a,t){let e=new zn(t.context,a.elements.map(n=>x({},n,{center_x:n.center_coord_x,center_y:n.center_coord_y})));t.textTextureLayer.add(e)}function Fi(){let a=new Blob([`var VD=Object.create;var D1=Object.defineProperty;var HD=Object.getOwnPropertyDescriptor;var WD=Object.getOwnPropertyNames;var XD=Object.getPrototypeOf,YD=Object.prototype.hasOwnProperty;var X=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var $D=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of WD(t))!YD.call(n,s)&&s!==e&&D1(n,s,{get:()=>t[s],enumerable:!(i=HD(t,s))||i.enumerable});return n};var Qt=(n,t,e)=>(e=n!=null?VD(XD(n)):{},$D(t||!n||!n.__esModule?D1(e,"default",{value:n,enumerable:!0}):e,n));var Ri=(n,t,e)=>new Promise((i,s)=>{var u=p=>{try{f(e.next(p))}catch(d){s(d)}},c=p=>{try{f(e.throw(p))}catch(d){s(d)}},f=p=>p.done?i(p.value):Promise.resolve(p.value).then(u,c);f((e=e.apply(n,t)).next())});var Sn=X((Ug,F1)=>{"use strict";var Ec=function(n){return n&&n.Math===Math&&n};F1.exports=Ec(typeof globalThis=="object"&&globalThis)||Ec(typeof window=="object"&&window)||Ec(typeof self=="object"&&self)||Ec(typeof global=="object"&&global)||Ec(typeof Ug=="object"&&Ug)||function(){return this}()||Function("return this")()});var An=X((pet,U1)=>{"use strict";U1.exports=function(n){try{return!!n()}catch(t){return!0}}});var ri=X((det,B1)=>{"use strict";var ZD=An();B1.exports=!ZD(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Sc=X((get,z1)=>{"use strict";var JD=An();z1.exports=!JD(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var vr=X((met,G1)=>{"use strict";var jD=Sc(),Kf=Function.prototype.call;G1.exports=jD?Kf.bind(Kf):function(){return Kf.apply(Kf,arguments)}});var H1=X(V1=>{"use strict";var k1={}.propertyIsEnumerable,q1=Object.getOwnPropertyDescriptor,KD=q1&&!k1.call({1:2},1);V1.f=KD?function(t){var e=q1(this,t);return!!e&&e.enumerable}:k1});var wc=X((vet,W1)=>{"use strict";W1.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var In=X((_et,$1)=>{"use strict";var X1=Sc(),Y1=Function.prototype,Bg=Y1.call,QD=X1&&Y1.bind.bind(Bg,Bg);$1.exports=X1?QD:function(n){return function(){return Bg.apply(n,arguments)}}});var vs=X((xet,J1)=>{"use strict";var Z1=In(),t3=Z1({}.toString),e3=Z1("".slice);J1.exports=function(n){return e3(t3(n),8,-1)}});var Qf=X((Eet,j1)=>{"use strict";var n3=In(),r3=An(),i3=vs(),zg=Object,o3=n3("".split);j1.exports=r3(function(){return!zg("z").propertyIsEnumerable(0)})?function(n){return i3(n)==="String"?o3(n,""):zg(n)}:zg});var th=X((wet,K1)=>{"use strict";K1.exports=function(n){return n==null}});var Fu=X((Met,Q1)=>{"use strict";var s3=th(),a3=TypeError;Q1.exports=function(n){if(s3(n))throw new a3("Can't call method on "+n);return n}});var Uu=X((bet,tE)=>{"use strict";var u3=Qf(),l3=Fu();tE.exports=function(n){return u3(l3(n))}});var er=X((Aet,eE)=>{"use strict";var Gg=typeof document=="object"&&document.all;eE.exports=typeof Gg=="undefined"&&Gg!==void 0?function(n){return typeof n=="function"||n===Gg}:function(n){return typeof n=="function"}});var xi=X((Tet,nE)=>{"use strict";var c3=er();nE.exports=function(n){return typeof n=="object"?n!==null:c3(n)}});var $s=X((Cet,rE)=>{"use strict";var kg=Sn(),f3=er(),h3=function(n){return f3(n)?n:void 0};rE.exports=function(n,t){return arguments.length<2?h3(kg[n]):kg[n]&&kg[n][t]}});var Mc=X((Iet,iE)=>{"use strict";var p3=In();iE.exports=p3({}.isPrototypeOf)});var Bu=X((Pet,aE)=>{"use strict";var d3=Sn(),oE=d3.navigator,sE=oE&&oE.userAgent;aE.exports=sE?String(sE):""});var bc=X((Ret,pE)=>{"use strict";var hE=Sn(),qg=Bu(),uE=hE.process,lE=hE.Deno,cE=uE&&uE.versions||lE&&lE.version,fE=cE&&cE.v8,So,eh;fE&&(So=fE.split("."),eh=So[0]>0&&So[0]<4?1:+(So[0]+So[1]));!eh&&qg&&(So=qg.match(/Edge\\/(\\d+)/),(!So||So[1]>=74)&&(So=qg.match(/Chrome\\/(\\d+)/),So&&(eh=+So[1])));pE.exports=eh});var nh=X((Let,gE)=>{"use strict";var dE=bc(),g3=An(),m3=Sn(),y3=m3.String;gE.exports=!!Object.getOwnPropertySymbols&&!g3(function(){var n=Symbol("symbol detection");return!y3(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&dE&&dE<41})});var Vg=X((Net,mE)=>{"use strict";var v3=nh();mE.exports=v3&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ac=X((Oet,yE)=>{"use strict";var _3=$s(),x3=er(),E3=Mc(),S3=Vg(),w3=Object;yE.exports=S3?function(n){return typeof n=="symbol"}:function(n){var t=_3("Symbol");return x3(t)&&E3(t.prototype,w3(n))}});var zu=X((Det,vE)=>{"use strict";var M3=String;vE.exports=function(n){try{return M3(n)}catch(t){return"Object"}}});var _s=X((Fet,_E)=>{"use strict";var b3=er(),A3=zu(),T3=TypeError;_E.exports=function(n){if(b3(n))return n;throw new T3(A3(n)+" is not a function")}});var Tc=X((Uet,xE)=>{"use strict";var C3=_s(),I3=th();xE.exports=function(n,t){var e=n[t];return I3(e)?void 0:C3(e)}});var SE=X((Bet,EE)=>{"use strict";var Hg=vr(),Wg=er(),Xg=xi(),P3=TypeError;EE.exports=function(n,t){var e,i;if(t==="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n))||Wg(e=n.valueOf)&&!Xg(i=Hg(e,n))||t!=="string"&&Wg(e=n.toString)&&!Xg(i=Hg(e,n)))return i;throw new P3("Can't convert object to primitive value")}});var Cc=X((zet,wE)=>{"use strict";wE.exports=!1});var rh=X((Get,bE)=>{"use strict";var ME=Sn(),R3=Object.defineProperty;bE.exports=function(n,t){try{R3(ME,n,{value:t,configurable:!0,writable:!0})}catch(e){ME[n]=t}return t}});var ih=X((ket,CE)=>{"use strict";var L3=Cc(),N3=Sn(),O3=rh(),AE="__core-js_shared__",TE=CE.exports=N3[AE]||O3(AE,{});(TE.versions||(TE.versions=[])).push({version:"3.42.0",mode:L3?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var oh=X((qet,PE)=>{"use strict";var IE=ih();PE.exports=function(n,t){return IE[n]||(IE[n]=t||{})}});var Vi=X((Vet,RE)=>{"use strict";var D3=Fu(),F3=Object;RE.exports=function(n){return F3(D3(n))}});var oo=X((Het,LE)=>{"use strict";var U3=In(),B3=Vi(),z3=U3({}.hasOwnProperty);LE.exports=Object.hasOwn||function(t,e){return z3(B3(t),e)}});var sh=X((Wet,NE)=>{"use strict";var G3=In(),k3=0,q3=Math.random(),V3=G3(1 .toString);NE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+V3(++k3+q3,36)}});var Xr=X((Xet,DE)=>{"use strict";var H3=Sn(),W3=oh(),OE=oo(),X3=sh(),Y3=nh(),$3=Vg(),Gu=H3.Symbol,Yg=W3("wks"),Z3=$3?Gu.for||Gu:Gu&&Gu.withoutSetter||X3;DE.exports=function(n){return OE(Yg,n)||(Yg[n]=Y3&&OE(Gu,n)?Gu[n]:Z3("Symbol."+n)),Yg[n]}});var $g=X((Yet,BE)=>{"use strict";var J3=vr(),FE=xi(),UE=Ac(),j3=Tc(),K3=SE(),Q3=Xr(),tF=TypeError,eF=Q3("toPrimitive");BE.exports=function(n,t){if(!FE(n)||UE(n))return n;var e=j3(n,eF),i;if(e){if(t===void 0&&(t="default"),i=J3(e,n,t),!FE(i)||UE(i))return i;throw new tF("Can't convert object to primitive value")}return t===void 0&&(t="number"),K3(n,t)}});var ah=X(($et,zE)=>{"use strict";var nF=$g(),rF=Ac();zE.exports=function(n){var t=nF(n,"string");return rF(t)?t:t+""}});var uh=X((Zet,kE)=>{"use strict";var iF=Sn(),GE=xi(),Zg=iF.document,oF=GE(Zg)&&GE(Zg.createElement);kE.exports=function(n){return oF?Zg.createElement(n):{}}});var Jg=X((Jet,qE)=>{"use strict";var sF=ri(),aF=An(),uF=uh();qE.exports=!sF&&!aF(function(){return Object.defineProperty(uF("div"),"a",{get:function(){return 7}}).a!==7})});var lh=X(HE=>{"use strict";var lF=ri(),cF=vr(),fF=H1(),hF=wc(),pF=Uu(),dF=ah(),gF=oo(),mF=Jg(),VE=Object.getOwnPropertyDescriptor;HE.f=lF?VE:function(t,e){if(t=pF(t),e=dF(e),mF)try{return VE(t,e)}catch(i){}if(gF(t,e))return hF(!cF(fF.f,t,e),t[e])}});var jg=X((Ket,WE)=>{"use strict";var yF=ri(),vF=An();WE.exports=yF&&vF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var so=X((Qet,XE)=>{"use strict";var _F=xi(),xF=String,EF=TypeError;XE.exports=function(n){if(_F(n))return n;throw new EF(xF(n)+" is not an object")}});var Wo=X($E=>{"use strict";var SF=ri(),wF=Jg(),MF=jg(),ch=so(),YE=ah(),bF=TypeError,Kg=Object.defineProperty,AF=Object.getOwnPropertyDescriptor,Qg="enumerable",tm="configurable",em="writable";$E.f=SF?MF?function(t,e,i){if(ch(t),e=YE(e),ch(i),typeof t=="function"&&e==="prototype"&&"value"in i&&em in i&&!i[em]){var s=AF(t,e);s&&s[em]&&(t[e]=i.value,i={configurable:tm in i?i[tm]:s[tm],enumerable:Qg in i?i[Qg]:s[Qg],writable:!1})}return Kg(t,e,i)}:Kg:function(t,e,i){if(ch(t),e=YE(e),ch(i),wF)try{return Kg(t,e,i)}catch(s){}if("get"in i||"set"in i)throw new bF("Accessors not supported");return"value"in i&&(t[e]=i.value),t}});var xs=X((ent,ZE)=>{"use strict";var TF=ri(),CF=Wo(),IF=wc();ZE.exports=TF?function(n,t,e){return CF.f(n,t,IF(1,e))}:function(n,t,e){return n[t]=e,n}});var fh=X((nnt,jE)=>{"use strict";var nm=ri(),PF=oo(),JE=Function.prototype,RF=nm&&Object.getOwnPropertyDescriptor,rm=PF(JE,"name"),LF=rm&&function(){}.name==="something",NF=rm&&(!nm||nm&&RF(JE,"name").configurable);jE.exports={EXISTS:rm,PROPER:LF,CONFIGURABLE:NF}});var om=X((rnt,KE)=>{"use strict";var OF=In(),DF=er(),im=ih(),FF=OF(Function.toString);DF(im.inspectSource)||(im.inspectSource=function(n){return FF(n)});KE.exports=im.inspectSource});var eS=X((int,tS)=>{"use strict";var UF=Sn(),BF=er(),QE=UF.WeakMap;tS.exports=BF(QE)&&/native code/.test(String(QE))});var hh=X((ont,rS)=>{"use strict";var zF=oh(),GF=sh(),nS=zF("keys");rS.exports=function(n){return nS[n]||(nS[n]=GF(n))}});var ph=X((snt,iS)=>{"use strict";iS.exports={}});var Va=X((ant,aS)=>{"use strict";var kF=eS(),sS=Sn(),qF=xi(),VF=xs(),sm=oo(),am=ih(),HF=hh(),WF=ph(),oS="Object already initialized",um=sS.TypeError,XF=sS.WeakMap,dh,Ic,gh,YF=function(n){return gh(n)?Ic(n):dh(n,{})},$F=function(n){return function(t){var e;if(!qF(t)||(e=Ic(t)).type!==n)throw new um("Incompatible receiver, "+n+" required");return e}};kF||am.state?(wo=am.state||(am.state=new XF),wo.get=wo.get,wo.has=wo.has,wo.set=wo.set,dh=function(n,t){if(wo.has(n))throw new um(oS);return t.facade=n,wo.set(n,t),t},Ic=function(n){return wo.get(n)||{}},gh=function(n){return wo.has(n)}):(qa=HF("state"),WF[qa]=!0,dh=function(n,t){if(sm(n,qa))throw new um(oS);return t.facade=n,VF(n,qa,t),t},Ic=function(n){return sm(n,qa)?n[qa]:{}},gh=function(n){return sm(n,qa)});var wo,qa;aS.exports={set:dh,get:Ic,has:gh,enforce:YF,getterFor:$F}});var fm=X((unt,cS)=>{"use strict";var cm=In(),ZF=An(),JF=er(),mh=oo(),lm=ri(),jF=fh().CONFIGURABLE,KF=om(),lS=Va(),QF=lS.enforce,tU=lS.get,uS=String,yh=Object.defineProperty,eU=cm("".slice),nU=cm("".replace),rU=cm([].join),iU=lm&&!ZF(function(){return yh(function(){},"length",{value:8}).length!==8}),oU=String(String).split("String"),sU=cS.exports=function(n,t,e){eU(uS(t),0,7)==="Symbol("&&(t="["+nU(uS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!mh(n,"name")||jF&&n.name!==t)&&(lm?yh(n,"name",{value:t,configurable:!0}):n.name=t),iU&&e&&mh(e,"arity")&&n.length!==e.arity&&yh(n,"length",{value:e.arity});try{e&&mh(e,"constructor")&&e.constructor?lm&&yh(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var i=QF(n);return mh(i,"source")||(i.source=rU(oU,typeof t=="string"?t:"")),n};Function.prototype.toString=sU(function(){return JF(this)&&tU(this).source||KF(this)},"toString")});var Ha=X((lnt,fS)=>{"use strict";var aU=er(),uU=Wo(),lU=fm(),cU=rh();fS.exports=function(n,t,e,i){i||(i={});var s=i.enumerable,u=i.name!==void 0?i.name:t;if(aU(e)&&lU(e,u,i),i.global)s?n[t]=e:cU(t,e);else{try{i.unsafe?n[t]&&(s=!0):delete n[t]}catch(c){}s?n[t]=e:uU.f(n,t,{value:e,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return n}});var pS=X((cnt,hS)=>{"use strict";var fU=Math.ceil,hU=Math.floor;hS.exports=Math.trunc||function(t){var e=+t;return(e>0?hU:fU)(e)}});var Hi=X((fnt,dS)=>{"use strict";var pU=pS();dS.exports=function(n){var t=+n;return t!==t||t===0?0:pU(t)}});var vh=X((hnt,gS)=>{"use strict";var dU=Hi(),gU=Math.max,mU=Math.min;gS.exports=function(n,t){var e=dU(n);return e<0?gU(e+t,0):mU(e,t)}});var Wa=X((pnt,mS)=>{"use strict";var yU=Hi(),vU=Math.min;mS.exports=function(n){var t=yU(n);return t>0?vU(t,9007199254740991):0}});var ii=X((dnt,yS)=>{"use strict";var _U=Wa();yS.exports=function(n){return _U(n.length)}});var xS=X((gnt,_S)=>{"use strict";var xU=Uu(),EU=vh(),SU=ii(),vS=function(n){return function(t,e,i){var s=xU(t),u=SU(s);if(u===0)return!n&&-1;var c=EU(i,u),f;if(n&&e!==e){for(;u>c;)if(f=s[c++],f!==f)return!0}else for(;u>c;c++)if((n||c in s)&&s[c]===e)return n||c||0;return!n&&-1}};_S.exports={includes:vS(!0),indexOf:vS(!1)}});var pm=X((mnt,SS)=>{"use strict";var wU=In(),hm=oo(),MU=Uu(),bU=xS().indexOf,AU=ph(),ES=wU([].push);SS.exports=function(n,t){var e=MU(n),i=0,s=[],u;for(u in e)!hm(AU,u)&&hm(e,u)&&ES(s,u);for(;t.length>i;)hm(e,u=t[i++])&&(~bU(s,u)||ES(s,u));return s}});var _h=X((ynt,wS)=>{"use strict";wS.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var dm=X(MS=>{"use strict";var TU=pm(),CU=_h(),IU=CU.concat("length","prototype");MS.f=Object.getOwnPropertyNames||function(t){return TU(t,IU)}});var AS=X(bS=>{"use strict";bS.f=Object.getOwnPropertySymbols});var CS=X((xnt,TS)=>{"use strict";var PU=$s(),RU=In(),LU=dm(),NU=AS(),OU=so(),DU=RU([].concat);TS.exports=PU("Reflect","ownKeys")||function(t){var e=LU.f(OU(t)),i=NU.f;return i?DU(e,i(t)):e}});var gm=X((Ent,PS)=>{"use strict";var IS=oo(),FU=CS(),UU=lh(),BU=Wo();PS.exports=function(n,t,e){for(var i=FU(t),s=BU.f,u=UU.f,c=0;c<i.length;c++){var f=i[c];!IS(n,f)&&!(e&&IS(e,f))&&s(n,f,u(t,f))}}});var LS=X((Snt,RS)=>{"use strict";var zU=An(),GU=er(),kU=/#|\\.prototype\\./,Pc=function(n,t){var e=VU[qU(n)];return e===WU?!0:e===HU?!1:GU(t)?zU(t):!!t},qU=Pc.normalize=function(n){return String(n).replace(kU,".").toLowerCase()},VU=Pc.data={},HU=Pc.NATIVE="N",WU=Pc.POLYFILL="P";RS.exports=Pc});var sr=X((wnt,NS)=>{"use strict";var xh=Sn(),XU=lh().f,YU=xs(),$U=Ha(),ZU=rh(),JU=gm(),jU=LS();NS.exports=function(n,t){var e=n.target,i=n.global,s=n.stat,u,c,f,p,d,g;if(i?c=xh:s?c=xh[e]||ZU(e,{}):c=xh[e]&&xh[e].prototype,c)for(f in t){if(d=t[f],n.dontCallGetSet?(g=XU(c,f),p=g&&g.value):p=c[f],u=jU(i?f:e+(s?".":"#")+f,n.forced),!u&&p!==void 0){if(typeof d==typeof p)continue;JU(d,p)}(n.sham||p&&p.sham)&&YU(d,"sham",!0),$U(c,f,d,n)}}});var Rc=X((Mnt,OS)=>{"use strict";var KU=vs();OS.exports=Array.isArray||function(t){return KU(t)==="Array"}});var mm=X((bnt,DS)=>{"use strict";var QU=ri(),tB=Rc(),eB=TypeError,nB=Object.getOwnPropertyDescriptor,rB=QU&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();DS.exports=rB?function(n,t){if(tB(n)&&!nB(n,"length").writable)throw new eB("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var Eh=X((Ant,FS)=>{"use strict";var iB=TypeError,oB=9007199254740991;FS.exports=function(n){if(n>oB)throw iB("Maximum allowed index exceeded");return n}});var Sh=X(()=>{"use strict";var sB=sr(),aB=Vi(),uB=ii(),lB=mm(),cB=Eh(),fB=An(),hB=fB(function(){return[].push.call({length:4294967296},1)!==4294967297}),pB=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},dB=hB||!pB();sB({target:"Array",proto:!0,arity:1,forced:dB},{push:function(t){var e=aB(this),i=uB(e),s=arguments.length;cB(i+s);for(var u=0;u<s;u++)e[i]=arguments[u],i++;return lB(e,i),i}})});var US=X(()=>{"use strict";var gB=sr(),mB=vr();gB({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return mB(URL.prototype.toString,this)}})});var zS=X((Rnt,BS)=>{"use strict";BS.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}});var qS=X((Lnt,kS)=>{"use strict";var yB=uh(),ym=yB("span").classList,GS=ym&&ym.constructor&&ym.constructor.prototype;kS.exports=GS===Object.prototype?void 0:GS});var HS=X((Nnt,VS)=>{"use strict";var vB=pm(),_B=_h();VS.exports=Object.keys||function(t){return vB(t,_B)}});var XS=X(WS=>{"use strict";var xB=ri(),EB=jg(),SB=Wo(),wB=so(),MB=Uu(),bB=HS();WS.f=xB&&!EB?Object.defineProperties:function(t,e){wB(t);for(var i=MB(e),s=bB(e),u=s.length,c=0,f;u>c;)SB.f(t,f=s[c++],i[f]);return t}});var $S=X((Dnt,YS)=>{"use strict";var AB=$s();YS.exports=AB("document","documentElement")});var ku=X((Fnt,ew)=>{"use strict";var TB=so(),CB=XS(),ZS=_h(),IB=ph(),PB=$S(),RB=uh(),LB=hh(),JS=">",jS="<",_m="prototype",xm="script",QS=LB("IE_PROTO"),vm=function(){},tw=function(n){return jS+xm+JS+n+jS+"/"+xm+JS},KS=function(n){n.write(tw("")),n.close();var t=n.parentWindow.Object;return n=null,t},NB=function(){var n=RB("iframe"),t="java"+xm+":",e;return n.style.display="none",PB.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(tw("document.F=Object")),e.close(),e.F},wh,Mh=function(){try{wh=new ActiveXObject("htmlfile")}catch(t){}Mh=typeof document!="undefined"?document.domain&&wh?KS(wh):NB():KS(wh);for(var n=ZS.length;n--;)delete Mh[_m][ZS[n]];return Mh()};IB[QS]=!0;ew.exports=Object.create||function(t,e){var i;return t!==null?(vm[_m]=TB(t),i=new vm,vm[_m]=null,i[QS]=t):i=Mh(),e===void 0?i:CB.f(i,e)}});var wm=X((Unt,nw)=>{"use strict";var OB=Xr(),DB=ku(),FB=Wo().f,Em=OB("unscopables"),Sm=Array.prototype;Sm[Em]===void 0&&FB(Sm,Em,{configurable:!0,value:DB(null)});nw.exports=function(n){Sm[Em][n]=!0}});var qu=X((Bnt,rw)=>{"use strict";rw.exports={}});var ow=X((znt,iw)=>{"use strict";var UB=An();iw.exports=!UB(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var Lc=X((Gnt,aw)=>{"use strict";var BB=oo(),zB=er(),GB=Vi(),kB=hh(),qB=ow(),sw=kB("IE_PROTO"),Mm=Object,VB=Mm.prototype;aw.exports=qB?Mm.getPrototypeOf:function(n){var t=GB(n);if(BB(t,sw))return t[sw];var e=t.constructor;return zB(e)&&t instanceof e?e.prototype:t instanceof Mm?VB:null}});var Cm=X((knt,cw)=>{"use strict";var HB=An(),WB=er(),XB=xi(),YB=ku(),uw=Lc(),$B=Ha(),ZB=Xr(),JB=Cc(),Tm=ZB("iterator"),lw=!1,Es,bm,Am;[].keys&&(Am=[].keys(),"next"in Am?(bm=uw(uw(Am)),bm!==Object.prototype&&(Es=bm)):lw=!0);var jB=!XB(Es)||HB(function(){var n={};return Es[Tm].call(n)!==n});jB?Es={}:JB&&(Es=YB(Es));WB(Es[Tm])||$B(Es,Tm,function(){return this});cw.exports={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:lw}});var Nc=X((qnt,hw)=>{"use strict";var KB=Wo().f,QB=oo(),tz=Xr(),fw=tz("toStringTag");hw.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!QB(n,fw)&&KB(n,fw,{configurable:!0,value:t})}});var dw=X((Vnt,pw)=>{"use strict";var ez=Cm().IteratorPrototype,nz=ku(),rz=wc(),iz=Nc(),oz=qu(),sz=function(){return this};pw.exports=function(n,t,e,i){var s=t+" Iterator";return n.prototype=nz(ez,{next:rz(+!i,e)}),iz(n,s,!1,!0),oz[s]=sz,n}});var Oc=X((Hnt,gw)=>{"use strict";var az=In(),uz=_s();gw.exports=function(n,t,e){try{return az(uz(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(i){}}});var yw=X((Wnt,mw)=>{"use strict";var lz=xi();mw.exports=function(n){return lz(n)||n===null}});var _w=X((Xnt,vw)=>{"use strict";var cz=yw(),fz=String,hz=TypeError;vw.exports=function(n){if(cz(n))return n;throw new hz("Can't set "+fz(n)+" as a prototype")}});var Vu=X((Ynt,xw)=>{"use strict";var pz=Oc(),dz=xi(),gz=Fu(),mz=_w();xw.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=pz(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(i){}return function(s,u){return gz(s),mz(u),dz(s)&&(n?e(s,u):s.__proto__=u),s}}():void 0)});var Rw=X(($nt,Pw)=>{"use strict";var yz=sr(),vz=vr(),bh=Cc(),Cw=fh(),_z=er(),xz=dw(),Ew=Lc(),Sw=Vu(),Ez=Nc(),Sz=xs(),Im=Ha(),wz=Xr(),ww=qu(),Iw=Cm(),Mz=Cw.PROPER,bz=Cw.CONFIGURABLE,Mw=Iw.IteratorPrototype,Ah=Iw.BUGGY_SAFARI_ITERATORS,Dc=wz("iterator"),bw="keys",Fc="values",Aw="entries",Tw=function(){return this};Pw.exports=function(n,t,e,i,s,u,c){xz(e,t,i);var f=function(x){if(x===s&&v)return v;if(!Ah&&x&&x in g)return g[x];switch(x){case bw:return function(){return new e(this,x)};case Fc:return function(){return new e(this,x)};case Aw:return function(){return new e(this,x)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=n.prototype,y=g[Dc]||g["@@iterator"]||s&&g[s],v=!Ah&&y||f(s),E=t==="Array"&&g.entries||y,M,A,_;if(E&&(M=Ew(E.call(new n)),M!==Object.prototype&&M.next&&(!bh&&Ew(M)!==Mw&&(Sw?Sw(M,Mw):_z(M[Dc])||Im(M,Dc,Tw)),Ez(M,p,!0,!0),bh&&(ww[p]=Tw))),Mz&&s===Fc&&y&&y.name!==Fc&&(!bh&&bz?Sz(g,"name",Fc):(d=!0,v=function(){return vz(y,this)})),s)if(A={values:f(Fc),keys:u?v:f(bw),entries:f(Aw)},c)for(_ in A)(Ah||d||!(_ in g))&&Im(g,_,A[_]);else yz({target:t,proto:!0,forced:Ah||d},A);return(!bh||c)&&g[Dc]!==v&&Im(g,Dc,v,{name:s}),ww[t]=v,A}});var Nw=X((Znt,Lw)=>{"use strict";Lw.exports=function(n,t){return{value:n,done:t}}});var zw=X((Jnt,Bw)=>{"use strict";var Az=Uu(),Pm=wm(),Ow=qu(),Fw=Va(),Tz=Wo().f,Cz=Rw(),Th=Nw(),Iz=Cc(),Pz=ri(),Uw="Array Iterator",Rz=Fw.set,Lz=Fw.getterFor(Uw);Bw.exports=Cz(Array,"Array",function(n,t){Rz(this,{type:Uw,target:Az(n),index:0,kind:t})},function(){var n=Lz(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Th(void 0,!0);switch(n.kind){case"keys":return Th(e,!1);case"values":return Th(t[e],!1)}return Th([e,t[e]],!1)},"values");var Dw=Ow.Arguments=Ow.Array;Pm("keys");Pm("values");Pm("entries");if(!Iz&&Pz&&Dw.name!=="values")try{Tz(Dw,"name",{value:"values"})}catch(n){}});var Bc=X(()=>{"use strict";var Gw=Sn(),qw=zS(),Nz=qS(),Uc=zw(),kw=xs(),Oz=Nc(),Dz=Xr(),Rm=Dz("iterator"),Lm=Uc.values,Vw=function(n,t){if(n){if(n[Rm]!==Lm)try{kw(n,Rm,Lm)}catch(i){n[Rm]=Lm}if(Oz(n,t,!0),qw[t]){for(var e in Uc)if(n[e]!==Uc[e])try{kw(n,e,Uc[e])}catch(i){n[e]=Uc[e]}}}};for(Ch in qw)Vw(Gw[Ch]&&Gw[Ch].prototype,Ch);var Ch;Vw(Nz,"DOMTokenList")});var Ih=X((Qnt,Hw)=>{"use strict";var Fz=vs(),Uz=In();Hw.exports=function(n){if(Fz(n)==="Function")return Uz(n)}});var zc=X((trt,Xw)=>{"use strict";var Ww=Ih(),Bz=_s(),zz=Sc(),Gz=Ww(Ww.bind);Xw.exports=function(n,t){return Bz(n),t===void 0?n:zz?Gz(n,t):function(){return n.apply(t,arguments)}}});var Zw=X((ert,$w)=>{"use strict";var kz=Rc(),qz=ii(),Vz=Eh(),Hz=zc(),Yw=function(n,t,e,i,s,u,c,f){for(var p=s,d=0,g=c?Hz(c,f):!1,y,v;d<i;)d in e&&(y=g?g(e[d],d,t):e[d],u>0&&kz(y)?(v=qz(y),p=Yw(n,t,y,v,p,u-1)-1):(Vz(p+1),n[p]=y),p++),d++;return p};$w.exports=Yw});var Kw=X((nrt,jw)=>{"use strict";var Wz=Xr(),Xz=Wz("toStringTag"),Jw={};Jw[Xz]="z";jw.exports=String(Jw)==="[object z]"});var Zs=X((rrt,Qw)=>{"use strict";var Yz=Kw(),$z=er(),Ph=vs(),Zz=Xr(),Jz=Zz("toStringTag"),jz=Object,Kz=Ph(function(){return arguments}())==="Arguments",Qz=function(n,t){try{return n[t]}catch(e){}};Qw.exports=Yz?Ph:function(n){var t,e,i;return n===void 0?"Undefined":n===null?"Null":typeof(e=Qz(t=jz(n),Jz))=="string"?e:Kz?Ph(t):(i=Ph(t))==="Object"&&$z(t.callee)?"Arguments":i}});var Om=X((irt,iM)=>{"use strict";var tG=In(),eG=An(),tM=er(),nG=Zs(),rG=$s(),iG=om(),eM=function(){},nM=rG("Reflect","construct"),Nm=/^\\s*(?:class|function)\\b/,oG=tG(Nm.exec),sG=!Nm.test(eM),Gc=function(t){if(!tM(t))return!1;try{return nM(eM,[],t),!0}catch(e){return!1}},rM=function(t){if(!tM(t))return!1;switch(nG(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sG||!!oG(Nm,iG(t))}catch(e){return!0}};rM.sham=!0;iM.exports=!nM||eG(function(){var n;return Gc(Gc.call)||!Gc(Object)||!Gc(function(){n=!0})||n})?rM:Gc});var uM=X((ort,aM)=>{"use strict";var oM=Rc(),aG=Om(),uG=xi(),lG=Xr(),cG=lG("species"),sM=Array;aM.exports=function(n){var t;return oM(n)&&(t=n.constructor,aG(t)&&(t===sM||oM(t.prototype))?t=void 0:uG(t)&&(t=t[cG],t===null&&(t=void 0))),t===void 0?sM:t}});var Dm=X((srt,lM)=>{"use strict";var fG=uM();lM.exports=function(n,t){return new(fG(n))(t===0?0:t)}});var cM=X(()=>{"use strict";var hG=sr(),pG=Zw(),dG=Vi(),gG=ii(),mG=Hi(),yG=Dm();hG({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=dG(this),i=gG(e),s=yG(e,0);return s.length=pG(s,e,e,i,0,t===void 0?1:mG(t)),s}})});var fM=X(()=>{"use strict";var vG=wm();vG("flat")});var mM=X((frt,gM)=>{"use strict";var _G=Xr(),pM=_G("iterator"),dM=!1;try{hM=0,Fm={next:function(){return{done:!!hM++}},return:function(){dM=!0}},Fm[pM]=function(){return this},Array.from(Fm,function(){throw 2})}catch(n){}var hM,Fm;gM.exports=function(n,t){try{if(!t&&!dM)return!1}catch(s){return!1}var e=!1;try{var i={};i[pM]=function(){return{next:function(){return{done:e=!0}}}},n(i)}catch(s){}return e}});var Rh=X((hrt,yM)=>{"use strict";yM.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var Hu=X((prt,_M)=>{"use strict";var vM=fm(),xG=Wo();_M.exports=function(n,t,e){return e.get&&vM(e.get,t,{getter:!0}),e.set&&vM(e.set,t,{setter:!0}),xG.f(n,t,e)}});var Wi=X((drt,IM)=>{"use strict";var EG=Rh(),Gm=ri(),Ei=Sn(),wM=er(),Oh=xi(),js=oo(),km=Zs(),SG=zu(),wG=xs(),Um=Ha(),MG=Hu(),bG=Mc(),Dh=Lc(),Xu=Vu(),AG=Xr(),TG=sh(),MM=Va(),bM=MM.enforce,CG=MM.get,Lh=Ei.Int8Array,Bm=Lh&&Lh.prototype,xM=Ei.Uint8ClampedArray,EM=xM&&xM.prototype,Xo=Lh&&Dh(Lh),Mo=Bm&&Dh(Bm),IG=Object.prototype,qm=Ei.TypeError,SM=AG("toStringTag"),zm=TG("TYPED_ARRAY_TAG"),Nh="TypedArrayConstructor",Ss=EG&&!!Xu&&km(Ei.opera)!=="Opera",AM=!1,Li,Js,Wu,ws={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vm={BigInt64Array:8,BigUint64Array:8},PG=function(t){if(!Oh(t))return!1;var e=km(t);return e==="DataView"||js(ws,e)||js(Vm,e)},TM=function(n){var t=Dh(n);if(Oh(t)){var e=CG(t);return e&&js(e,Nh)?e[Nh]:TM(t)}},CM=function(n){if(!Oh(n))return!1;var t=km(n);return js(ws,t)||js(Vm,t)},RG=function(n){if(CM(n))return n;throw new qm("Target is not a typed array")},LG=function(n){if(wM(n)&&(!Xu||bG(Xo,n)))return n;throw new qm(SG(n)+" is not a typed array constructor")},NG=function(n,t,e,i){if(Gm){if(e)for(var s in ws){var u=Ei[s];if(u&&js(u.prototype,n))try{delete u.prototype[n]}catch(c){try{u.prototype[n]=t}catch(f){}}}(!Mo[n]||e)&&Um(Mo,n,e?t:Ss&&Bm[n]||t,i)}},OG=function(n,t,e){var i,s;if(Gm){if(Xu){if(e){for(i in ws)if(s=Ei[i],s&&js(s,n))try{delete s[n]}catch(u){}}if(!Xo[n]||e)try{return Um(Xo,n,e?t:Ss&&Xo[n]||t)}catch(u){}else return}for(i in ws)s=Ei[i],s&&(!s[n]||e)&&Um(s,n,t)}};for(Li in ws)Js=Ei[Li],Wu=Js&&Js.prototype,Wu?bM(Wu)[Nh]=Js:Ss=!1;for(Li in Vm)Js=Ei[Li],Wu=Js&&Js.prototype,Wu&&(bM(Wu)[Nh]=Js);if((!Ss||!wM(Xo)||Xo===Function.prototype)&&(Xo=function(){throw new qm("Incorrect invocation")},Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li],Xo);if((!Ss||!Mo||Mo===IG)&&(Mo=Xo.prototype,Ss))for(Li in ws)Ei[Li]&&Xu(Ei[Li].prototype,Mo);Ss&&Dh(EM)!==Mo&&Xu(EM,Mo);if(Gm&&!js(Mo,SM)){AM=!0,MG(Mo,SM,{configurable:!0,get:function(){return Oh(this)?this[zm]:void 0}});for(Li in ws)Ei[Li]&&wG(Ei[Li],zm,Li)}IM.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ss,TYPED_ARRAY_TAG:AM&&zm,aTypedArray:RG,aTypedArrayConstructor:LG,exportTypedArrayMethod:NG,exportTypedArrayStaticMethod:OG,getTypedArrayConstructor:TM,isView:PG,isTypedArray:CM,TypedArray:Xo,TypedArrayPrototype:Mo}});var LM=X((grt,RM)=>{"use strict";var PM=Sn(),Hm=An(),DG=mM(),FG=Wi().NATIVE_ARRAY_BUFFER_VIEWS,UG=PM.ArrayBuffer,Xa=PM.Int8Array;RM.exports=!FG||!Hm(function(){Xa(1)})||!Hm(function(){new Xa(-1)})||!DG(function(n){new Xa,new Xa(null),new Xa(1.5),new Xa(n)},!0)||Hm(function(){return new Xa(new UG(2),1,void 0).length!==1})});var OM=X((mrt,NM)=>{"use strict";var BG=Ha();NM.exports=function(n,t,e){for(var i in t)BG(n,i,t[i],e);return n}});var Wm=X((yrt,DM)=>{"use strict";var zG=Mc(),GG=TypeError;DM.exports=function(n,t){if(zG(t,n))return n;throw new GG("Incorrect invocation")}});var Fh=X((vrt,FM)=>{"use strict";var kG=Hi(),qG=Wa(),VG=RangeError;FM.exports=function(n){if(n===void 0)return 0;var t=kG(n),e=qG(t);if(t!==e)throw new VG("Wrong length or index");return e}});var BM=X((_rt,UM)=>{"use strict";UM.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var kM=X((xrt,GM)=>{"use strict";var HG=2220446049250313e-31,zM=1/HG;GM.exports=function(n){return n+zM-zM}});var VM=X((Ert,qM)=>{"use strict";var WG=BM(),XG=kM(),YG=Math.abs,$G=2220446049250313e-31;qM.exports=function(n,t,e,i){var s=+n,u=YG(s),c=WG(s);if(u<i)return c*XG(u/i/t)*i*t;var f=(1+t/$G)*u,p=f-(f-u);return p>e||p!==p?c*(1/0):c*p}});var WM=X((Srt,HM)=>{"use strict";var ZG=VM(),JG=11920928955078125e-23,jG=34028234663852886e22,KG=11754943508222875e-54;HM.exports=Math.fround||function(t){return ZG(t,JG,jG,KG)}});var YM=X((wrt,XM)=>{"use strict";var QG=Array,t4=Math.abs,Ms=Math.pow,e4=Math.floor,n4=Math.log,r4=Math.LN2,i4=function(n,t,e){var i=QG(e),s=e*8-t-1,u=(1<<s)-1,c=u>>1,f=t===23?Ms(2,-24)-Ms(2,-77):0,p=n<0||n===0&&1/n<0?1:0,d=0,g,y,v;for(n=t4(n),n!==n||n===1/0?(y=n!==n?1:0,g=u):(g=e4(n4(n)/r4),v=Ms(2,-g),n*v<1&&(g--,v*=2),g+c>=1?n+=f/v:n+=f*Ms(2,1-c),n*v>=2&&(g++,v/=2),g+c>=u?(y=0,g=u):g+c>=1?(y=(n*v-1)*Ms(2,t),g+=c):(y=n*Ms(2,c-1)*Ms(2,t),g=0));t>=8;)i[d++]=y&255,y/=256,t-=8;for(g=g<<t|y,s+=t;s>0;)i[d++]=g&255,g/=256,s-=8;return i[d-1]|=p*128,i},o4=function(n,t){var e=n.length,i=e*8-t-1,s=(1<<i)-1,u=s>>1,c=i-7,f=e-1,p=n[f--],d=p&127,g;for(p>>=7;c>0;)d=d*256+n[f--],c-=8;for(g=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)g=g*256+n[f--],c-=8;if(d===0)d=1-u;else{if(d===s)return g?NaN:p?-1/0:1/0;g+=Ms(2,t),d-=u}return(p?-1:1)*g*Ms(2,d-t)};XM.exports={pack:i4,unpack:o4}});var Xm=X((Mrt,ZM)=>{"use strict";var s4=Vi(),$M=vh(),a4=ii();ZM.exports=function(t){for(var e=s4(this),i=a4(e),s=arguments.length,u=$M(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,f=c===void 0?i:$M(c,i);f>u;)e[u++]=t;return e}});var Uh=X((brt,JM)=>{"use strict";var u4=In();JM.exports=u4([].slice)});var Ym=X((Art,KM)=>{"use strict";var l4=er(),c4=xi(),jM=Vu();KM.exports=function(n,t,e){var i,s;return jM&&l4(i=t.constructor)&&i!==e&&c4(s=i.prototype)&&s!==e.prototype&&jM(n,s),n}});var Hh=X((Trt,gb)=>{"use strict";var qh=Sn(),Km=In(),$m=ri(),f4=Rh(),cb=fh(),h4=xs(),p4=Hu(),QM=OM(),Zm=An(),Bh=Wm(),d4=Hi(),g4=Wa(),Gh=Fh(),m4=WM(),fb=YM(),y4=Lc(),tb=Vu(),v4=Xm(),_4=Uh(),x4=Ym(),E4=gm(),hb=Nc(),Qm=Va(),S4=cb.PROPER,eb=cb.CONFIGURABLE,$u="ArrayBuffer",Vh="DataView",Zu="prototype",w4="Wrong length",pb="Wrong index",nb=Qm.getterFor($u),qc=Qm.getterFor(Vh),rb=Qm.set,bo=qh[$u],Xi=bo,Yu=Xi&&Xi[Zu],Yo=qh[Vh],Ya=Yo&&Yo[Zu],ib=Object.prototype,M4=qh.Array,kh=qh.RangeError,b4=Km(v4),A4=Km([].reverse),db=fb.pack,ob=fb.unpack,sb=function(n){return[n&255]},ab=function(n){return[n&255,n>>8&255]},ub=function(n){return[n&255,n>>8&255,n>>16&255,n>>24&255]},lb=function(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]},T4=function(n){return db(m4(n),23,4)},C4=function(n){return db(n,52,8)},zh=function(n,t,e){p4(n[Zu],t,{configurable:!0,get:function(){return e(this)[t]}})},Ks=function(n,t,e,i){var s=qc(n),u=Gh(e),c=!!i;if(u+t>s.byteLength)throw new kh(pb);var f=s.bytes,p=u+s.byteOffset,d=_4(f,p,p+t);return c?d:A4(d)},Qs=function(n,t,e,i,s,u){var c=qc(n),f=Gh(e),p=i(+s),d=!!u;if(f+t>c.byteLength)throw new kh(pb);for(var g=c.bytes,y=f+c.byteOffset,v=0;v<t;v++)g[y+v]=p[d?v:t-v-1]};f4?(Jm=S4&&bo.name!==$u,!Zm(function(){bo(1)})||!Zm(function(){new bo(-1)})||Zm(function(){return new bo,new bo(1.5),new bo(NaN),bo.length!==1||Jm&&!eb})?(Xi=function(t){return Bh(this,Yu),x4(new bo(Gh(t)),this,Xi)},Xi[Zu]=Yu,Yu.constructor=Xi,E4(Xi,bo)):Jm&&eb&&h4(bo,"name",$u),tb&&y4(Ya)!==ib&&tb(Ya,ib),kc=new Yo(new Xi(2)),jm=Km(Ya.setInt8),kc.setInt8(0,2147483648),kc.setInt8(1,2147483649),(kc.getInt8(0)||!kc.getInt8(1))&&QM(Ya,{setInt8:function(t,e){jm(this,t,e<<24>>24)},setUint8:function(t,e){jm(this,t,e<<24>>24)}},{unsafe:!0})):(Xi=function(t){Bh(this,Yu);var e=Gh(t);rb(this,{type:$u,bytes:b4(M4(e),0),byteLength:e}),$m||(this.byteLength=e,this.detached=!1)},Yu=Xi[Zu],Yo=function(t,e,i){Bh(this,Ya),Bh(t,Yu);var s=nb(t),u=s.byteLength,c=d4(e);if(c<0||c>u)throw new kh("Wrong offset");if(i=i===void 0?u-c:g4(i),c+i>u)throw new kh(w4);rb(this,{type:Vh,buffer:t,byteLength:i,byteOffset:c,bytes:s.bytes}),$m||(this.buffer=t,this.byteLength=i,this.byteOffset=c)},Ya=Yo[Zu],$m&&(zh(Xi,"byteLength",nb),zh(Yo,"buffer",qc),zh(Yo,"byteLength",qc),zh(Yo,"byteOffset",qc)),QM(Ya,{getInt8:function(t){return Ks(this,1,t)[0]<<24>>24},getUint8:function(t){return Ks(this,1,t)[0]},getInt16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Ks(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return lb(Ks(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return ob(Ks(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return ob(Ks(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Qs(this,1,t,sb,e)},setUint8:function(t,e){Qs(this,1,t,sb,e)},setInt16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Qs(this,2,t,ab,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Qs(this,4,t,ub,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Qs(this,4,t,T4,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Qs(this,8,t,C4,e,arguments.length>2?arguments[2]:!1)}}));var Jm,kc,jm;hb(Xi,$u);hb(Yo,Vh);gb.exports={ArrayBuffer:Xi,DataView:Yo}});var yb=X((Crt,mb)=>{"use strict";var I4=xi(),P4=Math.floor;mb.exports=Number.isInteger||function(t){return!I4(t)&&isFinite(t)&&P4(t)===t}});var _b=X((Irt,vb)=>{"use strict";var R4=Hi(),L4=RangeError;vb.exports=function(n){var t=R4(n);if(t<0)throw new L4("The argument can't be less than 0");return t}});var t0=X((Prt,xb)=>{"use strict";var N4=_b(),O4=RangeError;xb.exports=function(n,t){var e=N4(n);if(e%t)throw new O4("Wrong offset");return e}});var Sb=X((Rrt,Eb)=>{"use strict";var D4=Math.round;Eb.exports=function(n){var t=D4(n);return t<0?0:t>255?255:t&255}});var Mb=X((Lrt,wb)=>{"use strict";var F4=Om(),U4=zu(),B4=TypeError;wb.exports=function(n){if(F4(n))return n;throw new B4(U4(n)+" is not a constructor")}});var e0=X((Nrt,Ab)=>{"use strict";var z4=Zs(),bb=Tc(),G4=th(),k4=qu(),q4=Xr(),V4=q4("iterator");Ab.exports=function(n){if(!G4(n))return bb(n,V4)||bb(n,"@@iterator")||k4[z4(n)]}});var Cb=X((Ort,Tb)=>{"use strict";var H4=vr(),W4=_s(),X4=so(),Y4=zu(),$4=e0(),Z4=TypeError;Tb.exports=function(n,t){var e=arguments.length<2?$4(n):t;if(W4(e))return X4(H4(e,n));throw new Z4(Y4(n)+" is not iterable")}});var Pb=X((Drt,Ib)=>{"use strict";var J4=Xr(),j4=qu(),K4=J4("iterator"),Q4=Array.prototype;Ib.exports=function(n){return n!==void 0&&(j4.Array===n||Q4[K4]===n)}});var n0=X((Frt,Rb)=>{"use strict";var tk=Zs();Rb.exports=function(n){var t=tk(n);return t==="BigInt64Array"||t==="BigUint64Array"}});var Wh=X((Urt,Lb)=>{"use strict";var ek=$g(),nk=TypeError;Lb.exports=function(n){var t=ek(n,"number");if(typeof t=="number")throw new nk("Can't convert number to bigint");return BigInt(t)}});var Ob=X((Brt,Nb)=>{"use strict";var rk=zc(),ik=vr(),ok=Mb(),sk=Vi(),ak=ii(),uk=Cb(),lk=e0(),ck=Pb(),fk=n0(),hk=Wi().aTypedArrayConstructor,pk=Wh();Nb.exports=function(t){var e=ok(this),i=sk(t),s=arguments.length,u=s>1?arguments[1]:void 0,c=u!==void 0,f=lk(i),p,d,g,y,v,E,M,A;if(f&&!ck(f))for(M=uk(i,f),A=M.next,i=[];!(E=ik(A,M)).done;)i.push(E.value);for(c&&s>2&&(u=rk(u,arguments[2])),d=ak(i),g=new(hk(e))(d),y=fk(g),p=0;d>p;p++)v=c?u(i[p],p):i[p],g[p]=y?pk(v):+v;return g}});var Ub=X((zrt,Fb)=>{"use strict";var dk=zc(),gk=In(),mk=Qf(),yk=Vi(),vk=ii(),_k=Dm(),Db=gk([].push),ta=function(n){var t=n===1,e=n===2,i=n===3,s=n===4,u=n===6,c=n===7,f=n===5||u;return function(p,d,g,y){for(var v=yk(p),E=mk(v),M=vk(E),A=dk(d,g),_=0,x=y||_k,T=t?x(p,M):e||c?x(p,0):void 0,w,R;M>_;_++)if((f||_ in E)&&(w=E[_],R=A(w,_,v),n))if(t)T[_]=R;else if(R)switch(n){case 3:return!0;case 5:return w;case 6:return _;case 2:Db(T,w)}else switch(n){case 4:return!1;case 7:Db(T,w)}return u?-1:i||s?s:T}};Fb.exports={forEach:ta(0),map:ta(1),filter:ta(2),some:ta(3),every:ta(4),find:ta(5),findIndex:ta(6),filterReject:ta(7)}});var r0=X((Grt,zb)=>{"use strict";var xk=$s(),Ek=Hu(),Sk=Xr(),wk=ri(),Bb=Sk("species");zb.exports=function(n){var t=xk(n);wk&&t&&!t[Bb]&&Ek(t,Bb,{configurable:!0,get:function(){return this}})}});var i0=X((krt,Gb)=>{"use strict";var Mk=ii();Gb.exports=function(n,t,e){for(var i=0,s=arguments.length>2?e:Mk(t),u=new n(s);s>i;)u[i]=t[i++];return u}});var sA=X((qrt,f0)=>{"use strict";var kb=sr(),Kb=Sn(),qb=vr(),bk=ri(),Ak=LM(),Xc=Wi(),Qb=Hh(),Vb=Wm(),Tk=wc(),Vc=xs(),Ck=yb(),Ik=Wa(),Hb=Fh(),o0=t0(),Pk=Sb(),tA=ah(),Hc=oo(),Rk=Zs(),u0=xi(),Lk=Ac(),Nk=ku(),Ok=Mc(),Xh=Vu(),Dk=dm().f,Wb=Ob(),Fk=Ub().forEach,Uk=r0(),Bk=Hu(),eA=Wo(),nA=lh(),Xb=i0(),h0=Va(),zk=Ym(),l0=h0.get,Gk=h0.set,kk=h0.enforce,rA=eA.f,qk=nA.f,s0=Kb.RangeError,iA=Qb.ArrayBuffer,Vk=iA.prototype,Hk=Qb.DataView,Yh=Xc.NATIVE_ARRAY_BUFFER_VIEWS,Yb=Xc.TYPED_ARRAY_TAG,$b=Xc.TypedArray,Wc=Xc.TypedArrayPrototype,c0=Xc.isTypedArray,$h="BYTES_PER_ELEMENT",a0="Wrong length",Zh=function(n,t){Bk(n,t,{configurable:!0,get:function(){return l0(this)[t]}})},Zb=function(n){var t;return Ok(Vk,n)||(t=Rk(n))==="ArrayBuffer"||t==="SharedArrayBuffer"},oA=function(n,t){return c0(n)&&!Lk(t)&&t in n&&Ck(+t)&&t>=0},Jb=function(t,e){return e=tA(e),oA(t,e)?Tk(2,t[e]):qk(t,e)},jb=function(t,e,i){return e=tA(e),oA(t,e)&&u0(i)&&Hc(i,"value")&&!Hc(i,"get")&&!Hc(i,"set")&&!i.configurable&&(!Hc(i,"writable")||i.writable)&&(!Hc(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):rA(t,e,i)};bk?(Yh||(nA.f=Jb,eA.f=jb,Zh(Wc,"buffer"),Zh(Wc,"byteOffset"),Zh(Wc,"byteLength"),Zh(Wc,"length")),kb({target:"Object",stat:!0,forced:!Yh},{getOwnPropertyDescriptor:Jb,defineProperty:jb}),f0.exports=function(n,t,e){var i=n.match(/\\d+/)[0]/8,s=n+(e?"Clamped":"")+"Array",u="get"+n,c="set"+n,f=Kb[s],p=f,d=p&&p.prototype,g={},y=function(A,_){var x=l0(A);return x.view[u](_*i+x.byteOffset,!0)},v=function(A,_,x){var T=l0(A);T.view[c](_*i+T.byteOffset,e?Pk(x):x,!0)},E=function(A,_){rA(A,_,{get:function(){return y(this,_)},set:function(x){return v(this,_,x)},enumerable:!0})};Yh?Ak&&(p=t(function(A,_,x,T){return Vb(A,d),zk(function(){return u0(_)?Zb(_)?T!==void 0?new f(_,o0(x,i),T):x!==void 0?new f(_,o0(x,i)):new f(_):c0(_)?Xb(p,_):qb(Wb,p,_):new f(Hb(_))}(),A,p)}),Xh&&Xh(p,$b),Fk(Dk(f),function(A){A in p||Vc(p,A,f[A])}),p.prototype=d):(p=t(function(A,_,x,T){Vb(A,d);var w=0,R=0,B,U,D;if(!u0(_))D=Hb(_),U=D*i,B=new iA(U);else if(Zb(_)){B=_,R=o0(x,i);var P=_.byteLength;if(T===void 0){if(P%i)throw new s0(a0);if(U=P-R,U<0)throw new s0(a0)}else if(U=Ik(T)*i,U+R>P)throw new s0(a0);D=U/i}else return c0(_)?Xb(p,_):qb(Wb,p,_);for(Gk(A,{buffer:B,byteOffset:R,byteLength:U,length:D,view:new Hk(B)});w<D;)E(A,w++)}),Xh&&Xh(p,$b),d=p.prototype=Nk(Wc)),d.constructor!==p&&Vc(d,"constructor",p),kk(d).TypedArrayConstructor=p,Yb&&Vc(d,Yb,s);var M=p!==f;g[s]=p,kb({global:!0,constructor:!0,forced:M,sham:!Yh},g),$h in p||Vc(p,$h,i),$h in d||Vc(d,$h,i),Uk(s)}):f0.exports=function(){}});var p0=X(()=>{"use strict";var Wk=sA();Wk("Float32",function(n){return function(e,i,s){return n(this,e,i,s)}})});var d0=X(()=>{"use strict";var aA=Wi(),Xk=ii(),Yk=Hi(),$k=aA.aTypedArray,Zk=aA.exportTypedArrayMethod;Zk("at",function(t){var e=$k(this),i=Xk(e),s=Yk(t),u=s>=0?s:i+s;return u<0||u>=i?void 0:e[u]})});var g0=X(()=>{"use strict";var uA=Wi(),Jk=Xm(),jk=Wh(),Kk=Zs(),Qk=vr(),tq=In(),eq=An(),nq=uA.aTypedArray,rq=uA.exportTypedArrayMethod,iq=tq("".slice),oq=eq(function(){var n=0;return new Int8Array(2).fill({valueOf:function(){return n++}}),n!==1});rq("fill",function(t){var e=arguments.length;nq(this);var i=iq(Kk(this),0,3)==="Big"?jk(t):+t;return Qk(Jk,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},oq)});var m0=X((Zrt,cA)=>{"use strict";var sq=zc(),aq=Qf(),uq=Vi(),lq=ii(),lA=function(n){var t=n===1;return function(e,i,s){for(var u=uq(e),c=aq(u),f=lq(c),p=sq(i,s),d,g;f-- >0;)if(d=c[f],g=p(d,f,u),g)switch(n){case 0:return d;case 1:return f}return t?-1:void 0}};cA.exports={findLast:lA(0),findLastIndex:lA(1)}});var y0=X(()=>{"use strict";var fA=Wi(),cq=m0().findLast,fq=fA.aTypedArray,hq=fA.exportTypedArrayMethod;hq("findLast",function(t){return cq(fq(this),t,arguments.length>1?arguments[1]:void 0)})});var v0=X(()=>{"use strict";var hA=Wi(),pq=m0().findLastIndex,dq=hA.aTypedArray,gq=hA.exportTypedArrayMethod;gq("findLastIndex",function(t){return pq(dq(this),t,arguments.length>1?arguments[1]:void 0)})});var S0=X(()=>{"use strict";var dA=Sn(),gA=vr(),E0=Wi(),mq=ii(),yq=t0(),vq=Vi(),mA=An(),_q=dA.RangeError,_0=dA.Int8Array,pA=_0&&_0.prototype,yA=pA&&pA.set,xq=E0.aTypedArray,Eq=E0.exportTypedArrayMethod,x0=!mA(function(){var n=new Uint8ClampedArray(2);return gA(yA,n,{length:1,0:3},1),n[1]!==3}),Sq=x0&&E0.NATIVE_ARRAY_BUFFER_VIEWS&&mA(function(){var n=new _0(2);return n.set(1),n.set("2",1),n[0]!==0||n[1]!==2});Eq("set",function(t){xq(this);var e=yq(arguments.length>1?arguments[1]:void 0,1),i=vq(t);if(x0)return gA(yA,this,i,e);var s=this.length,u=mq(i),c=0;if(u+e>s)throw new _q("Wrong length");for(;c<u;)this[e+c]=i[c++]},!x0||Sq)});var M0=X((nit,_A)=>{"use strict";var vA=Uh(),wq=Math.floor,w0=function(n,t){var e=n.length;if(e<8)for(var i=1,s,u;i<e;){for(u=i,s=n[i];u&&t(n[u-1],s)>0;)n[u]=n[--u];u!==i++&&(n[u]=s)}else for(var c=wq(e/2),f=w0(vA(n,0,c),t),p=w0(vA(n,c),t),d=f.length,g=p.length,y=0,v=0;y<d||v<g;)n[y+v]=y<d&&v<g?t(f[y],p[v])<=0?f[y++]:p[v++]:y<d?f[y++]:p[v++];return n};_A.exports=w0});var b0=X((rit,EA)=>{"use strict";var Mq=Bu(),xA=Mq.match(/firefox\\/(\\d+)/i);EA.exports=!!xA&&+xA[1]});var A0=X((iit,SA)=>{"use strict";var bq=Bu();SA.exports=/MSIE|Trident/.test(bq)});var T0=X((oit,MA)=>{"use strict";var Aq=Bu(),wA=Aq.match(/AppleWebKit\\/(\\d+)\\./);MA.exports=!!wA&&+wA[1]});var I0=X(()=>{"use strict";var Tq=Sn(),Cq=Ih(),C0=An(),Iq=_s(),Pq=M0(),IA=Wi(),bA=b0(),Rq=A0(),AA=bc(),TA=T0(),Lq=IA.aTypedArray,Nq=IA.exportTypedArrayMethod,Yc=Tq.Uint16Array,Ju=Yc&&Cq(Yc.prototype.sort),Oq=!!Ju&&!(C0(function(){Ju(new Yc(2),null)})&&C0(function(){Ju(new Yc(2),{})})),CA=!!Ju&&!C0(function(){if(AA)return AA<74;if(bA)return bA<67;if(Rq)return!0;if(TA)return TA<602;var n=new Yc(516),t=Array(516),e,i;for(e=0;e<516;e++)i=e%4,n[e]=515-e,t[e]=e-2*i+3;for(Ju(n,function(s,u){return(s/4|0)-(u/4|0)}),e=0;e<516;e++)if(n[e]!==t[e])return!0}),Dq=function(n){return function(t,e){return n!==void 0?+n(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};Nq("sort",function(t){return t!==void 0&&Iq(t),CA?Ju(this,t):Pq(Lq(this),Dq(t))},!CA||Oq)});var RA=X((uit,PA)=>{"use strict";var Fq=ii();PA.exports=function(n,t){for(var e=Fq(n),i=new t(e),s=0;s<e;s++)i[s]=n[e-s-1];return i}});var R0=X(()=>{"use strict";var Uq=RA(),P0=Wi(),Bq=P0.aTypedArray,zq=P0.exportTypedArrayMethod,Gq=P0.getTypedArrayConstructor;zq("toReversed",function(){return Uq(Bq(this),Gq(this))})});var L0=X(()=>{"use strict";var Jh=Wi(),kq=In(),qq=_s(),Vq=i0(),Hq=Jh.aTypedArray,Wq=Jh.getTypedArrayConstructor,Xq=Jh.exportTypedArrayMethod,Yq=kq(Jh.TypedArrayPrototype.sort);Xq("toSorted",function(t){t!==void 0&&qq(t);var e=Hq(this),i=Vq(Wq(e),e);return Yq(i,t)})});var NA=X((pit,LA)=>{"use strict";var $q=ii(),Zq=Hi(),Jq=RangeError;LA.exports=function(n,t,e,i){var s=$q(n),u=Zq(e),c=u<0?s+u:u;if(c>=s||c<0)throw new Jq("Incorrect index");for(var f=new t(s),p=0;p<s;p++)f[p]=p===c?i:n[p];return f}});var O0=X(()=>{"use strict";var jq=NA(),N0=Wi(),Kq=n0(),Qq=Hi(),t5=Wh(),e5=N0.aTypedArray,n5=N0.getTypedArrayConstructor,r5=N0.exportTypedArrayMethod,i5=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(n){return n===8}}();r5("with",function(n,t){var e=e5(this),i=Qq(n),s=Kq(e)?t5(t):+t;return jq(e,n5(e),i,s)},!i5)});var F0=X(()=>{"use strict";var o5=sr(),s5=Sn(),a5=Hh(),u5=r0(),D0="ArrayBuffer",OA=a5[D0],l5=s5[D0];o5({global:!0,constructor:!0,forced:l5!==OA},{ArrayBuffer:OA});u5(D0)});var G0=X(()=>{"use strict";var c5=sr(),B0=Ih(),f5=An(),BA=Hh(),DA=so(),FA=vh(),h5=Wa(),z0=BA.ArrayBuffer,U0=BA.DataView,zA=U0.prototype,UA=B0(z0.prototype.slice),p5=B0(zA.getUint8),d5=B0(zA.setUint8),g5=f5(function(){return!new z0(2).slice(1,void 0).byteLength});c5({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:g5},{slice:function(t,e){if(UA&&e===void 0)return UA(DA(this),t);for(var i=DA(this).byteLength,s=FA(t,i),u=FA(e===void 0?i:e,i),c=new z0(h5(u-s)),f=new U0(this),p=new U0(c),d=0;s<u;)d5(p,d++,p5(f,s++));return c}})});var k0=X((xit,qA)=>{"use strict";var kA=Sn(),m5=Oc(),y5=vs(),GA=kA.ArrayBuffer,v5=kA.TypeError;qA.exports=GA&&m5(GA.prototype,"byteLength","get")||function(n){if(y5(n)!=="ArrayBuffer")throw new v5("ArrayBuffer expected");return n.byteLength}});var q0=X((Eit,VA)=>{"use strict";var _5=Sn(),x5=Rh(),E5=k0(),S5=_5.DataView;VA.exports=function(n){if(!x5||E5(n)!==0)return!1;try{return new S5(n),!1}catch(t){return!0}}});var V0=X(()=>{"use strict";var w5=ri(),M5=Hu(),b5=q0(),HA=ArrayBuffer.prototype;w5&&!("detached"in HA)&&M5(HA,"detached",{configurable:!0,get:function(){return b5(this)}})});var XA=X((Mit,WA)=>{"use strict";var A5=q0(),T5=TypeError;WA.exports=function(n){if(A5(n))throw new T5("ArrayBuffer is detached");return n}});var H0=X((bit,YA)=>{"use strict";var $c=Sn(),C5=Bu(),I5=vs(),jh=function(n){return C5.slice(0,n.length)===n};YA.exports=function(){return jh("Bun/")?"BUN":jh("Cloudflare-Workers")?"CLOUDFLARE":jh("Deno/")?"DENO":jh("Node.js/")?"NODE":$c.Bun&&typeof Bun.version=="string"?"BUN":$c.Deno&&typeof Deno.version=="object"?"DENO":I5($c.process)==="process"?"NODE":$c.window&&$c.document?"BROWSER":"REST"}()});var ZA=X((Ait,$A)=>{"use strict";var P5=H0();$A.exports=P5==="NODE"});var jA=X((Tit,JA)=>{"use strict";var R5=Sn(),L5=ZA();JA.exports=function(n){if(L5){try{return R5.process.getBuiltinModule(n)}catch(t){}try{return Function('return require("'+n+'")')()}catch(t){}}}});var Y0=X((Cit,QA)=>{"use strict";var N5=Sn(),O5=An(),W0=bc(),X0=H0(),KA=N5.structuredClone;QA.exports=!!KA&&!O5(function(){if(X0==="DENO"&&W0>92||X0==="NODE"&&W0>94||X0==="BROWSER"&&W0>97)return!1;var n=new ArrayBuffer(8),t=KA(n,{transfer:[n]});return n.byteLength!==0||t.byteLength!==8})});var rT=X((Iit,nT)=>{"use strict";var j0=Sn(),D5=jA(),F5=Y0(),U5=j0.structuredClone,tT=j0.ArrayBuffer,Kh=j0.MessageChannel,J0=!1,$0,eT,Qh,Z0;if(F5)J0=function(n){U5(n,{transfer:[n]})};else if(tT)try{Kh||($0=D5("worker_threads"),$0&&(Kh=$0.MessageChannel)),Kh&&(eT=new Kh,Qh=new tT(2),Z0=function(n){eT.port1.postMessage(null,[n])},Qh.byteLength===2&&(Z0(Qh),Qh.byteLength===0&&(J0=Z0)))}catch(n){}nT.exports=J0});var ry=X((Pit,cT)=>{"use strict";var ty=Sn(),ey=In(),aT=Oc(),B5=Fh(),z5=XA(),G5=k0(),iT=rT(),K0=Y0(),k5=ty.structuredClone,uT=ty.ArrayBuffer,Q0=ty.DataView,q5=Math.min,ny=uT.prototype,lT=Q0.prototype,V5=ey(ny.slice),oT=aT(ny,"resizable","get"),sT=aT(ny,"maxByteLength","get"),H5=ey(lT.getInt8),W5=ey(lT.setInt8);cT.exports=(K0||iT)&&function(n,t,e){var i=G5(n),s=t===void 0?i:B5(t),u=!oT||!oT(n),c;if(z5(n),K0&&(n=k5(n,{transfer:[n]}),i===s&&(e||u)))return n;if(i>=s&&(!e||u))c=V5(n,0,s);else{var f=e&&!u&&sT?{maxByteLength:sT(n)}:void 0;c=new uT(s,f);for(var p=new Q0(n),d=new Q0(c),g=q5(s,i),y=0;y<g;y++)W5(d,y,H5(p,y))}return K0||iT(n),c}});var iy=X(()=>{"use strict";var X5=sr(),fT=ry();fT&&X5({target:"ArrayBuffer",proto:!0},{transfer:function(){return fT(this,arguments.length?arguments[0]:void 0,!0)}})});var oy=X(()=>{"use strict";var Y5=sr(),hT=ry();hT&&Y5({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return hT(this,arguments.length?arguments[0]:void 0,!1)}})});var Ao=X((Dit,pT)=>{"use strict";var sy=In(),tp=Set.prototype;pT.exports={Set,add:sy(tp.add),has:sy(tp.has),remove:sy(tp.delete),proto:tp}});var ea=X((Fit,dT)=>{"use strict";var $5=Ao().has;dT.exports=function(n){return $5(n),n}});var na=X((Uit,gT)=>{"use strict";var Z5=vr();gT.exports=function(n,t,e){for(var i=e?n:n.iterator,s=n.next,u,c;!(u=Z5(s,i)).done;)if(c=t(u.value),c!==void 0)return c}});var ju=X((Bit,xT)=>{"use strict";var mT=In(),J5=na(),yT=Ao(),j5=yT.Set,vT=yT.proto,K5=mT(vT.forEach),_T=mT(vT.keys),Q5=_T(new j5).next;xT.exports=function(n,t,e){return e?J5({iterator:_T(n),next:Q5},t):K5(n,t)}});var ep=X((zit,ST)=>{"use strict";var ET=Ao(),tV=ju(),eV=ET.Set,nV=ET.add;ST.exports=function(n){var t=new eV;return tV(n,function(e){nV(t,e)}),t}});var Ku=X((Git,wT)=>{"use strict";var rV=Oc(),iV=Ao();wT.exports=rV(iV.proto,"size","get")||function(n){return n.size}});var bT=X((kit,MT)=>{"use strict";MT.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var ra=X((qit,RT)=>{"use strict";var AT=_s(),IT=so(),TT=vr(),oV=Hi(),sV=bT(),CT="Invalid size",aV=RangeError,uV=TypeError,lV=Math.max,PT=function(n,t){this.set=n,this.size=lV(t,0),this.has=AT(n.has),this.keys=AT(n.keys)};PT.prototype={getIterator:function(){return sV(IT(TT(this.keys,this.set)))},includes:function(n){return TT(this.has,this.set,n)}};RT.exports=function(n){IT(n);var t=+n.size;if(t!==t)throw new uV(CT);var e=oV(t);if(e<0)throw new aV(CT);return new PT(n,e)}});var DT=X((Vit,OT)=>{"use strict";var cV=ea(),NT=Ao(),fV=ep(),hV=Ku(),pV=ra(),dV=ju(),gV=na(),mV=NT.has,LT=NT.remove;OT.exports=function(t){var e=cV(this),i=pV(t),s=fV(e);return hV(e)<=i.size?dV(e,function(u){i.includes(u)&&LT(s,u)}):gV(i.getIterator(),function(u){mV(e,u)&&LT(s,u)}),s}});var ia=X((Hit,BT)=>{"use strict";var yV=$s(),FT=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},UT=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};BT.exports=function(n,t){var e=yV("Set");try{new e()[n](FT(0));try{return new e()[n](FT(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](UT(-1/0)),!1}catch(u){var i=new e;return i.add(1),i.add(2),t(i[n](UT(1/0)))}}}catch(s){return!1}}});var zT=X(()=>{"use strict";var vV=sr(),_V=DT(),xV=ia(),EV=!xV("difference",function(n){return n.size===0});vV({target:"Set",proto:!0,real:!0,forced:EV},{difference:_V})});var qT=X((Yit,kT)=>{"use strict";var SV=ea(),ay=Ao(),wV=Ku(),MV=ra(),bV=ju(),AV=na(),TV=ay.Set,GT=ay.add,CV=ay.has;kT.exports=function(t){var e=SV(this),i=MV(t),s=new TV;return wV(e)>i.size?AV(i.getIterator(),function(u){CV(e,u)&&GT(s,u)}):bV(e,function(u){i.includes(u)&&GT(s,u)}),s}});var VT=X(()=>{"use strict";var IV=sr(),PV=An(),RV=qT(),LV=ia(),NV=!LV("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||PV(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});IV({target:"Set",proto:!0,real:!0,forced:NV},{intersection:RV})});var uy=X((Jit,WT)=>{"use strict";var OV=vr(),HT=so(),DV=Tc();WT.exports=function(n,t,e){var i,s;HT(n);try{if(i=DV(n,"return"),!i){if(t==="throw")throw e;return e}i=OV(i,n)}catch(u){s=!0,i=u}if(t==="throw")throw e;if(s)throw i;return HT(i),e}});var YT=X((jit,XT)=>{"use strict";var FV=ea(),UV=Ao().has,BV=Ku(),zV=ra(),GV=ju(),kV=na(),qV=uy();XT.exports=function(t){var e=FV(this),i=zV(t);if(BV(e)<=i.size)return GV(e,function(u){if(i.includes(u))return!1},!0)!==!1;var s=i.getIterator();return kV(s,function(u){if(UV(e,u))return qV(s,"normal",!1)})!==!1}});var $T=X(()=>{"use strict";var VV=sr(),HV=YT(),WV=ia(),XV=!WV("isDisjointFrom",function(n){return!n});VV({target:"Set",proto:!0,real:!0,forced:XV},{isDisjointFrom:HV})});var JT=X((tot,ZT)=>{"use strict";var YV=ea(),$V=Ku(),ZV=ju(),JV=ra();ZT.exports=function(t){var e=YV(this),i=JV(t);return $V(e)>i.size?!1:ZV(e,function(s){if(!i.includes(s))return!1},!0)!==!1}});var jT=X(()=>{"use strict";var jV=sr(),KV=JT(),QV=ia(),tH=!QV("isSubsetOf",function(n){return n});jV({target:"Set",proto:!0,real:!0,forced:tH},{isSubsetOf:KV})});var QT=X((rot,KT)=>{"use strict";var eH=ea(),nH=Ao().has,rH=Ku(),iH=ra(),oH=na(),sH=uy();KT.exports=function(t){var e=eH(this),i=iH(t);if(rH(e)<i.size)return!1;var s=i.getIterator();return oH(s,function(u){if(!nH(e,u))return sH(s,"normal",!1)})!==!1}});var tC=X(()=>{"use strict";var aH=sr(),uH=QT(),lH=ia(),cH=!lH("isSupersetOf",function(n){return!n});aH({target:"Set",proto:!0,real:!0,forced:cH},{isSupersetOf:uH})});var nC=X((sot,eC)=>{"use strict";var fH=ea(),ly=Ao(),hH=ep(),pH=ra(),dH=na(),gH=ly.add,mH=ly.has,yH=ly.remove;eC.exports=function(t){var e=fH(this),i=pH(t).getIterator(),s=hH(e);return dH(i,function(u){mH(e,u)?yH(s,u):gH(s,u)}),s}});var rC=X(()=>{"use strict";var vH=sr(),_H=nC(),xH=ia();vH({target:"Set",proto:!0,real:!0,forced:!xH("symmetricDifference")},{symmetricDifference:_H})});var oC=X((lot,iC)=>{"use strict";var EH=ea(),SH=Ao().add,wH=ep(),MH=ra(),bH=na();iC.exports=function(t){var e=EH(this),i=MH(t).getIterator(),s=wH(e);return bH(i,function(u){SH(s,u)}),s}});var sC=X(()=>{"use strict";var AH=sr(),TH=oC(),CH=ia();AH({target:"Set",proto:!0,real:!0,forced:!CH("union")},{union:TH})});var cy=X((hot,uC)=>{"use strict";var aC=zu(),IH=TypeError;uC.exports=function(n,t){if(!delete n[t])throw new IH("Cannot delete property "+aC(t)+" of "+aC(n))}});var lC=X(()=>{"use strict";var PH=sr(),RH=Vi(),LH=ii(),NH=mm(),OH=cy(),DH=Eh(),FH=[].unshift(0)!==1,UH=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(n){return n instanceof TypeError}},BH=FH||!UH();PH({target:"Array",proto:!0,arity:1,forced:BH},{unshift:function(t){var e=RH(this),i=LH(e),s=arguments.length;if(s){DH(i+s);for(var u=i;u--;){var c=u+s;u in e?e[c]=e[u]:OH(e,c)}for(var f=0;f<s;f++)e[f]=arguments[f]}return NH(e,i+s)}})});var Ll=X((Cot,pP)=>{"use strict";var xY=Zs(),EY=String;pP.exports=function(n){if(xY(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return EY(n)}});var gP=X((Iot,dP)=>{"use strict";var SY=so();dP.exports=function(){var n=SY(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var yP=X((Pot,mP)=>{"use strict";var Kv=An(),wY=Sn(),Qv=wY.RegExp,t_=Kv(function(){var n=Qv("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),MY=t_||Kv(function(){return!Qv("a","y").sticky}),bY=t_||Kv(function(){var n=Qv("^r","gy");return n.lastIndex=2,n.exec("str")!==null});mP.exports={BROKEN_CARET:bY,MISSED_STICKY:MY,UNSUPPORTED_Y:t_}});var _P=X((Rot,vP)=>{"use strict";var AY=An(),TY=Sn(),CY=TY.RegExp;vP.exports=AY(function(){var n=CY(".","s");return!(n.dotAll&&n.test(\`
8006
8006
  \`)&&n.flags==="s")})});var EP=X((Lot,xP)=>{"use strict";var IY=An(),PY=Sn(),RY=PY.RegExp;xP.exports=IY(function(){var n=RY("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var dd=X((Not,wP)=>{"use strict";var Nl=vr(),pd=In(),LY=Ll(),NY=gP(),OY=yP(),DY=oh(),FY=ku(),UY=Va().get,BY=_P(),zY=EP(),GY=DY("native-string-replace",String.prototype.replace),hd=RegExp.prototype.exec,n_=hd,kY=pd("".charAt),qY=pd("".indexOf),VY=pd("".replace),e_=pd("".slice),r_=function(){var n=/a/,t=/b*/g;return Nl(hd,n,"a"),Nl(hd,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),SP=OY.BROKEN_CARET,i_=/()??/.exec("")[1]!==void 0,HY=r_||i_||SP||BY||zY;HY&&(n_=function(t){var e=this,i=UY(e),s=LY(t),u=i.raw,c,f,p,d,g,y,v;if(u)return u.lastIndex=e.lastIndex,c=Nl(n_,u,s),e.lastIndex=u.lastIndex,c;var E=i.groups,M=SP&&e.sticky,A=Nl(NY,e),_=e.source,x=0,T=s;if(M&&(A=VY(A,"y",""),qY(A,"g")===-1&&(A+="g"),T=e_(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&kY(s,e.lastIndex-1)!==\`
8007
8007
  \`)&&(_="(?: "+_+")",T=" "+T,x++),f=new RegExp("^(?:"+_+")",A)),i_&&(f=new RegExp("^"+_+"$(?!\\\\s)",A)),r_&&(p=e.lastIndex),d=Nl(hd,M?f:e,T),M?d?(d.input=e_(d.input,x),d[0]=e_(d[0],x),d.index=e.lastIndex,e.lastIndex+=d[0].length):e.lastIndex=0:r_&&d&&(e.lastIndex=e.global?d.index+d[0].length:p),i_&&d&&d.length>1&&Nl(GY,d[0],f,function(){for(g=1;g<arguments.length-2;g++)arguments[g]===void 0&&(d[g]=void 0)}),d&&E)for(d.groups=y=FY(null),g=0;g<E.length;g++)v=E[g],y[v[0]]=d[v[1]];return d});wP.exports=n_});var o_=X(()=>{"use strict";var WY=sr(),MP=dd();WY({target:"RegExp",proto:!0,forced:/./.exec!==MP},{exec:MP})});var gd=X((qot,TP)=>{"use strict";var AP=Object.getOwnPropertySymbols,ZY=Object.prototype.hasOwnProperty,JY=Object.prototype.propertyIsEnumerable;function jY(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function KY(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var i=Object.getOwnPropertyNames(t).map(function(u){return t[u]});if(i.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(u){s[u]=u}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}TP.exports=KY()?Object.assign:function(n,t){for(var e,i=jY(n),s,u=1;u<arguments.length;u++){e=Object(arguments[u]);for(var c in e)ZY.call(e,c)&&(i[c]=e[c]);if(AP){s=AP(e);for(var f=0;f<s.length;f++)JY.call(e,s[f])&&(i[s[f]]=e[s[f]])}}return i}});var f_=X((l_,c_)=>{(function(n,t){typeof l_=="object"&&typeof c_!="undefined"?c_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(l_,function(){"use strict";function n(_,x,T,w,R){(function B(U,D,P,ct,L){for(;ct>P;){if(ct-P>600){var W=ct-P+1,V=D-P+1,Mt=Math.log(W),$=.5*Math.exp(2*Mt/3),gt=.5*Math.sqrt(Mt*$*(W-$)/W)*(V-W/2<0?-1:1),ft=Math.max(P,Math.floor(D-V*$/W+gt)),vt=Math.min(ct,Math.floor(D+(W-V)*$/W+gt));B(U,D,ft,vt,L)}var it=U[D],lt=P,H=ct;for(t(U,P,D),L(U[ct],it)>0&&t(U,P,ct);lt<H;){for(t(U,lt,H),lt++,H--;L(U[lt],it)<0;)lt++;for(;L(U[H],it)>0;)H--}L(U[P],it)===0?t(U,P,H):t(U,++H,ct),H<=D&&(P=H+1),D<=H&&(ct=H-1)}})(_,x,T||0,w||_.length-1,R||e)}function t(_,x,T){var w=_[x];_[x]=_[T],_[T]=w}function e(_,x){return _<x?-1:_>x?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(_,x,T){if(!T)return x.indexOf(_);for(var w=0;w<x.length;w++)if(T(_,x[w]))return w;return-1}function u(_,x){c(_,0,_.children.length,x,_)}function c(_,x,T,w,R){R||(R=M(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var B=x;B<T;B++){var U=_.children[B];f(R,_.leaf?w(U):U)}return R}function f(_,x){return _.minX=Math.min(_.minX,x.minX),_.minY=Math.min(_.minY,x.minY),_.maxX=Math.max(_.maxX,x.maxX),_.maxY=Math.max(_.maxY,x.maxY),_}function p(_,x){return _.minX-x.minX}function d(_,x){return _.minY-x.minY}function g(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function y(_){return _.maxX-_.minX+(_.maxY-_.minY)}function v(_,x){return _.minX<=x.minX&&_.minY<=x.minY&&x.maxX<=_.maxX&&x.maxY<=_.maxY}function E(_,x){return x.minX<=_.maxX&&x.minY<=_.maxY&&x.maxX>=_.minX&&x.maxY>=_.minY}function M(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(_,x,T,w,R){for(var B=[x,T];B.length;)if(!((T=B.pop())-(x=B.pop())<=w)){var U=x+Math.ceil((T-x)/w/2)*w;n(_,U,x,T,R),B.push(x,U,U,T)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var x=this.data,T=[];if(!E(_,x))return T;for(var w=this.toBBox,R=[];x;){for(var B=0;B<x.children.length;B++){var U=x.children[B],D=x.leaf?w(U):U;E(_,D)&&(x.leaf?T.push(U):v(_,D)?this._all(U,T):R.push(U))}x=R.pop()}return T},i.prototype.collides=function(_){var x=this.data;if(!E(_,x))return!1;for(var T=[];x;){for(var w=0;w<x.children.length;w++){var R=x.children[w],B=x.leaf?this.toBBox(R):R;if(E(_,B)){if(x.leaf||v(_,B))return!0;T.push(R)}}x=T.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var x=0;x<_.length;x++)this.insert(_[x]);return this}var T=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var w=this.data;this.data=T,T=w}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=M([]),this},i.prototype.remove=function(_,x){if(!_)return this;for(var T,w,R,B=this.data,U=this.toBBox(_),D=[],P=[];B||D.length;){if(B||(B=D.pop(),w=D[D.length-1],T=P.pop(),R=!0),B.leaf){var ct=s(_,B.children,x);if(ct!==-1)return B.children.splice(ct,1),D.push(B),this._condense(D),this}R||B.leaf||!v(B,U)?w?(T++,B=w.children[T],R=!1):B=null:(D.push(B),P.push(T),T=0,w=B,B=B.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,x){return _.minX-x.minX},i.prototype.compareMinY=function(_,x){return _.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,x){for(var T=[];_;)_.leaf?x.push.apply(x,_.children):T.push.apply(T,_.children),_=T.pop();return x},i.prototype._build=function(_,x,T,w){var R,B=T-x+1,U=this._maxEntries;if(B<=U)return u(R=M(_.slice(x,T+1)),this.toBBox),R;w||(w=Math.ceil(Math.log(B)/Math.log(U)),U=Math.ceil(B/Math.pow(U,w-1))),(R=M([])).leaf=!1,R.height=w;var D=Math.ceil(B/U),P=D*Math.ceil(Math.sqrt(U));A(_,x,T,P,this.compareMinX);for(var ct=x;ct<=T;ct+=P){var L=Math.min(ct+P-1,T);A(_,ct,L,D,this.compareMinY);for(var W=ct;W<=L;W+=D){var V=Math.min(W+D-1,L);R.children.push(this._build(_,W,V,w-1))}}return u(R,this.toBBox),R},i.prototype._chooseSubtree=function(_,x,T,w){for(;w.push(x),!x.leaf&&w.length-1!==T;){for(var R=1/0,B=1/0,U=void 0,D=0;D<x.children.length;D++){var P=x.children[D],ct=g(P),L=(W=_,V=P,(Math.max(V.maxX,W.maxX)-Math.min(V.minX,W.minX))*(Math.max(V.maxY,W.maxY)-Math.min(V.minY,W.minY))-ct);L<B?(B=L,R=ct<R?ct:R,U=P):L===B&&ct<R&&(R=ct,U=P)}x=U||x.children[0]}var W,V;return x},i.prototype._insert=function(_,x,T){var w=T?_:this.toBBox(_),R=[],B=this._chooseSubtree(w,this.data,x,R);for(B.children.push(_),f(B,w);x>=0&&R[x].children.length>this._maxEntries;)this._split(R,x),x--;this._adjustParentBBoxes(w,R,x)},i.prototype._split=function(_,x){var T=_[x],w=T.children.length,R=this._minEntries;this._chooseSplitAxis(T,R,w);var B=this._chooseSplitIndex(T,R,w),U=M(T.children.splice(B,T.children.length-B));U.height=T.height,U.leaf=T.leaf,u(T,this.toBBox),u(U,this.toBBox),x?_[x-1].children.push(U):this._splitRoot(T,U)},i.prototype._splitRoot=function(_,x){this.data=M([_,x]),this.data.height=_.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,x,T){for(var w,R,B,U,D,P,ct,L=1/0,W=1/0,V=x;V<=T-x;V++){var Mt=c(_,0,V,this.toBBox),$=c(_,V,T,this.toBBox),gt=(R=Mt,B=$,U=void 0,D=void 0,P=void 0,ct=void 0,U=Math.max(R.minX,B.minX),D=Math.max(R.minY,B.minY),P=Math.min(R.maxX,B.maxX),ct=Math.min(R.maxY,B.maxY),Math.max(0,P-U)*Math.max(0,ct-D)),ft=g(Mt)+g($);gt<L?(L=gt,w=V,W=ft<W?ft:W):gt===L&&ft<W&&(W=ft,w=V)}return w||T-x},i.prototype._chooseSplitAxis=function(_,x,T){var w=_.leaf?this.compareMinX:p,R=_.leaf?this.compareMinY:d;this._allDistMargin(_,x,T,w)<this._allDistMargin(_,x,T,R)&&_.children.sort(w)},i.prototype._allDistMargin=function(_,x,T,w){_.children.sort(w);for(var R=this.toBBox,B=c(_,0,x,R),U=c(_,T-x,T,R),D=y(B)+y(U),P=x;P<T-x;P++){var ct=_.children[P];f(B,_.leaf?R(ct):ct),D+=y(B)}for(var L=T-x-1;L>=x;L--){var W=_.children[L];f(U,_.leaf?R(W):W),D+=y(U)}return D},i.prototype._adjustParentBBoxes=function(_,x,T){for(var w=T;w>=0;w--)f(x[w],_)},i.prototype._condense=function(_){for(var x=_.length-1,T=void 0;x>=0;x--)_[x].children.length===0?x>0?(T=_[x-1].children).splice(T.indexOf(_[x]),1):this.clear():u(_[x],this.toBBox)},i})});var CP=X((h_,p_)=>{(function(n,t){typeof h_=="object"&&typeof p_!="undefined"?p_.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(h_,function(){"use strict";var n=function(i,s){if(i===void 0&&(i=[]),s===void 0&&(s=t),this.data=i,this.length=this.data.length,this.compare=s,this.length>0)for(var u=(this.length>>1)-1;u>=0;u--)this._down(u)};n.prototype.push=function(i){this.data.push(i),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var i=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),i}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(i){for(var s=this,u=s.data,c=s.compare,f=u[i];i>0;){var p=i-1>>1,d=u[p];if(c(f,d)>=0)break;u[i]=d,i=p}u[i]=f},n.prototype._down=function(i){for(var s=this,u=s.data,c=s.compare,f=this.length>>1,p=u[i];i<f;){var d=(i<<1)+1,g=u[d],y=d+1;if(y<this.length&&c(u[y],g)<0&&(d=y,g=u[y]),c(g,p)>=0)break;u[i]=g,i=d}u[i]=p};function t(e,i){return e<i?-1:e>i?1:0}return n})});var PP=X(($ot,IP)=>{IP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=(s-i)/2,d=0,g=p-1;d<p;g=d++){var y=e[i+d*2+0],v=e[i+d*2+1],E=e[i+g*2+0],M=e[i+g*2+1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var LP=X((Zot,RP)=>{RP.exports=function(t,e,i,s){var u=t[0],c=t[1],f=!1;i===void 0&&(i=0),s===void 0&&(s=e.length);for(var p=s-i,d=0,g=p-1;d<p;g=d++){var y=e[d+i][0],v=e[d+i][1],E=e[g+i][0],M=e[g+i][1],A=v>c!=M>c&&u<(E-y)*(c-v)/(M-v)+y;A&&(f=!f)}return f}});var DP=X((Jot,vd)=>{var NP=PP(),OP=LP();vd.exports=function(t,e,i,s){return e.length>0&&Array.isArray(e[0])?OP(t,e,i,s):NP(t,e,i,s)};vd.exports.nested=OP;vd.exports.flat=NP});var UP=X((_d,FP)=>{(function(n,t){typeof _d=="object"&&typeof FP!="undefined"?t(_d):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(_d,function(n){"use strict";let e=33306690738754706e-32;function i(E,M,A,_,x){let T,w,R,B,U=M[0],D=_[0],P=0,ct=0;D>U==D>-U?(T=U,U=M[++P]):(T=D,D=_[++ct]);let L=0;if(P<E&&ct<A)for(D>U==D>-U?(R=T-((w=U+T)-U),U=M[++P]):(R=T-((w=D+T)-D),D=_[++ct]),T=w,R!==0&&(x[L++]=R);P<E&&ct<A;)D>U==D>-U?(R=T-((w=T+U)-(B=w-T))+(U-B),U=M[++P]):(R=T-((w=T+D)-(B=w-T))+(D-B),D=_[++ct]),T=w,R!==0&&(x[L++]=R);for(;P<E;)R=T-((w=T+U)-(B=w-T))+(U-B),U=M[++P],T=w,R!==0&&(x[L++]=R);for(;ct<A;)R=T-((w=T+D)-(B=w-T))+(D-B),D=_[++ct],T=w,R!==0&&(x[L++]=R);return T===0&&L!==0||(x[L++]=T),L}function s(E){return new Float64Array(E)}let u=33306690738754716e-32,c=22204460492503146e-32,f=11093356479670487e-47,p=s(4),d=s(8),g=s(12),y=s(16),v=s(4);n.orient2d=function(E,M,A,_,x,T){let w=(M-T)*(A-x),R=(E-x)*(_-T),B=w-R;if(w===0||R===0||w>0!=R>0)return B;let U=Math.abs(w+R);return Math.abs(B)>=u*U?B:-function(D,P,ct,L,W,V,Mt){let $,gt,ft,vt,it,lt,H,At,It,jt,nt,bt,Vt,$t,Ut,Gt,Ct,ee,Z=D-W,Ot=ct-W,_t=P-V,Nt=L-V;it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(jt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=Z*Nt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(jt=Ot-(It=(lt=134217729*Ot)-(lt-Ot)))-((Gt=_t*Ot)-H*It-At*It-H*jt))),p[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),p[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,p[2]=bt-(ee-it)+(nt-it),p[3]=ee;let wt=function(Y,N){let xt=N[0];for(let St=1;St<Y;St++)xt+=N[St];return xt}(4,p),Ht=c*Mt;if(wt>=Ht||-wt>=Ht||($=D-(Z+(it=D-Z))+(it-W),ft=ct-(Ot+(it=ct-Ot))+(it-W),gt=P-(_t+(it=P-_t))+(it-V),vt=L-(Nt+(it=L-Nt))+(it-V),$===0&&gt===0&&ft===0&&vt===0)||(Ht=f*Mt+e*Math.abs(wt),(wt+=Z*vt+Nt*$-(_t*ft+Ot*gt))>=Ht||-wt>=Ht))return wt;it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(jt=Nt-(It=(lt=134217729*Nt)-(lt-Nt)))-(($t=$*Nt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(jt=Ot-(It=(lt=134217729*Ot)-(lt-Ot)))-((Gt=gt*Ot)-H*It-At*It-H*jt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Xt=i(4,p,4,v,d);it=(Ut=(At=Z-(H=(lt=134217729*Z)-(lt-Z)))*(jt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=Z*vt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=_t-(H=(lt=134217729*_t)-(lt-_t)))*(jt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=_t*ft)-H*It-At*It-H*jt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let Pt=i(Xt,d,4,v,g);it=(Ut=(At=$-(H=(lt=134217729*$)-(lt-$)))*(jt=vt-(It=(lt=134217729*vt)-(lt-vt)))-(($t=$*vt)-H*It-At*It-H*jt))-(nt=Ut-(Ct=(At=gt-(H=(lt=134217729*gt)-(lt-gt)))*(jt=ft-(It=(lt=134217729*ft)-(lt-ft)))-((Gt=gt*ft)-H*It-At*It-H*jt))),v[0]=Ut-(nt+it)+(it-Ct),it=(Vt=$t-((bt=$t+nt)-(it=bt-$t))+(nt-it))-(nt=Vt-Gt),v[1]=Vt-(nt+it)+(it-Gt),it=(ee=bt+nt)-bt,v[2]=bt-(ee-it)+(nt-it),v[3]=ee;let ne=i(Pt,g,4,v,y);return y[ne-1]}(E,M,A,_,x,T,U)},n.orient2dfast=function(E,M,A,_,x,T){return(M-T)*(A-x)-(E-x)*(_-T)},Object.defineProperty(n,"__esModule",{value:!0})})});var VP=X((jot,y_)=>{"use strict";var BP=f_(),Ed=CP(),t$=DP(),e$=UP().orient2d;Ed.default&&(Ed=Ed.default);y_.exports=qP;y_.exports.default=qP;function qP(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var i=s$(n),s=new BP(16);s.toBBox=function(T){return{minX:T[0],minY:T[1],maxX:T[0],maxY:T[1]}},s.compareMinX=function(T,w){return T[0]-w[0]},s.compareMinY=function(T,w){return T[1]-w[1]},s.load(n);for(var u=[],c=0,f;c<i.length;c++){var p=i[c];s.remove(p),f=kP(p,f),u.push(f)}var d=new BP(16);for(c=0;c<u.length;c++)d.insert(d_(u[c]));for(var g=t*t,y=e*e;u.length;){var v=u.shift(),E=v.p,M=v.next.p,A=g_(E,M);if(!(A<y)){var _=A/g;p=n$(s,v.prev.p,E,M,v.next.next.p,_,d),p&&Math.min(g_(p,E),g_(p,M))<=_&&(u.push(v),u.push(kP(p,v)),s.remove(p),d.remove(v),d.insert(d_(v)),d.insert(d_(v.next)))}}v=f;var x=[];do x.push(v.p),v=v.next;while(v!==f);return x.push(v.p),x}function n$(n,t,e,i,s,u,c){for(var f=new Ed([],r$),p=n.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],y=p.leaf?m_(g,e,i):i$(e,i,g);y>u||f.push({node:g,dist:y})}for(;f.length&&!f.peek().node.children;){var v=f.pop(),E=v.node,M=m_(E,t,e),A=m_(E,i,s);if(v.dist<M&&v.dist<A&&GP(e,E,c)&&GP(i,E,c))return E}p=f.pop(),p&&(p=p.node)}return null}function r$(n,t){return n.dist-t.dist}function i$(n,t,e){if(zP(n,e)||zP(t,e))return 0;var i=xd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(i===0)return 0;var s=xd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var u=xd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(u===0)return 0;var c=xd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return c===0?0:Math.min(i,s,u,c)}function zP(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function GP(n,t,e){for(var i=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),u=Math.max(n[0],t[0]),c=Math.max(n[1],t[1]),f=e.search({minX:i,minY:s,maxX:u,maxY:c}),p=0;p<f.length;p++)if(o$(f[p].p,f[p].next.p,n,t))return!1;return!0}function Ol(n,t,e){return e$(n[0],n[1],t[0],t[1],e[0],e[1])}function o$(n,t,e,i){return n!==i&&t!==e&&Ol(n,t,e)>0!=Ol(n,t,i)>0&&Ol(e,i,n)>0!=Ol(e,i,t)>0}function d_(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function s$(n){for(var t=n[0],e=n[0],i=n[0],s=n[0],u=0;u<n.length;u++){var c=n[u];c[0]<t[0]&&(t=c),c[0]>i[0]&&(i=c),c[1]<e[1]&&(e=c),c[1]>s[1]&&(s=c)}var f=[t,e,i,s],p=f.slice();for(u=0;u<n.length;u++)t$(n[u],f)||p.push(n[u]);return u$(p)}function kP(n,t){var e={p:n,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function g_(n,t){var e=n[0]-t[0],i=n[1]-t[1];return e*e+i*i}function m_(n,t,e){var i=t[0],s=t[1],u=e[0]-i,c=e[1]-s;if(u!==0||c!==0){var f=((n[0]-i)*u+(n[1]-s)*c)/(u*u+c*c);f>1?(i=e[0],s=e[1]):f>0&&(i+=u*f,s+=c*f)}return u=n[0]-i,c=n[1]-s,u*u+c*c}function xd(n,t,e,i,s,u,c,f){var p=e-n,d=i-t,g=c-s,y=f-u,v=n-s,E=t-u,M=p*p+d*d,A=p*g+d*y,_=g*g+y*y,x=p*v+d*E,T=g*v+y*E,w=M*_-A*A,R,B,U,D,P=w,ct=w;w===0?(B=0,P=1,D=T,ct=_):(B=A*T-_*x,D=M*T-A*x,B<0?(B=0,D=T,ct=_):B>P&&(B=P,D=T+A,ct=_)),D<0?(D=0,-x<0?B=0:-x>M?B=P:(B=-x,P=M)):D>ct&&(D=ct,-x+A<0?B=0:-x+A>M?B=P:(B=-x+A,P=M)),R=B===0?0:B/P,U=D===0?0:D/ct;var L=(1-R)*n+R*e,W=(1-R)*t+R*i,V=(1-U)*s+U*c,Mt=(1-U)*u+U*f,$=V-L,gt=Mt-W;return $*$+gt*gt}function a$(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function u$(n){n.sort(a$);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&Ol(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var i=[],s=n.length-1;s>=0;s--){for(;i.length>=2&&Ol(i[i.length-2],i[i.length-1],n[s])<=0;)i.pop();i.push(n[s])}return i.pop(),t.pop(),t.concat(i)}});var ZP=X((__,x_)=>{(function(n,t){typeof __=="object"&&typeof x_!="undefined"?x_.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(__,function(){"use strict";function n(s,u,c,f,p){t(s,u,c||0,f||s.length-1,p||i)}function t(s,u,c,f,p){for(;f>c;){if(f-c>600){var d=f-c+1,g=u-c+1,y=Math.log(d),v=.5*Math.exp(2*y/3),E=.5*Math.sqrt(y*v*(d-v)/d)*(g-d/2<0?-1:1),M=Math.max(c,Math.floor(u-g*v/d+E)),A=Math.min(f,Math.floor(u+(d-g)*v/d+E));t(s,u,M,A,p)}var _=s[u],x=c,T=f;for(e(s,c,u),p(s[f],_)>0&&e(s,c,f);x<T;){for(e(s,x,T),x++,T--;p(s[x],_)<0;)x++;for(;p(s[T],_)>0;)T--}p(s[c],_)===0?e(s,c,T):(T++,e(s,T,f)),T<=u&&(c=T+1),u<=T&&(f=T-1)}}function e(s,u,c){var f=s[u];s[u]=s[c],s[c]=f}function i(s,u){return s<u?-1:s>u?1:0}return n})});var M_=X((wut,w_)=>{"use strict";w_.exports=vf;w_.exports.default=vf;var E$=ZP();function vf(n,t){if(!(this instanceof vf))return new vf(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}vf.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],i=this.toBBox;if(!wd(n,t))return e;for(var s=[],u,c,f,p;t;){for(u=0,c=t.children.length;u<c;u++)f=t.children[u],p=t.leaf?i(f):f,wd(n,p)&&(t.leaf?e.push(f):S_(n,p)?this._all(f,e):s.push(f));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!wd(n,t))return!1;for(var i=[],s,u,c,f;t;){for(s=0,u=t.children.length;s<u;s++)if(c=t.children[s],f=t.leaf?e(c):c,wd(n,f)){if(t.leaf||S_(n,f))return!0;i.push(c)}t=i.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var i=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=i;else if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var s=this.data;this.data=i,i=s}this._insert(i,this.data.height-i.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=Ul([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,i=this.toBBox(n),s=[],u=[],c,f,p,d;e||s.length;){if(e||(e=s.pop(),f=s[s.length-1],c=u.pop(),d=!0),e.leaf&&(p=S$(n,e.children,t),p!==-1))return e.children.splice(p,1),s.push(e),this._condense(s),this;!d&&!e.leaf&&S_(e,i)?(s.push(e),u.push(c),c=0,f=e,e=e.children[0]):f?(c++,e=f.children[c],d=!1):e=null}return this},toBBox:function(n){return n},compareMinX:JP,compareMinY:jP,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,i){var s=e-t+1,u=this._maxEntries,c;if(s<=u)return c=Ul(n.slice(t,e+1)),Fl(c,this.toBBox),c;i||(i=Math.ceil(Math.log(s)/Math.log(u)),u=Math.ceil(s/Math.pow(u,i-1))),c=Ul([]),c.leaf=!1,c.height=i;var f=Math.ceil(s/u),p=f*Math.ceil(Math.sqrt(u)),d,g,y,v;for(KP(n,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(y=Math.min(d+p-1,e),KP(n,d,y,f,this.compareMinY),g=d;g<=y;g+=f)v=Math.min(g+f-1,y),c.children.push(this._build(n,g,v,i-1));return Fl(c,this.toBBox),c},_chooseSubtree:function(n,t,e,i){for(var s,u,c,f,p,d,g,y;i.push(t),!(t.leaf||i.length-1===e);){for(g=y=1/0,s=0,u=t.children.length;s<u;s++)c=t.children[s],p=E_(c),d=w$(n,c)-p,d<y?(y=d,g=p<g?p:g,f=c):d===y&&p<g&&(g=p,f=c);t=f||t.children[0]}return t},_insert:function(n,t,e){var i=this.toBBox,s=e?n:i(n),u=[],c=this._chooseSubtree(s,this.data,t,u);for(c.children.push(n),yf(c,s);t>=0&&u[t].children.length>this._maxEntries;)this._split(u,t),t--;this._adjustParentBBoxes(s,u,t)},_split:function(n,t){var e=n[t],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);var u=this._chooseSplitIndex(e,s,i),c=Ul(e.children.splice(u,e.children.length-u));c.height=e.height,c.leaf=e.leaf,Fl(e,this.toBBox),Fl(c,this.toBBox),t?n[t-1].children.push(c):this._splitRoot(e,c)},_splitRoot:function(n,t){this.data=Ul([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Fl(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var i,s,u,c,f,p,d,g;for(p=d=1/0,i=t;i<=e-t;i++)s=mf(n,0,i,this.toBBox),u=mf(n,i,e,this.toBBox),c=M$(s,u),f=E_(s)+E_(u),c<p?(p=c,g=i,d=f<d?f:d):c===p&&f<d&&(d=f,g=i);return g},_chooseSplitAxis:function(n,t,e){var i=n.leaf?this.compareMinX:JP,s=n.leaf?this.compareMinY:jP,u=this._allDistMargin(n,t,e,i),c=this._allDistMargin(n,t,e,s);u<c&&n.children.sort(i)},_allDistMargin:function(n,t,e,i){n.children.sort(i);var s=this.toBBox,u=mf(n,0,t,s),c=mf(n,e-t,e,s),f=Sd(u)+Sd(c),p,d;for(p=t;p<e-t;p++)d=n.children[p],yf(u,n.leaf?s(d):d),f+=Sd(u);for(p=e-t-1;p>=t;p--)d=n.children[p],yf(c,n.leaf?s(d):d),f+=Sd(c);return f},_adjustParentBBoxes:function(n,t,e){for(var i=e;i>=0;i--)yf(t[i],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Fl(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function S$(n,t,e){if(!e)return t.indexOf(n);for(var i=0;i<t.length;i++)if(e(n,t[i]))return i;return-1}function Fl(n,t){mf(n,0,n.children.length,t,n)}function mf(n,t,e,i,s){s||(s=Ul(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var u=t,c;u<e;u++)c=n.children[u],yf(s,n.leaf?i(c):c);return s}function yf(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function JP(n,t){return n.minX-t.minX}function jP(n,t){return n.minY-t.minY}function E_(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Sd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function w$(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function M$(n,t){var e=Math.max(n.minX,t.minX),i=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),u=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,u-i)}function S_(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function wd(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Ul(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function KP(n,t,e,i,s){for(var u=[t,e],c;u.length;)e=u.pop(),t=u.pop(),!(e-t<=i)&&(c=t+Math.ceil((e-t)/i/2)*i,E$(n,c,t,e,s),u.push(t,c,c,e))}});var iR=X((Flt,P_)=>{"use strict";P_.exports=Td;P_.exports.default=Td;function Td(n,t,e){e=e||2;var i=t&&t.length,s=i?t[0]*e:n.length,u=eR(n,0,s,e,!0),c=[];if(!u||u.next===u.prev)return c;var f,p,d,g,y,v,E;if(i&&(u=O$(n,t,u,e)),n.length>80*e){f=d=n[0],p=g=n[1];for(var M=e;M<s;M+=e)y=n[M],v=n[M+1],y<f&&(f=y),v<p&&(p=v),y>d&&(d=y),v>g&&(g=v);E=Math.max(d-f,g-p),E=E!==0?32767/E:0}return Ef(u,c,e,f,p,E,0),c}function eR(n,t,e,i,s){var u,c;if(s===I_(n,t,e,i)>0)for(u=t;u<e;u+=i)c=tR(u,n[u],n[u+1],c);else for(u=e-i;u>=t;u-=i)c=tR(u,n[u],n[u+1],c);return c&&Cd(c,c.next)&&(wf(c),c=c.next),c}function du(n,t){if(!n)return n;t||(t=n);var e=n,i;do if(i=!1,!e.steiner&&(Cd(e,e.next)||tr(e.prev,e,e.next)===0)){if(wf(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Ef(n,t,e,i,s,u,c){if(n){!c&&u&&z$(n,i,s,u);for(var f=n,p,d;n.prev!==n.next;){if(p=n.prev,d=n.next,u?R$(n,i,s,u):P$(n)){t.push(p.i/e|0),t.push(n.i/e|0),t.push(d.i/e|0),wf(n),n=d.next,f=d.next;continue}if(n=d,n===f){c?c===1?(n=L$(du(n),t,e),Ef(n,t,e,i,s,u,2)):c===2&&N$(n,t,e,i,s,u):Ef(du(n),t,e,i,s,u,1);break}}}}function P$(n){var t=n.prev,e=n,i=n.next;if(tr(t,e,i)>=0)return!1;for(var s=t.x,u=e.x,c=i.x,f=t.y,p=e.y,d=i.y,g=s<u?s<c?s:c:u<c?u:c,y=f<p?f<d?f:d:p<d?p:d,v=s>u?s>c?s:c:u>c?u:c,E=f>p?f>d?f:d:p>d?p:d,M=i.next;M!==t;){if(M.x>=g&&M.x<=v&&M.y>=y&&M.y<=E&&Gl(s,f,u,p,c,d,M.x,M.y)&&tr(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function R$(n,t,e,i){var s=n.prev,u=n,c=n.next;if(tr(s,u,c)>=0)return!1;for(var f=s.x,p=u.x,d=c.x,g=s.y,y=u.y,v=c.y,E=f<p?f<d?f:d:p<d?p:d,M=g<y?g<v?g:v:y<v?y:v,A=f>p?f>d?f:d:p>d?p:d,_=g>y?g>v?g:v:y>v?y:v,x=T_(E,M,t,e,i),T=T_(A,_,t,e,i),w=n.prevZ,R=n.nextZ;w&&w.z>=x&&R&&R.z<=T;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Gl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0||(w=w.prevZ,R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Gl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;w&&w.z>=x;){if(w.x>=E&&w.x<=A&&w.y>=M&&w.y<=_&&w!==s&&w!==c&&Gl(f,g,p,y,d,v,w.x,w.y)&&tr(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;R&&R.z<=T;){if(R.x>=E&&R.x<=A&&R.y>=M&&R.y<=_&&R!==s&&R!==c&&Gl(f,g,p,y,d,v,R.x,R.y)&&tr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function L$(n,t,e){var i=n;do{var s=i.prev,u=i.next.next;!Cd(s,u)&&nR(s,i,i.next,u)&&Sf(s,u)&&Sf(u,s)&&(t.push(s.i/e|0),t.push(i.i/e|0),t.push(u.i/e|0),wf(i),wf(i.next),i=n=u),i=i.next}while(i!==n);return du(i)}function N$(n,t,e,i,s,u){var c=n;do{for(var f=c.next.next;f!==c.prev;){if(c.i!==f.i&&q$(c,f)){var p=rR(c,f);c=du(c,c.next),p=du(p,p.next),Ef(c,t,e,i,s,u,0),Ef(p,t,e,i,s,u,0);return}f=f.next}c=c.next}while(c!==n)}function O$(n,t,e,i){var s=[],u,c,f,p,d;for(u=0,c=t.length;u<c;u++)f=t[u]*i,p=u<c-1?t[u+1]*i:n.length,d=eR(n,f,p,i,!1),d===d.next&&(d.steiner=!0),s.push(k$(d));for(s.sort(D$),u=0;u<s.length;u++)e=F$(s[u],e);return e}function D$(n,t){return n.x-t.x}function F$(n,t){var e=U$(n,t);if(!e)return t;var i=rR(e,n);return du(i,i.next),du(e,e.next)}function U$(n,t){var e=t,i=n.x,s=n.y,u=-1/0,c;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var f=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=i&&f>u&&(u=f,c=e.x<e.next.x?e:e.next,f===i))return c}e=e.next}while(e!==t);if(!c)return null;var p=c,d=c.x,g=c.y,y=1/0,v;e=c;do i>=e.x&&e.x>=d&&i!==e.x&&Gl(s<g?i:u,s,d,g,s<g?u:i,s,e.x,e.y)&&(v=Math.abs(s-e.y)/(i-e.x),Sf(e,n)&&(v<y||v===y&&(e.x>c.x||e.x===c.x&&B$(c,e)))&&(c=e,y=v)),e=e.next;while(e!==p);return c}function B$(n,t){return tr(n.prev,n,t.prev)<0&&tr(t.next,n,n.next)<0}function z$(n,t,e,i){var s=n;do s.z===0&&(s.z=T_(s.x,s.y,t,e,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,G$(s)}function G$(n){var t,e,i,s,u,c,f,p,d=1;do{for(e=n,n=null,u=null,c=0;e;){for(c++,i=e,f=0,t=0;t<d&&(f++,i=i.nextZ,!!i);t++);for(p=d;f>0||p>0&&i;)f!==0&&(p===0||!i||e.z<=i.z)?(s=e,e=e.nextZ,f--):(s=i,i=i.nextZ,p--),u?u.nextZ=s:n=s,s.prevZ=u,u=s;e=i}u.nextZ=null,d*=2}while(c>1);return n}function T_(n,t,e,i,s){return n=(n-e)*s|0,t=(t-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function k$(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function Gl(n,t,e,i,s,u,c,f){return(s-c)*(t-f)>=(n-c)*(u-f)&&(n-c)*(i-f)>=(e-c)*(t-f)&&(e-c)*(u-f)>=(s-c)*(i-f)}function q$(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!V$(n,t)&&(Sf(n,t)&&Sf(t,n)&&H$(n,t)&&(tr(n.prev,n,t.prev)||tr(n,t.prev,t))||Cd(n,t)&&tr(n.prev,n,n.next)>0&&tr(t.prev,t,t.next)>0)}function tr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function Cd(n,t){return n.x===t.x&&n.y===t.y}function nR(n,t,e,i){var s=Ad(tr(n,t,e)),u=Ad(tr(n,t,i)),c=Ad(tr(e,i,n)),f=Ad(tr(e,i,t));return!!(s!==u&&c!==f||s===0&&bd(n,e,t)||u===0&&bd(n,i,t)||c===0&&bd(e,n,i)||f===0&&bd(e,t,i))}function bd(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function Ad(n){return n>0?1:n<0?-1:0}function V$(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&nR(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Sf(n,t){return tr(n.prev,n,n.next)<0?tr(n,t,n.next)>=0&&tr(n,n.prev,t)>=0:tr(n,t,n.prev)<0||tr(n,n.next,t)<0}function H$(n,t){var e=n,i=!1,s=(n.x+t.x)/2,u=(n.y+t.y)/2;do e.y>u!=e.next.y>u&&e.next.y!==e.y&&s<(e.next.x-e.x)*(u-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function rR(n,t){var e=new C_(n.i,n.x,n.y),i=new C_(t.i,t.x,t.y),s=n.next,u=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,u.next=i,i.prev=u,i}function tR(n,t,e,i){var s=new C_(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function wf(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function C_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Td.deviation=function(n,t,e,i){var s=t&&t.length,u=s?t[0]*e:n.length,c=Math.abs(I_(n,0,u,e));if(s)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,g=f<p-1?t[f+1]*e:n.length;c-=Math.abs(I_(n,d,g,e))}var y=0;for(f=0;f<i.length;f+=3){var v=i[f]*e,E=i[f+1]*e,M=i[f+2]*e;y+=Math.abs((n[v]-n[M])*(n[E+1]-n[v+1])-(n[v]-n[E])*(n[M+1]-n[v+1]))}return c===0&&y===0?0:Math.abs((y-c)/c)};function I_(n,t,e,i){for(var s=0,u=t,c=e-i;u<e;u+=i)s+=(n[c]-n[u])*(n[u+1]+n[c+1]),c=u;return s}Td.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,s=0;s<n.length;s++){for(var u=0;u<n[s].length;u++)for(var c=0;c<t;c++)e.vertices.push(n[s][u][c]);s>0&&(i+=n[s-1].length,e.holes.push(i))}return e}});var D_=X(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.earthRadius=63710088e-1;ge.factors={centimeters:ge.earthRadius*100,centimetres:ge.earthRadius*100,degrees:ge.earthRadius/111325,feet:ge.earthRadius*3.28084,inches:ge.earthRadius*39.37,kilometers:ge.earthRadius/1e3,kilometres:ge.earthRadius/1e3,meters:ge.earthRadius,metres:ge.earthRadius,miles:ge.earthRadius/1609.344,millimeters:ge.earthRadius*1e3,millimetres:ge.earthRadius*1e3,nauticalmiles:ge.earthRadius/1852,radians:1,yards:ge.earthRadius*1.0936};ge.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/ge.earthRadius,yards:1.0936133};ge.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Sa(n,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=n,i}ge.feature=Sa;function X$(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return R_(t).geometry;case"LineString":return N_(t).geometry;case"Polygon":return L_(t).geometry;case"MultiPoint":return sR(t).geometry;case"MultiLineString":return oR(t).geometry;case"MultiPolygon":return aR(t).geometry;default:throw new Error(n+" is invalid")}}ge.geometry=X$;function R_(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Id(n[0])||!Id(n[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:n};return Sa(i,t,e)}ge.point=R_;function Y$(n,t,e){return e===void 0&&(e={}),Pd(n.map(function(i){return R_(i,t)}),e)}ge.points=Y$;function L_(n,t,e){e===void 0&&(e={});for(var i=0,s=n;i<s.length;i++){var u=s[i];if(u.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var c=0;c<u[u.length-1].length;c++)if(u[u.length-1][c]!==u[0][c])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:n};return Sa(f,t,e)}ge.polygon=L_;function $$(n,t,e){return e===void 0&&(e={}),Pd(n.map(function(i){return L_(i,t)}),e)}ge.polygons=$$;function N_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:n};return Sa(i,t,e)}ge.lineString=N_;function Z$(n,t,e){return e===void 0&&(e={}),Pd(n.map(function(i){return N_(i,t)}),e)}ge.lineStrings=Z$;function Pd(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}ge.featureCollection=Pd;function oR(n,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:n};return Sa(i,t,e)}ge.multiLineString=oR;function sR(n,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:n};return Sa(i,t,e)}ge.multiPoint=sR;function aR(n,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:n};return Sa(i,t,e)}ge.multiPolygon=aR;function J$(n,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:n};return Sa(i,t,e)}ge.geometryCollection=J$;function j$(n,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(n*e)/e}ge.round=j$;function uR(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}ge.radiansToLength=uR;function O_(n,t){t===void 0&&(t="kilometers");var e=ge.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}ge.lengthToRadians=O_;function K$(n,t){return lR(O_(n,t))}ge.lengthToDegrees=K$;function Q$(n){var t=n%360;return t<0&&(t+=360),t}ge.bearingToAzimuth=Q$;function lR(n){var t=n%(2*Math.PI);return t*180/Math.PI}ge.radiansToDegrees=lR;function tZ(n){var t=n%360;return t*Math.PI/180}ge.degreesToRadians=tZ;function eZ(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return uR(O_(n,t),e)}ge.convertLength=eZ;function nZ(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var i=ge.areaFactors[t];if(!i)throw new Error("invalid original units");var s=ge.areaFactors[e];if(!s)throw new Error("invalid final units");return n/i*s}ge.convertArea=nZ;function Id(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}ge.isNumber=Id;function rZ(n){return!!n&&n.constructor===Object}ge.isObject=rZ;function iZ(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!Id(t))throw new Error("bbox must only contain numbers")})}ge.validateBBox=iZ;function oZ(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}ge.validateId=oZ});var U_=X(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});var ci=D_();function Mf(n,t,e){if(n!==null)for(var i,s,u,c,f,p,d,g=0,y=0,v,E=n.type,M=E==="FeatureCollection",A=E==="Feature",_=M?n.features.length:1,x=0;x<_;x++){d=M?n.features[x].geometry:A?n.geometry:n,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var T=0;T<f;T++){var w=0,R=0;if(c=v?d.geometries[T]:d,c!==null){p=c.coordinates;var B=c.type;switch(g=e&&(B==="Polygon"||B==="MultiPolygon")?1:0,B){case null:break;case"Point":if(t(p,y,x,w,R)===!1)return!1;y++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<p.length;i++){if(t(p[i],y,x,w,R)===!1)return!1;y++,B==="MultiPoint"&&w++}B==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<p.length;i++){for(s=0;s<p[i].length-g;s++){if(t(p[i][s],y,x,w,R)===!1)return!1;y++}B==="MultiLineString"&&w++,B==="Polygon"&&R++}B==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<p.length;i++){for(R=0,s=0;s<p[i].length;s++){for(u=0;u<p[i][s].length-g;u++){if(t(p[i][s][u],y,x,w,R)===!1)return!1;y++}R++}w++}break;case"GeometryCollection":for(i=0;i<c.geometries.length;i++)if(Mf(c.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function sZ(n,t,e,i){var s=e;return Mf(n,function(u,c,f,p,d){c===0&&e===void 0?s=u:s=t(s,u,c,f,p,d)},i),s}function cR(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function aZ(n,t,e){var i=e;return cR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function fR(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function uZ(n,t,e){var i=e;return fR(n,function(s,u){u===0&&e===void 0?i=s:i=t(i,s,u)}),i}function lZ(n){var t=[];return Mf(n,function(e){t.push(e)}),t}function F_(n,t){var e,i,s,u,c,f,p,d,g,y,v=0,E=n.type==="FeatureCollection",M=n.type==="Feature",A=E?n.features.length:1;for(e=0;e<A;e++){for(f=E?n.features[e].geometry:M?n.geometry:n,d=E?n.features[e].properties:M?n.properties:{},g=E?n.features[e].bbox:M?n.bbox:void 0,y=E?n.features[e].id:M?n.id:void 0,p=f?f.type==="GeometryCollection":!1,c=p?f.geometries.length:1,s=0;s<c;s++){if(u=p?f.geometries[s]:f,u===null){if(t(null,v,d,g,y)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(u,v,d,g,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<u.geometries.length;i++)if(t(u.geometries[i],v,d,g,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function cZ(n,t,e){var i=e;return F_(n,function(s,u,c,f,p){u===0&&e===void 0?i=s:i=t(i,s,u,c,f,p)}),i}function Rd(n,t){F_(n,function(e,i,s,u,c){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(ci.feature(e,s,{bbox:u,id:c}),i,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],y={type:p,coordinates:g};if(t(ci.feature(y,s),i,d)===!1)return!1}})}function fZ(n,t,e){var i=e;return Rd(n,function(s,u,c){u===0&&c===0&&e===void 0?i=s:i=t(i,s,u,c)}),i}function hR(n,t){Rd(n,function(e,i,s){var u=0;if(e.geometry){var c=e.geometry.type;if(!(c==="Point"||c==="MultiPoint")){var f,p=0,d=0,g=0;if(Mf(e,function(y,v,E,M,A){if(f===void 0||i>p||M>d||A>g){f=y,p=i,d=M,g=A,u=0;return}var _=ci.lineString([f,y],e.properties);if(t(_,i,s,A,u)===!1)return!1;u++,f=y})===!1)return!1}}})}function hZ(n,t,e){var i=e,s=!1;return hR(n,function(u,c,f,p,d){s===!1&&e===void 0?i=u:i=t(i,u,c,f,p,d),s=!0}),i}function pR(n,t){if(!n)throw new Error("geojson is required");Rd(n,function(e,i,s){if(e.geometry!==null){var u=e.geometry.type,c=e.geometry.coordinates;switch(u){case"LineString":if(t(e,i,s,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<c.length;f++)if(t(ci.lineString(c[f],e.properties),i,s,f)===!1)return!1;break}}})}function pZ(n,t,e){var i=e;return pR(n,function(s,u,c,f){u===0&&e===void 0?i=s:i=t(i,s,u,c,f)}),i}function dZ(n,t){if(t=t||{},!ci.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.segmentIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return u<0&&(u=p.length+u-1),ci.lineString([p[u],p[u+1]],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u-1),ci.lineString([p[s][u],p[s][u+1]],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u-1),ci.lineString([p[i][u],p[i][u+1]],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u-1),ci.lineString([p[i][s][u],p[i][s][u+1]],c,t)}throw new Error("geojson is invalid")}function gZ(n,t){if(t=t||{},!ci.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,s=t.geometryIndex||0,u=t.coordIndex||0,c=t.properties,f;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),c=c||n.features[e].properties,f=n.features[e].geometry;break;case"Feature":c=c||n.properties,f=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=n;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return ci.point(p,c,t);case"MultiPoint":return i<0&&(i=p.length+i),ci.point(p[i],c,t);case"LineString":return u<0&&(u=p.length+u),ci.point(p[u],c,t);case"Polygon":return s<0&&(s=p.length+s),u<0&&(u=p[s].length+u),ci.point(p[s][u],c,t);case"MultiLineString":return i<0&&(i=p.length+i),u<0&&(u=p[i].length+u),ci.point(p[i][u],c,t);case"MultiPolygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),u<0&&(u=p[i][s].length-u),ci.point(p[i][s][u],c,t)}throw new Error("geojson is invalid")}Mr.coordAll=lZ;Mr.coordEach=Mf;Mr.coordReduce=sZ;Mr.featureEach=fR;Mr.featureReduce=uZ;Mr.findPoint=gZ;Mr.findSegment=dZ;Mr.flattenEach=Rd;Mr.flattenReduce=fZ;Mr.geomEach=F_;Mr.geomReduce=cZ;Mr.lineEach=pR;Mr.lineReduce=pZ;Mr.propEach=cR;Mr.propReduce=aZ;Mr.segmentEach=hR;Mr.segmentReduce=hZ});var dR=X(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var mZ=U_();function B_(n){var t=[1/0,1/0,-1/0,-1/0];return mZ.coordEach(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}B_.default=B_;z_.default=B_});var Ld=X((Klt,G_)=>{var ns=f_(),mR=D_(),yR=U_(),kl=dR().default,yZ=yR.featureEach,Jlt=yR.coordEach,jlt=mR.polygon,gR=mR.featureCollection;function vR(n){var t=new ns(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:kl(e),ns.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:kl(s),i.push(s)}):yZ(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:kl(s),i.push(s)}),ns.prototype.load.call(this,i)},t.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:kl(e),ns.prototype.remove.call(this,e,i)},t.clear=function(){return ns.prototype.clear.call(this)},t.search=function(e){var i=ns.prototype.search.call(this,this.toBBox(e));return gR(i)},t.collides=function(e){return ns.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=ns.prototype.all.call(this);return gR(e)},t.toJSON=function(){return ns.prototype.toJSON.call(this)},t.fromJSON=function(e){return ns.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=kl(e);else if(e.type==="FeatureCollection")i=kl(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}G_.exports=vR;G_.exports.default=vR});var X_=X((aht,CR)=>{"use strict";var TR=Object.prototype.toString;CR.exports=function(t){var e=TR.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&TR.call(t.callee)==="[object Function]"),i}});var UR=X((uht,FR)=>{"use strict";var DR;Object.keys||(Tf=Object.prototype.hasOwnProperty,Y_=Object.prototype.toString,IR=X_(),$_=Object.prototype.propertyIsEnumerable,PR=!$_.call({toString:null},"toString"),RR=$_.call(function(){},"prototype"),Cf=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ud=function(n){var t=n.constructor;return t&&t.prototype===n},LR={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},NR=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!LR["$"+n]&&Tf.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{Ud(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),OR=function(n){if(typeof window=="undefined"||!NR)return Ud(n);try{return Ud(n)}catch(t){return!1}},DR=function(t){var e=t!==null&&typeof t=="object",i=Y_.call(t)==="[object Function]",s=IR(t),u=e&&Y_.call(t)==="[object String]",c=[];if(!e&&!i&&!s)throw new TypeError("Object.keys called on a non-object");var f=RR&&i;if(u&&t.length>0&&!Tf.call(t,0))for(var p=0;p<t.length;++p)c.push(String(p));if(s&&t.length>0)for(var d=0;d<t.length;++d)c.push(String(d));else for(var g in t)!(f&&g==="prototype")&&Tf.call(t,g)&&c.push(String(g));if(PR)for(var y=OR(t),v=0;v<Cf.length;++v)!(y&&Cf[v]==="constructor")&&Tf.call(t,Cf[v])&&c.push(Cf[v]);return c});var Tf,Y_,IR,$_,PR,RR,Cf,Ud,LR,NR,OR;FR.exports=DR});var Z_=X((lht,GR)=>{"use strict";var TZ=Array.prototype.slice,CZ=X_(),BR=Object.keys,Bd=BR?function(t){return BR(t)}:UR(),zR=Object.keys;Bd.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(i){return CZ(i)?zR(TZ.call(i)):zR(i)})}else Object.keys=Bd;return Object.keys||Bd};GR.exports=Bd});var J_=X((cht,kR)=>{"use strict";kR.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==s||f.enumerable!==!0)return!1}return!0}});var zd=X((fht,qR)=>{"use strict";var IZ=J_();qR.exports=function(){return IZ()&&!!Symbol.toStringTag}});var j_=X((hht,VR)=>{"use strict";VR.exports=Object});var K_=X((pht,HR)=>{"use strict";HR.exports=Error});var XR=X((dht,WR)=>{"use strict";WR.exports=EvalError});var $R=X((ght,YR)=>{"use strict";YR.exports=RangeError});var JR=X((mht,ZR)=>{"use strict";ZR.exports=ReferenceError});var Q_=X((yht,jR)=>{"use strict";jR.exports=SyntaxError});var gu=X((vht,KR)=>{"use strict";KR.exports=TypeError});var tL=X((_ht,QR)=>{"use strict";QR.exports=URIError});var nL=X((xht,eL)=>{"use strict";eL.exports=Math.abs});var iL=X((Eht,rL)=>{"use strict";rL.exports=Math.floor});var sL=X((Sht,oL)=>{"use strict";oL.exports=Math.max});var uL=X((wht,aL)=>{"use strict";aL.exports=Math.min});var cL=X((Mht,lL)=>{"use strict";lL.exports=Math.pow});var hL=X((bht,fL)=>{"use strict";fL.exports=Math.round});var dL=X((Aht,pL)=>{"use strict";pL.exports=Number.isNaN||function(t){return t!==t}});var mL=X((Tht,gL)=>{"use strict";var PZ=dL();gL.exports=function(t){return PZ(t)||t===0?t:t<0?-1:1}});var vL=X((Cht,yL)=>{"use strict";yL.exports=Object.getOwnPropertyDescriptor});var mu=X((Iht,_L)=>{"use strict";var Gd=vL();if(Gd)try{Gd([],"length")}catch(n){Gd=null}_L.exports=Gd});var If=X((Pht,xL)=>{"use strict";var kd=Object.defineProperty||!1;if(kd)try{kd({},"a",{value:1})}catch(n){kd=!1}xL.exports=kd});var wL=X((Rht,SL)=>{"use strict";var EL=typeof Symbol!="undefined"&&Symbol,RZ=J_();SL.exports=function(){return typeof EL!="function"||typeof Symbol!="function"||typeof EL("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:RZ()}});var tx=X((Lht,ML)=>{"use strict";ML.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var ex=X((Nht,bL)=>{"use strict";var LZ=j_();bL.exports=LZ.getPrototypeOf||null});var CL=X((Oht,TL)=>{"use strict";var NZ="Function.prototype.bind called on incompatible ",OZ=Object.prototype.toString,DZ=Math.max,FZ="[object Function]",AL=function(t,e){for(var i=[],s=0;s<t.length;s+=1)i[s]=t[s];for(var u=0;u<e.length;u+=1)i[u+t.length]=e[u];return i},UZ=function(t,e){for(var i=[],s=e||0,u=0;s<t.length;s+=1,u+=1)i[u]=t[s];return i},BZ=function(n,t){for(var e="",i=0;i<n.length;i+=1)e+=n[i],i+1<n.length&&(e+=t);return e};TL.exports=function(t){var e=this;if(typeof e!="function"||OZ.apply(e)!==FZ)throw new TypeError(NZ+e);for(var i=UZ(arguments,1),s,u=function(){if(this instanceof s){var g=e.apply(this,AL(i,arguments));return Object(g)===g?g:this}return e.apply(t,AL(i,arguments))},c=DZ(0,e.length-i.length),f=[],p=0;p<c;p++)f[p]="$"+p;if(s=Function("binder","return function ("+BZ(f,",")+"){ return binder.apply(this,arguments); }")(u),e.prototype){var d=function(){};d.prototype=e.prototype,s.prototype=new d,d.prototype=null}return s}});var ql=X((Dht,IL)=>{"use strict";var zZ=CL();IL.exports=Function.prototype.bind||zZ});var qd=X((Fht,PL)=>{"use strict";PL.exports=Function.prototype.call});var Vd=X((Uht,RL)=>{"use strict";RL.exports=Function.prototype.apply});var NL=X((Bht,LL)=>{"use strict";LL.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var nx=X((zht,OL)=>{"use strict";var GZ=ql(),kZ=Vd(),qZ=qd(),VZ=NL();OL.exports=VZ||GZ.call(qZ,kZ)});var Hd=X((Ght,DL)=>{"use strict";var HZ=ql(),WZ=gu(),XZ=qd(),YZ=nx();DL.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new WZ("a function is required");return YZ(HZ,XZ,t)}});var kL=X((kht,GL)=>{"use strict";var $Z=Hd(),FL=mu(),BL;try{BL=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var rx=!!BL&&FL&&FL(Object.prototype,"__proto__"),zL=Object,UL=zL.getPrototypeOf;GL.exports=rx&&typeof rx.get=="function"?$Z([rx.get]):typeof UL=="function"?function(t){return UL(t==null?t:zL(t))}:!1});var ix=X((qht,WL)=>{"use strict";var qL=tx(),VL=ex(),HL=kL();WL.exports=qL?function(t){return qL(t)}:VL?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return VL(t)}:HL?function(t){return HL(t)}:null});var ox=X((Vht,XL)=>{"use strict";var ZZ=Function.prototype.call,JZ=Object.prototype.hasOwnProperty,jZ=ql();XL.exports=jZ.call(ZZ,JZ)});var ux=X((Hht,KL)=>{"use strict";var tn,KZ=j_(),QZ=K_(),tJ=XR(),eJ=$R(),nJ=JR(),Xl=Q_(),Wl=gu(),rJ=tL(),iJ=nL(),oJ=iL(),sJ=sL(),aJ=uL(),uJ=cL(),lJ=hL(),cJ=mL(),JL=Function,sx=function(n){try{return JL('"use strict"; return ('+n+").constructor;")()}catch(t){}},Pf=mu(),fJ=If(),ax=function(){throw new Wl},hJ=Pf?function(){try{return arguments.callee,ax}catch(n){try{return Pf(arguments,"callee").get}catch(t){return ax}}}():ax,Vl=wL()(),Gr=ix(),pJ=ex(),dJ=tx(),jL=Vd(),Rf=qd(),Hl={},gJ=typeof Uint8Array=="undefined"||!Gr?tn:Gr(Uint8Array),yu={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?tn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?tn:ArrayBuffer,"%ArrayIteratorPrototype%":Vl&&Gr?Gr([][Symbol.iterator]()):tn,"%AsyncFromSyncIteratorPrototype%":tn,"%AsyncFunction%":Hl,"%AsyncGenerator%":Hl,"%AsyncGeneratorFunction%":Hl,"%AsyncIteratorPrototype%":Hl,"%Atomics%":typeof Atomics=="undefined"?tn:Atomics,"%BigInt%":typeof BigInt=="undefined"?tn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?tn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?tn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?tn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":QZ,"%eval%":eval,"%EvalError%":tJ,"%Float16Array%":typeof Float16Array=="undefined"?tn:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?tn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?tn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?tn:FinalizationRegistry,"%Function%":JL,"%GeneratorFunction%":Hl,"%Int8Array%":typeof Int8Array=="undefined"?tn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?tn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?tn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vl&&Gr?Gr(Gr([][Symbol.iterator]())):tn,"%JSON%":typeof JSON=="object"?JSON:tn,"%Map%":typeof Map=="undefined"?tn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Vl||!Gr?tn:Gr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":KZ,"%Object.getOwnPropertyDescriptor%":Pf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?tn:Promise,"%Proxy%":typeof Proxy=="undefined"?tn:Proxy,"%RangeError%":eJ,"%ReferenceError%":nJ,"%Reflect%":typeof Reflect=="undefined"?tn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?tn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Vl||!Gr?tn:Gr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?tn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vl&&Gr?Gr(""[Symbol.iterator]()):tn,"%Symbol%":Vl?Symbol:tn,"%SyntaxError%":Xl,"%ThrowTypeError%":hJ,"%TypedArray%":gJ,"%TypeError%":Wl,"%Uint8Array%":typeof Uint8Array=="undefined"?tn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?tn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?tn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?tn:Uint32Array,"%URIError%":rJ,"%WeakMap%":typeof WeakMap=="undefined"?tn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?tn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?tn:WeakSet,"%Function.prototype.call%":Rf,"%Function.prototype.apply%":jL,"%Object.defineProperty%":fJ,"%Object.getPrototypeOf%":pJ,"%Math.abs%":iJ,"%Math.floor%":oJ,"%Math.max%":sJ,"%Math.min%":aJ,"%Math.pow%":uJ,"%Math.round%":lJ,"%Math.sign%":cJ,"%Reflect.getPrototypeOf%":dJ};if(Gr)try{null.error}catch(n){YL=Gr(Gr(n)),yu["%Error.prototype%"]=YL}var YL,mJ=function n(t){var e;if(t==="%AsyncFunction%")e=sx("async function () {}");else if(t==="%GeneratorFunction%")e=sx("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=sx("async function* () {}");else if(t==="%AsyncGenerator%"){var i=n("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&Gr&&(e=Gr(s.prototype))}return yu[t]=e,e},$L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Lf=ql(),Wd=ox(),yJ=Lf.call(Rf,Array.prototype.concat),vJ=Lf.call(jL,Array.prototype.splice),ZL=Lf.call(Rf,String.prototype.replace),Xd=Lf.call(Rf,String.prototype.slice),_J=Lf.call(Rf,RegExp.prototype.exec),xJ=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,EJ=/\\\\(\\\\)?/g,SJ=function(t){var e=Xd(t,0,1),i=Xd(t,-1);if(e==="%"&&i!=="%")throw new Xl("invalid intrinsic syntax, expected closing \`%\`");if(i==="%"&&e!=="%")throw new Xl("invalid intrinsic syntax, expected opening \`%\`");var s=[];return ZL(t,xJ,function(u,c,f,p){s[s.length]=f?ZL(p,EJ,"$1"):c||u}),s},wJ=function(t,e){var i=t,s;if(Wd($L,i)&&(s=$L[i],i="%"+s[0]+"%"),Wd(yu,i)){var u=yu[i];if(u===Hl&&(u=mJ(i)),typeof u=="undefined"&&!e)throw new Wl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:u}}throw new Xl("intrinsic "+t+" does not exist!")};KL.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Wl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Wl('"allowMissing" argument must be a boolean');if(_J(/^%?[^%]*%?$/,t)===null)throw new Xl("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var i=SJ(t),s=i.length>0?i[0]:"",u=wJ("%"+s+"%",e),c=u.name,f=u.value,p=!1,d=u.alias;d&&(s=d[0],vJ(i,yJ([0,1],d)));for(var g=1,y=!0;g<i.length;g+=1){var v=i[g],E=Xd(v,0,1),M=Xd(v,-1);if((E==='"'||E==="'"||E==="\`"||M==='"'||M==="'"||M==="\`")&&E!==M)throw new Xl("property names with quotes must have matching quotes");if((v==="constructor"||!y)&&(p=!0),s+="."+v,c="%"+s+"%",Wd(yu,c))f=yu[c];else if(f!=null){if(!(v in f)){if(!e)throw new Wl("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pf&&g+1>=i.length){var A=Pf(f,v);y=!!A,y&&"get"in A&&!("originalValue"in A.get)?f=A.get:f=f[v]}else y=Wd(f,v),f=f[v];y&&!p&&(yu[c]=f)}}return f}});var Yd=X((Wht,eN)=>{"use strict";var QL=ux(),tN=Hd(),MJ=tN([QL("%String.prototype.indexOf%")]);eN.exports=function(t,e){var i=QL(t,!!e);return typeof i=="function"&&MJ(t,".prototype.")>-1?tN([i]):i}});var iN=X((Xht,rN)=>{"use strict";var bJ=zd()(),AJ=Yd(),lx=AJ("Object.prototype.toString"),$d=function(t){return bJ&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:lx(t)==="[object Arguments]"},nN=function(t){return $d(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&lx(t)!=="[object Array]"&&"callee"in t&&lx(t.callee)==="[object Function]"},TJ=function(){return $d(arguments)}();$d.isLegacyArguments=nN;rN.exports=TJ?$d:nN});var Zd=X((Yht,aN)=>{"use strict";var oN=If(),CJ=Q_(),Yl=gu(),sN=mu();aN.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Yl("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new Yl("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Yl("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Yl("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Yl("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Yl("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!sN&&sN(t,e);if(oN)oN(t,e,{configurable:c===null&&p?p.configurable:!c,enumerable:s===null&&p?p.enumerable:!s,value:i,writable:u===null&&p?p.writable:!u});else if(f||!s&&!u&&!c)t[e]=i;else throw new CJ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Jd=X(($ht,lN)=>{"use strict";var cx=If(),uN=function(){return!!cx};uN.hasArrayLengthDefineBug=function(){if(!cx)return null;try{return cx([],"length",{value:1}).length!==1}catch(t){return!0}};lN.exports=uN});var $l=X((Zht,pN)=>{"use strict";var IJ=Z_(),PJ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",RJ=Object.prototype.toString,LJ=Array.prototype.concat,cN=Zd(),NJ=function(n){return typeof n=="function"&&RJ.call(n)==="[object Function]"},fN=Jd()(),OJ=function(n,t,e,i){if(t in n){if(i===!0){if(n[t]===e)return}else if(!NJ(i)||!i())return}fN?cN(n,t,e,!0):cN(n,t,e)},hN=function(n,t){var e=arguments.length>2?arguments[2]:{},i=IJ(t);PJ&&(i=LJ.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)OJ(n,i[s],t[i[s]],e[i[s]])};hN.supportsDescriptors=!!fN;pN.exports=hN});var vN=X((Jht,yN)=>{"use strict";var DJ=ux(),dN=Zd(),FJ=Jd()(),gN=mu(),mN=gu(),UJ=DJ("%Math.floor%");yN.exports=function(t,e){if(typeof t!="function")throw new mN("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||UJ(e)!==e)throw new mN("\`length\` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,u=!0;if("length"in t&&gN){var c=gN(t,"length");c&&!c.configurable&&(s=!1),c&&!c.writable&&(u=!1)}return(s||u||!i)&&(FJ?dN(t,"length",e,!0,!0):dN(t,"length",e)),t}});var xN=X((jht,_N)=>{"use strict";var BJ=ql(),zJ=Vd(),GJ=nx();_N.exports=function(){return GJ(BJ,zJ,arguments)}});var fx=X((Kht,jd)=>{"use strict";var kJ=vN(),EN=If(),qJ=Hd(),SN=xN();jd.exports=function(t){var e=qJ(arguments),i=t.length-(arguments.length-1);return kJ(e,1+(i>0?i:0),!0)};EN?EN(jd.exports,"apply",{value:SN}):jd.exports.apply=SN});var hx=X((Qht,MN)=>{"use strict";var wN=function(n){return n!==n};MN.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||wN(t)&&wN(e))}});var px=X((tpt,bN)=>{"use strict";var VJ=hx();bN.exports=function(){return typeof Object.is=="function"?Object.is:VJ}});var TN=X((ept,AN)=>{"use strict";var HJ=px(),WJ=$l();AN.exports=function(){var t=HJ();return WJ(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var RN=X((npt,PN)=>{"use strict";var XJ=$l(),YJ=fx(),$J=hx(),CN=px(),ZJ=TN(),IN=YJ(CN(),Object);XJ(IN,{getPolyfill:CN,implementation:$J,shim:ZJ});PN.exports=IN});var UN=X((rpt,FN)=>{"use strict";var LN=Yd(),JJ=zd()(),jJ=ox(),KJ=mu(),mx;JJ?(NN=LN("RegExp.prototype.exec"),dx={},Kd=function(){throw dx},gx={toString:Kd,valueOf:Kd},typeof Symbol.toPrimitive=="symbol"&&(gx[Symbol.toPrimitive]=Kd),mx=function(t){if(!t||typeof t!="object")return!1;var e=KJ(t,"lastIndex"),i=e&&jJ(e,"value");if(!i)return!1;try{NN(t,gx)}catch(s){return s===dx}}):(ON=LN("Object.prototype.toString"),DN="[object RegExp]",mx=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:ON(t)===DN});var NN,dx,Kd,gx,ON,DN;FN.exports=mx});var zN=X((ipt,BN)=>{"use strict";var Of=function(){return typeof function(){}.name=="string"},Nf=Object.getOwnPropertyDescriptor;if(Nf)try{Nf([],"length")}catch(n){Nf=null}Of.functionsHaveConfigurableNames=function(){if(!Of()||!Nf)return!1;var t=Nf(function(){},"name");return!!t&&!!t.configurable};var QJ=Function.prototype.bind;Of.boundFunctionsHaveNames=function(){return Of()&&typeof QJ=="function"&&function(){}.bind().name!==""};BN.exports=Of});var qN=X((opt,kN)=>{"use strict";var GN=Zd(),tj=Jd()(),ej=zN().functionsHaveConfigurableNames(),nj=gu();kN.exports=function(t,e){if(typeof t!="function")throw new nj("\`fn\` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||ej)&&(tj?GN(t,"name",e,!0,!0):GN(t,"name",e)),t}});var yx=X((spt,VN)=>{"use strict";var rj=qN(),ij=gu(),oj=Object;VN.exports=rj(function(){if(this==null||this!==oj(this))throw new ij("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var vx=X((apt,HN)=>{"use strict";var sj=yx(),aj=$l().supportsDescriptors,uj=Object.getOwnPropertyDescriptor;HN.exports=function(){if(aj&&/a/mig.flags==="gim"){var t=uj(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),t.get.call(i),e==="dy")return t.get}}return sj}});var YN=X((upt,XN)=>{"use strict";var lj=$l().supportsDescriptors,cj=vx(),fj=mu(),hj=Object.defineProperty,pj=K_(),WN=ix(),dj=/a/;XN.exports=function(){if(!lj||!WN)throw new pj("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=cj(),e=WN(dj),i=fj(e,"flags");return(!i||i.get!==t)&&hj(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var jN=X((lpt,JN)=>{"use strict";var gj=$l(),mj=fx(),yj=yx(),$N=vx(),vj=YN(),ZN=mj($N());gj(ZN,{getPolyfill:$N,implementation:yj,shim:vj});JN.exports=ZN});var t2=X((cpt,QN)=>{"use strict";var KN=Yd(),_j=KN("Date.prototype.getDay"),xj=function(t){try{return _j(t),!0}catch(e){return!1}},Ej=KN("Object.prototype.toString"),Sj="[object Date]",wj=zd()();QN.exports=function(t){return typeof t!="object"||t===null?!1:wj?xj(t):Ej(t)===Sj}});var _x=X((fpt,f2)=>{var e2=Z_(),n2=iN(),r2=RN(),i2=UN(),o2=jN(),s2=t2(),a2=Date.prototype.getTime;function c2(n,t,e){var i=e||{};return(i.strict?r2(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?i.strict?r2(n,t):n==t:Mj(n,t,i)}function u2(n){return n==null}function l2(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function Mj(n,t,e){var i,s;if(typeof n!=typeof t||u2(n)||u2(t)||n.prototype!==t.prototype||n2(n)!==n2(t))return!1;var u=i2(n),c=i2(t);if(u!==c)return!1;if(u||c)return n.source===t.source&&o2(n)===o2(t);if(s2(n)&&s2(t))return a2.call(n)===a2.call(t);var f=l2(n),p=l2(t);if(f!==p)return!1;if(f||p){if(n.length!==t.length)return!1;for(i=0;i<n.length;i++)if(n[i]!==t[i])return!1;return!0}if(typeof n!=typeof t)return!1;try{var d=e2(n),g=e2(t)}catch(y){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),i=d.length-1;i>=0;i--)if(d[i]!=g[i])return!1;for(i=d.length-1;i>=0;i--)if(s=d[i],!c2(n[s],t[s],e))return!1;return!0}f2.exports=c2});var Rx=X((ygt,v2)=>{var dK=_x(),rs=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:gK};rs.prototype.compare=function(n,t){if(n.type!==t.type||!y2(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,i=m2(n),s=m2(t);return i.every(function(u){return this.some(function(c){return e.compare(u,c)})},s)}}return!1};function m2(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function y2(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}rs.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};rs.prototype.compareLine=function(n,t,e,i){if(!y2(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),u=this.pseudoNode?t:this.removePseudo(t);if(!(i&&!this.compareCoord(s[0],u[0])&&(u=this.fixStartIndex(u,s),!u))){var c=this.compareCoord(s[e],u[e]);return this.direction||c?this.comparePath(s,u):this.compareCoord(s[e],u[u.length-(1+e)])?this.comparePath(s.slice().reverse(),u):!1}};rs.prototype.fixStartIndex=function(n,t){for(var e,i=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){i=s;break}return i>=0&&(e=[].concat(n.slice(i,n.length),n.slice(1,i+1))),e};rs.prototype.comparePath=function(n,t){var e=this;return n.every(function(i,s){return e.compareCoord(i,this[s])},t)};rs.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),i=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(u){return this.some(function(c){return s.compareLine(u,c,1,!0)})},i)}else return!1};rs.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};rs.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};rs.prototype.removePseudo=function(n){return n};function gK(n,t){return dK(n,t,{strict:!0})}v2.exports=rs});var _2=X((Igt,eg)=>{function Ma(n,t,e,i){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(n,t,e,i)}Ma.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var u=this._regionQuery(s);if(u.length<this.minPts)this.noise.push(s);else{var c=this.clusters.length;this.clusters.push([]),this._addToCluster(s,c),this._expandCluster(c,u)}}return this.clusters};Ma.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};Ma.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var i=t[e];if(this._visited[i]!==1){this._visited[i]=1;var s=this._regionQuery(i);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[i]!==1&&this._addToCluster(i,n)}};Ma.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};Ma.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var i=this.distance(this.dataset[n],this.dataset[e]);i<this.epsilon&&t.push(e)}return t};Ma.prototype._mergeArrays=function(n,t){for(var e=t.length,i=0;i<e;i++){var s=t[i];n.indexOf(s)<0&&n.push(s)}return n};Ma.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof eg!="undefined"&&eg.exports&&(eg.exports=Ma)});var x2=X((Pgt,ng)=>{function ba(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ba.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ba.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,i=0;i<this.k;i++)this.centroids[i]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var u=0;u<this.k;u++){for(var c=new Array(g),f=0,p=0;p<g;p++)c[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(u===this.assignments[d]){for(var p=0;p<g;p++)c[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<g;p++)c[p]/=f;this.centroids[u]=c}else this.centroids[u]=this.randomCentroid(),s=!0}}return this.getClusters()};ba.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ba.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,i=0;i<t;i++)e=this.argmin(this.dataset[i],this.centroids,this.distance),e!=this.assignments[i]&&(this.assignments[i]=e,n=!0);return n};ba.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ba.prototype.argmin=function(n,t,e){for(var i=Number.MAX_VALUE,s=0,u=t.length,c,f=0;f<u;f++)c=e(n,t[f]),c<i&&(i=c,s=f);return s};ba.prototype.distance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;){var s=n[i]-t[i];e+=s*s}return Math.sqrt(e)};typeof ng!="undefined"&&ng.exports&&(ng.exports=ba)});var Lx=X((Rgt,rg)=>{function is(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}is.prototype.insert=function(n,t){for(var e=this._queue.length,i=e;i--;){var s=this._priorities[i];this._sorting==="desc"?t>s&&(e=i):t<s&&(e=i)}this._insertAt(n,t,e)};is.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};is.prototype.forEach=function(n){this._queue.forEach(n)};is.prototype.getElements=function(){return this._queue};is.prototype.getElementPriority=function(n){return this._priorities[n]};is.prototype.getPriorities=function(){return this._priorities};is.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};is.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var i=0;i<n.length;i++)this.insert(n[i],t[i])}e&&(this._sorting=e)};is.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof rg!="undefined"&&rg.exports&&(rg.exports=is)});var S2=X((Lgt,Jl)=>{typeof Jl!="undefined"&&Jl.exports&&(E2=Lx());var E2;function Bs(n,t,e,i){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,i)}Bs.prototype.run=function(n,t,e,i){this._init(n,t,e,i);for(var s=0,u=this.dataset.length;s<u;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var c=this.clusters.length-1;this._orderedList.push(s);var f=new E2(null,null,"asc"),p=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,p,f),this._expandCluster(c,f))}return this.clusters};Bs.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var i=this._orderedList[t],s=this._reachability[i];n.push([i,s])}return n};Bs.prototype._init=function(n,t,e,i){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),i&&(this.distance=i)};Bs.prototype._updateQueue=function(n,t,e){var i=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(i._processed[s]===void 0){var u=i.distance(i.dataset[n],i.dataset[s]),c=Math.max(i._coreDistance,u);i._reachability[s]===void 0?(i._reachability[s]=c,e.insert(s,c)):c<i._reachability[s]&&(i._reachability[s]=c,e.remove(s),e.insert(s,c))}})};Bs.prototype._expandCluster=function(n,t){for(var e=t.getElements(),i=0,s=e.length;i<s;i++){var u=e[i];if(this._processed[u]===void 0){var c=this._regionQuery(u);this._processed[u]=1,this.clusters[n].push(u),this._orderedList.push(u),this._distanceToCore(u)!==void 0&&(this._updateQueue(u,c,t),this._expandCluster(n,t))}}};Bs.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var i=this._regionQuery(n,e);if(i.length>=this.minPts)return e}};Bs.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],i=0,s=this.dataset.length;i<s;i++)this.distance(this.dataset[n],this.dataset[i])<t&&e.push(i);return e};Bs.prototype._euclideanDistance=function(n,t){for(var e=0,i=Math.min(n.length,t.length);i--;)e+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(e)};typeof Jl!="undefined"&&Jl.exports&&(Jl.exports=Bs)});var w2=X((Ngt,ig)=>{typeof ig!="undefined"&&ig.exports&&(ig.exports={DBSCAN:_2(),KMEANS:x2(),OPTICS:S2(),PriorityQueue:Lx()})});var Nx=X((zgt,b2)=>{"use strict";b2.exports={eudist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++){var f=(t[c]||0)-(e[c]||0);u+=f*f}return i?Math.sqrt(u):u},mandist:function(t,e,i){for(var s=t.length,u=0,c=0;c<s;c++)u+=Math.abs((t[c]||0)-(e[c]||0));return i?Math.sqrt(u):u},dist:function(t,e,i){var s=Math.abs(t-e);return i?s:s*s}}});var C2=X((Ggt,T2)=>{"use strict";var A2=Nx(),EK=A2.eudist,SK=A2.dist;T2.exports={kmrand:function(t,e){for(var i={},s=[],u=e<<2,c=t.length,f=t[0].length>0;s.length<e&&u-- >0;){var p=t[Math.floor(Math.random()*c)],d=f?p.join("_"):""+p;i[d]||(i[d]=!0,s.push(p))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var i=t[0].length?EK:SK,s=[],u=t.length,c=t[0].length>0,f={},p=t[Math.floor(Math.random()*u)],d=c?p.join("_"):""+p;for(s.push(p),f[d]=!0;s.length<e;){for(var g=[],y=s.length,v=0,E=[],M=0;M<u;M++){for(var A=1/0,_=0;_<y;_++){var x=i(t[M],s[_]);x<=A&&(A=x)}g[M]=A}for(var T=0;T<u;T++)v+=g[T];for(var w=0;w<u;w++)E[w]={i:w,v:t[w],pr:g[w]/v,cs:0};E.sort(function(D,P){return D.pr-P.pr}),E[0].cs=E[0].pr;for(var R=1;R<u;R++)E[R].cs=E[R-1].cs+E[R].pr;for(var B=Math.random(),U=0;U<u-1&&E[U++].cs<B;);s.push(E[U-1].v)}return s}}});var N2=X((Vgt,L2)=>{"use strict";var Ox=Nx(),R2=C2(),wK=Ox.eudist,kgt=Ox.mandist,qgt=Ox.dist,MK=R2.kmrand,bK=R2.kmpp,I2=1e4;function P2(n,t,e){e=e||[];for(var i=0;i<n;i++)e[i]=t;return e}function AK(n,t,e,i){var s=[],u=[],c=[],f=[],p=!1,d=i||I2,g=n.length,y=n[0].length,v=y>0,E=[];if(e)e=="kmrand"?s=MK(n,t):e=="kmpp"?s=bK(n,t):s=e;else for(var M={};s.length<t;){var A=Math.floor(Math.random()*g);M[A]||(M[A]=!0,s.push(n[A]))}do{P2(t,0,E);for(var _=0;_<g;_++){for(var x=1/0,T=0,w=0;w<t;w++){var f=v?wK(n[_],s[w]):Math.abs(n[_]-s[w]);f<=x&&(x=f,T=w)}c[_]=T,E[T]++}for(var R=[],u=[],B=0,U=0;U<t;U++)R[U]=v?P2(y,0,R[U]):0,u[U]=s[U];if(v){for(var D=0;D<t;D++)s[D]=[];for(var P=0;P<g;P++)for(var ct=c[P],L=R[ct],W=n[P],V=0;V<y;V++)L[V]+=W[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var $=s[Mt],gt=R[Mt],ft=u[Mt],vt=E[Mt],it=0;it<y;it++)$[it]=gt[it]/vt||0;if(p){for(var lt=0;lt<y;lt++)if(ft[lt]!=$[lt]){p=!1;break}}}}else{for(var H=0;H<g;H++){var At=c[H];R[At]+=n[H]}for(var It=0;It<t;It++)s[It]=R[It]/E[It]||0;p=!0;for(var jt=0;jt<t;jt++)if(u[jt]!=s[jt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:I2-d,k:t,idxs:c,centroids:s}}L2.exports=AK});var ec=X((Gx,kx)=>{(function(n,t){typeof Gx=="object"&&typeof kx!="undefined"?kx.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(Gx,function(){"use strict";function n(j,b){var I={label:0,sent:function(){if(G[0]&1)throw G[1];return G[1]},trys:[],ops:[]},F,k,G,rt;return rt={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function tt(ht){return function(O){return pt([ht,O])}}function pt(ht){if(F)throw new TypeError("Generator is already executing.");for(;I;)try{if(F=1,k&&(G=ht[0]&2?k.return:ht[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,ht[1])).done)return G;switch(k=0,G&&(ht=[ht[0]&2,G.value]),ht[0]){case 0:case 1:G=ht;break;case 4:return I.label++,{value:ht[1],done:!1};case 5:I.label++,k=ht[1],ht=[0];continue;case 7:ht=I.ops.pop(),I.trys.pop();continue;default:if(G=I.trys,!(G=G.length>0&&G[G.length-1])&&(ht[0]===6||ht[0]===2)){I=0;continue}if(ht[0]===3&&(!G||ht[1]>G[0]&&ht[1]<G[3])){I.label=ht[1];break}if(ht[0]===6&&I.label<G[1]){I.label=G[1],G=ht;break}if(G&&I.label<G[2]){I.label=G[2],I.ops.push(ht);break}G[2]&&I.ops.pop(),I.trys.pop();continue}ht=b.call(j,I)}catch(O){ht=[6,O],k=0}finally{F=G=0}if(ht[0]&5)throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}}var t=function(){function j(b,I){this.next=null,this.key=b,this.data=I,this.left=null,this.right=null}return j}();function e(j,b){return j>b?1:j<b?-1:0}function i(j,b,I){for(var F=new t(null,null),k=F,G=F;;){var rt=I(j,b.key);if(rt<0){if(b.left===null)break;if(I(j,b.left.key)<0){var tt=b.left;if(b.left=tt.right,tt.right=b,b=tt,b.left===null)break}G.left=b,G=b,b=b.left}else if(rt>0){if(b.right===null)break;if(I(j,b.right.key)>0){var tt=b.right;if(b.right=tt.left,tt.left=b,b=tt,b.right===null)break}k.right=b,k=b,b=b.right}else break}return k.right=b.left,G.left=b.right,b.left=F.right,b.right=F.left,b}function s(j,b,I,F){var k=new t(j,b);if(I===null)return k.left=k.right=null,k;I=i(j,I,F);var G=F(j,I.key);return G<0?(k.left=I.left,k.right=I,I.left=null):G>=0&&(k.right=I.right,k.left=I,I.right=null),k}function u(j,b,I){var F=null,k=null;if(b){b=i(j,b,I);var G=I(b.key,j);G===0?(F=b.left,k=b.right):G<0?(k=b.right,b.right=null,F=b):(F=b.left,b.left=null,k=b)}return{left:F,right:k}}function c(j,b,I){return b===null?j:(j===null||(b=i(j.key,b,I),b.left=j),b)}function f(j,b,I,F,k){if(j){F(""+b+(I?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+k(j)+\`
8008
8008
  \`);var G=b+(I?" ":"\\u2502 ");j.left&&f(j.left,G,!1,F,k),j.right&&f(j.right,G,!0,F,k)}}var p=function(){function j(b){b===void 0&&(b=e),this._root=null,this._size=0,this._comparator=b}return j.prototype.insert=function(b,I){return this._size++,this._root=s(b,I,this._root,this._comparator)},j.prototype.add=function(b,I){var F=new t(b,I);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var k=this._comparator,G=i(b,this._root,k),rt=k(b,G.key);return rt===0?this._root=G:(rt<0?(F.left=G.left,F.right=G,G.left=null):rt>0&&(F.right=G.right,F.left=G,G.right=null),this._size++,this._root=F),this._root},j.prototype.remove=function(b){this._root=this._remove(b,this._root,this._comparator)},j.prototype._remove=function(b,I,F){var k;if(I===null)return null;I=i(b,I,F);var G=F(b,I.key);return G===0?(I.left===null?k=I.right:(k=i(b,I.left,F),k.right=I.right),this._size--,k):I},j.prototype.pop=function(){var b=this._root;if(b){for(;b.left;)b=b.left;return this._root=i(b.key,this._root,this._comparator),this._root=this._remove(b.key,this._root,this._comparator),{key:b.key,data:b.data}}return null},j.prototype.findStatic=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return I;k<0?I=I.left:I=I.right}return null},j.prototype.find=function(b){return this._root&&(this._root=i(b,this._root,this._comparator),this._comparator(b,this._root.key)!==0)?null:this._root},j.prototype.contains=function(b){for(var I=this._root,F=this._comparator;I;){var k=F(b,I.key);if(k===0)return!0;k<0?I=I.left:I=I.right}return!1},j.prototype.forEach=function(b,I){for(var F=this._root,k=[],G=!1;!G;)F!==null?(k.push(F),F=F.left):k.length!==0?(F=k.pop(),b.call(I,F),F=F.right):G=!0;return this},j.prototype.range=function(b,I,F,k){for(var G=[],rt=this._comparator,tt=this._root,pt;G.length!==0||tt;)if(tt)G.push(tt),tt=tt.left;else{if(tt=G.pop(),pt=rt(tt.key,I),pt>0)break;if(rt(tt.key,b)>=0&&F.call(k,tt))return this;tt=tt.right}return this},j.prototype.keys=function(){var b=[];return this.forEach(function(I){var F=I.key;return b.push(F)}),b},j.prototype.values=function(){var b=[];return this.forEach(function(I){var F=I.data;return b.push(F)}),b},j.prototype.min=function(){return this._root?this.minNode(this._root).key:null},j.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},j.prototype.minNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.left;)b=b.left;return b},j.prototype.maxNode=function(b){if(b===void 0&&(b=this._root),b)for(;b.right;)b=b.right;return b},j.prototype.at=function(b){for(var I=this._root,F=!1,k=0,G=[];!F;)if(I)G.push(I),I=I.left;else if(G.length>0){if(I=G.pop(),k===b)return I;k++,I=I.right}else F=!0;return null},j.prototype.next=function(b){var I=this._root,F=null;if(b.right){for(F=b.right;F.left;)F=F.left;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?(F=I,I=I.left):I=I.right}return F},j.prototype.prev=function(b){var I=this._root,F=null;if(b.left!==null){for(F=b.left;F.right;)F=F.right;return F}for(var k=this._comparator;I;){var G=k(b.key,I.key);if(G===0)break;G<0?I=I.left:(F=I,I=I.right)}return F},j.prototype.clear=function(){return this._root=null,this._size=0,this},j.prototype.toList=function(){return y(this._root)},j.prototype.load=function(b,I,F){I===void 0&&(I=[]),F===void 0&&(F=!1);var k=b.length,G=this._comparator;if(F&&M(b,I,0,k-1,G),this._root===null)this._root=d(b,I,0,k),this._size=k;else{var rt=E(this.toList(),g(b,I),G);k=this._size+k,this._root=v({head:rt},0,k)}return this},j.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(j.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),j.prototype.toString=function(b){b===void 0&&(b=function(F){return String(F.key)});var I=[];return f(this._root,"",!0,function(F){return I.push(F)},b),I.join("")},j.prototype.update=function(b,I,F){var k=this._comparator,G=u(b,this._root,k),rt=G.left,tt=G.right;k(b,I)<0?tt=s(I,F,tt,k):rt=s(I,F,rt,k),this._root=c(rt,tt,k)},j.prototype.split=function(b){return u(b,this._root,this._comparator)},j.prototype[Symbol.iterator]=function(){var b,I,F;return n(this,function(k){switch(k.label){case 0:b=this._root,I=[],F=!1,k.label=1;case 1:return F?[3,6]:b===null?[3,2]:(I.push(b),b=b.left,[3,5]);case 2:return I.length===0?[3,4]:(b=I.pop(),[4,b]);case 3:return k.sent(),b=b.right,[3,5];case 4:F=!0,k.label=5;case 5:return[3,1];case 6:return[2]}})},j}();function d(j,b,I,F){var k=F-I;if(k>0){var G=I+Math.floor(k/2),rt=j[G],tt=b[G],pt=new t(rt,tt);return pt.left=d(j,b,I,G),pt.right=d(j,b,G+1,F),pt}return null}function g(j,b){for(var I=new t(null,null),F=I,k=0;k<j.length;k++)F=F.next=new t(j[k],b[k]);return F.next=null,I.next}function y(j){for(var b=j,I=[],F=!1,k=new t(null,null),G=k;!F;)b?(I.push(b),b=b.left):I.length>0?(b=G=G.next=I.pop(),b=b.right):F=!0;return G.next=null,k.next}function v(j,b,I){var F=I-b;if(F>0){var k=b+Math.floor(F/2),G=v(j,b,k),rt=j.head;return rt.left=G,j.head=j.head.next,rt.right=v(j,k+1,I),rt}return null}function E(j,b,I){for(var F=new t(null,null),k=F,G=j,rt=b;G!==null&&rt!==null;)I(G.key,rt.key)<0?(k.next=G,G=G.next):(k.next=rt,rt=rt.next),k=k.next;return G!==null?k.next=G:rt!==null&&(k.next=rt),F.next}function M(j,b,I,F,k){if(!(I>=F)){for(var G=j[I+F>>1],rt=I-1,tt=F+1;;){do rt++;while(k(j[rt],G)<0);do tt--;while(k(j[tt],G)>0);if(rt>=tt)break;var pt=j[rt];j[rt]=j[tt],j[tt]=pt,pt=b[rt],b[rt]=b[tt],b[tt]=pt}M(j,b,I,tt,k),M(j,b,tt+1,F,k)}}let A=(j,b)=>j.ll.x<=b.x&&b.x<=j.ur.x&&j.ll.y<=b.y&&b.y<=j.ur.y,_=(j,b)=>{if(b.ur.x<j.ll.x||j.ur.x<b.ll.x||b.ur.y<j.ll.y||j.ur.y<b.ll.y)return null;let I=j.ll.x<b.ll.x?b.ll.x:j.ll.x,F=j.ur.x<b.ur.x?j.ur.x:b.ur.x,k=j.ll.y<b.ll.y?b.ll.y:j.ll.y,G=j.ur.y<b.ur.y?j.ur.y:b.ur.y;return{ll:{x:I,y:k},ur:{x:F,y:G}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let T=x*x,w=(j,b)=>{if(-x<j&&j<x&&-x<b&&b<x)return 0;let I=j-b;return I*I<T*j*b?0:j<b?-1:1};class R{constructor(){this.reset()}reset(){this.xRounder=new B,this.yRounder=new B}round(b,I){return{x:this.xRounder.round(b),y:this.yRounder.round(I)}}}class B{constructor(){this.tree=new p,this.round(0)}round(b){let I=this.tree.add(b),F=this.tree.prev(I);if(F!==null&&w(I.key,F.key)===0)return this.tree.remove(b),F.key;let k=this.tree.next(I);return k!==null&&w(I.key,k.key)===0?(this.tree.remove(b),k.key):b}}let U=new R,D=11102230246251565e-32,P=134217729,ct=(3+8*D)*D;function L(j,b,I,F,k){let G,rt,tt,pt,ht=b[0],O=F[0],Q=0,J=0;O>ht==O>-ht?(G=ht,ht=b[++Q]):(G=O,O=F[++J]);let et=0;if(Q<j&&J<I)for(O>ht==O>-ht?(rt=ht+G,tt=G-(rt-ht),ht=b[++Q]):(rt=O+G,tt=G-(rt-O),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);Q<j&&J<I;)O>ht==O>-ht?(rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q]):(rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J]),G=rt,tt!==0&&(k[et++]=tt);for(;Q<j;)rt=G+ht,pt=rt-G,tt=G-(rt-pt)+(ht-pt),ht=b[++Q],G=rt,tt!==0&&(k[et++]=tt);for(;J<I;)rt=G+O,pt=rt-G,tt=G-(rt-pt)+(O-pt),O=F[++J],G=rt,tt!==0&&(k[et++]=tt);return(G!==0||et===0)&&(k[et++]=G),et}function W(j,b){let I=b[0];for(let F=1;F<j;F++)I+=b[F];return I}function V(j){return new Float64Array(j)}let Mt=(3+16*D)*D,$=(2+12*D)*D,gt=(9+64*D)*D*D,ft=V(4),vt=V(8),it=V(12),lt=V(16),H=V(4);function At(j,b,I,F,k,G,rt){let tt,pt,ht,O,Q,J,et,Tt,kt,ie,oe,we,ye,be,Ae,Un,dr,_n,pe=j-k,xn=I-k,Nn=b-G,Cn=F-G;be=pe*Cn,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=Nn*xn,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,ft[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,ft[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,ft[2]=we-(_n-Q)+(oe-Q),ft[3]=_n;let En=W(4,ft),Kr=$*rt;if(En>=Kr||-En>=Kr||(Q=j-pe,tt=j-(pe+Q)+(Q-k),Q=I-xn,ht=I-(xn+Q)+(Q-k),Q=b-Nn,pt=b-(Nn+Q)+(Q-G),Q=F-Cn,O=F-(Cn+Q)+(Q-G),tt===0&&pt===0&&ht===0&&O===0)||(Kr=gt*rt+ct*Math.abs(En),En+=pe*O+Cn*tt-(Nn*ht+xn*pt),En>=Kr||-En>=Kr))return En;be=tt*Cn,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*Cn,kt=J-(J-Cn),ie=Cn-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=pt*xn,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*xn,kt=J-(J-xn),ie=xn-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let Ar=L(4,ft,4,H,vt);be=pe*O,J=P*pe,et=J-(J-pe),Tt=pe-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=Nn*ht,J=P*Nn,et=J-(J-Nn),Tt=Nn-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let q=L(Ar,vt,4,H,it);be=tt*O,J=P*tt,et=J-(J-tt),Tt=tt-et,J=P*O,kt=J-(J-O),ie=O-kt,Ae=Tt*ie-(be-et*kt-Tt*kt-et*ie),Un=pt*ht,J=P*pt,et=J-(J-pt),Tt=pt-et,J=P*ht,kt=J-(J-ht),ie=ht-kt,dr=Tt*ie-(Un-et*kt-Tt*kt-et*ie),oe=Ae-dr,Q=Ae-oe,H[0]=Ae-(oe+Q)+(Q-dr),we=be+oe,Q=we-be,ye=be-(we-Q)+(oe-Q),oe=ye-Un,Q=ye-oe,H[1]=ye-(oe+Q)+(Q-Un),_n=we+oe,Q=_n-we,H[2]=we-(_n-Q)+(oe-Q),H[3]=_n;let at=L(q,it,4,H,lt);return lt[at-1]}function It(j,b,I,F,k,G){let rt=(b-G)*(I-k),tt=(j-k)*(F-G),pt=rt-tt,ht=Math.abs(rt+tt);return Math.abs(pt)>=Mt*ht?pt:-At(j,b,I,F,k,G,ht)}let jt=(j,b)=>j.x*b.y-j.y*b.x,nt=(j,b)=>j.x*b.x+j.y*b.y,bt=(j,b,I)=>{let F=It(j.x,j.y,b.x,b.y,I.x,I.y);return F>0?-1:F<0?1:0},Vt=j=>Math.sqrt(nt(j,j)),$t=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return jt(k,F)/Vt(k)/Vt(F)},Ut=(j,b,I)=>{let F={x:b.x-j.x,y:b.y-j.y},k={x:I.x-j.x,y:I.y-j.y};return nt(k,F)/Vt(k)/Vt(F)},Gt=(j,b,I)=>b.y===0?null:{x:j.x+b.x/b.y*(I-j.y),y:I},Ct=(j,b,I)=>b.x===0?null:{x:I,y:j.y+b.y/b.x*(I-j.x)},ee=(j,b,I,F)=>{if(b.x===0)return Ct(I,F,j.x);if(F.x===0)return Ct(j,b,I.x);if(b.y===0)return Gt(I,F,j.y);if(F.y===0)return Gt(j,b,I.y);let k=jt(b,F);if(k==0)return null;let G={x:I.x-j.x,y:I.y-j.y},rt=jt(G,b)/k,tt=jt(G,F)/k,pt=j.x+tt*b.x,ht=I.x+rt*F.x,O=j.y+tt*b.y,Q=I.y+rt*F.y,J=(pt+ht)/2,et=(O+Q)/2;return{x:J,y:et}};class Z{static compare(b,I){let F=Z.comparePoints(b.point,I.point);return F!==0?F:(b.point!==I.point&&b.link(I),b.isLeft!==I.isLeft?b.isLeft?1:-1:_t.compare(b.segment,I.segment))}static comparePoints(b,I){return b.x<I.x?-1:b.x>I.x?1:b.y<I.y?-1:b.y>I.y?1:0}constructor(b,I){b.events===void 0?b.events=[this]:b.events.push(this),this.point=b,this.isLeft=I}link(b){if(b.point===this.point)throw new Error("Tried to link already linked events");let I=b.point.events;for(let F=0,k=I.length;F<k;F++){let G=I[F];this.point.events.push(G),G.point=this.point}this.checkForConsuming()}checkForConsuming(){let b=this.point.events.length;for(let I=0;I<b;I++){let F=this.point.events[I];if(F.segment.consumedBy===void 0)for(let k=I+1;k<b;k++){let G=this.point.events[k];G.consumedBy===void 0&&F.otherSE.point.events===G.otherSE.point.events&&F.segment.consume(G.segment)}}}getAvailableLinkedEvents(){let b=[];for(let I=0,F=this.point.events.length;I<F;I++){let k=this.point.events[I];k!==this&&!k.segment.ringOut&&k.segment.isInResult()&&b.push(k)}return b}getLeftmostComparator(b){let I=new Map,F=k=>{let G=k.otherSE;I.set(k,{sine:$t(this.point,b.point,G.point),cosine:Ut(this.point,b.point,G.point)})};return(k,G)=>{I.has(k)||F(k),I.has(G)||F(G);let{sine:rt,cosine:tt}=I.get(k),{sine:pt,cosine:ht}=I.get(G);return rt>=0&&pt>=0?tt<ht?1:tt>ht?-1:0:rt<0&&pt<0?tt<ht?-1:tt>ht?1:0:pt<rt?-1:pt>rt?1:0}}}let Ot=0;class _t{static compare(b,I){let F=b.leftSE.point.x,k=I.leftSE.point.x,G=b.rightSE.point.x,rt=I.rightSE.point.x;if(rt<F)return 1;if(G<k)return-1;let tt=b.leftSE.point.y,pt=I.leftSE.point.y,ht=b.rightSE.point.y,O=I.rightSE.point.y;if(F<k){if(pt<tt&&pt<ht)return 1;if(pt>tt&&pt>ht)return-1;let Q=b.comparePoint(I.leftSE.point);if(Q<0)return 1;if(Q>0)return-1;let J=I.comparePoint(b.rightSE.point);return J!==0?J:-1}if(F>k){if(tt<pt&&tt<O)return-1;if(tt>pt&&tt>O)return 1;let Q=I.comparePoint(b.leftSE.point);if(Q!==0)return Q;let J=b.comparePoint(I.rightSE.point);return J<0?1:J>0?-1:1}if(tt<pt)return-1;if(tt>pt)return 1;if(G<rt){let Q=I.comparePoint(b.rightSE.point);if(Q!==0)return Q}if(G>rt){let Q=b.comparePoint(I.rightSE.point);if(Q<0)return 1;if(Q>0)return-1}if(G!==rt){let Q=ht-tt,J=G-F,et=O-pt,Tt=rt-k;if(Q>J&&et<Tt)return 1;if(Q<J&&et>Tt)return-1}return G>rt?1:G<rt||ht<O?-1:ht>O?1:b.id<I.id?-1:b.id>I.id?1:0}constructor(b,I,F,k){this.id=++Ot,this.leftSE=b,b.segment=this,b.otherSE=I,this.rightSE=I,I.segment=this,I.otherSE=b,this.rings=F,this.windings=k}static fromRing(b,I,F){let k,G,rt,tt=Z.comparePoints(b,I);if(tt<0)k=b,G=I,rt=1;else if(tt>0)k=I,G=b,rt=-1;else throw new Error(\`Tried to create degenerate segment at [\${b.x}, \${b.y}]\`);let pt=new Z(k,!0),ht=new Z(G,!1);return new _t(pt,ht,[F],[rt])}replaceRightSE(b){this.rightSE=b,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let b=this.leftSE.point.y,I=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:b<I?b:I},ur:{x:this.rightSE.point.x,y:b>I?b:I}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(b){return b.x===this.leftSE.point.x&&b.y===this.leftSE.point.y||b.x===this.rightSE.point.x&&b.y===this.rightSE.point.y}comparePoint(b){if(this.isAnEndpoint(b))return 0;let I=this.leftSE.point,F=this.rightSE.point,k=this.vector();if(I.x===F.x)return b.x===I.x?0:b.x<I.x?1:-1;let G=(b.y-I.y)/k.y,rt=I.x+G*k.x;if(b.x===rt)return 0;let tt=(b.x-I.x)/k.x,pt=I.y+tt*k.y;return b.y===pt?0:b.y<pt?-1:1}getIntersection(b){let I=this.bbox(),F=b.bbox(),k=_(I,F);if(k===null)return null;let G=this.leftSE.point,rt=this.rightSE.point,tt=b.leftSE.point,pt=b.rightSE.point,ht=A(I,tt)&&this.comparePoint(tt)===0,O=A(F,G)&&b.comparePoint(G)===0,Q=A(I,pt)&&this.comparePoint(pt)===0,J=A(F,rt)&&b.comparePoint(rt)===0;if(O&&ht)return J&&!Q?rt:!J&&Q?pt:null;if(O)return Q&&G.x===pt.x&&G.y===pt.y?null:G;if(ht)return J&&rt.x===tt.x&&rt.y===tt.y?null:tt;if(J&&Q)return null;if(J)return rt;if(Q)return pt;let et=ee(G,this.vector(),tt,b.vector());return et===null||!A(k,et)?null:U.round(et.x,et.y)}split(b){let I=[],F=b.events!==void 0,k=new Z(b,!0),G=new Z(b,!1),rt=this.rightSE;this.replaceRightSE(G),I.push(G),I.push(k);let tt=new _t(k,rt,this.rings.slice(),this.windings.slice());return Z.comparePoints(tt.leftSE.point,tt.rightSE.point)>0&&tt.swapEvents(),Z.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(k.checkForConsuming(),G.checkForConsuming()),I}swapEvents(){let b=this.rightSE;this.rightSE=this.leftSE,this.leftSE=b,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let I=0,F=this.windings.length;I<F;I++)this.windings[I]*=-1}consume(b){let I=this,F=b;for(;I.consumedBy;)I=I.consumedBy;for(;F.consumedBy;)F=F.consumedBy;let k=_t.compare(I,F);if(k!==0){if(k>0){let G=I;I=F,F=G}if(I.prev===F){let G=I;I=F,F=G}for(let G=0,rt=F.rings.length;G<rt;G++){let tt=F.rings[G],pt=F.windings[G],ht=I.rings.indexOf(tt);ht===-1?(I.rings.push(tt),I.windings.push(pt)):I.windings[ht]+=pt}F.rings=null,F.windings=null,F.consumedBy=I,F.leftSE.consumedBy=I.leftSE,F.rightSE.consumedBy=I.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let b=this.prev.consumedBy||this.prev;this._beforeState=b.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let b=this.beforeState();this._afterState={rings:b.rings.slice(0),windings:b.windings.slice(0),multiPolys:[]};let I=this._afterState.rings,F=this._afterState.windings,k=this._afterState.multiPolys;for(let tt=0,pt=this.rings.length;tt<pt;tt++){let ht=this.rings[tt],O=this.windings[tt],Q=I.indexOf(ht);Q===-1?(I.push(ht),F.push(O)):F[Q]+=O}let G=[],rt=[];for(let tt=0,pt=I.length;tt<pt;tt++){if(F[tt]===0)continue;let ht=I[tt],O=ht.poly;if(rt.indexOf(O)===-1)if(ht.isExterior)G.push(O);else{rt.indexOf(O)===-1&&rt.push(O);let Q=G.indexOf(ht.poly);Q!==-1&&G.splice(Q,1)}}for(let tt=0,pt=G.length;tt<pt;tt++){let ht=G[tt].multiPoly;k.indexOf(ht)===-1&&k.push(ht)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let b=this.beforeState().multiPolys,I=this.afterState().multiPolys;switch(ot.type){case"union":{let F=b.length===0,k=I.length===0;this._isInResult=F!==k;break}case"intersection":{let F,k;b.length<I.length?(F=b.length,k=I.length):(F=I.length,k=b.length),this._isInResult=k===ot.numMultiPolys&&F<k;break}case"xor":{let F=Math.abs(b.length-I.length);this._isInResult=F%2===1;break}case"difference":{let F=k=>k.length===1&&k[0].isSubject;this._isInResult=F(b)!==F(I);break}default:throw new Error(\`Unrecognized operation type found \${ot.type}\`)}return this._isInResult}}class Nt{constructor(b,I,F){if(!Array.isArray(b)||b.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=I,this.isExterior=F,this.segments=[],typeof b[0][0]!="number"||typeof b[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let k=U.round(b[0][0],b[0][1]);this.bbox={ll:{x:k.x,y:k.y},ur:{x:k.x,y:k.y}};let G=k;for(let rt=1,tt=b.length;rt<tt;rt++){if(typeof b[rt][0]!="number"||typeof b[rt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let pt=U.round(b[rt][0],b[rt][1]);pt.x===G.x&&pt.y===G.y||(this.segments.push(_t.fromRing(G,pt,this)),pt.x<this.bbox.ll.x&&(this.bbox.ll.x=pt.x),pt.y<this.bbox.ll.y&&(this.bbox.ll.y=pt.y),pt.x>this.bbox.ur.x&&(this.bbox.ur.x=pt.x),pt.y>this.bbox.ur.y&&(this.bbox.ur.y=pt.y),G=pt)}(k.x!==G.x||k.y!==G.y)&&this.segments.push(_t.fromRing(G,k,this))}getSweepEvents(){let b=[];for(let I=0,F=this.segments.length;I<F;I++){let k=this.segments[I];b.push(k.leftSE),b.push(k.rightSE)}return b}}class wt{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Nt(b[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let F=1,k=b.length;F<k;F++){let G=new Nt(b[F],this,!1);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.interiorRings.push(G)}this.multiPoly=I}getSweepEvents(){let b=this.exteriorRing.getSweepEvents();for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Ht{constructor(b,I){if(!Array.isArray(b))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof b[0][0][0]=="number"&&(b=[b])}catch(F){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let F=0,k=b.length;F<k;F++){let G=new wt(b[F],this);G.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=G.bbox.ll.x),G.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=G.bbox.ll.y),G.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=G.bbox.ur.x),G.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=G.bbox.ur.y),this.polys.push(G)}this.isSubject=I}getSweepEvents(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getSweepEvents();for(let G=0,rt=k.length;G<rt;G++)b.push(k[G])}return b}}class Xt{static factory(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.isInResult()||G.ringOut)continue;let rt=null,tt=G.leftSE,pt=G.rightSE,ht=[tt],O=tt.point,Q=[];for(;rt=tt,tt=pt,ht.push(tt),tt.point!==O;)for(;;){let J=tt.getAvailableLinkedEvents();if(J.length===0){let kt=ht[0].point,ie=ht[ht.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${kt.x}, \${kt.y}]. Last matching segment found ends at [\${ie.x}, \${ie.y}].\`)}if(J.length===1){pt=J[0].otherSE;break}let et=null;for(let kt=0,ie=Q.length;kt<ie;kt++)if(Q[kt].point===tt.point){et=kt;break}if(et!==null){let kt=Q.splice(et)[0],ie=ht.splice(kt.index);ie.unshift(ie[0].otherSE),I.push(new Xt(ie.reverse()));continue}Q.push({index:ht.length,point:tt.point});let Tt=tt.getLeftmostComparator(rt);pt=J.sort(Tt)[0].otherSE;break}I.push(new Xt(ht))}return I}constructor(b){this.events=b;for(let I=0,F=b.length;I<F;I++)b[I].segment.ringOut=this;this.poly=null}getGeom(){let b=this.events[0].point,I=[b];for(let ht=1,O=this.events.length-1;ht<O;ht++){let Q=this.events[ht].point,J=this.events[ht+1].point;bt(Q,b,J)!==0&&(I.push(Q),b=Q)}if(I.length===1)return null;let F=I[0],k=I[1];bt(F,b,k)===0&&I.shift(),I.push(I[0]);let G=this.isExteriorRing()?1:-1,rt=this.isExteriorRing()?0:I.length-1,tt=this.isExteriorRing()?I.length:-1,pt=[];for(let ht=rt;ht!=tt;ht+=G)pt.push([I[ht].x,I[ht].y]);return pt}isExteriorRing(){if(this._isExteriorRing===void 0){let b=this.enclosingRing();this._isExteriorRing=b?!b.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let b=this.events[0];for(let k=1,G=this.events.length;k<G;k++){let rt=this.events[k];Z.compare(b,rt)>0&&(b=rt)}let I=b.segment.prevInResult(),F=I?I.prevInResult():null;for(;;){if(!I)return null;if(!F)return I.ringOut;if(F.ringOut!==I.ringOut)return F.ringOut.enclosingRing()!==I.ringOut?I.ringOut:I.ringOut.enclosingRing();I=F.prevInResult(),F=I?I.prevInResult():null}}}class Pt{constructor(b){this.exteriorRing=b,b.poly=this,this.interiorRings=[]}addInterior(b){this.interiorRings.push(b),b.poly=this}getGeom(){let b=[this.exteriorRing.getGeom()];if(b[0]===null)return null;for(let I=0,F=this.interiorRings.length;I<F;I++){let k=this.interiorRings[I].getGeom();k!==null&&b.push(k)}return b}}class ne{constructor(b){this.rings=b,this.polys=this._composePolys(b)}getGeom(){let b=[];for(let I=0,F=this.polys.length;I<F;I++){let k=this.polys[I].getGeom();k!==null&&b.push(k)}return b}_composePolys(b){let I=[];for(let F=0,k=b.length;F<k;F++){let G=b[F];if(!G.poly)if(G.isExteriorRing())I.push(new Pt(G));else{let rt=G.enclosingRing();rt.poly||I.push(new Pt(rt)),rt.poly.addInterior(G)}}return I}}class Y{constructor(b){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t.compare;this.queue=b,this.tree=new p(I),this.segments=[]}process(b){let I=b.segment,F=[];if(b.consumedBy)return b.isLeft?this.queue.remove(b.otherSE):this.tree.remove(I),F;let k=b.isLeft?this.tree.add(I):this.tree.find(I);if(!k)throw new Error(\`Unable to find segment #\${I.id} [\${I.leftSE.point.x}, \${I.leftSE.point.y}] -> [\${I.rightSE.point.x}, \${I.rightSE.point.y}] in SweepLine tree.\`);let G=k,rt=k,tt,pt;for(;tt===void 0;)G=this.tree.prev(G),G===null?tt=null:G.key.consumedBy===void 0&&(tt=G.key);for(;pt===void 0;)rt=this.tree.next(rt),rt===null?pt=null:rt.key.consumedBy===void 0&&(pt=rt.key);if(b.isLeft){let ht=null;if(tt){let Q=tt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(ht=Q),!tt.isAnEndpoint(Q))){let J=this._splitSafely(tt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}let O=null;if(pt){let Q=pt.getIntersection(I);if(Q!==null&&(I.isAnEndpoint(Q)||(O=Q),!pt.isAnEndpoint(Q))){let J=this._splitSafely(pt,Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}}if(ht!==null||O!==null){let Q=null;ht===null?Q=O:O===null?Q=ht:Q=Z.comparePoints(ht,O)<=0?ht:O,this.queue.remove(I.rightSE),F.push(I.rightSE);let J=I.split(Q);for(let et=0,Tt=J.length;et<Tt;et++)F.push(J[et])}F.length>0?(this.tree.remove(I),F.push(b)):(this.segments.push(I),I.prev=tt)}else{if(tt&&pt){let ht=tt.getIntersection(pt);if(ht!==null){if(!tt.isAnEndpoint(ht)){let O=this._splitSafely(tt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}if(!pt.isAnEndpoint(ht)){let O=this._splitSafely(pt,ht);for(let Q=0,J=O.length;Q<J;Q++)F.push(O[Q])}}}this.tree.remove(I)}return F}_splitSafely(b,I){this.tree.remove(b);let F=b.rightSE;this.queue.remove(F);let k=b.split(I);return k.push(F),b.consumedBy===void 0&&this.tree.add(b),k}}let N=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xt=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class St{run(b,I,F){ot.type=b,U.reset();let k=[new Ht(I,!0)];for(let Q=0,J=F.length;Q<J;Q++)k.push(new Ht(F[Q],!1));if(ot.numMultiPolys=k.length,ot.type==="difference"){let Q=k[0],J=1;for(;J<k.length;)_(k[J].bbox,Q.bbox)!==null?J++:k.splice(J,1)}if(ot.type==="intersection")for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q];for(let Tt=Q+1,kt=k.length;Tt<kt;Tt++)if(_(et.bbox,k[Tt].bbox)===null)return[]}let G=new p(Z.compare);for(let Q=0,J=k.length;Q<J;Q++){let et=k[Q].getSweepEvents();for(let Tt=0,kt=et.length;Tt<kt;Tt++)if(G.insert(et[Tt]),G.size>N)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let rt=new Y(G),tt=G.size,pt=G.pop();for(;pt;){let Q=pt.key;if(G.size===tt){let et=Q.segment;throw new Error(\`Unable to pop() \${Q.isLeft?"left":"right"} SweepEvent [\${Q.point.x}, \${Q.point.y}] from segment #\${et.id} [\${et.leftSE.point.x}, \${et.leftSE.point.y}] -> [\${et.rightSE.point.x}, \${et.rightSE.point.y}] from queue.\`)}if(G.size>N)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(rt.segments.length>xt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let J=rt.process(Q);for(let et=0,Tt=J.length;et<Tt;et++){let kt=J[et];kt.consumedBy===void 0&&G.insert(kt)}tt=G.size,pt=G.pop()}U.reset();let ht=Xt.factory(rt.segments);return new ne(ht).getGeom()}}let ot=new St;var Wt={union:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("union",j,I)},intersection:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("intersection",j,I)},xor:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("xor",j,I)},difference:function(j){for(var b=arguments.length,I=new Array(b>1?b-1:0),F=1;F<b;F++)I[F-1]=arguments[F];return ot.run("difference",j,I)}};return Wt})});var K2=X((ug,j2)=>{(function(n,t){typeof ug=="object"&&typeof j2!="undefined"?t(ug):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(ug,function(n){"use strict";function t(){}function e(r){this.message=r||""}function i(r){this.message=r||""}function s(r){this.message=r||""}function u(){}function c(r){return r===null?Ae:r.color}function f(r){return r===null?null:r.parent}function p(r,o){r!==null&&(r.color=o)}function d(r){return r===null?null:r.left}function g(r){return r===null?null:r.right}function y(){this.root_=null,this.size_=0}function v(){}function E(){this.array_=[],arguments[0]instanceof tt&&this.addAll(arguments[0])}function M(){}function A(r){this.message=r||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var o=Object(this),a=Math.max(Math.min(o.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(a+l,0):Math.min(l,a);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(h=h<0?Math.max(a+arguments[2],0):Math.min(h,a);l<h;)o[l]=r,++l;return o},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var x=function(){};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.prototype.equalsWithTolerance=function(r,o,a){return Math.abs(r-o)<=a};var T=function(r){function o(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o}(Error),w=function(){},R={MAX_VALUE:{configurable:!0}};w.isNaN=function(r){return Number.isNaN(r)},w.doubleToLongBits=function(r){return r},w.longBitsToDouble=function(r){return r},w.isInfinite=function(r){return!Number.isFinite(r)},R.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(w,R);var B=function(){},U=function(){},D=function(){},P=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var o=arguments[0];this.x=o.x,this.y=o.y,this.z=o.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ct={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};P.prototype.setOrdinate=function(r,o){switch(r){case P.X:this.x=o;break;case P.Y:this.y=o;break;case P.Z:this.z=o;break;default:throw new T("Invalid ordinate index: "+r)}},P.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var o=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,o.x,a)&&!!x.equalsWithTolerance(this.y,o.y,a)}},P.prototype.getOrdinate=function(r){switch(r){case P.X:return this.x;case P.Y:return this.y;case P.Z:return this.z}throw new T("Invalid ordinate index: "+r)},P.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||w.isNaN(this.z))&&w.isNaN(r.z)},P.prototype.equals=function(r){return r instanceof P&&this.equals2D(r)},P.prototype.equalInZ=function(r,o){return x.equalsWithTolerance(this.z,r.z,o)},P.prototype.compareTo=function(r){var o=r;return this.x<o.x?-1:this.x>o.x?1:this.y<o.y?-1:this.y>o.y?1:0},P.prototype.clone=function(){},P.prototype.copy=function(){return new P(this)},P.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},P.prototype.distance3D=function(r){var o=this.x-r.x,a=this.y-r.y,l=this.z-r.z;return Math.sqrt(o*o+a*a+l*l)},P.prototype.distance=function(r){var o=this.x-r.x,a=this.y-r.y;return Math.sqrt(o*o+a*a)},P.prototype.hashCode=function(){var r=17;return r=37*r+P.hashCode(this.x),r=37*r+P.hashCode(this.y)},P.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},P.prototype.interfaces_=function(){return[B,U,t]},P.prototype.getClass=function(){return P},P.hashCode=function(){if(arguments.length===1){var r=arguments[0],o=w.doubleToLongBits(r);return Math.trunc((o^o)>>>32)}},ct.DimensionalComparator.get=function(){return L},ct.serialVersionUID.get=function(){return 6683108902428367e3},ct.NULL_ORDINATE.get=function(){return w.NaN},ct.X.get=function(){return 0},ct.Y.get=function(){return 1},ct.Z.get=function(){return 2},Object.defineProperties(P,ct);var L=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var o=arguments[0];if(o!==2&&o!==3)throw new T("only 2 or 3 dimensions may be specified");this._dimensionsToTest=o}}};L.prototype.compare=function(r,o){var a=r,l=o,h=L.compare(a.x,l.x);if(h!==0)return h;var m=L.compare(a.y,l.y);return m!==0?m:this._dimensionsToTest<=2?0:L.compare(a.z,l.z)},L.prototype.interfaces_=function(){return[D]},L.prototype.getClass=function(){return L},L.compare=function(r,o){return r<o?-1:r>o?1:w.isNaN(r)?w.isNaN(o)?0:-1:w.isNaN(o)?1:0};var W=function(){};W.prototype.create=function(){},W.prototype.interfaces_=function(){return[]},W.prototype.getClass=function(){return W};var V=function(){},Mt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.toLocationSymbol=function(r){switch(r){case V.EXTERIOR:return"e";case V.BOUNDARY:return"b";case V.INTERIOR:return"i";case V.NONE:return"-"}throw new T("Unknown location value: "+r)},Mt.INTERIOR.get=function(){return 0},Mt.BOUNDARY.get=function(){return 1},Mt.EXTERIOR.get=function(){return 2},Mt.NONE.get=function(){return-1},Object.defineProperties(V,Mt);var $=function(r,o){return r.interfaces_&&r.interfaces_().indexOf(o)>-1},gt=function(){},ft={LOG_10:{configurable:!0}};gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.log10=function(r){var o=Math.log(r);return w.isInfinite(o)||w.isNaN(o)?o:o/gt.LOG_10},gt.min=function(r,o,a,l){var h=r;return o<h&&(h=o),a<h&&(h=a),l<h&&(h=l),h},gt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],o=arguments[1],a=arguments[2];return r<o?o:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],m=arguments[2];return l<h?h:l>m?m:l}},gt.wrap=function(r,o){return r<0?o- -r%o:r%o},gt.max=function(){if(arguments.length===3){var r=arguments[0],o=arguments[1],a=arguments[2],l=r;return o>l&&(l=o),a>l&&(l=a),l}if(arguments.length===4){var h=arguments[0],m=arguments[1],S=arguments[2],C=arguments[3],z=h;return m>z&&(z=m),S>z&&(z=S),C>z&&(z=C),z}},gt.average=function(r,o){return(r+o)/2},ft.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(gt,ft);var vt=function(r){this.str=r};vt.prototype.append=function(r){this.str+=r},vt.prototype.setCharAt=function(r,o){this.str=this.str.substr(0,r)+o+this.str.substr(r+1)},vt.prototype.toString=function(r){return this.str};var it=function(r){this.value=r};it.prototype.intValue=function(){return this.value},it.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},it.isNaN=function(r){return Number.isNaN(r)};var lt=function(){};lt.isWhitespace=function(r){return r<=32&&r>=0||r===127},lt.toUpperCase=function(r){return r.toUpperCase()};var H=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var o=arguments[0];this.init(o)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var l=arguments[0];r.call(this,r.parse(l))}}else if(arguments.length===2){var h=arguments[0],m=arguments[1];this.init(h,m)}},At={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};H.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},H.prototype.extractSignificantDigits=function(r,o){var a=this.abs(),l=H.magnitude(a._hi),h=H.TEN.pow(l);(a=a.divide(h)).gt(H.TEN)?(a=a.divide(H.TEN),l+=1):a.lt(H.ONE)&&(a=a.multiply(H.TEN),l-=1);for(var m=l+1,S=new vt,C=H.MAX_PRINT_DIGITS-1,z=0;z<=C;z++){r&&z===m&&S.append(".");var K=Math.trunc(a._hi);if(K<0)break;var mt=!1,yt=0;K>9?(mt=!0,yt="9"):yt="0"+K,S.append(yt),a=a.subtract(H.valueOf(K)).multiply(H.TEN),mt&&a.selfAdd(H.TEN);var zt=!0,qt=H.magnitude(a._hi);if(qt<0&&Math.abs(qt)>=C-z&&(zt=!1),!zt)break}return o[0]=l,S.toString()},H.prototype.sqr=function(){return this.multiply(this)},H.prototype.doubleValue=function(){return this._hi+this._lo},H.prototype.subtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var o=arguments[0];return this.add(-o)}},H.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},H.prototype.isZero=function(){return this._hi===0&&this._lo===0},H.prototype.selfSubtract=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.isNaN()?this:this.selfAdd(-o,0)}},H.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},H.prototype.min=function(r){return this.le(r)?this:r},H.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfDivide(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,z=null,K=null,mt=null,yt=null;return z=this._hi/a,K=H.SPLIT*z,h=K-z,yt=H.SPLIT*a,h=K-h,m=z-h,S=yt-a,mt=z*a,S=yt-S,C=a-S,yt=h*S-mt+h*C+m*S+m*C,K=(this._hi-mt-yt+this._lo-z*l)/a,yt=z+K,this._hi=yt,this._lo=z-yt+K,this}},H.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},H.prototype.divide=function(){if(arguments[0]instanceof H){var r=arguments[0],o=null,a=null,l=null,h=null,m=null,S=null,C=null,z=null;return a=(m=this._hi/r._hi)-(o=(S=H.SPLIT*m)-(o=S-m)),z=o*(l=(z=H.SPLIT*r._hi)-(l=z-r._hi))-(C=m*r._hi)+o*(h=r._hi-l)+a*l+a*h,S=(this._hi-C-z+this._lo-m*r._lo)/r._hi,new H(z=m+S,m-z+S)}if(typeof arguments[0]=="number"){var K=arguments[0];return w.isNaN(K)?H.createNaN():H.copy(this).selfDivide(K,0)}},H.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},H.prototype.pow=function(r){if(r===0)return H.valueOf(1);var o=new H(this),a=H.valueOf(1),l=Math.abs(r);if(l>1)for(;l>0;)l%2==1&&a.selfMultiply(o),(l/=2)>0&&(o=o.sqr());else a=o;return r<0?a.reciprocal():a},H.prototype.ceil=function(){if(this.isNaN())return H.NaN;var r=Math.ceil(this._hi),o=0;return r===this._hi&&(o=Math.ceil(this._lo)),new H(r,o)},H.prototype.compareTo=function(r){var o=r;return this._hi<o._hi?-1:this._hi>o._hi?1:this._lo<o._lo?-1:this._lo>o._lo?1:0},H.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},H.prototype.setValue=function(){if(arguments[0]instanceof H){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var o=arguments[0];return this.init(o),this}},H.prototype.max=function(r){return this.ge(r)?this:r},H.prototype.sqrt=function(){if(this.isZero())return H.valueOf(0);if(this.isNegative())return H.NaN;var r=1/Math.sqrt(this._hi),o=this._hi*r,a=H.valueOf(o),l=this.subtract(a.sqr())._hi*(.5*r);return a.add(l)},H.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0],a=null,l=null,h=null,m=null,S=null,C=null;return h=this._hi+o,S=h-this._hi,m=h-S,m=o-S+(this._hi-m),C=m+this._lo,a=h+C,l=C+(h-a),this._hi=a+l,this._lo=l+(a-this._hi),this}}else if(arguments.length===2){var z=arguments[0],K=arguments[1],mt=null,yt=null,zt=null,qt=null,Jt=null,ue=null,dn=null;qt=this._hi+z,yt=this._lo+K,Jt=qt-(ue=qt-this._hi),zt=yt-(dn=yt-this._lo);var Wn=(mt=qt+(ue=(Jt=z-ue+(this._hi-Jt))+yt))+(ue=(zt=K-dn+(this._lo-zt))+(ue+(qt-mt))),Dr=ue+(mt-Wn);return this._hi=Wn,this._lo=Dr,this}},H.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof H){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var o=arguments[0];return this.selfMultiply(o,0)}}else if(arguments.length===2){var a=arguments[0],l=arguments[1],h=null,m=null,S=null,C=null,z=null,K=null;h=(z=H.SPLIT*this._hi)-this._hi,K=H.SPLIT*a,h=z-h,m=this._hi-h,S=K-a;var mt=(z=this._hi*a)+(K=h*(S=K-S)-z+h*(C=a-S)+m*S+m*C+(this._hi*l+this._lo*a)),yt=K+(h=z-mt);return this._hi=mt,this._lo=yt,this}},H.prototype.selfSqr=function(){return this.selfMultiply(this)},H.prototype.floor=function(){if(this.isNaN())return H.NaN;var r=Math.floor(this._hi),o=0;return r===this._hi&&(o=Math.floor(this._lo)),new H(r,o)},H.prototype.negate=function(){return this.isNaN()?this:new H(-this._hi,-this._lo)},H.prototype.clone=function(){},H.prototype.multiply=function(){if(arguments[0]instanceof H){var r=arguments[0];return r.isNaN()?H.createNaN():H.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return w.isNaN(o)?H.createNaN():H.copy(this).selfMultiply(o,0)}},H.prototype.isNaN=function(){return w.isNaN(this._hi)},H.prototype.intValue=function(){return Math.trunc(this._hi)},H.prototype.toString=function(){var r=H.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},H.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!0,o),l=o[0]+1,h=a;if(a.charAt(0)===".")h="0"+a;else if(l<0)h="0."+H.stringOfChar("0",-l)+a;else if(a.indexOf(".")===-1){var m=l-a.length;h=a+H.stringOfChar("0",m)+".0"}return this.isNegative()?"-"+h:h},H.prototype.reciprocal=function(){var r=null,o=null,a=null,l=null,h=null,m=null,S=null,C=null;o=(h=1/this._hi)-(r=(m=H.SPLIT*h)-(r=m-h)),a=(C=H.SPLIT*this._hi)-this._hi;var z=h+(m=(1-(S=h*this._hi)-(C=r*(a=C-a)-S+r*(l=this._hi-a)+o*a+o*l)-h*this._lo)/this._hi);return new H(z,h-z+m)},H.prototype.toSciNotation=function(){if(this.isZero())return H.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var o=new Array(1).fill(null),a=this.extractSignificantDigits(!1,o),l=H.SCI_NOT_EXPONENT_CHAR+o[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var h="";a.length>1&&(h=a.substring(1));var m=a.charAt(0)+"."+h;return this.isNegative()?"-"+m+l:m+l},H.prototype.abs=function(){return this.isNaN()?H.NaN:this.isNegative()?this.negate():new H(this)},H.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},H.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},H.prototype.add=function(){if(arguments[0]instanceof H){var r=arguments[0];return H.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return H.copy(this).selfAdd(o)}},H.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof H){var o=arguments[0];this._hi=o._hi,this._lo=o._lo}}else if(arguments.length===2){var a=arguments[0],l=arguments[1];this._hi=a,this._lo=l}},H.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},H.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},H.prototype.trunc=function(){return this.isNaN()?H.NaN:this.isPositive()?this.floor():this.ceil()},H.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},H.prototype.interfaces_=function(){return[t,B,U]},H.prototype.getClass=function(){return H},H.sqr=function(r){return H.valueOf(r).selfMultiply(r)},H.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return H.parse(r)}if(typeof arguments[0]=="number"){var o=arguments[0];return new H(o)}},H.sqrt=function(r){return H.valueOf(r).sqrt()},H.parse=function(r){for(var o=0,a=r.length;lt.isWhitespace(r.charAt(o));)o++;var l=!1;if(o<a){var h=r.charAt(o);h!=="-"&&h!=="+"||(o++,h==="-"&&(l=!0))}for(var m=new H,S=0,C=0,z=0;!(o>=a);){var K=r.charAt(o);if(o++,lt.isDigit(K)){var mt=K-"0";m.selfMultiply(H.TEN),m.selfAdd(mt),S++}else{if(K!=="."){if(K==="e"||K==="E"){var yt=r.substring(o);try{z=it.parseInt(yt)}catch(dn){throw dn instanceof Error?new Error("Invalid exponent "+yt+" in string "+r):dn}break}throw new Error("Unexpected character '"+K+"' at position "+o+" in string "+r)}C=S}}var zt=m,qt=S-C-z;if(qt===0)zt=m;else if(qt>0){var Jt=H.TEN.pow(qt);zt=m.divide(Jt)}else if(qt<0){var ue=H.TEN.pow(-qt);zt=m.multiply(ue)}return l?zt.negate():zt},H.createNaN=function(){return new H(w.NaN,w.NaN)},H.copy=function(r){return new H(r)},H.magnitude=function(r){var o=Math.abs(r),a=Math.log(o)/Math.log(10),l=Math.trunc(Math.floor(a));return 10*Math.pow(10,l)<=o&&(l+=1),l},H.stringOfChar=function(r,o){for(var a=new vt,l=0;l<o;l++)a.append(r);return a.toString()},At.PI.get=function(){return new H(3.141592653589793,12246467991473532e-32)},At.TWO_PI.get=function(){return new H(6.283185307179586,24492935982947064e-32)},At.PI_2.get=function(){return new H(1.5707963267948966,6123233995736766e-32)},At.E.get=function(){return new H(2.718281828459045,14456468917292502e-32)},At.NaN.get=function(){return new H(w.NaN,w.NaN)},At.EPS.get=function(){return 123259516440783e-46},At.SPLIT.get=function(){return 134217729},At.MAX_PRINT_DIGITS.get=function(){return 32},At.TEN.get=function(){return H.valueOf(10)},At.ONE.get=function(){return H.valueOf(1)},At.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},At.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(H,At);var It=function(){},jt={DP_SAFE_EPSILON:{configurable:!0}};It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.orientationIndex=function(r,o,a){var l=It.orientationIndexFilter(r,o,a);if(l<=1)return l;var h=H.valueOf(o.x).selfAdd(-r.x),m=H.valueOf(o.y).selfAdd(-r.y),S=H.valueOf(a.x).selfAdd(-o.x),C=H.valueOf(a.y).selfAdd(-o.y);return h.selfMultiply(C).selfSubtract(m.selfMultiply(S)).signum()},It.signOfDet2x2=function(r,o,a,l){return r.multiply(l).selfSubtract(o.multiply(a)).signum()},It.intersection=function(r,o,a,l){var h=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(o.x).selfSubtract(r.x)),m=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(o.y).selfSubtract(r.y)),S=h.subtract(m),C=H.valueOf(l.x).selfSubtract(a.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),z=H.valueOf(l.y).selfSubtract(a.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),K=C.subtract(z).selfDivide(S).doubleValue(),mt=H.valueOf(r.x).selfAdd(H.valueOf(o.x).selfSubtract(r.x).selfMultiply(K)).doubleValue(),yt=H.valueOf(o.x).selfSubtract(r.x).selfMultiply(H.valueOf(r.y).selfSubtract(a.y)),zt=H.valueOf(o.y).selfSubtract(r.y).selfMultiply(H.valueOf(r.x).selfSubtract(a.x)),qt=yt.subtract(zt).selfDivide(S).doubleValue(),Jt=H.valueOf(a.y).selfAdd(H.valueOf(l.y).selfSubtract(a.y).selfMultiply(qt)).doubleValue();return new P(mt,Jt)},It.orientationIndexFilter=function(r,o,a){var l=null,h=(r.x-a.x)*(o.y-a.y),m=(r.y-a.y)*(o.x-a.x),S=h-m;if(h>0){if(m<=0)return It.signum(S);l=h+m}else{if(!(h<0)||m>=0)return It.signum(S);l=-h-m}var C=It.DP_SAFE_EPSILON*l;return S>=C||-S>=C?It.signum(S):2},It.signum=function(r){return r>0?1:r<0?-1:0},jt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(It,jt);var nt=function(){},bt={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};bt.X.get=function(){return 0},bt.Y.get=function(){return 1},bt.Z.get=function(){return 2},bt.M.get=function(){return 3},nt.prototype.setOrdinate=function(r,o,a){},nt.prototype.size=function(){},nt.prototype.getOrdinate=function(r,o){},nt.prototype.getCoordinate=function(){},nt.prototype.getCoordinateCopy=function(r){},nt.prototype.getDimension=function(){},nt.prototype.getX=function(r){},nt.prototype.clone=function(){},nt.prototype.expandEnvelope=function(r){},nt.prototype.copy=function(){},nt.prototype.getY=function(r){},nt.prototype.toCoordinateArray=function(){},nt.prototype.interfaces_=function(){return[U]},nt.prototype.getClass=function(){return nt},Object.defineProperties(nt,bt);var Vt=function(){},$t=function(r){function o(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(o.__proto__=r),o.prototype=Object.create(r&&r.prototype),o.prototype.constructor=o,o.prototype.interfaces_=function(){return[]},o.prototype.getClass=function(){return o},o}(Vt),Ut=function(){};Ut.arraycopy=function(r,o,a,l,h){for(var m=0,S=o;S<o+h;S++)a[l+m]=r[S],m++},Ut.getProperty=function(r){return{"line.separator":\`
@@ -11810,12 +11810,12 @@ void main() {
11810
11810
  \`)};function og(n,t,e){this.x=n,this.y=t,this.weight=e}og.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};og.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};og.prototype.isWall=function(){return this.weight===0};function F2(n){this.content=[],this.scoreFunction=n}F2.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,i=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(i))this.content[e]=t,this.content[n]=i,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],i=this.scoreFunction(e);;){var s=n+1<<1,u=s-1,c=null,f;if(u<t){var p=this.content[u];f=this.scoreFunction(p),f<i&&(c=u)}if(s<t){var d=this.content[s],g=this.scoreFunction(d);g<(c===null?i:f)&&(c=s)}if(c!==null)this.content[n]=this.content[c],this.content[c]=e,n=c;else break}}};function Fx(){this._=null}function jl(n){n.U=n.C=n.L=n.R=n.P=n.N=null}Fx.prototype={constructor:Fx,insert:function(n,t){var e,i,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=U2(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)i=e.U,e===i.L?(s=i.R,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.R&&(Ff(this,e),n=e,e=n.U),e.C=!1,i.C=!0,Uf(this,i))):(s=i.L,s&&s.C?(e.C=s.C=!1,i.C=!0,n=i):(n===e.L&&(Uf(this,e),n=e,e=n.U),e.C=!1,i.C=!0,Ff(this,i))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,i=n.L,s=n.R,u,c;if(i?s?u=U2(s):u=i:u=s,t?t.L===n?t.L=u:t.R=u:this._=u,i&&s?(c=u.C,u.C=n.C,u.L=i,i.U=u,u!==s?(t=u.U,u.U=n.U,n=u.R,t.L=n,u.R=s,s.U=u):(u.U=t,t=u,n=u.R)):(c=n.C,n=u),n&&(n.U=t),!c){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ff(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Uf(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ff(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Uf(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Ff(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Uf(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ff(n,t){var e=t,i=t.R,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.R=i.L,e.R&&(e.R.U=e),i.L=e}function Uf(n,t){var e=t,i=t.L,s=e.U;s?s.L===e?s.L=i:s.R=i:n._=i,i.U=s,e.U=i,e.L=i.R,e.L&&(e.L.U=e),i.R=e}function U2(n){for(;n.L;)n=n.L;return n}var Ux=Fx;function Kl(n,t,e,i){var s=[null,null],u=kr.push(s)-1;return s.left=n,s.right=t,e&&Bf(s,n,t,e),i&&Bf(s,t,n,i),Ti[n.index].halfedges.push(u),Ti[t.index].halfedges.push(u),s}function Ql(n,t,e){var i=[t,e];return i.left=n,i}function Bf(n,t,e,i){!n[0]&&!n[1]?(n[0]=i,n.left=t,n.right=e):n.left===e?n[1]=i:n[0]=i}function PK(n,t,e,i,s){var u=n[0],c=n[1],f=u[0],p=u[1],d=c[0],g=c[1],y=0,v=1,E=d-f,M=g-p,A;if(A=t-f,!(!E&&A>0)){if(A/=E,E<0){if(A<y)return;A<v&&(v=A)}else if(E>0){if(A>v)return;A>y&&(y=A)}if(A=i-f,!(!E&&A<0)){if(A/=E,E<0){if(A>v)return;A>y&&(y=A)}else if(E>0){if(A<y)return;A<v&&(v=A)}if(A=e-p,!(!M&&A>0)){if(A/=M,M<0){if(A<y)return;A<v&&(v=A)}else if(M>0){if(A>v)return;A>y&&(y=A)}if(A=s-p,!(!M&&A<0)){if(A/=M,M<0){if(A>v)return;A>y&&(y=A)}else if(M>0){if(A<y)return;A<v&&(v=A)}return!(y>0)&&!(v<1)||(y>0&&(n[0]=[f+y*E,p+y*M]),v<1&&(n[1]=[f+v*E,p+v*M])),!0}}}}}function RK(n,t,e,i,s){var u=n[1];if(u)return!0;var c=n[0],f=n.left,p=n.right,d=f[0],g=f[1],y=p[0],v=p[1],E=(d+y)/2,M=(g+v)/2,A,_;if(v===g){if(E<t||E>=i)return;if(d>y){if(!c)c=[E,e];else if(c[1]>=s)return;u=[E,s]}else{if(!c)c=[E,s];else if(c[1]<e)return;u=[E,e]}}else if(A=(d-y)/(v-g),_=M-A*E,A<-1||A>1)if(d>y){if(!c)c=[(e-_)/A,e];else if(c[1]>=s)return;u=[(s-_)/A,s]}else{if(!c)c=[(s-_)/A,s];else if(c[1]<e)return;u=[(e-_)/A,e]}else if(g<v){if(!c)c=[t,A*t+_];else if(c[0]>=i)return;u=[i,A*i+_]}else{if(!c)c=[i,A*i+_];else if(c[0]<t)return;u=[t,A*t+_]}return n[0]=c,n[1]=u,!0}function B2(n,t,e,i){for(var s=kr.length,u;s--;)(!RK(u=kr[s],n,t,e,i)||!PK(u,n,t,e,i)||!(Math.abs(u[0][0]-u[1][0])>Ln||Math.abs(u[0][1]-u[1][1])>Ln))&&delete kr[s]}function z2(n){return Ti[n.index]={site:n,halfedges:[]}}function LK(n,t){var e=n.site,i=t.left,s=t.right;return e===s&&(s=i,i=e),s?Math.atan2(s[1]-i[1],s[0]-i[0]):(e===i?(i=t[1],s=t[0]):(i=t[0],s=t[1]),Math.atan2(i[0]-s[0],s[1]-i[1]))}function Bx(n,t){return t[+(t.left!==n.site)]}function NK(n,t){return t[+(t.left===n.site)]}function G2(){for(var n=0,t=Ti.length,e,i,s,u;n<t;++n)if((e=Ti[n])&&(u=(i=e.halfedges).length)){var c=new Array(u),f=new Array(u);for(s=0;s<u;++s)c[s]=s,f[s]=LK(e,kr[i[s]]);for(c.sort(function(p,d){return f[d]-f[p]}),s=0;s<u;++s)f[s]=i[c[s]];for(s=0;s<u;++s)i[s]=f[s]}}function k2(n,t,e,i){var s=Ti.length,u,c,f,p,d,g,y,v,E,M,A,_,x=!0;for(u=0;u<s;++u)if(c=Ti[u]){for(f=c.site,d=c.halfedges,p=d.length;p--;)kr[d[p]]||d.splice(p,1);for(p=0,g=d.length;p<g;)M=NK(c,kr[d[p]]),A=M[0],_=M[1],y=Bx(c,kr[d[++p%g]]),v=y[0],E=y[1],(Math.abs(A-v)>Ln||Math.abs(_-E)>Ln)&&(d.splice(p,0,kr.push(Ql(f,M,Math.abs(A-n)<Ln&&i-_>Ln?[n,Math.abs(v-n)<Ln?E:i]:Math.abs(_-i)<Ln&&e-A>Ln?[Math.abs(E-i)<Ln?v:e,i]:Math.abs(A-e)<Ln&&_-t>Ln?[e,Math.abs(v-e)<Ln?E:t]:Math.abs(_-t)<Ln&&A-n>Ln?[Math.abs(E-t)<Ln?v:n,t]:null))-1),++g);g&&(x=!1)}if(x){var T,w,R,B=1/0;for(u=0,x=null;u<s;++u)(c=Ti[u])&&(f=c.site,T=f[0]-n,w=f[1]-t,R=T*T+w*w,R<B&&(B=R,x=c));if(x){var U=[n,t],D=[n,i],P=[e,i],ct=[e,t];x.halfedges.push(kr.push(Ql(f=x.site,U,D))-1,kr.push(Ql(f,D,P))-1,kr.push(Ql(f,P,ct))-1,kr.push(Ql(f,ct,U))-1)}}for(u=0;u<s;++u)(c=Ti[u])&&(c.halfedges.length||delete Ti[u])}var q2=[],sg;function OK(){jl(this),this.x=this.y=this.arc=this.site=this.cy=null}function vu(n){var t=n.P,e=n.N;if(!(!t||!e)){var i=t.site,s=n.site,u=e.site;if(i!==u){var c=s[0],f=s[1],p=i[0]-c,d=i[1]-f,g=u[0]-c,y=u[1]-f,v=2*(p*y-d*g);if(!(v>=-V2)){var E=p*p+d*d,M=g*g+y*y,A=(y*E-d*M)/v,_=(p*M-g*E)/v,x=q2.pop()||new OK;x.arc=n,x.site=s,x.x=A+c,x.y=(x.cy=_+f)+Math.sqrt(A*A+_*_),n.circle=x;for(var T=null,w=tc._;w;)if(x.y<w.y||x.y===w.y&&x.x<=w.x)if(w.L)w=w.L;else{T=w.P;break}else if(w.R)w=w.R;else{T=w;break}tc.insert(T,x),T||(sg=x)}}}}function _u(n){var t=n.circle;t&&(t.P||(sg=t.N),tc.remove(t),q2.push(t),jl(t),n.circle=null)}var W2=[];function DK(){jl(this),this.edge=this.site=this.circle=null}function H2(n){var t=W2.pop()||new DK;return t.site=n,t}function zx(n){_u(n),xu.remove(n),W2.push(n),jl(n)}function X2(n){var t=n.circle,e=t.x,i=t.cy,s=[e,i],u=n.P,c=n.N,f=[n];zx(n);for(var p=u;p.circle&&Math.abs(e-p.circle.x)<Ln&&Math.abs(i-p.circle.cy)<Ln;)u=p.P,f.unshift(p),zx(p),p=u;f.unshift(p),_u(p);for(var d=c;d.circle&&Math.abs(e-d.circle.x)<Ln&&Math.abs(i-d.circle.cy)<Ln;)c=d.N,f.push(d),zx(d),d=c;f.push(d),_u(d);var g=f.length,y;for(y=1;y<g;++y)d=f[y],p=f[y-1],Bf(d.edge,p.site,d.site,s);p=f[0],d=f[g-1],d.edge=Kl(p.site,d.site,null,s),vu(p),vu(d)}function Y2(n){for(var t=n[0],e=n[1],i,s,u,c,f=xu._;f;)if(u=$2(f,e)-t,u>Ln)f=f.L;else if(c=t-FK(f,e),c>Ln){if(!f.R){i=f;break}f=f.R}else{u>-Ln?(i=f.P,s=f):c>-Ln?(i=f,s=f.N):i=s=f;break}z2(n);var p=H2(n);if(xu.insert(i,p),!(!i&&!s)){if(i===s){_u(i),s=H2(i.site),xu.insert(p,s),p.edge=s.edge=Kl(i.site,p.site),vu(i),vu(s);return}if(!s){p.edge=Kl(i.site,p.site);return}_u(i),_u(s);var d=i.site,g=d[0],y=d[1],v=n[0]-g,E=n[1]-y,M=s.site,A=M[0]-g,_=M[1]-y,x=2*(v*_-E*A),T=v*v+E*E,w=A*A+_*_,R=[(_*T-E*w)/x+g,(v*w-A*T)/x+y];Bf(s.edge,d,M,R),p.edge=Kl(d,n,null,R),s.edge=Kl(n,M,null,R),vu(i),vu(s)}}function $2(n,t){var e=n.site,i=e[0],s=e[1],u=s-t;if(!u)return i;var c=n.P;if(!c)return-1/0;e=c.site;var f=e[0],p=e[1],d=p-t;if(!d)return f;var g=f-i,y=1/u-1/d,v=g/d;return y?(-v+Math.sqrt(v*v-2*y*(g*g/(-2*d)-p+d/2+s-u/2)))/y+i:(i+f)/2}function FK(n,t){var e=n.N;if(e)return $2(e,t);var i=n.site;return i[1]===t?i[0]:1/0}var Ln=1e-6,V2=1e-12,xu,Ti,tc,kr;function UK(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function BK(n,t){return t[1]-n[1]||t[0]-n[0]}function ag(n,t){var e=n.sort(BK).pop(),i,s,u;for(kr=[],Ti=new Array(n.length),xu=new Ux,tc=new Ux;;)if(u=sg,e&&(!u||e[1]<u.y||e[1]===u.y&&e[0]<u.x))(e[0]!==i||e[1]!==s)&&(Y2(e),i=e[0],s=e[1]),e=n.pop();else if(u)X2(u.arc);else break;if(G2(),t){var c=+t[0][0],f=+t[0][1],p=+t[1][0],d=+t[1][1];B2(c,f,p,d),k2(c,f,p,d)}this.edges=kr,this.cells=Ti,xu=tc=kr=Ti=null}ag.prototype={constructor:ag,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(i){return Bx(t,n[i])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,i){if(f=(u=e.halfedges).length)for(var s=e.site,u,c=-1,f,p,d=t[u[f-1]],g=d.left===s?d.right:d.left;++c<f;)p=g,d=t[u[c]],g=d.left===s?d.right:d.left,p&&g&&i<p.index&&i<g.index&&UK(s,p,g)<0&&n.push([s.data,p.data,g.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var i=this,s,u=i._found||0,c=i.cells.length,f;!(f=i.cells[u]);)if(++u>=c)return null;var p=n-f.site[0],d=t-f.site[1],g=p*p+d*d;do f=i.cells[s=u],u=null,f.halfedges.forEach(function(y){var v=i.edges[y],E=v.left;if(!((E===f.site||!E)&&!(E=v.right))){var M=n-E[0],A=t-E[1],_=M*M+A*A;_<g&&(g=_,u=E.index)}});while(u!==null);return i._found=s,e==null||g<=e*e?f.site:null}};var XK=Qt(ec(),1);var t1=Qt(K2(),1);function Di(){return new cg}function cg(){this.reset()}cg.prototype={constructor:cg,reset:function(){this.s=this.t=0},add:function(n){Q2(lg,n,this.t),Q2(this,lg.s,this.s),this.s?this.t+=lg.t:this.s=lg.t},valueOf:function(){return this.s}};var lg=new cg;function Q2(n,t,e){var i=n.s=t+e,s=i-t,u=i-s;n.t=t-u+(e-s)}var yn=1e-6;var Tn=Math.PI,br=Tn/2,fg=Tn/4,os=Tn*2,Eu=180/Tn,Fi=Tn/180,nr=Math.abs,Uo=Math.atan,Ui=Math.atan2,hn=Math.cos;var hg=Math.exp;var zf=Math.log;var Me=Math.sin;var jr=Math.sqrt,Gf=Math.tan;function qx(n){return n>1?0:n<-1?Tn:Math.acos(n)}function Ci(n){return n>1?br:n<-1?-br:Math.asin(n)}function Bo(){}var YK=Di(),k0t=Di();function Su(n){var t=n[0],e=n[1],i=hn(e);return[i*hn(t),i*Me(t),Me(e)]}function kf(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function qf(n){var t=jr(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var j0t=Di();function eO(n,t){return[n>Tn?n-os:n<-Tn?n+os:n,t]}eO.invert=eO;function Vx(){var n=[],t;return{point:function(e,i){t.push([e,i])},lineStart:function(){n.push(t=[])},lineEnd:Bo,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Hx(n,t){return nr(n[0]-t[0])<yn&&nr(n[1]-t[1])<yn}function pg(n,t,e,i){this.x=n,this.z=t,this.o=e,this.e=i,this.v=!1,this.n=this.p=null}function Wx(n,t,e,i,s){var u=[],c=[],f,p;if(n.forEach(function(M){if(!((A=M.length-1)<=0)){var A,_=M[0],x=M[A],T;if(Hx(_,x)){for(s.lineStart(),f=0;f<A;++f)s.point((_=M[f])[0],_[1]);s.lineEnd();return}u.push(T=new pg(_,M,null,!0)),c.push(T.o=new pg(_,null,T,!1)),u.push(T=new pg(x,M,null,!1)),c.push(T.o=new pg(x,null,T,!0))}}),!!u.length){for(c.sort(t),nO(u),nO(c),f=0,p=c.length;f<p;++f)c[f].e=e=!e;for(var d=u[0],g,y;;){for(var v=d,E=!0;v.v;)if((v=v.n)===d)return;g=v.z,s.lineStart();do{if(v.v=v.o.v=!0,v.e){if(E)for(f=0,p=g.length;f<p;++f)s.point((y=g[f])[0],y[1]);else i(v.x,v.n.x,1,s);v=v.n}else{if(E)for(g=v.p.z,f=g.length-1;f>=0;--f)s.point((y=g[f])[0],y[1]);else i(v.x,v.p.x,-1,s);v=v.p}v=v.o,g=v.z,E=!E}while(!v.v);s.lineEnd()}}}function nO(n){if(t=n.length){for(var t,e=0,i=n[0],s;++e<t;)i.n=s=n[e],s.p=i,i=s;i.n=s=n[0],s.p=i}}function Aa(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function Xx(n){return n.length===1&&(n=JK(n)),{left:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)<0?i=u+1:s=u}return i},right:function(t,e,i,s){for(i==null&&(i=0),s==null&&(s=t.length);i<s;){var u=i+s>>>1;n(t[u],e)>0?s=u:i=u+1}return i}}}function JK(n){return function(t,e){return Aa(n(t),e)}}var rO=Xx(Aa),jK=rO.right,KK=rO.left;var iO=Array.prototype,tQ=iO.slice,eQ=iO.map;var Vyt=Math.sqrt(50),Hyt=Math.sqrt(10),Wyt=Math.sqrt(2);function gg(n){for(var t=n.length,e,i=-1,s=0,u,c;++i<t;)s+=n[i].length;for(u=new Array(s);--t>=0;)for(c=n[t],e=c.length;--e>=0;)u[--s]=c[e];return u}var lQ=1e9,C_t=-lQ;var Yx=Di();function $x(n,t){var e=t[0],i=t[1],s=[Me(e),-hn(e),0],u=0,c=0;Yx.reset();for(var f=0,p=n.length;f<p;++f)if(g=(d=n[f]).length)for(var d,g,y=d[g-1],v=y[0],E=y[1]/2+fg,M=Me(E),A=hn(E),_=0;_<g;++_,v=T,M=R,A=B,y=x){var x=d[_],T=x[0],w=x[1]/2+fg,R=Me(w),B=hn(w),U=T-v,D=U>=0?1:-1,P=D*U,ct=P>Tn,L=M*R;if(Yx.add(Ui(L*D*Me(P),A*B+L*hn(P))),u+=ct?U+D*os:U,ct^v>=e^T>=e){var W=kf(Su(y),Su(x));qf(W);var V=kf(s,W);qf(V);var Mt=(ct^U>=0?-1:1)*Ci(V[2]);(i>Mt||i===Mt&&(W[0]||W[1]))&&(c+=ct^U>=0?1:-1)}}return(u<-yn||u<yn&&Yx<-yn)^c&1}var B_t=Di();var rxt=Di(),ixt=Di();var hQ=1/0;var axt=-hQ;function Zx(n){this._context=n}Zx.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,os);break}}},result:Bo};var yxt=Di();function Jx(){this._string=[]}Jx.prototype={_radius:4.5,_circle:aO(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=aO(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function aO(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function jx(n,t,e,i){return function(s,u){var c=t(u),f=s.invert(i[0],i[1]),p=Vx(),d=t(p),g=!1,y,v,E,M={point:A,lineStart:x,lineEnd:T,polygonStart:function(){M.point=w,M.lineStart=R,M.lineEnd=B,v=[],y=[]},polygonEnd:function(){M.point=A,M.lineStart=x,M.lineEnd=T,v=gg(v);var U=$x(y,f);v.length?(g||(u.polygonStart(),g=!0),Wx(v,gQ,U,e,u)):U&&(g||(u.polygonStart(),g=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),g&&(u.polygonEnd(),g=!1),v=y=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function A(U,D){var P=s(U,D);n(U=P[0],D=P[1])&&u.point(U,D)}function _(U,D){var P=s(U,D);c.point(P[0],P[1])}function x(){M.point=_,c.lineStart()}function T(){M.point=A,c.lineEnd()}function w(U,D){E.push([U,D]);var P=s(U,D);d.point(P[0],P[1])}function R(){d.lineStart(),E=[]}function B(){w(E[0][0],E[0][1]),d.lineEnd();var U=d.clean(),D=p.result(),P,ct=D.length,L,W,V;if(E.pop(),y.push(E),E=null,!!ct){if(U&1){if(W=D[0],(L=W.length-1)>0){for(g||(u.polygonStart(),g=!0),u.lineStart(),P=0;P<L;++P)u.point((V=W[P])[0],V[1]);u.lineEnd()}return}ct>1&&U&2&&D.push(D.pop().concat(D.shift())),v.push(D.filter(dQ))}}return M}}function dQ(n){return n.length>1}function gQ(n,t){return((n=n.x)[0]<0?n[1]-br-yn:br-n[1])-((t=t.x)[0]<0?t[1]-br-yn:br-t[1])}var mQ=jx(function(){return!0},yQ,_Q,[-Tn,-br]);function yQ(n){var t=NaN,e=NaN,i=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(u,c){var f=u>0?Tn:-Tn,p=nr(u-t);nr(p-Tn)<yn?(n.point(t,e=(e+c)/2>0?br:-br),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),n.point(u,e),s=0):i!==f&&p>=Tn&&(nr(t-i)<yn&&(t-=i*yn),nr(u-f)<yn&&(u-=f*yn),e=vQ(t,e,u,c),n.point(i,e),n.lineEnd(),n.lineStart(),n.point(f,e),s=0),n.point(t=u,e=c),i=f},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function vQ(n,t,e,i){var s,u,c=Me(n-e);return nr(c)>yn?Uo((Me(t)*(u=hn(i))*Me(e)-Me(i)*(s=hn(t))*Me(n))/(s*u*c)):(t+i)/2}function _Q(n,t,e,i){var s;if(n==null)s=e*br,i.point(-Tn,s),i.point(0,s),i.point(Tn,s),i.point(Tn,0),i.point(Tn,-s),i.point(0,-s),i.point(-Tn,-s),i.point(-Tn,0),i.point(-Tn,s);else if(nr(n[0]-t[0])>yn){var u=n[0]<t[0]?Tn:-Tn;s=e*u/2,i.point(-u,s),i.point(0,s),i.point(u,s)}else i.point(t[0],t[1])}function mg(n){return function(t){var e=new Kx;for(var i in n)e[i]=n[i];return e.stream=t,e}}function Kx(){}Kx.prototype={constructor:Kx,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var i1t=hn(30*Fi);var v1t=mg({point:function(n,t){this.stream.point(n*Fi,t*Fi)}});function yg(n){return function(t,e){var i=hn(t),s=hn(e),u=n(i*s);return[u*s*Me(t),u*Me(e)]}}function ss(n){return function(t,e){var i=jr(t*t+e*e),s=n(i),u=Me(s),c=hn(s);return[Ui(t*u,i*c),Ci(i&&e*u/i)]}}var dO=yg(function(n){return jr(2/(1+n))});dO.invert=ss(function(n){return 2*Ci(n/2)});var gO=yg(function(n){return(n=qx(n))&&n/Me(n)});gO.invert=ss(function(n){return n});function Qx(n,t){return[n,zf(Gf((br+t)/2))]}Qx.invert=function(n,t){return[n,2*Uo(hg(t))-br]};function vg(n,t){return[n,t]}vg.invert=vg;function mO(n,t){var e=hn(t),i=hn(n)*e;return[e*Me(n)/i,Me(t)/i]}mO.invert=ss(Uo);function yO(n,t){var e=t*t,i=e*e;return[n*(.8707-.131979*e+i*(-.013791+i*(.003971*e-.001529*i))),t*(1.007226+e*(.015085+i*(-.044475+.028874*e-.005916*i)))]}yO.invert=function(n,t){var e=t,i=25,s;do{var u=e*e,c=u*u;e-=s=(e*(1.007226+u*(.015085+c*(-.044475+.028874*u-.005916*c)))-t)/(1.007226+u*(.015085*3+c*(-.044475*7+.028874*9*u-.005916*11*c)))}while(nr(s)>yn&&--i>0);return[n/(.8707+(u=e*e)*(-.131979+u*(-.013791+u*u*u*(.003971-.001529*u)))),e]};function vO(n,t){return[hn(t)*Me(n),Me(t)]}vO.invert=ss(Ci);function _O(n,t){var e=hn(t),i=1+hn(n)*e;return[e*Me(n)/i,Me(t)/i]}_O.invert=ss(function(n){return 2*Uo(n)});function xO(n,t){return[zf(Gf((br+t)/2)),-n]}xO.invert=function(n,t){return[-t,2*Uo(hg(n))-br]};var bQ=Qt(ec(),1);var AQ=Qt(ec(),1);var CQ=Qt(ec(),1);var IQ=Qt(ec(),1);function SO(n,t){let e=0,i=1/0,[s,u]=t;for(let c=0;c<n.length-1;c++){let[f,p]=n[c],[d,g]=n[c+1],y=Math.min(f,d)<=s&&s<=Math.max(f,d),v=Math.min(p,g)<=u&&u<=Math.max(p,g);if(y&&v){let E=Math.abs((d-f)*(u-p)-(g-p)*(s-f));E<i&&(i=E,e=c)}}return e}function wO(n,t){let e=n[0],i=n[1],s=!1;for(let u=0,c=t.length-1;u<t.length;c=u++){let f=t[u][0],p=t[u][1],d=t[c][0],g=t[c][1];p>i!=g>i&&e<(d-f)*(i-p)/(g-p)+f&&(s=!s)}return s}var NAt=Qt(ZO(),1),OAt=Qt(o_(),1);function aD(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function uD(n){let t={};for(let i in n)i.startsWith("on")&&(t[aD(i.slice(2))]=n[i]);let e=i=>Ri(this,null,function*(){let{data:s}=i;if(t[s.type])try{let u=yield t[s.type](s.data);if(u!=null&&u.$transfer&&Array.isArray(u.$transfer)){let c=u.$transfer;delete u.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:u},c)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:u})}catch(u){self.postMessage({type:""+s.type+"_result",key:s.key,error:u})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var qAt=Qt(bD(),1),VAt=Qt(Bc(),1);function AD(n,t,e){e===void 0&&(e=0),n.forEach(i=>{if(i.geometry.coords=JSON.parse(JSON.stringify(i.geometry.cds)),i.geometry.type==="polygon"){var s;i.geometry.coords.map(u=>{Array.isArray(u)&&u.forEach(c=>{c[0]-=t[0],c[1]-=t[1]})}),i.geometry.otherCds&&(i.geometry.otherCoords=i.geometry.otherCds.map(u=>u.map(c=>ic(c,t)))),(s=i.doors)!=null&&s.length&&i.doors.map(u=>{u.coord=ic(u.coordinate,t)}),i.center&&(i.centerCoords=ic(i.center,t))}else i.geometry.coords=ic(i.geometry.cds,t),i.center&&(i.centerCoords=ic(i.center,t));if(i.center_x&&i.center_y){let[u,c]=ic([i.center_x,i.center_y],t);i.center_coord_x=u,i.center_coord_y=c}});for(let i=0;i<n.length;i++){let s=n[i];s.deltaHeight=1e-5*(e+i+1)}}function ic(n,t){return[n[0]-t[0],n[1]-t[1]]}var jAt=Qt(p0(),1),KAt=Qt(d0(),1),QAt=Qt(g0(),1),tTt=Qt(y0(),1),eTt=Qt(v0(),1),nTt=Qt(S0(),1),rTt=Qt(I0(),1),iTt=Qt(R0(),1),oTt=Qt(L0(),1),sTt=Qt(O0(),1),aTt=Qt(F0(),1),uTt=Qt(G0(),1),lTt=Qt(V0(),1),cTt=Qt(iy(),1),fTt=Qt(oy(),1),hTt=Qt(Sh(),1);function Eg(n,t=!1){let e=n[0].index!==null,i=new Set(Object.keys(n[0].attributes)),s=new Set(Object.keys(n[0].morphAttributes)),u={},c={},f=n[0].morphTargetsRelative,p=new ui,d=0;for(let g=0;g<n.length;++g){let y=n[g],v=0;if(e!==(y.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let E in y.attributes){if(!i.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+'. All geometries must have compatible attributes; make sure "'+E+'" attribute exists among all geometries, or in none of them.'),null;u[E]===void 0&&(u[E]=[]),u[E].push(y.attributes[E]),v++}if(v!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". Make sure all geometries have the same number of attributes."),null;if(f!==y.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let E in y.morphAttributes){if(!s.has(E))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". .morphAttributes must be consistent throughout all geometries."),null;c[E]===void 0&&(c[E]=[]),c[E].push(y.morphAttributes[E])}if(t){let E;if(e)E=y.index.count;else if(y.attributes.position!==void 0)E=y.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+g+". The geometry must have either an index or a position attribute"),null;p.addGroup(d,E,g),d+=E}}if(e){let g=0,y=[];for(let v=0;v<n.length;++v){let E=n[v].index;for(let M=0;M<E.count;++M)y.push(E.getX(M)+g);g+=n[v].attributes.position.count}p.setIndex(y)}for(let g in u){let y=TD(u[g]);if(!y)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+g+" attribute."),null;p.setAttribute(g,y)}for(let g in c){let y=c[g][0].length;if(y===0)break;p.morphAttributes=p.morphAttributes||{},p.morphAttributes[g]=[];for(let v=0;v<y;++v){let E=[];for(let A=0;A<c[g].length;++A)E.push(c[g][A][v]);let M=TD(E);if(!M)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+g+" morphAttribute."),null;p.morphAttributes[g].push(M)}}return p}function TD(n){let t,e,i,s=-1,u=0;for(let d=0;d<n.length;++d){let g=n[d];if(t===void 0&&(t=g.array.constructor),t!==g.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(e===void 0&&(e=g.itemSize),e!==g.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=g.normalized),i!==g.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(s===-1&&(s=g.gpuType),s!==g.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;u+=g.count*e}let c=new t(u),f=new Yn(c,e,i),p=0;for(let d=0;d<n.length;++d){let g=n[d];if(g.isInterleavedBufferAttribute){let y=p/e;for(let v=0,E=g.count;v<E;v++)for(let M=0;M<e;M++){let A=g.getComponent(v,M);f.setComponent(v+y,M,A)}}else c.set(g.array,p);p+=g.count*e}return s!==void 0&&(f.gpuType=s),f}function CD(n,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let i=n.filter(f=>f.geometry.type==="polygon");if(!i.length)return null;let s=i.map(f=>{var p;let d=f.geometry.coords,g=fd(d[0],d.slice(1)),y=new rd(g,{steps:1,bevelEnabled:!1,depth:f.height,curveSegments:4});(p=f).deltaHeight||(p.deltaHeight=0),y.translate(0,0,f.airHeight+f.deltaHeight);let v=y.attributes.position.count,E=new Float32Array(v).fill(f.height+f.airHeight+f.deltaHeight);if(y.setAttribute("maxZ",new Yn(E,1)),y.setAttribute("opacity",new Yn(new Float32Array(v).fill(f.fillOpacity),1)),e){let _=new Float32Array(v).fill(f.airHeight+f.deltaHeight);y.setAttribute("minZ",new Yn(_,1))}let M=new Te(f.fillColor).convertLinearToSRGB(),A=new Float32Array(v*3);for(let _=0;_<v;_++)A[_*3]=M.r,A[_*3+1]=M.g,A[_*3+2]=M.b;return y.setAttribute("color",new Yn(A,3)),y}),u=Eg(s);s.forEach(f=>f.dispose());let c={geometry:u};return u.dispose(),t&&(c.lineGeometry=c1(i)||void 0),c}function c1(n){let{points:t,colors:e,opacities:i}=Ktt(n);if(!t.length)return null;let s=new ui().setFromPoints(t);return s.setAttribute("color",new Yn(new Float32Array(e),3)),s.setAttribute("opacity",new Yn(new Float32Array(i),1)),s}function Ktt(n){let t=[],e=[],i=[];return n.filter(s=>s.strokeOpacity>0).map(s=>{let u=s.height+(s.deltaHeight||0)+s.airHeight,{coords:c}=s.geometry,{strokeColor:f,strokeOpacity:p}=s,d=new Te(f).convertLinearToSRGB();for(let g=0;g<c.length;g++){let y=c[g];for(let v=0;v<y.length;v++){let E=y[v],M=v+1===y.length?y[0]:y[v+1];t.push(new st(E[0],E[1],u)),t.push(new st(M[0],M[1],u)),e.push(d.r,d.g,d.b),e.push(d.r,d.g,d.b),i.push(p),i.push(p)}}}),{points:t,colors:e,opacities:i}}var Hf=function(n){return n.HALF="half",n.POWER="power",n.MECHANICAL="mechanical",n.NORMAL="normal",n.VIP="vip",n}({});var ID=new Ko,Sg=new st,wg=class extends sd{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],e=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new _r(t,3)),this.setAttribute("uv",new _r(e,2))}applyMatrix4(t){let e=this.attributes.instanceStart,i=this.attributes.instanceEnd;return e!==void 0&&(e.applyMatrix4(t),i.applyMatrix4(t),e.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let i=new gf(e,6,1);return this.setAttribute("instanceStart",new ts(i,3,0)),this.setAttribute("instanceEnd",new ts(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));let i=new gf(e,6,1);return this.setAttribute("instanceColorStart",new ts(i,3,0)),this.setAttribute("instanceColorEnd",new ts(i,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new od(t.geometry)),this}fromLineSegments(t){let e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ko);let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;t!==void 0&&e!==void 0&&(this.boundingBox.setFromBufferAttribute(t),ID.setFromBufferAttribute(e),this.boundingBox.union(ID))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new uu),this.boundingBox===null&&this.computeBoundingBox();let t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(t!==void 0&&e!==void 0){let i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let u=0,c=t.count;u<c;u++)Sg.fromBufferAttribute(t,u),s=Math.max(s,i.distanceToSquared(Sg)),Sg.fromBufferAttribute(e,u),s=Math.max(s,i.distanceToSquared(Sg));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}};var xTt=Qt(sD(),1);var Mg=function(n){return n.LAYERED_RENDER_VERSION="layeredRender",n.MERGED_RENDER_VERSION="mergedRender",n}({});var f1=["range","ground","store","facility","parkingSpace"];function PD(n){return f1.indexOf(n.l_type)===-1?f1.length:f1.indexOf(n.l_type)}function Qtt(n){n.layers.sort((t,e)=>PD(t)-PD(e))}function tet(n){let t=n.layers.find(i=>i.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];n.layers.map(i=>{if(i.l_type!=="range")return AD(i.elements,e)})}function RD(n){Qtt(n),tet(n)}function bg(n,t){return t===void 0&&(t=4),n.floor_id+"_"+n.version_id+(t?"_"+t:"")}var oc=[],sc=[];function eet(n,t){return Ri(this,null,function*(){return yield rp(),fy(n,""+t)})}function LD(n,t,e){return Ri(this,null,function*(){let{db:i}=yield rp();return cC(n,""+t,e,i)})}function net(n){return Ri(this,null,function*(){let t=yield fetch(n.map_url).then(e=>e.json());return t.floor=n.floor,RD(t),oc.push(t),t})}function ret(n,t){return Ri(this,null,function*(){let e=bg(n,t===Mg.LAYERED_RENDER_VERSION?1:void 0);try{let i=yield eet(np.MAP_DATA,e);return i&&(t===Mg.LAYERED_RENDER_VERSION||i.transformed)?(console.log("\\u4ECE\\u7F13\\u5B58\\u4E2D\\u53D6\\u5230\\u4E86\\u6570\\u636E"),i):(console.log("\\u7F13\\u5B58\\u4E2D\\u6CA1\\u6709\\u6570\\u636E",e,i),sc.push(n),null)}catch(i){return console.log("[get floor data error]",i),sc.push(n),null}})}function iet(n,t){return t===void 0&&(t=!0),t&&(n.layers.forEach(e=>{switch(e.l_type){case"ground":if(e.elements.length<2)break;e.mergedElements=Wf(e.elements);break;case"store":h1(e.elements),e.mergedElements=Wf(e.elements);break;case"facility":h1(e.elements),e.mergedElements=Wf(e.elements);break;case"parkingSpace":console.time("parkingSpace merge"),e.mergedElements=oet(e.elements),console.timeEnd("parkingSpace merge"),e.mergedParkingTexture=uet(e.elements);break;case"graph":h1(e.elements),e.mergedElements=Wf(e.elements);break;case"wall":e.mergedElements=Wf(e.elements,!1,!0);break;case"lane":e.mergedElements=set(e.elements);break;case"texture2d":case"texture3d":e.mergedMatrixes=ND(e.elements);break;case"glb":case"text":}}),n.transformed=!0),n}function Wf(n,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let i=CD(n,t,e);if(i){var s;return[xc({},n[0],{mergedGeometry:i.geometry.toJSON(),lineGeometry:((s=i.lineGeometry)==null?void 0:s.toJSON())||null})]}else return[]}function oet(n){let t=[],e=[],i=[],s=[];n.forEach((c,f)=>{let p=c.geometry.coords[0],[d,g,y]=p.slice(0,3),v=Math.sqrt((g[0]-d[0])**2+(g[1]-d[1])**2),E=Math.sqrt((y[0]-g[0])**2+(y[1]-g[1])**2),M=[v,E],A=Math.max(...M),_=Math.min(...M),x;A===v?x=[g[0]-d[0],g[1]-d[1]]:x=[y[0]-g[0],y[1]-g[1]];let[T,w]=x,R=Math.atan2(w,T)-Math.PI/2,B=new jn().compose(new st(c.center_coord_x,c.center_coord_y,(c.deltaHeight||0)+c.airHeight+c.height/2),new No().setFromAxisAngle(new st(0,0,1),R),new st(_,A,c.height));i.push(...B.toArray()),s.push(...new Te(c.fillColor).convertLinearToSRGB().toArray()),t[f]=c.fillOpacity||1,e[f]=(c.deltaHeight||0)+c.airHeight+c.height});let u=c1(n);return{size:n.length,opacities:t,maxZ:e,matrixes:i,colors:s,lineGeometry:(u==null?void 0:u.toJSON())||null}}function ND(n){let t=n.reduce((i,s)=>{let{iconUrl:u}=s;return i.has(u)||i.set(u,[]),i.get(u).push(s),i},new Map);return Array.from(t.values()).map(i=>{let s=i.map(c=>new jn().compose(new st(c.centerCoords[0],c.centerCoords[1],c.deltaHeight+c.airHeight+c.height),new No().setFromAxisAngle(new st(0,0,1),c.secondRotate),new st(c.secondWidth,c.secondHeight,1)).toArray());return xc({},i[0],{mergedMatrixes:{size:s.length,array:s.flat()}})})}function set(n){let t=n.map(u=>{let c=fd(u.geometry.coords[0].slice(0,-1),u.geometry.coords.slice(1)),f=new id(c,4),p=f.getAttribute("position"),d=[],g=new Te(u.fillColor);for(let v=0;v<p.count;v++){p.setZ(v,u.airHeight+(u.deltaHeight||0));var y;d.push(g.r,g.g,g.b,(y=u.fillOpacity)!=null?y:1)}return f.setAttribute("color",new Yn(new Float32Array(d),4)),f}),e=Eg(t);t.forEach(u=>u.dispose());let i={mergedGeometry:e.toJSON()};e.dispose();let s=n.filter(u=>{var c,f;return u.double&&((f=u.geometry.otherCoords)==null||(c=f[1])==null?void 0:c.length)});return s.length&&[!0,!1].forEach(u=>{let c=s.filter(g=>g.double===!0&&g.dashed===u);if(!c.length)return;let f=[],p=[];c.forEach(g=>{let y=g.geometry.otherCoords[1],v=g.airHeight+(g.deltaHeight||0)+.01,E=new Te(g.secondColor);for(let M=0;M<y.length-1;M++){let A=y[M],_=y[M+1];f.push(A[0],A[1],v,_[0],_[1],v),p.push(E.r,E.g,E.b,E.r,E.g,E.b)}});let d=new wg;d.setPositions(f),d.setColors(p),i[u?"dashedLineGeometry":"lineGeometry"]={positions:f,colors:p},d.dispose()}),i}var aet=new Set([Hf.HALF,Hf.MECHANICAL,Hf.POWER,Hf.VIP]);function uet(n){let t=n.filter(e=>aet.has(e.parkingType)).map(e=>{let i=new Ft(...e.geometry.coords[0][0]),s=new Ft(...e.geometry.coords[0][1]),u=new Ft(...e.geometry.coords[0][2]),c=Math.min(i.distanceTo(s),s.distanceTo(u)),f=0;return c===i.distanceTo(s)?f=s.sub(i).angle()-Math.PI/2:f=u.sub(s).angle()-Math.PI/2,{uuid:e.id,iconUrl:e.parkingType,name:e.texts[0],deltaHeight:(e.deltaHeight||0)+.001,airHeight:e.airHeight,height:e.height,geometry:e.geometry,opacity:e.fillOpacity,visible:!0,secondWidth:c-1,secondHeight:c-1,secondRotate:f,centerCoords:[e.center_coord_x,e.center_coord_y]}});return ND(t)}function h1(n){n.map(t=>{var e;if((e=t.doors)!=null&&e.length&&t.geometry.type==="polygon"){let i=t.geometry.coords[0];t.doors.forEach(s=>{let u=s.type==="single"?.5:1,c=.5,f=SO(i,s.coord),p=new Ft(...s.coord),d=new Ft(...i[f]).sub(new Ft(...s.coord)).normalize(),g=new Ft().addVectors(p,d.clone().multiplyScalar(u)),y=new Ft().addVectors(p,d.clone().multiplyScalar(-u)),v=new Ft(-d.y,d.x),E=new Ft().addVectors(g,v.clone().multiplyScalar(c));wO([E.x,E.y],i)||(v.multiplyScalar(-1),E=new Ft().addVectors(g,v.clone().multiplyScalar(c)));let M=new Ft().addVectors(y,v.clone().multiplyScalar(c)),A=[[g.x,g.y],[E.x,E.y],[M.x,M.y],[y.x,y.y]];i=[...i.slice(0,f+1),...A,...i.slice(f+1)]}),t.geometry.coords[0]=i}})}var p1="";function OD(n){let t=sc.findIndex(e=>e.floor===n);if(t!==-1){console.log("\\u8C03\\u6574\\u697C\\u5C42\\u8BF7\\u6C42\\u7684\\u4F18\\u5148\\u7EA7",n,t);let e=sc.splice(t,1)[0];sc.unshift(e)}else p1=n}var d1="";function DD(n){let t=oc.findIndex(e=>e.floor===n);if(t!==-1){console.log("\\u8C03\\u6574\\u697C\\u5C42merge\\u4F18\\u5148\\u7EA7",n,t);let e=oc.splice(t,1)[0];oc.unshift(e)}else d1=n}function cet(n){OD(n),DD(n)}uD({onLoad(n){return Ri(this,null,function*(){let{floors:t,version:e}=n;for(yield rp(),yield Promise.all(t.map(i=>Ri(this,null,function*(){return ret(i,e)}))),p1&&OD(p1),yield Promise.all(sc.map(i=>Ri(this,null,function*(){let s=yield net(i);if(s&&e===Mg.LAYERED_RENDER_VERSION){let u=bg(t.find(c=>c.floor===s.floor),1);yield LD(np.MAP_DATA,u,s),console.log(s.floor+" \\u5199\\u5165\\u7F13\\u5B58\\u6210\\u529F\\uFF0Ckey="+u),self.postMessage({type:"floor_success",data:{floor:s.floor}})}}))),d1&&DD(d1);oc.length>0;){let i=oc.shift(),s=iet(i),u=bg(t.find(c=>c.floor===i.floor));yield LD(np.MAP_DATA,u,s),console.log(i.floor+" \\u5199\\u5165\\u7F13\\u5B58\\u6210\\u529F\\uFF0Ckey="+u),self.postMessage({type:"floor_success",data:{floor:i.floor}})}fC(),console.log("\\u6240\\u6709\\u6570\\u636E\\u5904\\u7406\\u5B8C\\u6210")})},onAdjustFloorPriority(n){let{floor:t}=n;cet(t)}});
11811
11811
  `],{type:"text/javascript"}),t=URL.createObjectURL(a),e=new Worker(t);return URL.revokeObjectURL(t),e}var Tu={mergeParkingSpace:!0,mergeGraphic:!0,renderVersion:Ke.MERGED_RENDER_VERSION,layers:["graph","wall","lane","texture2d","texture3d","glb","store","facility","parkingSpace","text"],filterPoi:()=>!0},Fe=class extends it{initDb(){return g(this,null,function*(){try{let{db:t}=yield cr();this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t,e){return g(this,null,function*(){if(Array.isArray(t))this.floors=t,e&&(this.placeConfig=x({},this.placeConfig,e));else if(typeof t=="string"){let n=yield fetch(t).then(r=>r.json());n.code===200&&(this.floors=n.data.list,this.placeConfig=x({},this.placeConfig,JSON.parse(n.data.config||"{}")))}else return this.load("https://screen.aibee.cn/ai-map/map/get-floor-map?place_id="+t);this.getOtherDataByFreeTime()})}setCacheData(t,e,n){return g(this,null,function*(){return this.initDbPromise.then(()=>hr(t,""+e,n))})}getCacheData(t,e){return g(this,null,function*(){return this.initDbPromise.then(()=>xn(t,""+e))})}getFloorData(t){return g(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return g(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=Nr(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=Or(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return g(this,null,function*(){if(this.getFloorDataPromise.has(t.floor))return this.getFloorDataPromise.get(t.floor);let e=new Promise(n=>g(this,null,function*(){let r=$e(t),i=yield fetch(t.map_url).then(o=>o.json());i.floor=t.floor,qn(i),this.setCacheData(Ct.MAP_DATA,r,i),this.setCacheData(Ct.MAP_VERSION,r,t.version_id),n(i)}));return this.getFloorDataPromise.set(t.floor,e),e})}getFloorJsonData(t){return g(this,null,function*(){let e=this.floors.find(n=>n.floor===t);return e?new Promise(n=>g(this,null,function*(){let r=$e(e,this.options.renderVersion===Ke.LAYERED_RENDER_VERSION?1:void 0);try{let i=$e(e),o=yield this.getCacheData(Ct.MAP_DATA,i);if(o&&o.transformed){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u5408\u5E76\u540E\u7684\u6570\u636E"),n(o);return}if(this.options.renderVersion===Ke.LAYERED_RENDER_VERSION){let s=yield this.getCacheData(Ct.MAP_DATA,r);if(s){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u6570\u636E"),n(s);return}}if(console.log("\u7F13\u5B58\u4E2D\u6CA1\u6709\u6570\u636E"),this.loadWorker){$(this.loadWorker,"adjust_floor_priority",{floor:t});let s=u=>{if(u.data.type==="floor_success"&&u.data.data.floor===t){var l;(l=this.loadWorker)==null||l.removeEventListener("message",s),n(this.getFloorJsonData(t))}};this.loadWorker.addEventListener("message",s)}else n(this.getFloorJsonDataByFloorInfo(e))}catch(i){console.log("[get floor data error]",i),n(this.getFloorJsonDataByFloorInfo(e))}})):null})}getRoadNetworkData(){return g(this,null,function*(){return(yield Promise.all(this.floors.map(e=>g(this,null,function*(){let n=$e(e,0);try{let r=yield this.getCacheData(Ct.ROAD_NETWORK_DATA,n);if(r)return r;let i=yield fetch(e.route_url).then(o=>o.json());return this.setCacheData(Ct.ROAD_NETWORK_DATA,n,i),this.setCacheData(Ct.ROUTE_VERSION,n,e.version_id),i}catch(r){let i=yield fetch(e.route_url).then(o=>o.json());return this.setCacheData(Ct.ROAD_NETWORK_DATA,n,i),i}})))).filter(e=>e.points)})}getFacilitiesData(){return g(this,null,function*(){let t=this.floors.reduce((r,i)=>r.updated_at>i.updated_at?r:i,this.floors[0]);if(!t)return null;let e=$e(t,0),n=()=>g(this,null,function*(){let r=yield fetch(t.entry_infra_url).then(i=>i.json());return r&&(this.setCacheData(Ct.FACILITY_DATA,e,r),this.setCacheData(Ct.FACILITY_VERSION,e,t.version_id)),r});try{let r=yield this.getCacheData(Ct.FACILITY_DATA,e);return r||n()}catch(r){return console.log("[get facility error]",r),n()}})}getOtherDataByFreeTime(){return g(this,null,function*(){yield this.initDbPromise,yield $(this.loadWorker,"load",{floors:this.floors,version:this.options.renderVersion}),this.closeWorker()})}getMulFloorsData(t){return g(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(n=>n))})}getDataByUrl(t){return g(this,null,function*(){let e=yield fetch(t).then(n=>n.json());return this.getDataByJson(e)})}getDataByJson(t,e,n){return g(this,null,function*(){qn(t),e=this.getFloorBaseLayer(t,e);let r=x({},this.placeConfig,n);return yield this.getFloorContentLayer(t,e),yield this.getFloorPoi(t,e,r),this.changeFloorBox(t,e),e})}getDataByJsonStep(t,e,n){return g(this,null,function*(){qn(t),e=this.getFloorBaseLayer(t,e);let r=x({},this.placeConfig,n);return this.changeFloorBox(t,e),requestAnimationFrame(()=>g(this,null,function*(){yield this.getFloorContentLayer(t,e),this.changeFloorBox(t,e),requestAnimationFrame(()=>g(this,null,function*(){yield this.getFloorPoi(t,e,r),this.changeFloorBox(t,e)}))})),e})}changeFloorBox(t,e){e.updateBox();let n=e.box.getSize(new Dr.Vector3),r=Math.max(n.x,n.y,n.z);e.userData.height=r/4+t.floorHeight}switchFloor(t,e){return g(this,null,function*(){return new Promise(n=>{let r={run:()=>this._switchFloor(t,e),meta:{type:"switchFloor"}},i=this.taskQueue.replaceByMetaType(r),o=s=>{let{task:u,res:l}=s;u.tid===i&&(this.taskQueue.removeEventListener("active-task-end",o),n(l))};this.taskQueue.addEventListener("active-task-end",o)})})}_switchFloor(t,e){return g(this,null,function*(){var n;let r=t;if(typeof t=="string"){let c=yield this.getFloorJsonData(t);if(c)r=c;else return null}else qn(t);let i=x({},this.placeConfig,e),o=new Bt(this.bmap.context);o.userData.data=t;let s=this.floors.find(c=>c.floor===r.floor);var u;let l=(u=s==null?void 0:s.map_angle)!=null?u:0;return this.bmap.dispatchEvent({type:_t.SWITCH_FLOOR_BEFORE,data:{curFloor:o,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:o,graphics:[],floorData:r}}),this.bmap.context.scene.background=new Dr.Color(i.backgroundColor),this.getFloorBaseLayer(r,o),this.changeFloorBox(r,o),this.bmap.buildingCenter=o.userData.center,this.bmap.currentBuildGround=(n=o.userData.data.layers.find(c=>c.l_type==="range"))==null?void 0:n.elements[0],this.bmap.context.switchFloor(o),this.bmap.initialFloorCamera(),this.bmap.context.control.setAzimuthalAngle(l/180*Math.PI,!0),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:o,graphics:[]}}),this.bmap.dispatchEvent({type:_t.SWITCH_FLOOR_GROUND,data:{curFloor:o}}),yield ir(),yield this.getFloorContentLayer(r,o),this.changeFloorBox(r,o),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:o,graphics:[]}}),yield ui(2),yield this.getFloorPoi(r,o,i),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:o,graphics:o.graphicLayer.children}}),this.bmap.dispatchEvent({type:_t.SWITCH_FLOOR_AFTER,data:{curFloor:o,graphics:o.graphicLayer.children}}),o})}getFloorBaseLayer(t,e){e||(e=new Bt(this.bmap.context));let n=[0,0];return t.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];n=[i.center_x,i.center_y],e.userData.range=i.geometry.cds[0],e.userData.rangeGraphic=i;break;case"ground":Ui(r,e);break;default:break}}),e.userData.center=n,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return g(this,null,function*(){e||(e=new Bt(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let n=Date.now();for(let r=0;r<t.layers.length;r++){let i=t.layers[r];["range","ground"].includes(i.l_type)||this.options.layers.includes(i.l_type)&&(Hs(i,e,this.options),console.log("time",Date.now()-n,i.l_type),n=Date.now())}return e})}getFloorPoi(t,e,n){return g(this,null,function*(){n===void 0&&(n=this.placeConfig);let r=Date.now();yield Promise.all(t.layers.map(o=>{if(this.options.layers.includes(o.l_type))return Ws(o,e,this.locale,n,this.options)})),console.log("poi time",Date.now()-r);let i=Date.now();ir().then(()=>{console.log("poi render time",Date.now()-i)})})}clear(){return g(this,null,function*(){Jo(),this.db=null})}closeWorker(){this.loadWorker&&(this.loadWorker.terminate(),this.loadWorker=null)}dispose(){super.dispose(),this.clear(),this.closeWorker(),this.getFloorDataPromise.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new Ne,this.loadWorker=Fi(),this.locale="zh-cn",this.placeConfig={backgroundColor:"#f1f7f6",showFacilityName:!0,showStoreName:!0,textFontSize:14},this.getFloorDataPromise=new Map,this.options=x({},Tu,e),this.placeConfig=x({},this.placeConfig,t.config.loaderPlaceConfig),this.initDbPromise=this.initDb()}};var dv=require("core-js/modules/web.dom-collections.iterator.js");function Bi(a,t){return g(this,null,function*(){let{brand:e,project:n}=a,{apiDomain:r,apiPath:{floorRange:i},apiInfo:o}=t,s=""+r+i+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n;return yield fetch(s,o).then(l=>l.json()).then(l=>l.data).then(l=>{let c=(l||[])[0];return c&&(c.info=JSON.parse(c.info)),c})})}function zi(a,t){return g(this,null,function*(){let{brand:e,project:n,floor:r,ts:i,resource_type_list:o}=a,{apiDomain:s,apiPath:{floorGraphic:u},apiInfo:l}=t,c=""+s+u+"?brand="+e+"&project="+n+"&phase="+n+"&building="+n+"&floor="+r+"&ts="+i+"&resource_type_list="+o;return yield fetch(c,l).then(p=>p.json()).then(p=>p.data).then(p=>((p||[]).map(f=>f.info=JSON.parse(f.info)),p||[]))})}function Au(a,t){return g(this,null,function*(){let{project:e,floor:n}=a,{apiDomain:r,apiInfo:i}=t,o=r+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+n;return yield fetch(o,i).then(u=>u.json()).then(u=>u.data).then(u=>JSON.parse(u[0].streetInfo||"{}")).then(u=>u.fileId?Cu(u.fileId,t):null)})}function Cu(a,t){return g(this,null,function*(){let{apiDomain:e,apiInfo:n}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+a,n).then(r=>r.arrayBuffer()).then(r=>{let o=new TextDecoder("utf-8").decode(r);return o?JSON.parse(o):null})})}var Gi=class{load(t){return g(this,null,function*(){let e=Pe(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,n]=yield Promise.all([this.loadBuildGround(t),zi(t,this.bmap.config)]),r=Pe({floor:t.floor,ts:t.ts});mn(n.map(o=>o.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),n.forEach(o=>o.info.transformToBuildingGround=!1),this.cacheData.set(e,n);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+n.length),this.loadExternalStreet(t),n})}loadExternalStreet(t){return g(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let n=e.userData.legacyToGraphicMap||new Map,r=e.userData.graphicMap||new Map,{ground:i,markGraphic:o,graphic:s}=this.bmap.config;for(let u=0;u<t.length;u++){let l=t[u];l.info.group==="ground"?(l.info.fillColor=i.color,l.info.fillOpacity=i.opacity,l.info.height=i.height,l.info.stroke=i.stroke,l.info.strokeColor=i.strokeColor,l.info.strokeOpacity=i.strokeOpacity):l.info.userData.mark?(l.info.height=o.height,l.info.fillColor=o.color,l.info.fillOpacity=o.opacity,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity):(l.info.fillOpacity=s.fillOpacity,this.bmap.config.initTransToMark&&(l.info.height=o.height,l.info.fillColor=o.color,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity))}for(let u of t){if(u.info.group==="ground")e.createGround(u.info);else{let l=e.addGraphic(u.info);l.userData.data=u,n.set(u.legacy_id,l)}r.set(u.element_uuid,u)}e.userData.legacyToGraphicMap=n,e.userData.graphicMap=r,e.userData.rangeGraphic=this.bmap.currentBuildGround,e.userData.range=this.bmap.currentBuildGround.geometry.cds[0],e.userData.center=this.bmap.buildingCenter,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(_t.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(_t.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let n=e.userData.graphicMap||new Map;return t.filter(r=>!n.has(r.element_uuid))}switchFloorByStoreData(t,e){return g(this,null,function*(){let n=yield this.load(x({},t,{resource_type_list:"6"})),r=this.filterData(n,e);this.switchFloorByData(r,e)})}switchFloorByOtherData(t,e){return g(this,null,function*(){let n=yield this.load(x({},t,{resource_type_list:"1,2,3,4"})),r=this.filterData(n,e);this.switchFloorByData(r,e)})}loadBuildGround(t){return g(this,null,function*(){let{brand:e,project:n}=t,r=yield this.loadBuildingGround({brand:e,project:n});var i;return this.bmap.currentBuildGround=(i=r==null?void 0:r.info)!=null?i:null,this.bmap.changeBuildingCenter(r,{brand:e,project:n}),this.bmap.currentBuildGround})}loadBuildingGround(t){return g(this,null,function*(){let{brand:e,project:n}=t,r=Pe({brand:e,project:n});if(this.buildingGroundMap.has(r))return this.buildingGroundMap.get(r);let i=Bi({brand:e,project:n},this.bmap.config).then(o=>(this.buildingGroundMap.set(r,o),o));return this.buildingGroundMap.set(r,i),i})}switchFloor(t){return g(this,null,function*(){let e=new Bt(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(n){console.log(n)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var Ru=function(a){return a[a.D2=0]="D2",a[a.D3=1.1]="D3",a}({}),ki=class extends Vt.EventDispatcher{get basicZoom(){return this.context.basicZoom}set basicZoom(t){this.context.basicZoom=t}changeBuildingCenter(t,e){let{brand:n,project:r}=e,i=t?hn(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return g(this,null,function*(){return this.loader||(this.loader=new Fe(this),this.loader.placeConfig=x({},this.loader.placeConfig,this.config.loaderPlaceConfig),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e,n){e===void 0&&(e=!0),n===void 0&&(n=t.graphicLayer.children),this.triggerHooks(_t.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:n}),this.buildingCenter=t.userData.center,this.currentBuildGround=t.userData.rangeGraphic,this.context.switchFloor(t,e),this.initialFloorCamera(),this.triggerHooks(_t.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*this.config.control.maxZoomScale,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}addModel(t,e){if(t.options.geometry.type==="polygon"){var n;let r=(n=this.context.currentFloor)==null?void 0:n.addModel(x({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:s=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,s,1)}}}addHeatmap(t){var e;return(e=this.context.currentFloor)==null?void 0:e.addHeatmap(t)}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.getGraphics())||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let n=t.options.center,r=t.getCenter(),i=(n==null?void 0:n[0])||r.x,o=(n==null?void 0:n[1])||r.y;return console.log(i,o,n,r),this.context.currentFloor.addPoi(x({},e,{position:{x:i,y:o,z:r.z+t.options.height/2}}))}return null}createPoi2ByPosition(t,e){if(this.context.currentFloor){let n=this.mercatorToWorld([t.x,t.y]),r=new et(this.context,x({},e,{position:{x:n.x,y:n.y,z:t.z}}));return this.context.currentFloor.poiLayer2.pushPoi(r),r}return null}removeHeatMap(){var t;(t=this.context.currentFloor)==null||t.removeHeatMap()}translateElementToCenter(t,e,n,r){e===void 0&&(e=500),n===void 0&&(n=0),r===void 0&&(r=0);let i=t.getPosition().clone(),{context:{camera:o}}=this;if(o.updateMatrix(),r){let s=new Vt.Vector3;s.setFromMatrixColumn(o.matrix,1),s.normalize(),s.multiplyScalar(r/o.zoom),i.add(s)}if(n){let s=new Vt.Vector3;s.setFromMatrixColumn(o.matrix,0),s.normalize(),s.multiplyScalar(n/o.zoom),i.add(s)}return this.context.setCameraPosition(i,e)}translateElementToCenterX(t,e){return g(this,null,function*(){return e===void 0&&(e=500),Ft(new Promise(n=>{let r=this.context.control.target.clone(),i=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:o,height:s},camera:u}=this.context,c=I(i,u,o,s).x-o/2,h=new Vt.Vector3;h.setFromMatrixColumn(this.context.camera.matrix,0),h.normalize(),h.multiplyScalar(c/this.context.camera.zoom),r.add(h),this.context.setCameraPosition(r,e).then(n)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:n,clientHeight:r}=this.container;return I(e,this.context.camera,n,r)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return g(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let n=this.context.camera.zoom;return this.context.setZoom(n+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t,e){t===void 0&&(t=.1),e===void 0&&(e=500);let n=this.context.control.getAzimuthalAngle();return this.context.setAzimuthalAngle(n+t,e)}measureDistance(){return g(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new Dn(this.context);let n=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){n(),e("cancel")},this.svgLine.addEventListener("distance",r=>{let{distance:i}=r;t(i)})})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new Un(this.context);let n=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){n(),e("cancel")},this.svgPolygon.addEventListener("area",r=>{let{area:i}=r;t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}fitCameraByPois(t,e,n){return g(this,null,function*(){if(e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500),!t.length)return;let r=new Vt.Box3;return t.forEach(i=>{let{position:o}=i;r.expandByPoint(o)}),this.context.fitCameraToBox(r,e,n,!1)})}fitCameraByPoiNodeIds(t,e,n){return g(this,null,function*(){e===void 0&&(e=[20,20,20,20]),n===void 0&&(n=500);let r=t.map(i=>this.getPoiById(i)).filter(i=>!!i);if(r.length)return this.fitCameraByPois(r,e,n)})}getGraphicByNodeId(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((n=this.context.currentFloor)==null?void 0:n.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let n=hn(this.currentBuildGround.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-n[0],i-n[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}mercatorToWorld(t){let e=this.buildingCenter;return new Vt.Vector3(t[0]-e[0],t[1]-e[1],0)}removePoiById(t){var e,n;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(n=this.context.currentFloor)==null||n.poiLayer2.removePoiById(t)}getPoiById(t){var e,n;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||((n=this.context.currentFloor)==null?void 0:n.poiLayer2.getPoiById(t))}getPois(){var t,e;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(n=>!n.options.built_in),...((e=this.context.currentFloor)==null?void 0:e.poiLayer2.pois)||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,tt.dispose(),ht.dispose(),me.dispose(),Tt.dispose(),L.dispose(),$t.dispose(),this.debounceResize=null,Vt.Sprite.Dispose==null||Vt.Sprite.Dispose.call(Vt.Sprite)}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.buildingCenter=[0,0],this.timer=new K,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:n}}=this.context;n!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=n)},this.onKeydown=n=>{this.polarKeys.includes(n.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(n.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=n=>{if(this.polarKeys.includes(n.code)){let r=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=r,this.context.control.minPolarAngle=r}if(this.azimuthalKeys.includes(n.code)){let r=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=r,this.context.control.minAzimuthAngle=r}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let n=this.context.control.getAzimuthalAngle(),r=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let i=this.context.getFitCameraToGroundZoom(this.config.defaultPadding,0)||1;this.context.camera.zoom=r,this.context.control.minZoom=i,this.context.control.maxZoom=i*this.config.control.maxZoomScale,this.basicZoom=r,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(n,0),this.context.cameraBound.setEnable(!0)},this.config=Oi(e),this.context=new Xn(t,this),this.debounceResize=(0,Xs.debounce)(this.resize,5),this.registryEvent()}};var Pu=function(a){return a.HALF="half",a.POWER="power",a.MECHANICAL="mechanical",a.NORMAL="normal",a.VIP="vip",a}({});var Uv=require("core-js/modules/web.dom-collections.iterator.js");var ut=class extends it{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null,super.dispose()}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var Vi=class extends ut{fetchEquipment(){return g(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:n}=this.bmap.config,r=""+t+e;yield fetch(r,n).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let n=this.getGraphicEquipment(e);return n&&this.equipmentMap.has(n)}).forEach(e=>{let n=this.equipmentMap.get(this.getGraphicEquipment(e)),r=this.bmap.createGraphicPoi(e,{icon:n==null?void 0:n.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=n,r.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(_t.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var n;(n=this.bmap.context.currentFloor)==null||n.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:n}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(n)},this.fetchEquipment(),this.bmap.addEventListener(_t.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var zy=require("core-js/modules/es.string.replace.js"),Gy=require("core-js/modules/es.regexp.exec.js"),ky=require("core-js/modules/web.dom-collections.iterator.js"),Vy=require("core-js/modules/es.promise.finally.js");var oy=require("core-js/modules/web.dom-collections.iterator.js"),sy=require("core-js/modules/es.array.push.js"),dt=require("three");var kv=require("core-js/modules/es.typed-array.float32-array.js"),Vv=require("core-js/modules/es.typed-array.at.js"),Hv=require("core-js/modules/es.typed-array.fill.js"),Wv=require("core-js/modules/es.typed-array.find-last.js"),Xv=require("core-js/modules/es.typed-array.find-last-index.js"),qv=require("core-js/modules/es.typed-array.set.js"),jv=require("core-js/modules/es.typed-array.sort.js"),Yv=require("core-js/modules/es.typed-array.to-reversed.js"),Zv=require("core-js/modules/es.typed-array.to-sorted.js"),Kv=require("core-js/modules/es.typed-array.with.js"),$v=require("core-js/modules/es.array-buffer.constructor.js"),Jv=require("core-js/modules/es.array-buffer.slice.js"),Qv=require("core-js/modules/es.array-buffer.detached.js"),ty=require("core-js/modules/es.array-buffer.transfer.js"),ey=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),ny=require("core-js/modules/es.array.push.js"),ry=require("core-js/modules/es.typed-array.uint16-array.js"),A=require("three"),Ht=class extends A.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new A.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};Ht.prototype.setMatrixWorld=function(a){this.matrixWorld=a};Ht.prototype.setGeometry=function(a,t){this._geometry=a,this.setPoints(a.getAttribute("position").array,t)};Ht.prototype.setPoints=function(a,t){if(!(a instanceof Float32Array)&&!(a instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=a,this.widthCallback=t,this.positions=[],this.counters=[],a.length&&a[0]instanceof A.Vector3)for(var e=0;e<a.length;e++){var n=a[e],r=e/a.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(var e=0;e<a.length;e+=3){var r=e/a.length;this.positions.push(a[e],a[e+1],a[e+2]),this.positions.push(a[e],a[e+1],a[e+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Iu(a,t){var e=new A.Matrix4,n=new A.Ray,r=new A.Sphere,i=new A.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),a.ray.intersectSphere(r,i)!==!1){e.copy(this.matrixWorld).invert(),n.copy(a.ray).applyMatrix4(e);var s=new A.Vector3,u=new A.Vector3,l=new A.Vector3,c=this instanceof A.LineSegments?2:1,h=o.index,p=o.attributes;if(h!==null)for(var f=h.array,d=p.position.array,m=p.width.array,v=0,y=f.length-1;v<y;v+=c){var S=f[v],w=f[v+1];s.fromArray(d,S*3),u.fromArray(d,w*3);var O=m[Math.floor(v/3)]!==void 0?m[Math.floor(v/3)]:1,N=a.params.Line.threshold+this.material.lineWidth*O/2,Y=N*N,C=n.distanceSqToSegment(s,u,i,l);if(!(C>Y)){i.applyMatrix4(this.matrixWorld);var U=a.ray.origin.distanceTo(i);U<a.near||U>a.far||(t.push({distance:U,point:l.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}),v=y)}}}}Ht.prototype.raycast=Iu;Ht.prototype.compareV3=function(a,t){var e=a*6,n=t*6;return this.positions[e]===this.positions[n]&&this.positions[e+1]===this.positions[n+1]&&this.positions[e+2]===this.positions[n+2]};Ht.prototype.copyV3=function(a){var t=a*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};Ht.prototype.getDistance=function(a){let t=0;for(let e=0;e<a;e++){let n=6*e,r=new A.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),i=new A.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),o=r.distanceTo(i);t+=o}return t};Ht.prototype.process=function(){var a=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(a-1);var n;this.compareV3(0,a-1)?n=this.copyV3(a-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var r=0;r<a;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(r/(a-1)):t=1,this.width.push(t),this.width.push(t),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===a-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/e;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<a-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(a-1,0)?n=this.copyV3(1):n=this.copyV3(a-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new A.BufferAttribute(new Float32Array(this.positions),3),previous:new A.BufferAttribute(new Float32Array(this.previous),3),next:new A.BufferAttribute(new Float32Array(this.next),3),side:new A.BufferAttribute(new Float32Array(this.side),1),width:new A.BufferAttribute(new Float32Array(this.width),1),uv:new A.BufferAttribute(new Float32Array(this.uvs),2),index:new A.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new A.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Hi(a,t,e,n,r){var i;if(a=a.subarray||a.slice?a:a.buffer,e=e.subarray||e.slice?e:e.buffer,a=t?a.subarray?a.subarray(t,r&&t+r):a.slice(t,r&&t+r):a,e.set)e.set(a,n);else for(i=0;i<a.length;i++)e[i+n]=a[i];return e}Ht.prototype.advance=function(a){var t=this._attributes.position.array,e=this._attributes.previous.array,n=this._attributes.next.array,r=t.length;Hi(t,0,e,0,r),Hi(t,6,t,0,r-6),t[r-6]=a.x,t[r-5]=a.y,t[r-4]=a.z,t[r-3]=a.x,t[r-2]=a.y,t[r-1]=a.z,Hi(t,6,n,0,r-6),n[r-6]=a.x,n[r-5]=a.y,n[r-4]=a.z,n[r-3]=a.x,n[r-2]=a.y,n[r-1]=a.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};A.ShaderChunk.meshline_vert=["",A.ShaderChunk.logdepthbuf_pars_vertex,A.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",A.ShaderChunk.logdepthbuf_vertex,A.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",A.ShaderChunk.fog_vertex,"}"].join(`
11812
11812
  `);A.ShaderChunk.meshline_frag=["",A.ShaderChunk.fog_pars_fragment,A.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {",""," if (vUV.x <= thresholdRatio) {"," discard;"," }",A.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",A.ShaderChunk.fog_fragment,"}"].join(`
11813
- `);var jn=class extends A.ShaderMaterial{constructor(t){super({uniforms:Object.assign({},A.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new A.Color(16777215)},opacity:{value:1},resolution:{value:new A.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new A.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:A.ShaderChunk.meshline_vert,fragmentShader:A.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};jn.prototype.copy=function(a){return A.ShaderMaterial.prototype.copy.call(this,a),this.lineWidth=a.lineWidth,this.map=a.map,this.useMap=a.useMap,this.alphaMap=a.alphaMap,this.useAlphaMap=a.useAlphaMap,this.color.copy(a.color),this.opacity=a.opacity,this.resolution.copy(a.resolution),this.sizeAttenuation=a.sizeAttenuation,this.dashArray.copy(a.dashArray),this.dashOffset.copy(a.dashOffset),this.dashRatio.copy(a.dashRatio),this.useDash=a.useDash,this.visibility=a.visibility,this.alphaTest=a.alphaTest,this.repeat.copy(a.repeat),this};var qs={texture_url:fr,lineWidth:10,color:16777215},Ur=class extends dt.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:r}}}}}=this,i=t.map(s=>{let[u,l]=s;return I(new dt.Vector3(u,l,0),e,n,r)}).map(s=>{let{x:u,y:l}=s;return[u,l]});return At(i)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new dt.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new dt.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return g(this,null,function*(){let e=this.geometry=new Ht;if(this.updatePoints(t),!this.texture){let i=this.texture=yield this.loadTexture(this.config.texture_url);i.wrapS=i.wrapT=dt.RepeatWrapping}let n=this.material=new jn({useMap:!0,color:new dt.Color(this.config.color),transparent:!0,resolution:new dt.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:dt.NormalBlending,repeat:new dt.Vector2(this.getRepeat(),1)}),r=this.mesh=new dt.Mesh(e,n);return r.renderOrder=99999,this.add(r),r})}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=qs,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:r}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,r)}},this.config=Object.assign({},qs,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Qe=require("@tweenjs/tween.js"),Nt=require("three");var fy=require("core-js/modules/es.array.unshift.js"),dy=require("core-js/modules/web.dom-collections.iterator.js"),gy=require("core-js/modules/es.array.push.js"),js=require("three");var Ys=require("@tweenjs/tween.js"),Zs=require("lodash"),Je=require("@turf/turf");var Lu={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1,destinationDistanceThreshold:10},Fr=class extends it{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}setRoadData(t){this.roadData=t}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null),t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:n,position:r,curRoutePath:i,paths:o,routeIndex:s}=this;if(!n.length)return null;let u=n,l=this.paths[this.routeIndex].floor,c=this.getCurRouteRemainDistance();if(r){let v=Qt(n,r);u=u.slice(v+1),u.unshift(r)}let h=[{floor:i==null?void 0:i.floor,points:u},...o.slice(s+1)],{distance:p,closestPoint:f,index:d,i:m}=h.reduce((v,y,S)=>{if(y.floor!==t)return v;let{distance:w,closestPoint:O,index:N}=y.points.reduce((Y,C,U,T)=>{if(!T[U+1])return x({},Y,{distance:Y.distance===1/0?G(C,e):Y.distance});let{distance:R,closestPoint:M}=fi(e,C,T[U+1]);if(l===t){let V=[e,...T.slice(U+1)],Z=At(V);if(c-Z>10)return Y}return R<Y.distance?{distance:R,closestPoint:M,index:U}:Y},{distance:1/0,closestPoint:y.points[0],index:0});return w<v.distance?{distance:w,closestPoint:O,index:S,i:N}:v},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:p,closestPoint:f,routeIndex:d+s,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,e){let n=this.adsorb(t,e);if(!n)return;let{distance:r,closestPoint:i,routeIndex:o,pointIndex:s}=n;r>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=o,this.pointIndex=s,this.position=i,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return g(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(n=>{let r=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],i=this.getCurRouteRemainDistance(),o=i/this.options.simulationSpeed,s=this.throttleUpdatePosition=(0,Zs.throttle)(l=>{let c=Ie(r,l.distance);c&&(e.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))},100),u=this.simulationTween=new Ys.Tween({distance:0},this.tweenUtil.group).to({distance:i},o*1e3).onUpdate(s).onComplete(()=>{this.tweenUtil.remove(u),s.flush(),s.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{n(this.startCurRouteSimulation())},3e3)):(n(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[n,...t.slice(e+1)];return At(r)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[...t.slice(0,e+1),n];return At(r)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((r,i)=>r+i.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:n,position:r,curRoutePath:i}=this,o=e,s=ee.FRONT,u=(i==null||(t=i.pointInfos[o])==null?void 0:t.crossName)||"",l=0,c=0,h=0;for(;s===ee.FRONT&&o<=n.length;){let m=n[o],v=n[o+1],y=n[o+2];if(!m||!v)s=ee.END;else if(l+=G(m,v),!y)s=ee.END;else{s=sr(m,v,y),c=pn(m,v,y),h=(new js.Vector2(y[0]-v[0],y[1]-v[1]).angle()*180/Math.PI-90+360)%360;var p;u=(p=i==null?void 0:i.pointInfos[o+1].crossName)!=null?p:"",o+=1}}n[o]&&(l=G(r,n[o]));let f=ar(c);if(s===ee.END&&l<=this.options.directionEmitThreshold)return{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f};let d=this.getCurRouteToStartDistance();return e===0&&d<=5?{dir:ee.START,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f}:(l>=this.options.directionEmitThreshold&&(s=ee.FRONT),{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f})}getCurPointAreaInfo(){let t=this.roadData.find(e=>e.floor===this.paths[this.routeIndex].floor);if(t){let e=(t.areas||[]).find(n=>{let r=(0,Je.polygon)(n.cds),i=(0,Je.point)(this.position);return(0,Je.booleanPointInPolygon)(i,r)});if(e)return e}return{imageUrl:null}}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),n=this.getNextDirDistance();if(!n)return null;let{dir:r,distance:i,crossName:o,angle:s,nextAngle:u,nextDir:l}=n;e<=this.options.destinationDistanceThreshold&&(r=ee.END);let{imageUrl:c}=this.getCurPointAreaInfo();return{distance:t,curRouteDistance:e,nextDirDistance:i,dir:r,angle:s,nextAngle:u,pos:this.position,routeIndex:this.routeIndex,crossName:o,offset:this.offset,reset:this.reset,imageUrl:c,nextDir:l}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,n){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new K,this.resetTimer=null,this.tweenUtil=new le,this.paused=!1,this.onAddPaths=r=>{let{paths:i}=r;this.paths=i,this.resetStatus(i),this.simulationTween&&!this.paused&&this.startSimulation()},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},Lu,e),this.roadData=n,this.registryEvent()}};var yy=require("core-js/modules/es.typed-array.uint8-array.js"),xy=require("core-js/modules/es.typed-array.at.js"),Ey=require("core-js/modules/es.typed-array.fill.js"),Sy=require("core-js/modules/es.typed-array.find-last.js"),by=require("core-js/modules/es.typed-array.find-last-index.js"),My=require("core-js/modules/es.typed-array.set.js"),wy=require("core-js/modules/es.typed-array.sort.js"),Ty=require("core-js/modules/es.typed-array.to-reversed.js"),Ay=require("core-js/modules/es.typed-array.to-sorted.js"),Cy=require("core-js/modules/es.typed-array.with.js"),Ry=require("core-js/modules/es.array-buffer.constructor.js"),Py=require("core-js/modules/es.array-buffer.slice.js"),Iy=require("core-js/modules/es.array-buffer.detached.js"),Ly=require("core-js/modules/es.array-buffer.transfer.js"),Ny=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Oy=require("core-js/modules/es.typed-array.from.js"),Dy=require("core-js/modules/web.dom-collections.iterator.js"),Yt=require("three");var pe=class a extends et{addDebug(){a.canvas.style.cssText=`
11813
+ `);var jn=class extends A.ShaderMaterial{constructor(t){super({uniforms:Object.assign({},A.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new A.Color(16777215)},opacity:{value:1},resolution:{value:new A.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new A.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:A.ShaderChunk.meshline_vert,fragmentShader:A.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};jn.prototype.copy=function(a){return A.ShaderMaterial.prototype.copy.call(this,a),this.lineWidth=a.lineWidth,this.map=a.map,this.useMap=a.useMap,this.alphaMap=a.alphaMap,this.useAlphaMap=a.useAlphaMap,this.color.copy(a.color),this.opacity=a.opacity,this.resolution.copy(a.resolution),this.sizeAttenuation=a.sizeAttenuation,this.dashArray.copy(a.dashArray),this.dashOffset.copy(a.dashOffset),this.dashRatio.copy(a.dashRatio),this.useDash=a.useDash,this.visibility=a.visibility,this.alphaTest=a.alphaTest,this.repeat.copy(a.repeat),this};var qs={texture_url:fr,lineWidth:10,color:16777215},Ur=class extends dt.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:n,height:r}}}}}=this,i=t.map(s=>{let[u,l]=s;return I(new dt.Vector3(u,l,0),e,n,r)}).map(s=>{let{x:u,y:l}=s;return[u,l]});return At(i)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new dt.Vector2(t,1)}loadTexture(t){return new Promise((e,n)=>{new dt.TextureLoader().load(t,e,void 0,n)})}transformPoints(t){let e=[];for(let n=0;n<t.length;n++)e.push(...t[n],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return g(this,null,function*(){let e=this.geometry=new Ht;if(this.updatePoints(t),!this.texture){let i=this.texture=yield this.loadTexture(this.config.texture_url);i.wrapS=i.wrapT=dt.RepeatWrapping}let n=this.material=new jn({useMap:!0,color:new dt.Color(this.config.color),transparent:!0,resolution:new dt.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:dt.NormalBlending,repeat:new dt.Vector2(this.getRepeat(),1)}),r=this.mesh=new dt.Mesh(e,n);return r.renderOrder=99999,this.add(r),r})}dispose(){var t,e,n;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.texture)==null||n.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=qs,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let n=this.navigation.bmap.context.camera.zoom;n!==this.prevCameraZoom&&(this.prevCameraZoom=n,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:n,height:r}=this.navigation.bmap.context.clientSize;this.material.resolution.set(n,r)}},this.config=Object.assign({},qs,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Qe=require("@tweenjs/tween.js"),Nt=require("three");var fy=require("core-js/modules/es.array.unshift.js"),dy=require("core-js/modules/web.dom-collections.iterator.js"),gy=require("core-js/modules/es.array.push.js"),js=require("three");var Ys=require("@tweenjs/tween.js"),Zs=require("lodash"),Je=require("@turf/turf");var Lu={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1,destinationDistanceThreshold:10},Fr=class extends it{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}setRoadData(t){this.roadData=t}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null),t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:n,position:r,curRoutePath:i,paths:o,routeIndex:s}=this;if(!n.length)return null;let u=n,l=this.paths[this.routeIndex].floor,c=this.getCurRouteRemainDistance();if(r){let v=Qt(n,r);u=u.slice(v+1),u.unshift(r)}let h=[{floor:i==null?void 0:i.floor,points:u},...o.slice(s+1)],{distance:p,closestPoint:f,index:d,i:m}=h.reduce((v,y,S)=>{if(y.floor!==t)return v;let{distance:w,closestPoint:O,index:N}=y.points.reduce((Y,C,U,T)=>{if(!T[U+1])return x({},Y,{distance:Y.distance===1/0?G(C,e):Y.distance});let{distance:R,closestPoint:M}=fi(e,C,T[U+1]);if(!this.navigation.options.canBack&&l===t){let V=[e,...T.slice(U+1)],Z=At(V);if(c-Z>10)return Y}return R<Y.distance?{distance:R,closestPoint:M,index:U}:Y},{distance:1/0,closestPoint:y.points[0],index:0});return w<v.distance?{distance:w,closestPoint:O,index:S,i:N}:v},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:p,closestPoint:f,routeIndex:d+s,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,e){let n=this.adsorb(t,e);if(!n)return;let{distance:r,closestPoint:i,routeIndex:o,pointIndex:s}=n;r>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=o,this.pointIndex=s,this.position=i,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return g(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(n=>{let r=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],i=this.getCurRouteRemainDistance(),o=i/this.options.simulationSpeed,s=this.throttleUpdatePosition=(0,Zs.throttle)(l=>{let c=Ie(r,l.distance);c&&(e.push({floor:t.floor,pos:c}),this.toPosition(t.floor,c))},100),u=this.simulationTween=new Ys.Tween({distance:0},this.tweenUtil.group).to({distance:i},o*1e3).onUpdate(s).onComplete(()=>{this.tweenUtil.remove(u),s.flush(),s.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{n(this.startCurRouteSimulation())},3e3)):(n(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[n,...t.slice(e+1)];return At(r)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:n}=this;if(!t.length)return 0;let r=[...t.slice(0,e+1),n];return At(r)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((r,i)=>r+i.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:n,position:r,curRoutePath:i}=this,o=e,s=ee.FRONT,u=(i==null||(t=i.pointInfos[o])==null?void 0:t.crossName)||"",l=0,c=0,h=0;for(;s===ee.FRONT&&o<=n.length;){let m=n[o],v=n[o+1],y=n[o+2];if(!m||!v)s=ee.END;else if(l+=G(m,v),!y)s=ee.END;else{s=sr(m,v,y),c=pn(m,v,y),h=(new js.Vector2(y[0]-v[0],y[1]-v[1]).angle()*180/Math.PI-90+360)%360;var p;u=(p=i==null?void 0:i.pointInfos[o+1].crossName)!=null?p:"",o+=1}}n[o]&&(l=G(r,n[o]));let f=ar(c);if(s===ee.END&&l<=this.options.directionEmitThreshold)return{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f};let d=this.getCurRouteToStartDistance();return e===0&&d<=5?{dir:ee.START,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f}:(l>=this.options.directionEmitThreshold&&(s=ee.FRONT),{dir:s,distance:l,crossName:u,angle:c,nextAngle:h,nextDir:f})}getCurPointAreaInfo(){let t=this.roadData.find(e=>e.floor===this.paths[this.routeIndex].floor);if(t){let e=(t.areas||[]).find(n=>{let r=(0,Je.polygon)(n.cds),i=(0,Je.point)(this.position);return(0,Je.booleanPointInPolygon)(i,r)});if(e)return e}return{imageUrl:null}}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),n=this.getNextDirDistance();if(!n)return null;let{dir:r,distance:i,crossName:o,angle:s,nextAngle:u,nextDir:l}=n;e<=this.options.destinationDistanceThreshold&&(r=ee.END);let{imageUrl:c}=this.getCurPointAreaInfo();return{distance:t,curRouteDistance:e,nextDirDistance:i,dir:r,angle:s,nextAngle:u,pos:this.position,routeIndex:this.routeIndex,crossName:o,offset:this.offset,reset:this.reset,imageUrl:c,nextDir:l}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,n){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new K,this.resetTimer=null,this.tweenUtil=new le,this.paused=!1,this.onAddPaths=r=>{let{paths:i}=r;this.paths=i,this.resetStatus(i),this.simulationTween&&!this.paused&&this.startSimulation()},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},Lu,e),this.roadData=n,this.registryEvent()}};var yy=require("core-js/modules/es.typed-array.uint8-array.js"),xy=require("core-js/modules/es.typed-array.at.js"),Ey=require("core-js/modules/es.typed-array.fill.js"),Sy=require("core-js/modules/es.typed-array.find-last.js"),by=require("core-js/modules/es.typed-array.find-last-index.js"),My=require("core-js/modules/es.typed-array.set.js"),wy=require("core-js/modules/es.typed-array.sort.js"),Ty=require("core-js/modules/es.typed-array.to-reversed.js"),Ay=require("core-js/modules/es.typed-array.to-sorted.js"),Cy=require("core-js/modules/es.typed-array.with.js"),Ry=require("core-js/modules/es.array-buffer.constructor.js"),Py=require("core-js/modules/es.array-buffer.slice.js"),Iy=require("core-js/modules/es.array-buffer.detached.js"),Ly=require("core-js/modules/es.array-buffer.transfer.js"),Ny=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Oy=require("core-js/modules/es.typed-array.from.js"),Dy=require("core-js/modules/web.dom-collections.iterator.js"),Zt=require("three");var pe=class a extends et{addDebug(){a.canvas.style.cssText=`
11814
11814
  position: fixed;
11815
11815
  top: 0;
11816
11816
  left: 0;
11817
11817
  z-index: 9999;
11818
- `,document.body.appendChild(a.canvas)}setAngle(t){if(console.log("angle",t),a.textureMap.has(t))this._initIcon(a.textureMap.get(t));else{this.draw(t);let e=this.getTexture(this.getImageData());a.textureMap.set(t,e),this._initIcon(e),this._initScale({zoom:this.bmap.context.camera.zoom})}}_initIcon(t){if(this.spriteIcon)this.spriteIcon.material.map=t,t.needsUpdate=!0;else{let e=new Yt.Sprite(new Yt.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));e.renderOrder=1e5+this.options.level,t.needsUpdate=!0,this.add(e),e.center.set(.5,.5),this.spriteIcon=e}}initSize(){this.spriteIcon&&this.spriteIcon.center.set(.5,.5)}draw(t){let{ctx:e}=a,{config:{size:n}}=this,r=n[0]/2,i=n[1]/2,o=4,s=1,u=o+s;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(r,i,i-u,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let l=-Math.PI/2,c=l-t;e.beginPath(),e.arc(r,i,i-u,l,c,!0)}else{let l=-Math.PI/2,c=l+Math.PI*2-t;e.beginPath(),e.arc(r,i,i-u,l,c,!1)}e.stroke(),e.clearRect(r-u*2,0,u*4,u*4),e.beginPath(),e.arc(r,u,o,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=s,e.stroke(),e.clearRect(0,i-5,10,10),e.clearRect(r-5,n[1]-10,10,10),e.clearRect(n[0]-10,i-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,i-1,10,2),e.fillStyle="#fff",e.fillRect(r-1,n[1]-10,2,10),t>Math.PI&&t<Math.PI/2*3?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(n[0]-10,i-1,10,2)}getImageData(){let{ctx:t}=a,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new Yt.DataTexture(Uint8Array.from(t.data),e[0],e[1],Yt.RGBAFormat);return n.format=Yt.RGBAFormat,n.magFilter=Yt.LinearFilter,n.minFilter=Yt.LinearFilter,n.colorSpace="srgb",n.flipY=!0,n}dispose(){var t;super.dispose(),(t=this.spriteIcon)==null||t.material.dispose()}static dispose(){this.textureMap.forEach(t=>{t.dispose()}),this.textureMap.clear(),this.ctx=null,this.canvas=null}constructor(t,e){super(t.context,{icon_size:e.size,collision_enable:!1,level:2}),this.bmap=t,this.config=e,a.canvas.width=e.size[0],a.canvas.height=e.size[1]}};pe.canvas=document.createElement("canvas");pe.ctx=pe.canvas.getContext("2d",{willReadFrequently:!0});pe.textureMap=new Map;var Nu={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45,canBack:!1},Wi=class extends ut{get curFloorPathLength(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.distance)!=null?e:0}get curFloorPathPoints(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.points)!=null?e:[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}setRoadData(t){this.options.roadData=t,this.positionNavigation.setRoadData(t)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new pe(this.bmap,{size:[e[0]+20,e[1]+20]}),this.startRotateHelperPoi.setAngle(0),this.startRotateHelperPoi.position.setZ(.51),(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.startRotateHelperPoi)}hideStartRotateHelperPoi(){if(this.needStartRotateHelperPoi=!1,this.startRotateHelperPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}setStartPoiPosition(t,e){this.startPoi&&(this.startPoi.position.setX(t).setY(e),this.startRotateHelperPoi&&this.startRotateHelperPoi.position.setX(t).setY(e),this.detachLine&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position))}resetStatus(){this.pauseAnimation(),this.positionNavigation.resetStatus(this.paths),this.movedDistance=0,this.startPoi&&this.translatePath&&this.setStartPoiPosition(this.translatePath[0][0],this.translatePath[0][1])}toPositionByTask(t){var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="toPosition"))==null?void 0:e.tid,i={run:()=>this.toPositionBySpeed(t,this.options.speed),meta:{type:"toPosition"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)}pauseAnimation(){this.taskQueue.clear(),this.positionNavigation.pause(),this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(this.resetStatus(),this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi){var t;if((t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.detachStartPoi){var n;(n=this.bmap.context.currentFloor)==null||n.removePoi2(this.detachStartPoi),this.detachStartPoi=null}this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.translatePath=null}setCurFloorPath(t){t===null?(this.curFloorPath=null,this.currentPathPosition=null,this.toPointPosition=null):(this.curFloorPath=t,this.currentPathPosition=t.points[0],this.toPointPosition=t.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(t){var e,n;this.curPathIndex=t,((e=this.paths[t])==null?void 0:e.floor)===((n=this.bmap.context.currentFloor)==null?void 0:n.name)?(this.setCurFloorPath(this.paths[t]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}addPath(t,e){e===void 0&&(e=0);var n;this.paths=t,this.curPathIndex=e,this.clearTween(),this.clearPath();let r=(n=this.bmap.context.currentFloor)==null?void 0:n.name,i=t[e];if(r&&(i==null?void 0:i.floor)===r)if(this.setCurFloorPath(i),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(i.points));else{let o=()=>{this.bmap.removeEventListener("center-change",o),this.renderPath(this.translatePoints(i.points))};this.bmap.addEventListener("center-change",o)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(r=>[r[0]-e,r[1]-n])}renderPath(t){this.translatePath=t;let e=this.catmullRomCurve3(t);if(this.cPath=e,this.animationPathOptions={cPathIndex:0},this.pathStart=e[0],this.path?this.path.updatePoints(e):(this.path=new Ur(this,this.options.path),this.path.create(e),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi){var n;if((n=this.bmap.context.currentFloor)==null||n.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var r;(r=this.bmap.context.currentFloor)==null||r.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var i;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(i=this.bmap.context.currentFloor)==null||i.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e[0][0],e[0][1],.51),new Nt.Vector3(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var o;this.startPoi=new et(this.bmap.context,x({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(o=this.bmap.context.currentFloor)==null||o.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return gn(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],r=new Nt.Vector3(n[0]-e[0],n[1]-e[1],0).normalize(),i=new Nt.Vector3(0,1,0).normalize(),o=r.angleTo(i),s=new Nt.Vector3().crossVectors(i,r);return(Object.is(s.y,0)?-1:1)*o}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new Nt.Vector2(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return g(this,null,function*(){t===void 0&&(t=100);let e=this.getPathDirection();if(e===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-e)>Math.PI&&(n>0?e=Math.PI*2+e:e=e-Math.PI*2);let r=Math.abs(e-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=t/Math.PI*6*r;return Ft(new Promise(s=>{let u={azimuthal:i.getAzimuthalAngle()},l={azimuthal:e},c=i.getPolarAngle(),{maxPolarAngle:h,minPolarAngle:p}=i;i.maxPolarAngle=c,i.minPolarAngle=c;let f=new Qe.Tween(u,this.tweenUtil.group).to(l,o).easing(Qe.Easing.Quadratic.InOut).onUpdate(()=>g(this,null,function*(){this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(u.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(f),i.maxPolarAngle=h,i.minPolarAngle=p,s(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return g(this,null,function*(){t===void 0&&(t=1e3);var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="initNavigationCamera"))==null?void 0:e.tid,i={run:()=>Ft(g(this,null,function*(){yield this.initCameraZoom(t/2),this.options.disablePathRotate||(yield this.changeCameraToPathUp(t/4)),yield this.translateCameraToStartPoi(t/(this.options.disablePathRotate?2:4))}),t+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)})}translateCameraToStartPoi(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(e/2),s=Math.round(n/2),u=i.target.clone(),l=I(this.startPoi.position,r,e,n),c=l.x-o,h=s-l.y+this.options.offsetY;if(!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}return Ft(new Promise(p=>{let f=i.target.clone();console.log(f,u,t);let d=new Qe.Tween(f,this.tweenUtil.group).to(u,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(f,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(u,0),this.tweenUtil.remove(d),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),t+500).then(()=>{this.bmap.context.control.enabled=!0})}})}initCameraZoom(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,u=Math.min(e/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(u,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex]&&this.paths[this.curPathIndex].floor===t&&this.detachStartPoi){let n=this.translatePoints([e]);this.detachStartPoi.position.setX(n[0][0]),this.detachStartPoi.position.setY(n[0][1]),this.detachLine&&this.startPoi&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position)}this.options.canBack&&(this.positionNavigation.pointIndex=0,this.positionNavigation.position=this.paths[this.curPathIndex].points[0]),this.positionNavigation.toPosition(t,e)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(t){this.positionNavigation.changeSimulationSpeed(t)}toPositionBySpeed(t,e){return g(this,null,function*(){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,s=di(i,t);if(o===-1||s===-1||!this.options.canBack&&s<=o)return null;let u=s-o;if(!u)return;let l=Math.min(Math.abs(u)/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),Ft(new Promise(c=>{let h=this.pathTween=new Qe.Tween({distance:0},this.tweenUtil.group).to({distance:u},l*1e3).onUpdate(p=>g(this,null,function*(){this.moveDistance(p.distance+o,h)})).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),l*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return g(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let r=Ie(this.curFloorPathPoints,this.movedDistance);if(r===null)return;this.currentPathPosition=r;let i=this.translatePoints([r])[0];this.startPoi&&(this.setStartPoiPosition(i[0],i[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),!this.options.disablePathAnimation&&!this.options.disablePathRotate&&(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}removeDetachStart(){if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.detachStartPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}}hideDetachStart(){this.showDetachStartState=!1,this.removeDetachStart()}showDetachStart(){if(this.showDetachStartState=!0,this.path&&this.startPoi&&this.options.detachStartPoi){var t;let e=this.startPoi.position;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:e,collision_enable:!1}))||null,(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e.x,e.y,.51),new Nt.Vector3(e.x,e.y,.51)),this.bmap.context.scene.add(this.detachLine)}}setStartPoiRotate(t){this.startPoiRotate=t;let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360,r=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=r),this.startPoi&&(this.startPoi.options.icon_rotate=r,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(r))}dispose(){var t;if(this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.hideDetachStart(),this.startPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startPoi),this.startPoi=null}this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startRotateHelperPoi)==null||t.dispose(),pe.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,super.dispose()}constructor(t,e={},n){super(t),this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curPathIndex=0,this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.toPointPosition=null,this.pathTween=null,this.startPoi=null,this.detachStartPoi=null,this.detachLine=null,this.startPoiRotate=null,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.showDetachStartState=!0,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new le,this.taskQueue=new Ne,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onNavigationInfo=r=>{let{info:i}=r;if(this.dispatchEvent({type:"navigation-info",info:i}),!i.offset){if(i.routeIndex!==this.curPathIndex)return;this.toPointPosition=i.pos,this.toPositionByTask(i.pos)}},this.onUpdate=()=>{this.tweenUtil.update()},this.onSwitchFloor=r=>{let{data:{curFloor:i}}=r;if(this.clearTween(),this.paths[this.curPathIndex]){let o=this.paths[this.curPathIndex];this.setCurFloorPath(o!=null?o:null),o?this.renderPath(this.translatePoints(o.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.startPoiRotate!==null&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},Nu,n),this.positionNavigation=new Fr(this,x({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Qy=require("core-js/modules/web.dom-collections.iterator.js");var Be=require("three"),Xi=class extends ut{show(t,e){let n=0;t.forEach(o=>{o.poiLayer2.pois.forEach(s=>{s.position.setZ(s.position.z+n+o.groundMaxHeight),s.options.depth_test=!0,this.poiLayer.pushPoi(s)}),o.poiLayer2.pois.length=0,o.poiLayer2.dispose(),o.position.z=n,n+=o.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0}showStep(t,e){let n=0;t.forEach(l=>{l.position.z=n,n+=l.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0;let o=()=>{t.some(l=>l.poiLayer2.pois.length>0)?u():requestAnimationFrame(o)},s=null,u=()=>{let l=!1;n=0,t.forEach(c=>{let h=c.poiLayer2.pois.splice(0,c.poiLayer2.pois.length);h.length>0&&(l=!0,h.forEach(p=>{p.position.setZ(p.position.z+n+c.groundMaxHeight),p.options.depth_test=!0,p.visible=!0,p.spriteIcon&&(p.spriteIcon.visible=!0),p.spriteText&&(p.spriteText.visible=!0),this.poiLayer.pushPoi(p)})),c.position.z=n,n+=c.userData.height}),l&&(this.poiLayer.onAddToScene(),this.bmap.context.cameraBound.updateBox(),this.fitCamera()),t.some(c=>c.poiLayer2.pois.length>0)?s=setTimeout(u,1e3):s&&clearTimeout(s)};o()}hide(){let{scene:t}=this.bmap.context;this.poiLayer.onRemoveFromScene(),t.remove(this.group),this.poiLayer.clear(),this.floors.forEach(e=>{e.dispose()}),this.floors=[],this.group.clear(),this.showStatus=!1}fitCamera(){let{context:t,config:e,type:n}=this.bmap;t.cameraBound.setEnable(!1),t.control.minZoom=0,t.control.maxZoom=1/0,t.camera.zoom=1,t.setAzimuthalAngle(e.control.defaultAzimuthal,0),t.setPolarAngle(e.control.defaultPolar,0),t.fitCameraToObject(this.group,e.defaultPadding,0,!1);let r=t.camera.zoom;t.control.minZoom=r,t.control.maxZoom=r*e.control.maxZoomScale,this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange),this.bmap.onControlChange(),t.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(t=>t.dispose()),this.floors=[],super.dispose()}constructor(t){super(t),this.floors=[],this.group=new Be.Group,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new De(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new Be.Box3().setFromObject(this.group),{clientSize:{width:n,height:r}}=this.bmap.context,{max:i,min:o}=e,u=Math.min(n/(i.x-o.x),r/(i.y-o.y))*(i.x-o.x)/45;this.poiLayer.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let c=this.bmap.context.camera.zoom>=u;l.visible=c,c||l.parentSetVisible(c)})}}};var Ks=require("three");function qi(){let a=new Blob([`var RU=Object.create;var xE=Object.defineProperty;var LU=Object.getOwnPropertyDescriptor;var NU=Object.getOwnPropertyNames;var OU=Object.getPrototypeOf,DU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var FU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of NU(t))!DU.call(n,s)&&s!==e&&xE(n,s,{get:()=>t[s],enumerable:!(o=LU(t,s))||o.enumerable});return n};var Je=(n,t,e)=>(e=n!=null?RU(OU(n)):{},FU(t||!n||!n.__esModule?xE(e,"default",{value:n,enumerable:!0}):e,n));var pp=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=ot((Vm,EE)=>{"use strict";var Uf=function(n){return n&&n.Math===Math&&n};EE.exports=Uf(typeof globalThis=="object"&&globalThis)||Uf(typeof window=="object"&&window)||Uf(typeof self=="object"&&self)||Uf(typeof global=="object"&&global)||Uf(typeof Vm=="object"&&Vm)||function(){return this}()||Function("return this")()});var SE=ot((sj,wE)=>{"use strict";wE.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}});var Ui=ot((aj,ME)=>{"use strict";var Wm=typeof document=="object"&&document.all;ME.exports=typeof Wm=="undefined"&&Wm!==void 0?function(n){return typeof n=="function"||n===Wm}:function(n){return typeof n=="function"}});var Ys=ot((uj,bE)=>{"use strict";var UU=Ui();bE.exports=function(n){return typeof n=="object"?n!==null:UU(n)}});var dp=ot((lj,TE)=>{"use strict";var BU=so(),AE=Ys(),Xm=BU.document,zU=AE(Xm)&&AE(Xm.createElement);TE.exports=function(n){return zU?Xm.createElement(n):{}}});var IE=ot((cj,PE)=>{"use strict";var GU=dp(),Ym=GU("span").classList,CE=Ym&&Ym.constructor&&Ym.constructor.prototype;PE.exports=CE===Object.prototype?void 0:CE});var mi=ot((fj,RE)=>{"use strict";RE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Bf=ot((hj,LE)=>{"use strict";var kU=mi();LE.exports=!kU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var yi=ot((pj,DE)=>{"use strict";var NE=Bf(),OE=Function.prototype,$m=OE.call,qU=NE&&OE.bind.bind($m,$m);DE.exports=NE?qU:function(n){return function(){return $m.apply(n,arguments)}}});var ac=ot((dj,UE)=>{"use strict";var FE=yi(),HU=FE({}.toString),VU=FE("".slice);UE.exports=function(n){return VU(HU(n),8,-1)}});var zE=ot((gj,BE)=>{"use strict";var WU=yi(),XU=mi(),YU=ac(),Zm=Object,$U=WU("".split);BE.exports=XU(function(){return!Zm("z").propertyIsEnumerable(0)})?function(n){return YU(n)==="String"?$U(n,""):Zm(n)}:Zm});var Jm=ot((mj,GE)=>{"use strict";GE.exports=function(n){return n==null}});var uc=ot((yj,kE)=>{"use strict";var ZU=Jm(),JU=TypeError;kE.exports=function(n){if(ZU(n))throw new JU("Can't call method on "+n);return n}});var lc=ot((vj,qE)=>{"use strict";var KU=zE(),jU=uc();qE.exports=function(n){return KU(jU(n))}});var zf=ot((_j,HE)=>{"use strict";HE.exports=!1});var gp=ot((xj,WE)=>{"use strict";var VE=so(),QU=Object.defineProperty;WE.exports=function(n,t){try{QU(VE,n,{value:t,configurable:!0,writable:!0})}catch(e){VE[n]=t}return t}});var mp=ot((Ej,$E)=>{"use strict";var tB=zf(),eB=so(),nB=gp(),XE="__core-js_shared__",YE=$E.exports=eB[XE]||nB(XE,{});(YE.versions||(YE.versions=[])).push({version:"3.42.0",mode:tB?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var yp=ot((wj,JE)=>{"use strict";var ZE=mp();JE.exports=function(n,t){return ZE[n]||(ZE[n]=t||{})}});var cc=ot((Sj,KE)=>{"use strict";var rB=uc(),iB=Object;KE.exports=function(n){return iB(rB(n))}});var Ma=ot((Mj,jE)=>{"use strict";var oB=yi(),sB=cc(),aB=oB({}.hasOwnProperty);jE.exports=Object.hasOwn||function(t,e){return aB(sB(t),e)}});var Km=ot((bj,QE)=>{"use strict";var uB=yi(),lB=0,cB=Math.random(),fB=uB(1 .toString);QE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+fB(++lB+cB,36)}});var rw=ot((Aj,nw)=>{"use strict";var hB=so(),tw=hB.navigator,ew=tw&&tw.userAgent;nw.exports=ew?String(ew):""});var cw=ot((Tj,lw)=>{"use strict";var uw=so(),jm=rw(),iw=uw.process,ow=uw.Deno,sw=iw&&iw.versions||ow&&ow.version,aw=sw&&sw.v8,$s,vp;aw&&($s=aw.split("."),vp=$s[0]>0&&$s[0]<4?1:+($s[0]+$s[1]));!vp&&jm&&($s=jm.match(/Edge\\/(\\d+)/),(!$s||$s[1]>=74)&&($s=jm.match(/Chrome\\/(\\d+)/),$s&&(vp=+$s[1])));lw.exports=vp});var Qm=ot((Cj,hw)=>{"use strict";var fw=cw(),pB=mi(),dB=so(),gB=dB.String;hw.exports=!!Object.getOwnPropertySymbols&&!pB(function(){var n=Symbol("symbol detection");return!gB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&fw&&fw<41})});var t0=ot((Pj,pw)=>{"use strict";var mB=Qm();pw.exports=mB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ns=ot((Ij,gw)=>{"use strict";var yB=so(),vB=yp(),dw=Ma(),_B=Km(),xB=Qm(),EB=t0(),fc=yB.Symbol,e0=vB("wks"),wB=EB?fc.for||fc:fc&&fc.withoutSetter||_B;gw.exports=function(n){return dw(e0,n)||(e0[n]=xB&&dw(fc,n)?fc[n]:wB("Symbol."+n)),e0[n]}});var ba=ot((Rj,mw)=>{"use strict";var SB=Ys(),MB=String,bB=TypeError;mw.exports=function(n){if(SB(n))return n;throw new bB(MB(n)+" is not an object")}});var Zs=ot((Lj,yw)=>{"use strict";var AB=mi();yw.exports=!AB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var n0=ot((Nj,vw)=>{"use strict";var TB=Zs(),CB=mi();vw.exports=TB&&CB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var r0=ot((Oj,_w)=>{"use strict";var PB=Zs(),IB=mi(),RB=dp();_w.exports=!PB&&!IB(function(){return Object.defineProperty(RB("div"),"a",{get:function(){return 7}}).a!==7})});var Os=ot((Dj,xw)=>{"use strict";var LB=Bf(),_p=Function.prototype.call;xw.exports=LB?_p.bind(_p):function(){return _p.apply(_p,arguments)}});var hc=ot((Fj,Ew)=>{"use strict";var i0=so(),NB=Ui(),OB=function(n){return NB(n)?n:void 0};Ew.exports=function(n,t){return arguments.length<2?OB(i0[n]):i0[n]&&i0[n][t]}});var Sw=ot((Uj,ww)=>{"use strict";var DB=yi();ww.exports=DB({}.isPrototypeOf)});var o0=ot((Bj,Mw)=>{"use strict";var FB=hc(),UB=Ui(),BB=Sw(),zB=t0(),GB=Object;Mw.exports=zB?function(n){return typeof n=="symbol"}:function(n){var t=FB("Symbol");return UB(t)&&BB(t.prototype,GB(n))}});var Aw=ot((zj,bw)=>{"use strict";var kB=String;bw.exports=function(n){try{return kB(n)}catch(t){return"Object"}}});var Gf=ot((Gj,Tw)=>{"use strict";var qB=Ui(),HB=Aw(),VB=TypeError;Tw.exports=function(n){if(qB(n))return n;throw new VB(HB(n)+" is not a function")}});var xp=ot((kj,Cw)=>{"use strict";var WB=Gf(),XB=Jm();Cw.exports=function(n,t){var e=n[t];return XB(e)?void 0:WB(e)}});var Iw=ot((qj,Pw)=>{"use strict";var s0=Os(),a0=Ui(),u0=Ys(),YB=TypeError;Pw.exports=function(n,t){var e,o;if(t==="string"&&a0(e=n.toString)&&!u0(o=s0(e,n))||a0(e=n.valueOf)&&!u0(o=s0(e,n))||t!=="string"&&a0(e=n.toString)&&!u0(o=s0(e,n)))return o;throw new YB("Can't convert object to primitive value")}});var Ow=ot((Hj,Nw)=>{"use strict";var $B=Os(),Rw=Ys(),Lw=o0(),ZB=xp(),JB=Iw(),KB=Ns(),jB=TypeError,QB=KB("toPrimitive");Nw.exports=function(n,t){if(!Rw(n)||Lw(n))return n;var e=ZB(n,QB),o;if(e){if(t===void 0&&(t="default"),o=$B(e,n,t),!Rw(o)||Lw(o))return o;throw new jB("Can't convert object to primitive value")}return t===void 0&&(t="number"),JB(n,t)}});var l0=ot((Vj,Dw)=>{"use strict";var tz=Ow(),ez=o0();Dw.exports=function(n){var t=tz(n,"string");return ez(t)?t:t+""}});var Lu=ot(Uw=>{"use strict";var nz=Zs(),rz=r0(),iz=n0(),Ep=ba(),Fw=l0(),oz=TypeError,c0=Object.defineProperty,sz=Object.getOwnPropertyDescriptor,f0="enumerable",h0="configurable",p0="writable";Uw.f=nz?iz?function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),typeof t=="function"&&e==="prototype"&&"value"in o&&p0 in o&&!o[p0]){var s=sz(t,e);s&&s[p0]&&(t[e]=o.value,o={configurable:h0 in o?o[h0]:s[h0],enumerable:f0 in o?o[f0]:s[f0],writable:!1})}return c0(t,e,o)}:c0:function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),rz)try{return c0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new oz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var zw=ot((Xj,Bw)=>{"use strict";var az=Math.ceil,uz=Math.floor;Bw.exports=Math.trunc||function(t){var e=+t;return(e>0?uz:az)(e)}});var El=ot((Yj,Gw)=>{"use strict";var lz=zw();Gw.exports=function(n){var t=+n;return t!==t||t===0?0:lz(t)}});var qw=ot(($j,kw)=>{"use strict";var cz=El(),fz=Math.max,hz=Math.min;kw.exports=function(n,t){var e=cz(n);return e<0?fz(e+t,0):hz(e,t)}});var d0=ot((Zj,Hw)=>{"use strict";var pz=El(),dz=Math.min;Hw.exports=function(n){var t=pz(n);return t>0?dz(t,9007199254740991):0}});var kf=ot((Jj,Vw)=>{"use strict";var gz=d0();Vw.exports=function(n){return gz(n.length)}});var Yw=ot((Kj,Xw)=>{"use strict";var mz=lc(),yz=qw(),vz=kf(),Ww=function(n){return function(t,e,o){var s=mz(t),l=vz(s);if(l===0)return!n&&-1;var p=yz(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};Xw.exports={includes:Ww(!0),indexOf:Ww(!1)}});var wp=ot((jj,$w)=>{"use strict";$w.exports={}});var m0=ot((Qj,Jw)=>{"use strict";var _z=yi(),g0=Ma(),xz=lc(),Ez=Yw().indexOf,wz=wp(),Zw=_z([].push);Jw.exports=function(n,t){var e=xz(n),o=0,s=[],l;for(l in e)!g0(wz,l)&&g0(e,l)&&Zw(s,l);for(;t.length>o;)g0(e,l=t[o++])&&(~Ez(s,l)||Zw(s,l));return s}});var Sp=ot((tQ,Kw)=>{"use strict";Kw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Qw=ot((eQ,jw)=>{"use strict";var Sz=m0(),Mz=Sp();jw.exports=Object.keys||function(t){return Sz(t,Mz)}});var eS=ot(tS=>{"use strict";var bz=Zs(),Az=n0(),Tz=Lu(),Cz=ba(),Pz=lc(),Iz=Qw();tS.f=bz&&!Az?Object.defineProperties:function(t,e){Cz(t);for(var o=Pz(e),s=Iz(e),l=s.length,p=0,h;l>p;)Tz.f(t,h=s[p++],o[h]);return t}});var rS=ot((rQ,nS)=>{"use strict";var Rz=hc();nS.exports=Rz("document","documentElement")});var Mp=ot((iQ,oS)=>{"use strict";var Lz=yp(),Nz=Km(),iS=Lz("keys");oS.exports=function(n){return iS[n]||(iS[n]=Nz(n))}});var qf=ot((oQ,hS)=>{"use strict";var Oz=ba(),Dz=eS(),sS=Sp(),Fz=wp(),Uz=rS(),Bz=dp(),zz=Mp(),aS=">",uS="<",v0="prototype",_0="script",cS=zz("IE_PROTO"),y0=function(){},fS=function(n){return uS+_0+aS+n+uS+"/"+_0+aS},lS=function(n){n.write(fS("")),n.close();var t=n.parentWindow.Object;return n=null,t},Gz=function(){var n=Bz("iframe"),t="java"+_0+":",e;return n.style.display="none",Uz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(fS("document.F=Object")),e.close(),e.F},bp,Ap=function(){try{bp=new ActiveXObject("htmlfile")}catch(t){}Ap=typeof document!="undefined"?document.domain&&bp?lS(bp):Gz():lS(bp);for(var n=sS.length;n--;)delete Ap[v0][sS[n]];return Ap()};Fz[cS]=!0;hS.exports=Object.create||function(t,e){var o;return t!==null?(y0[v0]=Oz(t),o=new y0,y0[v0]=null,o[cS]=t):o=Ap(),e===void 0?o:Dz.f(o,e)}});var w0=ot((sQ,pS)=>{"use strict";var kz=Ns(),qz=qf(),Hz=Lu().f,x0=kz("unscopables"),E0=Array.prototype;E0[x0]===void 0&&Hz(E0,x0,{configurable:!0,value:qz(null)});pS.exports=function(n){E0[x0][n]=!0}});var Tp=ot((aQ,dS)=>{"use strict";dS.exports={}});var yS=ot((uQ,mS)=>{"use strict";var Vz=so(),Wz=Ui(),gS=Vz.WeakMap;mS.exports=Wz(gS)&&/native code/.test(String(gS))});var Cp=ot((lQ,vS)=>{"use strict";vS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var pc=ot((cQ,_S)=>{"use strict";var Xz=Zs(),Yz=Lu(),$z=Cp();_S.exports=Xz?function(n,t,e){return Yz.f(n,t,$z(1,e))}:function(n,t,e){return n[t]=e,n}});var Rp=ot((fQ,wS)=>{"use strict";var Zz=yS(),ES=so(),Jz=Ys(),Kz=pc(),S0=Ma(),M0=mp(),jz=Mp(),Qz=wp(),xS="Object already initialized",b0=ES.TypeError,tG=ES.WeakMap,Pp,Hf,Ip,eG=function(n){return Ip(n)?Hf(n):Pp(n,{})},nG=function(n){return function(t){var e;if(!Jz(t)||(e=Hf(t)).type!==n)throw new b0("Incompatible receiver, "+n+" required");return e}};Zz||M0.state?(Js=M0.state||(M0.state=new tG),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Pp=function(n,t){if(Js.has(n))throw new b0(xS);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Ip=function(n){return Js.has(n)}):(wl=jz("state"),Qz[wl]=!0,Pp=function(n,t){if(S0(n,wl))throw new b0(xS);return t.facade=n,Kz(n,wl,t),t},Hf=function(n){return S0(n,wl)?n[wl]:{}},Ip=function(n){return S0(n,wl)});var Js,wl;wS.exports={set:Pp,get:Hf,has:Ip,enforce:eG,getterFor:nG}});var AS=ot(bS=>{"use strict";var SS={}.propertyIsEnumerable,MS=Object.getOwnPropertyDescriptor,rG=MS&&!SS.call({1:2},1);bS.f=rG?function(t){var e=MS(this,t);return!!e&&e.enumerable}:SS});var A0=ot(CS=>{"use strict";var iG=Zs(),oG=Os(),sG=AS(),aG=Cp(),uG=lc(),lG=l0(),cG=Ma(),fG=r0(),TS=Object.getOwnPropertyDescriptor;CS.f=iG?TS:function(t,e){if(t=uG(t),e=lG(e),fG)try{return TS(t,e)}catch(o){}if(cG(t,e))return aG(!oG(sG.f,t,e),t[e])}});var P0=ot((dQ,IS)=>{"use strict";var T0=Zs(),hG=Ma(),PS=Function.prototype,pG=T0&&Object.getOwnPropertyDescriptor,C0=hG(PS,"name"),dG=C0&&function(){}.name==="something",gG=C0&&(!T0||T0&&pG(PS,"name").configurable);IS.exports={EXISTS:C0,PROPER:dG,CONFIGURABLE:gG}});var R0=ot((gQ,RS)=>{"use strict";var mG=yi(),yG=Ui(),I0=mp(),vG=mG(Function.toString);yG(I0.inspectSource)||(I0.inspectSource=function(n){return vG(n)});RS.exports=I0.inspectSource});var DS=ot((mQ,OS)=>{"use strict";var N0=yi(),_G=mi(),xG=Ui(),Lp=Ma(),L0=Zs(),EG=P0().CONFIGURABLE,wG=R0(),NS=Rp(),SG=NS.enforce,MG=NS.get,LS=String,Np=Object.defineProperty,bG=N0("".slice),AG=N0("".replace),TG=N0([].join),CG=L0&&!_G(function(){return Np(function(){},"length",{value:8}).length!==8}),PG=String(String).split("String"),IG=OS.exports=function(n,t,e){bG(LS(t),0,7)==="Symbol("&&(t="["+AG(LS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Lp(n,"name")||EG&&n.name!==t)&&(L0?Np(n,"name",{value:t,configurable:!0}):n.name=t),CG&&e&&Lp(e,"arity")&&n.length!==e.arity&&Np(n,"length",{value:e.arity});try{e&&Lp(e,"constructor")&&e.constructor?L0&&Np(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=SG(n);return Lp(o,"source")||(o.source=TG(PG,typeof t=="string"?t:"")),n};Function.prototype.toString=IG(function(){return xG(this)&&MG(this).source||wG(this)},"toString")});var Vf=ot((yQ,FS)=>{"use strict";var RG=Ui(),LG=Lu(),NG=DS(),OG=gp();FS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(RG(e)&&NG(e,l,o),o.global)s?n[t]=e:OG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:LG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var BS=ot(US=>{"use strict";var DG=m0(),FG=Sp(),UG=FG.concat("length","prototype");US.f=Object.getOwnPropertyNames||function(t){return DG(t,UG)}});var GS=ot(zS=>{"use strict";zS.f=Object.getOwnPropertySymbols});var qS=ot((xQ,kS)=>{"use strict";var BG=hc(),zG=yi(),GG=BS(),kG=GS(),qG=ba(),HG=zG([].concat);kS.exports=BG("Reflect","ownKeys")||function(t){var e=GG.f(qG(t)),o=kG.f;return o?HG(e,o(t)):e}});var WS=ot((EQ,VS)=>{"use strict";var HS=Ma(),VG=qS(),WG=A0(),XG=Lu();VS.exports=function(n,t,e){for(var o=VG(t),s=XG.f,l=WG.f,p=0;p<o.length;p++){var h=o[p];!HS(n,h)&&!(e&&HS(e,h))&&s(n,h,l(t,h))}}});var YS=ot((wQ,XS)=>{"use strict";var YG=mi(),$G=Ui(),ZG=/#|\\.prototype\\./,Wf=function(n,t){var e=KG[JG(n)];return e===QG?!0:e===jG?!1:$G(t)?YG(t):!!t},JG=Wf.normalize=function(n){return String(n).replace(ZG,".").toLowerCase()},KG=Wf.data={},jG=Wf.NATIVE="N",QG=Wf.POLYFILL="P";XS.exports=Wf});var Ds=ot((SQ,$S)=>{"use strict";var Op=so(),t4=A0().f,e4=pc(),n4=Vf(),r4=gp(),i4=WS(),o4=YS();$S.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,_;if(o?p=Op:s?p=Op[e]||r4(e,{}):p=Op[e]&&Op[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(_=t4(p,h),g=_&&_.value):g=p[h],l=o4(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;i4(m,g)}(n.sham||g&&g.sham)&&e4(m,"sham",!0),n4(p,h,m,n)}}});var JS=ot((MQ,ZS)=>{"use strict";var s4=mi();ZS.exports=!s4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var D0=ot((bQ,jS)=>{"use strict";var a4=Ma(),u4=Ui(),l4=cc(),c4=Mp(),f4=JS(),KS=c4("IE_PROTO"),O0=Object,h4=O0.prototype;jS.exports=f4?O0.getPrototypeOf:function(n){var t=l4(n);if(a4(t,KS))return t[KS];var e=t.constructor;return u4(e)&&t instanceof e?e.prototype:t instanceof O0?h4:null}});var z0=ot((AQ,eM)=>{"use strict";var p4=mi(),d4=Ui(),g4=Ys(),m4=qf(),QS=D0(),y4=Vf(),v4=Ns(),_4=zf(),B0=v4("iterator"),tM=!1,nu,F0,U0;[].keys&&(U0=[].keys(),"next"in U0?(F0=QS(QS(U0)),F0!==Object.prototype&&(nu=F0)):tM=!0);var x4=!g4(nu)||p4(function(){var n={};return nu[B0].call(n)!==n});x4?nu={}:_4&&(nu=m4(nu));d4(nu[B0])||y4(nu,B0,function(){return this});eM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:tM}});var Dp=ot((TQ,rM)=>{"use strict";var E4=Lu().f,w4=Ma(),S4=Ns(),nM=S4("toStringTag");rM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!w4(n,nM)&&E4(n,nM,{configurable:!0,value:t})}});var oM=ot((CQ,iM)=>{"use strict";var M4=z0().IteratorPrototype,b4=qf(),A4=Cp(),T4=Dp(),C4=Tp(),P4=function(){return this};iM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=b4(M4,{next:A4(+!o,e)}),T4(n,s,!1,!0),C4[s]=P4,n}});var G0=ot((PQ,sM)=>{"use strict";var I4=yi(),R4=Gf();sM.exports=function(n,t,e){try{return I4(R4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var uM=ot((IQ,aM)=>{"use strict";var L4=Ys();aM.exports=function(n){return L4(n)||n===null}});var cM=ot((RQ,lM)=>{"use strict";var N4=uM(),O4=String,D4=TypeError;lM.exports=function(n){if(N4(n))return n;throw new D4("Can't set "+O4(n)+" as a prototype")}});var hM=ot((LQ,fM)=>{"use strict";var F4=G0(),U4=Ys(),B4=uc(),z4=cM();fM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=F4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return B4(s),z4(l),U4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var SM=ot((NQ,wM)=>{"use strict";var G4=Ds(),k4=Os(),Fp=zf(),xM=P0(),q4=Ui(),H4=oM(),pM=D0(),dM=hM(),V4=Dp(),W4=pc(),k0=Vf(),X4=Ns(),gM=Tp(),EM=z0(),Y4=xM.PROPER,$4=xM.CONFIGURABLE,mM=EM.IteratorPrototype,Up=EM.BUGGY_SAFARI_ITERATORS,Xf=X4("iterator"),yM="keys",Yf="values",vM="entries",_M=function(){return this};wM.exports=function(n,t,e,o,s,l,p){H4(e,t,o);var h=function(x){if(x===s&&S)return S;if(!Up&&x&&x in _)return _[x];switch(x){case yM:return function(){return new e(this,x)};case Yf:return function(){return new e(this,x)};case vM:return function(){return new e(this,x)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,E=_[Xf]||_["@@iterator"]||s&&_[s],S=!Up&&E||h(s),b=t==="Array"&&_.entries||E,A,I,w;if(b&&(A=pM(b.call(new n)),A!==Object.prototype&&A.next&&(!Fp&&pM(A)!==mM&&(dM?dM(A,mM):q4(A[Xf])||k0(A,Xf,_M)),V4(A,g,!0,!0),Fp&&(gM[g]=_M))),Y4&&s===Yf&&E&&E.name!==Yf&&(!Fp&&$4?W4(_,"name",Yf):(m=!0,S=function(){return k4(E,this)})),s)if(I={values:h(Yf),keys:l?S:h(yM),entries:h(vM)},p)for(w in I)(Up||m||!(w in _))&&k0(_,w,I[w]);else G4({target:t,proto:!0,forced:Up||m},I);return(!Fp||p)&&_[Xf]!==S&&k0(_,Xf,S,{name:s}),gM[t]=S,I}});var bM=ot((OQ,MM)=>{"use strict";MM.exports=function(n,t){return{value:n,done:t}}});var RM=ot((DQ,IM)=>{"use strict";var Z4=lc(),q0=w0(),AM=Tp(),CM=Rp(),J4=Lu().f,K4=SM(),Bp=bM(),j4=zf(),Q4=Zs(),PM="Array Iterator",tk=CM.set,ek=CM.getterFor(PM);IM.exports=K4(Array,"Array",function(n,t){tk(this,{type:PM,target:Z4(n),index:0,kind:t})},function(){var n=ek(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Bp(void 0,!0);switch(n.kind){case"keys":return Bp(e,!1);case"values":return Bp(t[e],!1)}return Bp([e,t[e]],!1)},"values");var TM=AM.Arguments=AM.Array;q0("keys");q0("values");q0("entries");if(!j4&&Q4&&TM.name!=="values")try{J4(TM,"name",{value:"values"})}catch(n){}});var Gp=ot(()=>{"use strict";var LM=so(),OM=SE(),nk=IE(),$f=RM(),NM=pc(),rk=Dp(),ik=Ns(),H0=ik("iterator"),V0=$f.values,DM=function(n,t){if(n){if(n[H0]!==V0)try{NM(n,H0,V0)}catch(o){n[H0]=V0}if(rk(n,t,!0),OM[t]){for(var e in $f)if(n[e]!==$f[e])try{NM(n,e,$f[e])}catch(o){n[e]=$f[e]}}}};for(zp in OM)DM(LM[zp]&&LM[zp].prototype,zp);var zp;DM(nk,"DOMTokenList")});var BM=ot((BQ,UM)=>{"use strict";var ok=Ns(),sk=ok("toStringTag"),FM={};FM[sk]="z";UM.exports=String(FM)==="[object z]"});var W0=ot((zQ,zM)=>{"use strict";var ak=BM(),uk=Ui(),kp=ac(),lk=Ns(),ck=lk("toStringTag"),fk=Object,hk=kp(function(){return arguments}())==="Arguments",pk=function(n,t){try{return n[t]}catch(e){}};zM.exports=ak?kp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=pk(t=fk(n),ck))=="string"?e:hk?kp(t):(o=kp(t))==="Object"&&uk(t.callee)?"Arguments":o}});var qp=ot((GQ,GM)=>{"use strict";var dk=W0(),gk=String;GM.exports=function(n){if(dk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gk(n)}});var qM=ot((kQ,kM)=>{"use strict";var mk=ba();kM.exports=function(){var n=mk(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var VM=ot((qQ,HM)=>{"use strict";var X0=mi(),yk=so(),Y0=yk.RegExp,$0=X0(function(){var n=Y0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),vk=$0||X0(function(){return!Y0("a","y").sticky}),_k=$0||X0(function(){var n=Y0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});HM.exports={BROKEN_CARET:_k,MISSED_STICKY:vk,UNSUPPORTED_Y:$0}});var XM=ot((HQ,WM)=>{"use strict";var xk=mi(),Ek=so(),wk=Ek.RegExp;WM.exports=xk(function(){var n=wk(".","s");return!(n.dotAll&&n.test(\`
11818
+ `,document.body.appendChild(a.canvas)}setAngle(t){if(console.log("angle",t),a.textureMap.has(t))this._initIcon(a.textureMap.get(t));else{this.draw(t);let e=this.getTexture(this.getImageData());a.textureMap.set(t,e),this._initIcon(e),this._initScale({zoom:this.bmap.context.camera.zoom})}}_initIcon(t){if(this.spriteIcon)this.spriteIcon.material.map=t,t.needsUpdate=!0;else{let e=new Zt.Sprite(new Zt.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));e.renderOrder=1e5+this.options.level,t.needsUpdate=!0,this.add(e),e.center.set(.5,.5),this.spriteIcon=e}}initSize(){this.spriteIcon&&this.spriteIcon.center.set(.5,.5)}draw(t){let{ctx:e}=a,{config:{size:n}}=this,r=n[0]/2,i=n[1]/2,o=4,s=1,u=o+s;if(e.clearRect(0,0,n[0],n[1]),e.setLineDash([10,10]),e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(r,i,i-u,-Math.PI/2,Math.PI*2-Math.PI/2,t<Math.PI),e.stroke(),e.strokeStyle="#0A7AFF",t<Math.PI){let l=-Math.PI/2,c=l-t;e.beginPath(),e.arc(r,i,i-u,l,c,!0)}else{let l=-Math.PI/2,c=l+Math.PI*2-t;e.beginPath(),e.arc(r,i,i-u,l,c,!1)}e.stroke(),e.clearRect(r-u*2,0,u*4,u*4),e.beginPath(),e.arc(r,u,o,0,Math.PI*2),e.fillStyle="#0A7AFF",e.fill(),e.setLineDash([10,0]),e.strokeStyle="#fff",e.lineWidth=s,e.stroke(),e.clearRect(0,i-5,10,10),e.clearRect(r-5,n[1]-10,10,10),e.clearRect(n[0]-10,i-5,10,10),t>Math.PI/2&&t<Math.PI?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(0,i-1,10,2),e.fillStyle="#fff",e.fillRect(r-1,n[1]-10,2,10),t>Math.PI&&t<Math.PI/2*3?e.fillStyle="#0A7AFF":e.fillStyle="#fff",e.fillRect(n[0]-10,i-1,10,2)}getImageData(){let{ctx:t}=a,{config:{size:e}}=this;return t.getImageData(0,0,e[0],e[1])}getTexture(t){let{config:{size:e}}=this,n=new Zt.DataTexture(Uint8Array.from(t.data),e[0],e[1],Zt.RGBAFormat);return n.format=Zt.RGBAFormat,n.magFilter=Zt.LinearFilter,n.minFilter=Zt.LinearFilter,n.colorSpace="srgb",n.flipY=!0,n}dispose(){var t;super.dispose(),(t=this.spriteIcon)==null||t.material.dispose()}static dispose(){this.textureMap.forEach(t=>{t.dispose()}),this.textureMap.clear(),this.ctx=null,this.canvas=null}constructor(t,e){super(t.context,{icon_size:e.size,collision_enable:!1,level:2}),this.bmap=t,this.config=e,a.canvas.width=e.size[0],a.canvas.height=e.size[1]}};pe.canvas=document.createElement("canvas");pe.ctx=pe.canvas.getContext("2d",{willReadFrequently:!0});pe.textureMap=new Map;var Nu={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,disablePathRotate:!1,disablePathShorten:!1,speed:1,roadData:[],runAnimationMaxTime:1,navigationCameraBasic:45,canBack:!1},Wi=class extends ut{get curFloorPathLength(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.distance)!=null?e:0}get curFloorPathPoints(){var t,e;return(e=(t=this.curFloorPath)==null?void 0:t.points)!=null?e:[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.addEventListener("control-change",this.onControlChangeForStartPoi)}setRoadData(t){this.options.roadData=t,this.positionNavigation.setRoadData(t)}showStartRotateHelperPoi(){var t;if(this.needStartRotateHelperPoi=!0,!this.startPoi||this.startRotateHelperPoi)return;let e=this.startPoi.options.icon_size;this.startRotateHelperPoi=new pe(this.bmap,{size:[e[0]+20,e[1]+20]}),this.startRotateHelperPoi.setAngle(0),this.startRotateHelperPoi.position.setZ(.51),(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.startRotateHelperPoi)}hideStartRotateHelperPoi(){if(this.needStartRotateHelperPoi=!1,this.startRotateHelperPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}setStartPoiPosition(t,e){this.startPoi&&(this.startPoi.position.setX(t).setY(e),this.startRotateHelperPoi&&this.startRotateHelperPoi.position.setX(t).setY(e),this.detachLine&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position))}resetStatus(){this.pauseAnimation(),this.positionNavigation.resetStatus(this.paths),this.movedDistance=0,this.startPoi&&this.translatePath&&this.setStartPoiPosition(this.translatePath[0][0],this.translatePath[0][1])}toPositionByTask(t){var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="toPosition"))==null?void 0:e.tid,i={run:()=>this.toPositionBySpeed(t,this.options.speed),meta:{type:"toPosition"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)}pauseAnimation(){this.taskQueue.clear(),this.positionNavigation.pause(),this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener(_t.SWITCH_FLOOR_GROUND,this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo),this.bmap.context.removeEventListener("control-change",this.onControlChangeForStartPoi)}clearPath(){if(this.resetStatus(),this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi){var t;if((t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.detachStartPoi){var n;(n=this.bmap.context.currentFloor)==null||n.removePoi2(this.detachStartPoi),this.detachStartPoi=null}this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.translatePath=null}setCurFloorPath(t){t===null?(this.curFloorPath=null,this.currentPathPosition=null,this.toPointPosition=null):(this.curFloorPath=t,this.currentPathPosition=t.points[0],this.toPointPosition=t.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(t){var e,n;this.curPathIndex=t,((e=this.paths[t])==null?void 0:e.floor)===((n=this.bmap.context.currentFloor)==null?void 0:n.name)?(this.setCurFloorPath(this.paths[t]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}addPath(t,e){e===void 0&&(e=0);var n;this.paths=t,this.curPathIndex=e,this.clearTween(),this.clearPath();let r=(n=this.bmap.context.currentFloor)==null?void 0:n.name,i=t[e];if(r&&(i==null?void 0:i.floor)===r)if(this.setCurFloorPath(i),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(i.points));else{let o=()=>{this.bmap.removeEventListener("center-change",o),this.renderPath(this.translatePoints(i.points))};this.bmap.addEventListener("center-change",o)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,n]=this.bmap.buildingCenter;return t.map(r=>[r[0]-e,r[1]-n])}renderPath(t){this.translatePath=t;let e=this.catmullRomCurve3(t);if(this.cPath=e,this.animationPathOptions={cPathIndex:0},this.pathStart=e[0],this.path?this.path.updatePoints(e):(this.path=new Ur(this,this.options.path),this.path.create(e),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi){var n;if((n=this.bmap.context.currentFloor)==null||n.poiLayer2.removePoi(this.startPoi),this.startPoi=null,this.startRotateHelperPoi){var r;(r=this.bmap.context.currentFloor)==null||r.poiLayer2.removePoi(this.startRotateHelperPoi),this.startRotateHelperPoi=null}}if(this.removeDetachStart(),this.showDetachStartState&&this.options.detachStartPoi){var i;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(i=this.bmap.context.currentFloor)==null||i.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e[0][0],e[0][1],.51),new Nt.Vector3(e[0][0],e[0][1],.51)),this.bmap.context.scene.add(this.detachLine)}if(this.options.needStartPoi){var o;this.startPoi=new et(this.bmap.context,x({},this.options.startPoi,{id:"navigation_start_poi",position:{x:e[0][0],y:e[0][1],z:.51},collision_enable:!1}))||null,(o=this.bmap.context.currentFloor)==null||o.poiLayer2.pushPoi(this.startPoi),this.needStartRotateHelperPoi&&this.showStartRotateHelperPoi(),console.log(this.startRotateHelperPoi)}this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(t){return gn(t,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.currentPathPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1],r=new Nt.Vector3(n[0]-e[0],n[1]-e[1],0).normalize(),i=new Nt.Vector3(0,1,0).normalize(),o=r.angleTo(i),s=new Nt.Vector3().crossVectors(i,r);return(Object.is(s.y,0)?-1:1)*o}getPathDirection2(){if(!this.curFloorPath||!this.toPointPosition||this.curFloorPathPoints.length<2)return null;let t=Qt(this.curFloorPathPoints,this.toPointPosition),e=this.curFloorPathPoints[t],n=this.curFloorPathPoints[t+1];return(new Nt.Vector2(n[0]-e[0],n[1]-e[1]).normalize().angle()*180/Math.PI-90+360)%360}changeCameraToPathUp(t){return g(this,null,function*(){t===void 0&&(t=100);let e=this.getPathDirection();if(e===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-e)>Math.PI&&(n>0?e=Math.PI*2+e:e=e-Math.PI*2);let r=Math.abs(e-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=t/Math.PI*6*r;return Ft(new Promise(s=>{let u={azimuthal:i.getAzimuthalAngle()},l={azimuthal:e},c=i.getPolarAngle(),{maxPolarAngle:h,minPolarAngle:p}=i;i.maxPolarAngle=c,i.minPolarAngle=c;let f=new Qe.Tween(u,this.tweenUtil.group).to(l,o).easing(Qe.Easing.Quadratic.InOut).onUpdate(()=>g(this,null,function*(){this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(u.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)})).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(f),i.maxPolarAngle=h,i.minPolarAngle=p,s(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})})}initNavigationCamera(t){return g(this,null,function*(){t===void 0&&(t=1e3);var e;let r=(e=this.taskQueue.getTasks().find(o=>o.meta.type==="initNavigationCamera"))==null?void 0:e.tid,i={run:()=>Ft(g(this,null,function*(){yield this.initCameraZoom(t/2),this.options.disablePathRotate||(yield this.changeCameraToPathUp(t/4)),yield this.translateCameraToStartPoi(t/(this.options.disablePathRotate?2:4))}),t+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};r?this.taskQueue.replace(r,i):this.taskQueue.add(i)})}translateCameraToStartPoi(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(e/2),s=Math.round(n/2),u=i.target.clone(),l=I(this.startPoi.position,r,e,n),c=l.x-o,h=s-l.y+this.options.offsetY;if(!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new Nt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),u.add(new Nt.Vector3(p.x,p.y,0))}return Ft(new Promise(p=>{let f=i.target.clone();console.log(f,u,t);let d=new Qe.Tween(f,this.tweenUtil.group).to(u,t).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(f,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(u,0),this.tweenUtil.remove(d),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),t+500).then(()=>{this.bmap.context.control.enabled=!0})}})}initCameraZoom(t){return g(this,null,function*(){if(t===void 0&&(t=100),!this.startPoi)return;let{clientSize:{width:e,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,u=Math.min(e/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/this.options.navigationCameraBasic;return this.bmap.context.setZoom(u,this.startPoi.position,t).finally(()=>{this.bmap.context.control.enabled=!0})})}toPosition(t,e){if(this.paths[this.curPathIndex]&&this.paths[this.curPathIndex].floor===t&&this.detachStartPoi){let n=this.translatePoints([e]);this.detachStartPoi.position.setX(n[0][0]),this.detachStartPoi.position.setY(n[0][1]),this.detachLine&&this.startPoi&&this.detachLine.setPosition(this.startPoi.position,this.detachStartPoi.position)}this.options.canBack&&(this.positionNavigation.pointIndex=0,this.positionNavigation.position=this.paths[this.curPathIndex].points[0]),this.positionNavigation.toPosition(t,e)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(t){this.positionNavigation.changeSimulationSpeed(t)}toPositionBySpeed(t,e){return g(this,null,function*(){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,s=di(i,t);if(o===-1||s===-1||!this.options.canBack&&s<=o)return null;let u=s-o;if(!u)return;let l=Math.min(Math.abs(u)/e,this.options.runAnimationMaxTime);return this.pathTween&&this.clearTween(),Ft(new Promise(c=>{let h=this.pathTween=new Qe.Tween({distance:0},this.tweenUtil.group).to({distance:u},l*1e3).onUpdate(p=>g(this,null,function*(){this.moveDistance(p.distance+o,h)})).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),l*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})})}moveDistance(t,e){return g(this,null,function*(){if(this.movedDistance=t,!this.options.disablePathShorten){var n;(n=this.path)==null||n.movePath(this.movedDistance/this.curFloorPathLength)}let r=Ie(this.curFloorPathPoints,this.movedDistance);if(r===null)return;this.currentPathPosition=r;let i=this.translatePoints([r])[0];this.startPoi&&(this.setStartPoiPosition(i[0],i[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),!this.options.disablePathAnimation&&!this.options.disablePathRotate&&(e==null||e.pause(),yield this.changeCameraToPathUp(500/this.options.speed),e==null||e.resume())})}removeDetachStart(){if(this.detachLine&&(this.bmap.context.scene.remove(this.detachLine),this.detachLine.dispose(),this.detachLine=null),this.detachStartPoi){var t;(t=this.bmap.context.currentFloor)==null||t.poiLayer2.removePoi(this.detachStartPoi),this.detachStartPoi=null}}hideDetachStart(){this.showDetachStartState=!1,this.removeDetachStart()}showDetachStart(){if(this.showDetachStartState=!0,this.path&&this.startPoi&&this.options.detachStartPoi){var t;let e=this.startPoi.position;this.detachStartPoi=new et(this.bmap.context,x({},this.options.detachStartPoi,{id:"navigation_detach_start_poi",position:e,collision_enable:!1}))||null,(t=this.bmap.context.currentFloor)==null||t.poiLayer2.pushPoi(this.detachStartPoi),this.detachLine=new qe(this.bmap.context,new Nt.Vector3(e.x,e.y,.51),new Nt.Vector3(e.x,e.y,.51)),this.bmap.context.scene.add(this.detachLine)}}setStartPoiRotate(t){this.startPoiRotate=t;let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360,r=(360-t-n)%360;this.detachStartPoi&&(this.detachStartPoi.options.icon_rotate=r),this.startPoi&&(this.startPoi.options.icon_rotate=r,this.startRotateHelperPoi&&this.startRotateHelperPoi.setAngle(r))}dispose(){var t;if(this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.hideDetachStart(),this.startPoi){var e;(e=this.bmap.context.currentFloor)==null||e.poiLayer2.removePoi(this.startPoi),this.startPoi=null}this.tweenUtil.dispose(),this.unRegistryEvent(),(t=this.startRotateHelperPoi)==null||t.dispose(),pe.dispose(),this.positionNavigation.dispose(),this.startRotateHelperPoi=null,super.dispose()}constructor(t,e={},n){super(t),this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curPathIndex=0,this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.toPointPosition=null,this.pathTween=null,this.startPoi=null,this.detachStartPoi=null,this.detachLine=null,this.startPoiRotate=null,this.startRotateHelperPoi=null,this.needStartRotateHelperPoi=!1,this.showDetachStartState=!0,this.movedDistance=0,this.pathStart=[0,0],this.tweenUtil=new le,this.taskQueue=new Ne,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onNavigationInfo=r=>{let{info:i}=r;if(this.dispatchEvent({type:"navigation-info",info:i}),!i.offset){if(i.routeIndex!==this.curPathIndex)return;this.toPointPosition=i.pos,this.toPositionByTask(i.pos)}},this.onUpdate=()=>{this.tweenUtil.update()},this.onSwitchFloor=r=>{let{data:{curFloor:i}}=r;if(this.clearTween(),this.paths[this.curPathIndex]){let o=this.paths[this.curPathIndex];this.setCurFloorPath(o!=null?o:null),o?this.renderPath(this.translatePoints(o.points)):this.clearPath()}else this.clearPath()},this.onControlChangeForStartPoi=()=>{this.startPoi&&this.startPoiRotate!==null&&this.setStartPoiRotate(this.startPoiRotate)},!n&&typeof e=="object"&&(n=e),this.options=Object.assign({},Nu,n),this.positionNavigation=new Fr(this,x({simulationSpeed:this.options.speed},this.options.positionNavigation),this.options.roadData),this.registryEvent()}};var Qy=require("core-js/modules/web.dom-collections.iterator.js");var Be=require("three"),Xi=class extends ut{show(t,e){let n=0;t.forEach(o=>{o.poiLayer2.pois.forEach(s=>{s.position.setZ(s.position.z+n+o.groundMaxHeight),s.options.depth_test=!0,this.poiLayer.pushPoi(s)}),o.poiLayer2.pois.length=0,o.poiLayer2.dispose(),o.position.z=n,n+=o.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0}showStep(t,e){let n=0;t.forEach(l=>{l.position.z=n,n+=l.userData.height});let{scene:r,currentFloor:i}=this.bmap.context;r.background=new Be.Color((e==null?void 0:e.backgroundColor)||"#f1f7f6"),i&&(r.remove(i),i.dispose()),this.group.add(this.poiLayer,...t),this.poiLayer.onAddToScene(),r.add(this.group),this.floors=t,this.fitCamera(),this.bmap.context.cameraBound.updateBox(),this.showStatus=!0;let o=()=>{t.some(l=>l.poiLayer2.pois.length>0)?u():requestAnimationFrame(o)},s=null,u=()=>{let l=!1;n=0,t.forEach(c=>{let h=c.poiLayer2.pois.splice(0,c.poiLayer2.pois.length);h.length>0&&(l=!0,h.forEach(p=>{p.position.setZ(p.position.z+n+c.groundMaxHeight),p.options.depth_test=!0,p.visible=!0,p.spriteIcon&&(p.spriteIcon.visible=!0),p.spriteText&&(p.spriteText.visible=!0),this.poiLayer.pushPoi(p)})),c.position.z=n,n+=c.userData.height}),l&&(this.poiLayer.onAddToScene(),this.bmap.context.cameraBound.updateBox(),this.fitCamera()),t.some(c=>c.poiLayer2.pois.length>0)?s=setTimeout(u,1e3):s&&clearTimeout(s)};o()}hide(){let{scene:t}=this.bmap.context;this.poiLayer.onRemoveFromScene(),t.remove(this.group),this.poiLayer.clear(),this.floors.forEach(e=>{e.dispose()}),this.floors=[],this.group.clear(),this.showStatus=!1}fitCamera(){let{context:t,config:e,type:n}=this.bmap;t.cameraBound.setEnable(!1),t.control.minZoom=0,t.control.maxZoom=1/0,t.camera.zoom=1,t.setAzimuthalAngle(e.control.defaultAzimuthal,0),t.setPolarAngle(e.control.defaultPolar,0),t.fitCameraToObject(this.group,e.defaultPadding,0,!1);let r=t.camera.zoom;t.control.minZoom=r,t.control.maxZoom=r*e.control.maxZoomScale,this.bmap.basicZoom=t.camera.zoom,t.control.addEventListener("change",this.bmap.onControlChange),this.bmap.onControlChange(),t.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(t=>t.dispose()),this.floors=[],super.dispose()}constructor(t){super(t),this.floors=[],this.group=new Be.Group,this.showStatus=!1,this.group.name="mul-floor-group",this.poiLayer=new De(t.context),this.poiLayer.changeParkingSpaceVisibleByZoom=()=>{let e=new Be.Box3().setFromObject(this.group),{clientSize:{width:n,height:r}}=this.bmap.context,{max:i,min:o}=e,u=Math.min(n/(i.x-o.x),r/(i.y-o.y))*(i.x-o.x)/45;this.poiLayer.pois.filter(l=>l.userData.type==="parkingSpace").map(l=>{let c=this.bmap.context.camera.zoom>=u;l.visible=c,c||l.parentSetVisible(c)})}}};var Ks=require("three");function qi(){let a=new Blob([`var RU=Object.create;var xE=Object.defineProperty;var LU=Object.getOwnPropertyDescriptor;var NU=Object.getOwnPropertyNames;var OU=Object.getPrototypeOf,DU=Object.prototype.hasOwnProperty;var ot=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var FU=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of NU(t))!DU.call(n,s)&&s!==e&&xE(n,s,{get:()=>t[s],enumerable:!(o=LU(t,s))||o.enumerable});return n};var Je=(n,t,e)=>(e=n!=null?RU(OU(n)):{},FU(t||!n||!n.__esModule?xE(e,"default",{value:n,enumerable:!0}):e,n));var pp=(n,t,e)=>new Promise((o,s)=>{var l=g=>{try{h(e.next(g))}catch(m){s(m)}},p=g=>{try{h(e.throw(g))}catch(m){s(m)}},h=g=>g.done?o(g.value):Promise.resolve(g.value).then(l,p);h((e=e.apply(n,t)).next())});var so=ot((Vm,EE)=>{"use strict";var Uf=function(n){return n&&n.Math===Math&&n};EE.exports=Uf(typeof globalThis=="object"&&globalThis)||Uf(typeof window=="object"&&window)||Uf(typeof self=="object"&&self)||Uf(typeof global=="object"&&global)||Uf(typeof Vm=="object"&&Vm)||function(){return this}()||Function("return this")()});var SE=ot((sj,wE)=>{"use strict";wE.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}});var Ui=ot((aj,ME)=>{"use strict";var Wm=typeof document=="object"&&document.all;ME.exports=typeof Wm=="undefined"&&Wm!==void 0?function(n){return typeof n=="function"||n===Wm}:function(n){return typeof n=="function"}});var Ys=ot((uj,bE)=>{"use strict";var UU=Ui();bE.exports=function(n){return typeof n=="object"?n!==null:UU(n)}});var dp=ot((lj,TE)=>{"use strict";var BU=so(),AE=Ys(),Xm=BU.document,zU=AE(Xm)&&AE(Xm.createElement);TE.exports=function(n){return zU?Xm.createElement(n):{}}});var IE=ot((cj,PE)=>{"use strict";var GU=dp(),Ym=GU("span").classList,CE=Ym&&Ym.constructor&&Ym.constructor.prototype;PE.exports=CE===Object.prototype?void 0:CE});var mi=ot((fj,RE)=>{"use strict";RE.exports=function(n){try{return!!n()}catch(t){return!0}}});var Bf=ot((hj,LE)=>{"use strict";var kU=mi();LE.exports=!kU(function(){var n=function(){}.bind();return typeof n!="function"||n.hasOwnProperty("prototype")})});var yi=ot((pj,DE)=>{"use strict";var NE=Bf(),OE=Function.prototype,$m=OE.call,qU=NE&&OE.bind.bind($m,$m);DE.exports=NE?qU:function(n){return function(){return $m.apply(n,arguments)}}});var ac=ot((dj,UE)=>{"use strict";var FE=yi(),HU=FE({}.toString),VU=FE("".slice);UE.exports=function(n){return VU(HU(n),8,-1)}});var zE=ot((gj,BE)=>{"use strict";var WU=yi(),XU=mi(),YU=ac(),Zm=Object,$U=WU("".split);BE.exports=XU(function(){return!Zm("z").propertyIsEnumerable(0)})?function(n){return YU(n)==="String"?$U(n,""):Zm(n)}:Zm});var Jm=ot((mj,GE)=>{"use strict";GE.exports=function(n){return n==null}});var uc=ot((yj,kE)=>{"use strict";var ZU=Jm(),JU=TypeError;kE.exports=function(n){if(ZU(n))throw new JU("Can't call method on "+n);return n}});var lc=ot((vj,qE)=>{"use strict";var KU=zE(),jU=uc();qE.exports=function(n){return KU(jU(n))}});var zf=ot((_j,HE)=>{"use strict";HE.exports=!1});var gp=ot((xj,WE)=>{"use strict";var VE=so(),QU=Object.defineProperty;WE.exports=function(n,t){try{QU(VE,n,{value:t,configurable:!0,writable:!0})}catch(e){VE[n]=t}return t}});var mp=ot((Ej,$E)=>{"use strict";var tB=zf(),eB=so(),nB=gp(),XE="__core-js_shared__",YE=$E.exports=eB[XE]||nB(XE,{});(YE.versions||(YE.versions=[])).push({version:"3.42.0",mode:tB?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var yp=ot((wj,JE)=>{"use strict";var ZE=mp();JE.exports=function(n,t){return ZE[n]||(ZE[n]=t||{})}});var cc=ot((Sj,KE)=>{"use strict";var rB=uc(),iB=Object;KE.exports=function(n){return iB(rB(n))}});var Ma=ot((Mj,jE)=>{"use strict";var oB=yi(),sB=cc(),aB=oB({}.hasOwnProperty);jE.exports=Object.hasOwn||function(t,e){return aB(sB(t),e)}});var Km=ot((bj,QE)=>{"use strict";var uB=yi(),lB=0,cB=Math.random(),fB=uB(1 .toString);QE.exports=function(n){return"Symbol("+(n===void 0?"":n)+")_"+fB(++lB+cB,36)}});var rw=ot((Aj,nw)=>{"use strict";var hB=so(),tw=hB.navigator,ew=tw&&tw.userAgent;nw.exports=ew?String(ew):""});var cw=ot((Tj,lw)=>{"use strict";var uw=so(),jm=rw(),iw=uw.process,ow=uw.Deno,sw=iw&&iw.versions||ow&&ow.version,aw=sw&&sw.v8,$s,vp;aw&&($s=aw.split("."),vp=$s[0]>0&&$s[0]<4?1:+($s[0]+$s[1]));!vp&&jm&&($s=jm.match(/Edge\\/(\\d+)/),(!$s||$s[1]>=74)&&($s=jm.match(/Chrome\\/(\\d+)/),$s&&(vp=+$s[1])));lw.exports=vp});var Qm=ot((Cj,hw)=>{"use strict";var fw=cw(),pB=mi(),dB=so(),gB=dB.String;hw.exports=!!Object.getOwnPropertySymbols&&!pB(function(){var n=Symbol("symbol detection");return!gB(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&fw&&fw<41})});var t0=ot((Pj,pw)=>{"use strict";var mB=Qm();pw.exports=mB&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ns=ot((Ij,gw)=>{"use strict";var yB=so(),vB=yp(),dw=Ma(),_B=Km(),xB=Qm(),EB=t0(),fc=yB.Symbol,e0=vB("wks"),wB=EB?fc.for||fc:fc&&fc.withoutSetter||_B;gw.exports=function(n){return dw(e0,n)||(e0[n]=xB&&dw(fc,n)?fc[n]:wB("Symbol."+n)),e0[n]}});var ba=ot((Rj,mw)=>{"use strict";var SB=Ys(),MB=String,bB=TypeError;mw.exports=function(n){if(SB(n))return n;throw new bB(MB(n)+" is not an object")}});var Zs=ot((Lj,yw)=>{"use strict";var AB=mi();yw.exports=!AB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var n0=ot((Nj,vw)=>{"use strict";var TB=Zs(),CB=mi();vw.exports=TB&&CB(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var r0=ot((Oj,_w)=>{"use strict";var PB=Zs(),IB=mi(),RB=dp();_w.exports=!PB&&!IB(function(){return Object.defineProperty(RB("div"),"a",{get:function(){return 7}}).a!==7})});var Os=ot((Dj,xw)=>{"use strict";var LB=Bf(),_p=Function.prototype.call;xw.exports=LB?_p.bind(_p):function(){return _p.apply(_p,arguments)}});var hc=ot((Fj,Ew)=>{"use strict";var i0=so(),NB=Ui(),OB=function(n){return NB(n)?n:void 0};Ew.exports=function(n,t){return arguments.length<2?OB(i0[n]):i0[n]&&i0[n][t]}});var Sw=ot((Uj,ww)=>{"use strict";var DB=yi();ww.exports=DB({}.isPrototypeOf)});var o0=ot((Bj,Mw)=>{"use strict";var FB=hc(),UB=Ui(),BB=Sw(),zB=t0(),GB=Object;Mw.exports=zB?function(n){return typeof n=="symbol"}:function(n){var t=FB("Symbol");return UB(t)&&BB(t.prototype,GB(n))}});var Aw=ot((zj,bw)=>{"use strict";var kB=String;bw.exports=function(n){try{return kB(n)}catch(t){return"Object"}}});var Gf=ot((Gj,Tw)=>{"use strict";var qB=Ui(),HB=Aw(),VB=TypeError;Tw.exports=function(n){if(qB(n))return n;throw new VB(HB(n)+" is not a function")}});var xp=ot((kj,Cw)=>{"use strict";var WB=Gf(),XB=Jm();Cw.exports=function(n,t){var e=n[t];return XB(e)?void 0:WB(e)}});var Iw=ot((qj,Pw)=>{"use strict";var s0=Os(),a0=Ui(),u0=Ys(),YB=TypeError;Pw.exports=function(n,t){var e,o;if(t==="string"&&a0(e=n.toString)&&!u0(o=s0(e,n))||a0(e=n.valueOf)&&!u0(o=s0(e,n))||t!=="string"&&a0(e=n.toString)&&!u0(o=s0(e,n)))return o;throw new YB("Can't convert object to primitive value")}});var Ow=ot((Hj,Nw)=>{"use strict";var $B=Os(),Rw=Ys(),Lw=o0(),ZB=xp(),JB=Iw(),KB=Ns(),jB=TypeError,QB=KB("toPrimitive");Nw.exports=function(n,t){if(!Rw(n)||Lw(n))return n;var e=ZB(n,QB),o;if(e){if(t===void 0&&(t="default"),o=$B(e,n,t),!Rw(o)||Lw(o))return o;throw new jB("Can't convert object to primitive value")}return t===void 0&&(t="number"),JB(n,t)}});var l0=ot((Vj,Dw)=>{"use strict";var tz=Ow(),ez=o0();Dw.exports=function(n){var t=tz(n,"string");return ez(t)?t:t+""}});var Lu=ot(Uw=>{"use strict";var nz=Zs(),rz=r0(),iz=n0(),Ep=ba(),Fw=l0(),oz=TypeError,c0=Object.defineProperty,sz=Object.getOwnPropertyDescriptor,f0="enumerable",h0="configurable",p0="writable";Uw.f=nz?iz?function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),typeof t=="function"&&e==="prototype"&&"value"in o&&p0 in o&&!o[p0]){var s=sz(t,e);s&&s[p0]&&(t[e]=o.value,o={configurable:h0 in o?o[h0]:s[h0],enumerable:f0 in o?o[f0]:s[f0],writable:!1})}return c0(t,e,o)}:c0:function(t,e,o){if(Ep(t),e=Fw(e),Ep(o),rz)try{return c0(t,e,o)}catch(s){}if("get"in o||"set"in o)throw new oz("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var zw=ot((Xj,Bw)=>{"use strict";var az=Math.ceil,uz=Math.floor;Bw.exports=Math.trunc||function(t){var e=+t;return(e>0?uz:az)(e)}});var El=ot((Yj,Gw)=>{"use strict";var lz=zw();Gw.exports=function(n){var t=+n;return t!==t||t===0?0:lz(t)}});var qw=ot(($j,kw)=>{"use strict";var cz=El(),fz=Math.max,hz=Math.min;kw.exports=function(n,t){var e=cz(n);return e<0?fz(e+t,0):hz(e,t)}});var d0=ot((Zj,Hw)=>{"use strict";var pz=El(),dz=Math.min;Hw.exports=function(n){var t=pz(n);return t>0?dz(t,9007199254740991):0}});var kf=ot((Jj,Vw)=>{"use strict";var gz=d0();Vw.exports=function(n){return gz(n.length)}});var Yw=ot((Kj,Xw)=>{"use strict";var mz=lc(),yz=qw(),vz=kf(),Ww=function(n){return function(t,e,o){var s=mz(t),l=vz(s);if(l===0)return!n&&-1;var p=yz(o,l),h;if(n&&e!==e){for(;l>p;)if(h=s[p++],h!==h)return!0}else for(;l>p;p++)if((n||p in s)&&s[p]===e)return n||p||0;return!n&&-1}};Xw.exports={includes:Ww(!0),indexOf:Ww(!1)}});var wp=ot((jj,$w)=>{"use strict";$w.exports={}});var m0=ot((Qj,Jw)=>{"use strict";var _z=yi(),g0=Ma(),xz=lc(),Ez=Yw().indexOf,wz=wp(),Zw=_z([].push);Jw.exports=function(n,t){var e=xz(n),o=0,s=[],l;for(l in e)!g0(wz,l)&&g0(e,l)&&Zw(s,l);for(;t.length>o;)g0(e,l=t[o++])&&(~Ez(s,l)||Zw(s,l));return s}});var Sp=ot((tQ,Kw)=>{"use strict";Kw.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Qw=ot((eQ,jw)=>{"use strict";var Sz=m0(),Mz=Sp();jw.exports=Object.keys||function(t){return Sz(t,Mz)}});var eS=ot(tS=>{"use strict";var bz=Zs(),Az=n0(),Tz=Lu(),Cz=ba(),Pz=lc(),Iz=Qw();tS.f=bz&&!Az?Object.defineProperties:function(t,e){Cz(t);for(var o=Pz(e),s=Iz(e),l=s.length,p=0,h;l>p;)Tz.f(t,h=s[p++],o[h]);return t}});var rS=ot((rQ,nS)=>{"use strict";var Rz=hc();nS.exports=Rz("document","documentElement")});var Mp=ot((iQ,oS)=>{"use strict";var Lz=yp(),Nz=Km(),iS=Lz("keys");oS.exports=function(n){return iS[n]||(iS[n]=Nz(n))}});var qf=ot((oQ,hS)=>{"use strict";var Oz=ba(),Dz=eS(),sS=Sp(),Fz=wp(),Uz=rS(),Bz=dp(),zz=Mp(),aS=">",uS="<",v0="prototype",_0="script",cS=zz("IE_PROTO"),y0=function(){},fS=function(n){return uS+_0+aS+n+uS+"/"+_0+aS},lS=function(n){n.write(fS("")),n.close();var t=n.parentWindow.Object;return n=null,t},Gz=function(){var n=Bz("iframe"),t="java"+_0+":",e;return n.style.display="none",Uz.appendChild(n),n.src=String(t),e=n.contentWindow.document,e.open(),e.write(fS("document.F=Object")),e.close(),e.F},bp,Ap=function(){try{bp=new ActiveXObject("htmlfile")}catch(t){}Ap=typeof document!="undefined"?document.domain&&bp?lS(bp):Gz():lS(bp);for(var n=sS.length;n--;)delete Ap[v0][sS[n]];return Ap()};Fz[cS]=!0;hS.exports=Object.create||function(t,e){var o;return t!==null?(y0[v0]=Oz(t),o=new y0,y0[v0]=null,o[cS]=t):o=Ap(),e===void 0?o:Dz.f(o,e)}});var w0=ot((sQ,pS)=>{"use strict";var kz=Ns(),qz=qf(),Hz=Lu().f,x0=kz("unscopables"),E0=Array.prototype;E0[x0]===void 0&&Hz(E0,x0,{configurable:!0,value:qz(null)});pS.exports=function(n){E0[x0][n]=!0}});var Tp=ot((aQ,dS)=>{"use strict";dS.exports={}});var yS=ot((uQ,mS)=>{"use strict";var Vz=so(),Wz=Ui(),gS=Vz.WeakMap;mS.exports=Wz(gS)&&/native code/.test(String(gS))});var Cp=ot((lQ,vS)=>{"use strict";vS.exports=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}}});var pc=ot((cQ,_S)=>{"use strict";var Xz=Zs(),Yz=Lu(),$z=Cp();_S.exports=Xz?function(n,t,e){return Yz.f(n,t,$z(1,e))}:function(n,t,e){return n[t]=e,n}});var Rp=ot((fQ,wS)=>{"use strict";var Zz=yS(),ES=so(),Jz=Ys(),Kz=pc(),S0=Ma(),M0=mp(),jz=Mp(),Qz=wp(),xS="Object already initialized",b0=ES.TypeError,tG=ES.WeakMap,Pp,Hf,Ip,eG=function(n){return Ip(n)?Hf(n):Pp(n,{})},nG=function(n){return function(t){var e;if(!Jz(t)||(e=Hf(t)).type!==n)throw new b0("Incompatible receiver, "+n+" required");return e}};Zz||M0.state?(Js=M0.state||(M0.state=new tG),Js.get=Js.get,Js.has=Js.has,Js.set=Js.set,Pp=function(n,t){if(Js.has(n))throw new b0(xS);return t.facade=n,Js.set(n,t),t},Hf=function(n){return Js.get(n)||{}},Ip=function(n){return Js.has(n)}):(wl=jz("state"),Qz[wl]=!0,Pp=function(n,t){if(S0(n,wl))throw new b0(xS);return t.facade=n,Kz(n,wl,t),t},Hf=function(n){return S0(n,wl)?n[wl]:{}},Ip=function(n){return S0(n,wl)});var Js,wl;wS.exports={set:Pp,get:Hf,has:Ip,enforce:eG,getterFor:nG}});var AS=ot(bS=>{"use strict";var SS={}.propertyIsEnumerable,MS=Object.getOwnPropertyDescriptor,rG=MS&&!SS.call({1:2},1);bS.f=rG?function(t){var e=MS(this,t);return!!e&&e.enumerable}:SS});var A0=ot(CS=>{"use strict";var iG=Zs(),oG=Os(),sG=AS(),aG=Cp(),uG=lc(),lG=l0(),cG=Ma(),fG=r0(),TS=Object.getOwnPropertyDescriptor;CS.f=iG?TS:function(t,e){if(t=uG(t),e=lG(e),fG)try{return TS(t,e)}catch(o){}if(cG(t,e))return aG(!oG(sG.f,t,e),t[e])}});var P0=ot((dQ,IS)=>{"use strict";var T0=Zs(),hG=Ma(),PS=Function.prototype,pG=T0&&Object.getOwnPropertyDescriptor,C0=hG(PS,"name"),dG=C0&&function(){}.name==="something",gG=C0&&(!T0||T0&&pG(PS,"name").configurable);IS.exports={EXISTS:C0,PROPER:dG,CONFIGURABLE:gG}});var R0=ot((gQ,RS)=>{"use strict";var mG=yi(),yG=Ui(),I0=mp(),vG=mG(Function.toString);yG(I0.inspectSource)||(I0.inspectSource=function(n){return vG(n)});RS.exports=I0.inspectSource});var DS=ot((mQ,OS)=>{"use strict";var N0=yi(),_G=mi(),xG=Ui(),Lp=Ma(),L0=Zs(),EG=P0().CONFIGURABLE,wG=R0(),NS=Rp(),SG=NS.enforce,MG=NS.get,LS=String,Np=Object.defineProperty,bG=N0("".slice),AG=N0("".replace),TG=N0([].join),CG=L0&&!_G(function(){return Np(function(){},"length",{value:8}).length!==8}),PG=String(String).split("String"),IG=OS.exports=function(n,t,e){bG(LS(t),0,7)==="Symbol("&&(t="["+AG(LS(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Lp(n,"name")||EG&&n.name!==t)&&(L0?Np(n,"name",{value:t,configurable:!0}):n.name=t),CG&&e&&Lp(e,"arity")&&n.length!==e.arity&&Np(n,"length",{value:e.arity});try{e&&Lp(e,"constructor")&&e.constructor?L0&&Np(n,"prototype",{writable:!1}):n.prototype&&(n.prototype=void 0)}catch(s){}var o=SG(n);return Lp(o,"source")||(o.source=TG(PG,typeof t=="string"?t:"")),n};Function.prototype.toString=IG(function(){return xG(this)&&MG(this).source||wG(this)},"toString")});var Vf=ot((yQ,FS)=>{"use strict";var RG=Ui(),LG=Lu(),NG=DS(),OG=gp();FS.exports=function(n,t,e,o){o||(o={});var s=o.enumerable,l=o.name!==void 0?o.name:t;if(RG(e)&&NG(e,l,o),o.global)s?n[t]=e:OG(t,e);else{try{o.unsafe?n[t]&&(s=!0):delete n[t]}catch(p){}s?n[t]=e:LG.f(n,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return n}});var BS=ot(US=>{"use strict";var DG=m0(),FG=Sp(),UG=FG.concat("length","prototype");US.f=Object.getOwnPropertyNames||function(t){return DG(t,UG)}});var GS=ot(zS=>{"use strict";zS.f=Object.getOwnPropertySymbols});var qS=ot((xQ,kS)=>{"use strict";var BG=hc(),zG=yi(),GG=BS(),kG=GS(),qG=ba(),HG=zG([].concat);kS.exports=BG("Reflect","ownKeys")||function(t){var e=GG.f(qG(t)),o=kG.f;return o?HG(e,o(t)):e}});var WS=ot((EQ,VS)=>{"use strict";var HS=Ma(),VG=qS(),WG=A0(),XG=Lu();VS.exports=function(n,t,e){for(var o=VG(t),s=XG.f,l=WG.f,p=0;p<o.length;p++){var h=o[p];!HS(n,h)&&!(e&&HS(e,h))&&s(n,h,l(t,h))}}});var YS=ot((wQ,XS)=>{"use strict";var YG=mi(),$G=Ui(),ZG=/#|\\.prototype\\./,Wf=function(n,t){var e=KG[JG(n)];return e===QG?!0:e===jG?!1:$G(t)?YG(t):!!t},JG=Wf.normalize=function(n){return String(n).replace(ZG,".").toLowerCase()},KG=Wf.data={},jG=Wf.NATIVE="N",QG=Wf.POLYFILL="P";XS.exports=Wf});var Ds=ot((SQ,$S)=>{"use strict";var Op=so(),t4=A0().f,e4=pc(),n4=Vf(),r4=gp(),i4=WS(),o4=YS();$S.exports=function(n,t){var e=n.target,o=n.global,s=n.stat,l,p,h,g,m,_;if(o?p=Op:s?p=Op[e]||r4(e,{}):p=Op[e]&&Op[e].prototype,p)for(h in t){if(m=t[h],n.dontCallGetSet?(_=t4(p,h),g=_&&_.value):g=p[h],l=o4(o?h:e+(s?".":"#")+h,n.forced),!l&&g!==void 0){if(typeof m==typeof g)continue;i4(m,g)}(n.sham||g&&g.sham)&&e4(m,"sham",!0),n4(p,h,m,n)}}});var JS=ot((MQ,ZS)=>{"use strict";var s4=mi();ZS.exports=!s4(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})});var D0=ot((bQ,jS)=>{"use strict";var a4=Ma(),u4=Ui(),l4=cc(),c4=Mp(),f4=JS(),KS=c4("IE_PROTO"),O0=Object,h4=O0.prototype;jS.exports=f4?O0.getPrototypeOf:function(n){var t=l4(n);if(a4(t,KS))return t[KS];var e=t.constructor;return u4(e)&&t instanceof e?e.prototype:t instanceof O0?h4:null}});var z0=ot((AQ,eM)=>{"use strict";var p4=mi(),d4=Ui(),g4=Ys(),m4=qf(),QS=D0(),y4=Vf(),v4=Ns(),_4=zf(),B0=v4("iterator"),tM=!1,nu,F0,U0;[].keys&&(U0=[].keys(),"next"in U0?(F0=QS(QS(U0)),F0!==Object.prototype&&(nu=F0)):tM=!0);var x4=!g4(nu)||p4(function(){var n={};return nu[B0].call(n)!==n});x4?nu={}:_4&&(nu=m4(nu));d4(nu[B0])||y4(nu,B0,function(){return this});eM.exports={IteratorPrototype:nu,BUGGY_SAFARI_ITERATORS:tM}});var Dp=ot((TQ,rM)=>{"use strict";var E4=Lu().f,w4=Ma(),S4=Ns(),nM=S4("toStringTag");rM.exports=function(n,t,e){n&&!e&&(n=n.prototype),n&&!w4(n,nM)&&E4(n,nM,{configurable:!0,value:t})}});var oM=ot((CQ,iM)=>{"use strict";var M4=z0().IteratorPrototype,b4=qf(),A4=Cp(),T4=Dp(),C4=Tp(),P4=function(){return this};iM.exports=function(n,t,e,o){var s=t+" Iterator";return n.prototype=b4(M4,{next:A4(+!o,e)}),T4(n,s,!1,!0),C4[s]=P4,n}});var G0=ot((PQ,sM)=>{"use strict";var I4=yi(),R4=Gf();sM.exports=function(n,t,e){try{return I4(R4(Object.getOwnPropertyDescriptor(n,t)[e]))}catch(o){}}});var uM=ot((IQ,aM)=>{"use strict";var L4=Ys();aM.exports=function(n){return L4(n)||n===null}});var cM=ot((RQ,lM)=>{"use strict";var N4=uM(),O4=String,D4=TypeError;lM.exports=function(n){if(N4(n))return n;throw new D4("Can't set "+O4(n)+" as a prototype")}});var hM=ot((LQ,fM)=>{"use strict";var F4=G0(),U4=Ys(),B4=uc(),z4=cM();fM.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var n=!1,t={},e;try{e=F4(Object.prototype,"__proto__","set"),e(t,[]),n=t instanceof Array}catch(o){}return function(s,l){return B4(s),z4(l),U4(s)&&(n?e(s,l):s.__proto__=l),s}}():void 0)});var SM=ot((NQ,wM)=>{"use strict";var G4=Ds(),k4=Os(),Fp=zf(),xM=P0(),q4=Ui(),H4=oM(),pM=D0(),dM=hM(),V4=Dp(),W4=pc(),k0=Vf(),X4=Ns(),gM=Tp(),EM=z0(),Y4=xM.PROPER,$4=xM.CONFIGURABLE,mM=EM.IteratorPrototype,Up=EM.BUGGY_SAFARI_ITERATORS,Xf=X4("iterator"),yM="keys",Yf="values",vM="entries",_M=function(){return this};wM.exports=function(n,t,e,o,s,l,p){H4(e,t,o);var h=function(x){if(x===s&&S)return S;if(!Up&&x&&x in _)return _[x];switch(x){case yM:return function(){return new e(this,x)};case Yf:return function(){return new e(this,x)};case vM:return function(){return new e(this,x)}}return function(){return new e(this)}},g=t+" Iterator",m=!1,_=n.prototype,E=_[Xf]||_["@@iterator"]||s&&_[s],S=!Up&&E||h(s),b=t==="Array"&&_.entries||E,A,I,w;if(b&&(A=pM(b.call(new n)),A!==Object.prototype&&A.next&&(!Fp&&pM(A)!==mM&&(dM?dM(A,mM):q4(A[Xf])||k0(A,Xf,_M)),V4(A,g,!0,!0),Fp&&(gM[g]=_M))),Y4&&s===Yf&&E&&E.name!==Yf&&(!Fp&&$4?W4(_,"name",Yf):(m=!0,S=function(){return k4(E,this)})),s)if(I={values:h(Yf),keys:l?S:h(yM),entries:h(vM)},p)for(w in I)(Up||m||!(w in _))&&k0(_,w,I[w]);else G4({target:t,proto:!0,forced:Up||m},I);return(!Fp||p)&&_[Xf]!==S&&k0(_,Xf,S,{name:s}),gM[t]=S,I}});var bM=ot((OQ,MM)=>{"use strict";MM.exports=function(n,t){return{value:n,done:t}}});var RM=ot((DQ,IM)=>{"use strict";var Z4=lc(),q0=w0(),AM=Tp(),CM=Rp(),J4=Lu().f,K4=SM(),Bp=bM(),j4=zf(),Q4=Zs(),PM="Array Iterator",tk=CM.set,ek=CM.getterFor(PM);IM.exports=K4(Array,"Array",function(n,t){tk(this,{type:PM,target:Z4(n),index:0,kind:t})},function(){var n=ek(this),t=n.target,e=n.index++;if(!t||e>=t.length)return n.target=null,Bp(void 0,!0);switch(n.kind){case"keys":return Bp(e,!1);case"values":return Bp(t[e],!1)}return Bp([e,t[e]],!1)},"values");var TM=AM.Arguments=AM.Array;q0("keys");q0("values");q0("entries");if(!j4&&Q4&&TM.name!=="values")try{J4(TM,"name",{value:"values"})}catch(n){}});var Gp=ot(()=>{"use strict";var LM=so(),OM=SE(),nk=IE(),$f=RM(),NM=pc(),rk=Dp(),ik=Ns(),H0=ik("iterator"),V0=$f.values,DM=function(n,t){if(n){if(n[H0]!==V0)try{NM(n,H0,V0)}catch(o){n[H0]=V0}if(rk(n,t,!0),OM[t]){for(var e in $f)if(n[e]!==$f[e])try{NM(n,e,$f[e])}catch(o){n[e]=$f[e]}}}};for(zp in OM)DM(LM[zp]&&LM[zp].prototype,zp);var zp;DM(nk,"DOMTokenList")});var BM=ot((BQ,UM)=>{"use strict";var ok=Ns(),sk=ok("toStringTag"),FM={};FM[sk]="z";UM.exports=String(FM)==="[object z]"});var W0=ot((zQ,zM)=>{"use strict";var ak=BM(),uk=Ui(),kp=ac(),lk=Ns(),ck=lk("toStringTag"),fk=Object,hk=kp(function(){return arguments}())==="Arguments",pk=function(n,t){try{return n[t]}catch(e){}};zM.exports=ak?kp:function(n){var t,e,o;return n===void 0?"Undefined":n===null?"Null":typeof(e=pk(t=fk(n),ck))=="string"?e:hk?kp(t):(o=kp(t))==="Object"&&uk(t.callee)?"Arguments":o}});var qp=ot((GQ,GM)=>{"use strict";var dk=W0(),gk=String;GM.exports=function(n){if(dk(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gk(n)}});var qM=ot((kQ,kM)=>{"use strict";var mk=ba();kM.exports=function(){var n=mk(this),t="";return n.hasIndices&&(t+="d"),n.global&&(t+="g"),n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.dotAll&&(t+="s"),n.unicode&&(t+="u"),n.unicodeSets&&(t+="v"),n.sticky&&(t+="y"),t}});var VM=ot((qQ,HM)=>{"use strict";var X0=mi(),yk=so(),Y0=yk.RegExp,$0=X0(function(){var n=Y0("a","y");return n.lastIndex=2,n.exec("abcd")!==null}),vk=$0||X0(function(){return!Y0("a","y").sticky}),_k=$0||X0(function(){var n=Y0("^r","gy");return n.lastIndex=2,n.exec("str")!==null});HM.exports={BROKEN_CARET:_k,MISSED_STICKY:vk,UNSUPPORTED_Y:$0}});var XM=ot((HQ,WM)=>{"use strict";var xk=mi(),Ek=so(),wk=Ek.RegExp;WM.exports=xk(function(){var n=wk(".","s");return!(n.dotAll&&n.test(\`
11819
11819
  \`)&&n.flags==="s")})});var $M=ot((VQ,YM)=>{"use strict";var Sk=mi(),Mk=so(),bk=Mk.RegExp;YM.exports=Sk(function(){var n=bk("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"})});var Wp=ot((WQ,JM)=>{"use strict";var dc=Os(),Vp=yi(),Ak=qp(),Tk=qM(),Ck=VM(),Pk=yp(),Ik=qf(),Rk=Rp().get,Lk=XM(),Nk=$M(),Ok=Pk("native-string-replace",String.prototype.replace),Hp=RegExp.prototype.exec,J0=Hp,Dk=Vp("".charAt),Fk=Vp("".indexOf),Uk=Vp("".replace),Z0=Vp("".slice),K0=function(){var n=/a/,t=/b*/g;return dc(Hp,n,"a"),dc(Hp,t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),ZM=Ck.BROKEN_CARET,j0=/()??/.exec("")[1]!==void 0,Bk=K0||j0||ZM||Lk||Nk;Bk&&(J0=function(t){var e=this,o=Rk(e),s=Ak(t),l=o.raw,p,h,g,m,_,E,S;if(l)return l.lastIndex=e.lastIndex,p=dc(J0,l,s),e.lastIndex=l.lastIndex,p;var b=o.groups,A=ZM&&e.sticky,I=dc(Tk,e),w=e.source,x=0,R=s;if(A&&(I=Uk(I,"y",""),Fk(I,"g")===-1&&(I+="g"),R=Z0(s,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&Dk(s,e.lastIndex-1)!==\`
11820
11820
  \`)&&(w="(?: "+w+")",R=" "+R,x++),h=new RegExp("^(?:"+w+")",I)),j0&&(h=new RegExp("^"+w+"$(?!\\\\s)",I)),K0&&(g=e.lastIndex),m=dc(Hp,A?h:e,R),A?m?(m.input=Z0(m.input,x),m[0]=Z0(m[0],x),m.index=e.lastIndex,e.lastIndex+=m[0].length):e.lastIndex=0:K0&&m&&(e.lastIndex=e.global?m.index+m[0].length:g),j0&&m&&m.length>1&&dc(Ok,m[0],h,function(){for(_=1;_<arguments.length-2;_++)arguments[_]===void 0&&(m[_]=void 0)}),m&&b)for(m.groups=E=Ik(null),_=0;_<b.length;_++)S=b[_],E[S[0]]=m[S[1]];return m});JM.exports=J0});var Xp=ot(()=>{"use strict";var zk=Ds(),KM=Wp();zk({target:"RegExp",proto:!0,forced:/./.exec!==KM},{exec:KM})});var Yp=ot(($Q,jM)=>{"use strict";var Gk=ac();jM.exports=Array.isArray||function(t){return Gk(t)==="Array"}});var tb=ot((ZQ,QM)=>{"use strict";var kk=Zs(),qk=Yp(),Hk=TypeError,Vk=Object.getOwnPropertyDescriptor,Wk=kk&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}}();QM.exports=Wk?function(n,t){if(qk(n)&&!Vk(n,"length").writable)throw new Hk("Cannot set read only .length");return n.length=t}:function(n,t){return n.length=t}});var Q0=ot((JQ,eb)=>{"use strict";var Xk=TypeError,Yk=9007199254740991;eb.exports=function(n){if(n>Yk)throw Xk("Maximum allowed index exceeded");return n}});var ty=ot(()=>{"use strict";var $k=Ds(),Zk=cc(),Jk=kf(),Kk=tb(),jk=Q0(),Qk=mi(),tq=Qk(function(){return[].push.call({length:4294967296},1)!==4294967297}),eq=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(n){return n instanceof TypeError}},nq=tq||!eq();$k({target:"Array",proto:!0,arity:1,forced:nq},{push:function(t){var e=Zk(this),o=Jk(e),s=arguments.length;jk(o+s);for(var l=0;l<s;l++)e[o]=arguments[l],o++;return Kk(e,o),o}})});var Ks=ot((QQ,nb)=>{"use strict";var ey=yi(),$p=Set.prototype;nb.exports={Set,add:ey($p.add),has:ey($p.has),remove:ey($p.delete),proto:$p}});var Nu=ot((ttt,rb)=>{"use strict";var rq=Ks().has;rb.exports=function(n){return rq(n),n}});var Ou=ot((ett,ib)=>{"use strict";var iq=Os();ib.exports=function(n,t,e){for(var o=e?n:n.iterator,s=n.next,l,p;!(l=iq(s,o)).done;)if(p=t(l.value),p!==void 0)return p}});var gc=ot((ntt,lb)=>{"use strict";var ob=yi(),oq=Ou(),sb=Ks(),sq=sb.Set,ab=sb.proto,aq=ob(ab.forEach),ub=ob(ab.keys),uq=ub(new sq).next;lb.exports=function(n,t,e){return e?oq({iterator:ub(n),next:uq},t):aq(n,t)}});var Zp=ot((rtt,fb)=>{"use strict";var cb=Ks(),lq=gc(),cq=cb.Set,fq=cb.add;fb.exports=function(n){var t=new cq;return lq(n,function(e){fq(t,e)}),t}});var mc=ot((itt,hb)=>{"use strict";var hq=G0(),pq=Ks();hb.exports=hq(pq.proto,"size","get")||function(n){return n.size}});var db=ot((ott,pb)=>{"use strict";pb.exports=function(n){return{iterator:n,next:n.next,done:!1}}});var Du=ot((stt,xb)=>{"use strict";var gb=Gf(),vb=ba(),mb=Os(),dq=El(),gq=db(),yb="Invalid size",mq=RangeError,yq=TypeError,vq=Math.max,_b=function(n,t){this.set=n,this.size=vq(t,0),this.has=gb(n.has),this.keys=gb(n.keys)};_b.prototype={getIterator:function(){return gq(vb(mb(this.keys,this.set)))},includes:function(n){return mb(this.has,this.set,n)}};xb.exports=function(n){vb(n);var t=+n.size;if(t!==t)throw new yq(yb);var e=dq(t);if(e<0)throw new mq(yb);return new _b(n,e)}});var Mb=ot((att,Sb)=>{"use strict";var _q=Nu(),wb=Ks(),xq=Zp(),Eq=mc(),wq=Du(),Sq=gc(),Mq=Ou(),bq=wb.has,Eb=wb.remove;Sb.exports=function(t){var e=_q(this),o=wq(t),s=xq(e);return Eq(e)<=o.size?Sq(e,function(l){o.includes(l)&&Eb(s,l)}):Mq(o.getIterator(),function(l){bq(e,l)&&Eb(s,l)}),s}});var Fu=ot((utt,Tb)=>{"use strict";var Aq=hc(),bb=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Ab=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};Tb.exports=function(n,t){var e=Aq("Set");try{new e()[n](bb(0));try{return new e()[n](bb(-1)),!1}catch(s){if(!t)return!0;try{return new e()[n](Ab(-1/0)),!1}catch(l){var o=new e;return o.add(1),o.add(2),t(o[n](Ab(1/0)))}}}catch(s){return!1}}});var Cb=ot(()=>{"use strict";var Tq=Ds(),Cq=Mb(),Pq=Fu(),Iq=!Pq("difference",function(n){return n.size===0});Tq({target:"Set",proto:!0,real:!0,forced:Iq},{difference:Cq})});var Rb=ot((ftt,Ib)=>{"use strict";var Rq=Nu(),ny=Ks(),Lq=mc(),Nq=Du(),Oq=gc(),Dq=Ou(),Fq=ny.Set,Pb=ny.add,Uq=ny.has;Ib.exports=function(t){var e=Rq(this),o=Nq(t),s=new Fq;return Lq(e)>o.size?Dq(o.getIterator(),function(l){Uq(e,l)&&Pb(s,l)}):Oq(e,function(l){o.includes(l)&&Pb(s,l)}),s}});var Lb=ot(()=>{"use strict";var Bq=Ds(),zq=mi(),Gq=Rb(),kq=Fu(),qq=!kq("intersection",function(n){return n.size===2&&n.has(1)&&n.has(2)})||zq(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});Bq({target:"Set",proto:!0,real:!0,forced:qq},{intersection:Gq})});var ry=ot((dtt,Ob)=>{"use strict";var Hq=Os(),Nb=ba(),Vq=xp();Ob.exports=function(n,t,e){var o,s;Nb(n);try{if(o=Vq(n,"return"),!o){if(t==="throw")throw e;return e}o=Hq(o,n)}catch(l){s=!0,o=l}if(t==="throw")throw e;if(s)throw o;return Nb(o),e}});var Fb=ot((gtt,Db)=>{"use strict";var Wq=Nu(),Xq=Ks().has,Yq=mc(),$q=Du(),Zq=gc(),Jq=Ou(),Kq=ry();Db.exports=function(t){var e=Wq(this),o=$q(t);if(Yq(e)<=o.size)return Zq(e,function(l){if(o.includes(l))return!1},!0)!==!1;var s=o.getIterator();return Jq(s,function(l){if(Xq(e,l))return Kq(s,"normal",!1)})!==!1}});var Ub=ot(()=>{"use strict";var jq=Ds(),Qq=Fb(),t5=Fu(),e5=!t5("isDisjointFrom",function(n){return!n});jq({target:"Set",proto:!0,real:!0,forced:e5},{isDisjointFrom:Qq})});var zb=ot((vtt,Bb)=>{"use strict";var n5=Nu(),r5=mc(),i5=gc(),o5=Du();Bb.exports=function(t){var e=n5(this),o=o5(t);return r5(e)>o.size?!1:i5(e,function(s){if(!o.includes(s))return!1},!0)!==!1}});var Gb=ot(()=>{"use strict";var s5=Ds(),a5=zb(),u5=Fu(),l5=!u5("isSubsetOf",function(n){return n});s5({target:"Set",proto:!0,real:!0,forced:l5},{isSubsetOf:a5})});var qb=ot((Ett,kb)=>{"use strict";var c5=Nu(),f5=Ks().has,h5=mc(),p5=Du(),d5=Ou(),g5=ry();kb.exports=function(t){var e=c5(this),o=p5(t);if(h5(e)<o.size)return!1;var s=o.getIterator();return d5(s,function(l){if(!f5(e,l))return g5(s,"normal",!1)})!==!1}});var Hb=ot(()=>{"use strict";var m5=Ds(),y5=qb(),v5=Fu(),_5=!v5("isSupersetOf",function(n){return!n});m5({target:"Set",proto:!0,real:!0,forced:_5},{isSupersetOf:y5})});var Wb=ot((Mtt,Vb)=>{"use strict";var x5=Nu(),iy=Ks(),E5=Zp(),w5=Du(),S5=Ou(),M5=iy.add,b5=iy.has,A5=iy.remove;Vb.exports=function(t){var e=x5(this),o=w5(t).getIterator(),s=E5(e);return S5(o,function(l){b5(e,l)?A5(s,l):M5(s,l)}),s}});var Xb=ot(()=>{"use strict";var T5=Ds(),C5=Wb(),P5=Fu();T5({target:"Set",proto:!0,real:!0,forced:!P5("symmetricDifference")},{symmetricDifference:C5})});var $b=ot((Ttt,Yb)=>{"use strict";var I5=Nu(),R5=Ks().add,L5=Zp(),N5=Du(),O5=Ou();Yb.exports=function(t){var e=I5(this),o=N5(t).getIterator(),s=L5(e);return O5(o,function(l){R5(s,l)}),s}});var Zb=ot(()=>{"use strict";var D5=Ds(),F5=$b(),U5=Fu();D5({target:"Set",proto:!0,real:!0,forced:!U5("union")},{union:F5})});var Kb=ot((Itt,Jb)=>{"use strict";var B5=ac(),z5=yi();Jb.exports=function(n){if(B5(n)==="Function")return z5(n)}});var tA=ot((Rtt,Qb)=>{"use strict";var jb=Kb(),G5=Gf(),k5=Bf(),q5=jb(jb.bind);Qb.exports=function(n,t){return G5(n),t===void 0?n:k5?q5(n,t):function(){return n.apply(t,arguments)}}});var rA=ot((Ltt,nA)=>{"use strict";var H5=Yp(),V5=kf(),W5=Q0(),X5=tA(),eA=function(n,t,e,o,s,l,p,h){for(var g=s,m=0,_=p?X5(p,h):!1,E,S;m<o;)m in e&&(E=_?_(e[m],m,t):e[m],l>0&&H5(E)?(S=V5(E),g=eA(n,t,E,S,g,l-1)-1):(W5(g+1),n[g]=E),g++),m++;return g};nA.exports=eA});var lA=ot((Ntt,uA)=>{"use strict";var Y5=yi(),$5=mi(),iA=Ui(),Z5=W0(),J5=hc(),K5=R0(),oA=function(){},sA=J5("Reflect","construct"),oy=/^\\s*(?:class|function)\\b/,j5=Y5(oy.exec),Q5=!oy.test(oA),Zf=function(t){if(!iA(t))return!1;try{return sA(oA,[],t),!0}catch(e){return!1}},aA=function(t){if(!iA(t))return!1;switch(Z5(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Q5||!!j5(oy,K5(t))}catch(e){return!0}};aA.sham=!0;uA.exports=!sA||$5(function(){var n;return Zf(Zf.call)||!Zf(Object)||!Zf(function(){n=!0})||n})?aA:Zf});var pA=ot((Ott,hA)=>{"use strict";var cA=Yp(),tH=lA(),eH=Ys(),nH=Ns(),rH=nH("species"),fA=Array;hA.exports=function(n){var t;return cA(n)&&(t=n.constructor,tH(t)&&(t===fA||cA(t.prototype))?t=void 0:eH(t)&&(t=t[rH],t===null&&(t=void 0))),t===void 0?fA:t}});var gA=ot((Dtt,dA)=>{"use strict";var iH=pA();dA.exports=function(n,t){return new(iH(n))(t===0?0:t)}});var mA=ot(()=>{"use strict";var oH=Ds(),sH=rA(),aH=cc(),uH=kf(),lH=El(),cH=gA();oH({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=aH(this),o=uH(e),s=cH(e,0);return s.length=sH(s,e,e,o,0,t===void 0?1:lH(t)),s}})});var yA=ot(()=>{"use strict";var fH=w0();fH("flat")});var _A=ot((Gtt,vA)=>{var sy=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(s=>(s.key===t&&Object.assign(s,{priority:o}),s)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};vA.exports=sy});var wA=ot((ktt,EA)=>{function xA(n,t){let e=new Map;for(let[o,s]of n)o!==t&&s instanceof Map?e.set(o,xA(s,t)):o!==t&&e.set(o,s);return e}EA.exports=xA});var bA=ot((qtt,MA)=>{function hH(n){let t=Number(n);return!(isNaN(t)||t<=0)}function SA(n){let t=new Map;return Object.keys(n).forEach(o=>{let s=n[o];if(s!==null&&typeof s=="object"&&!Array.isArray(s))return t.set(o,SA(s));if(!hH(s))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,s);return t.set(o,Number(s))}),t}MA.exports=SA});var CA=ot((Htt,TA)=>{function AA(n){if(!(n instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof n}\`);n.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){AA(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}TA.exports=AA});var LA=ot((Vtt,RA)=>{var pH=_A(),dH=wA(),PA=bA(),IA=CA(),ay=class{constructor(t){t instanceof Map?(IA(t),this.graph=t):t?this.graph=PA(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(IA(e),o=e):o=PA(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=dH(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let s=new Set,l=new pH,p=new Map,h=[],g=0,m=[];if(o.avoid&&(m=[].concat(o.avoid)),m.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(m.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let _=l.next();if(_.key===e){g=_.priority;let S=_.key;for(;p.has(S);)h.push(S),S=p.get(S);break}s.add(_.key),(this.graph.get(_.key)||new Map).forEach((S,b)=>{if(s.has(b)||m.includes(b))return null;if(!l.has(b))return p.set(b,_.key),l.set(b,_.priority+S);let A=l.get(b).priority,I=_.priority+S;return I<A?(p.set(b,_.key),l.set(b,I)):null})}return h.length?(o.trim?h.shift():h=h.concat([t]),o.reverse||(h=h.reverse()),o.cost?{path:h,cost:g}:h):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};RA.exports=ay});var Xd=ot((net,CC)=>{"use strict";var TC=Object.getOwnPropertySymbols,AX=Object.prototype.hasOwnProperty,TX=Object.prototype.propertyIsEnumerable;function CX(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function PX(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(l){s[l]=l}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}CC.exports=PX()?Object.assign:function(n,t){for(var e,o=CX(n),s,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var p in e)AX.call(e,p)&&(o[p]=e[p]);if(TC){s=TC(e);for(var h=0;h<s.length;h++)TX.call(e,s[h])&&(o[s[h]]=e[s[h]])}}return o}});var kv=ot((zv,Gv)=>{(function(n,t){typeof zv=="object"&&typeof Gv!="undefined"?Gv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self).RBush=t()})(zv,function(){"use strict";function n(w,x,R,C,F){(function V(X,q,D,xt,B){for(;xt>D;){if(xt-D>600){var j=xt-D+1,J=q-D+1,Dt=Math.log(j),Q=.5*Math.exp(2*Dt/3),At=.5*Math.sqrt(Dt*Q*(j-Q)/j)*(J-j/2<0?-1:1),Mt=Math.max(D,Math.floor(q-J*Q/j+At)),Lt=Math.min(xt,Math.floor(q+(j-J)*Q/j+At));V(X,q,Mt,Lt,B)}var pt=X[q],yt=D,K=xt;for(t(X,D,q),B(X[xt],pt)>0&&t(X,D,xt);yt<K;){for(t(X,yt,K),yt++,K--;B(X[yt],pt)<0;)yt++;for(;B(X[K],pt)>0;)K--}B(X[D],pt)===0?t(X,D,K):t(X,++K,xt),K<=q&&(D=K+1),q<=K&&(xt=K-1)}})(w,x,R||0,C||w.length-1,F||e)}function t(w,x,R){var C=w[x];w[x]=w[R],w[R]=C}function e(w,x){return w<x?-1:w>x?1:0}var o=function(w){w===void 0&&(w=9),this._maxEntries=Math.max(4,w),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(w,x,R){if(!R)return x.indexOf(w);for(var C=0;C<x.length;C++)if(R(w,x[C]))return C;return-1}function l(w,x){p(w,0,w.children.length,x,w)}function p(w,x,R,C,F){F||(F=A(null)),F.minX=1/0,F.minY=1/0,F.maxX=-1/0,F.maxY=-1/0;for(var V=x;V<R;V++){var X=w.children[V];h(F,w.leaf?C(X):X)}return F}function h(w,x){return w.minX=Math.min(w.minX,x.minX),w.minY=Math.min(w.minY,x.minY),w.maxX=Math.max(w.maxX,x.maxX),w.maxY=Math.max(w.maxY,x.maxY),w}function g(w,x){return w.minX-x.minX}function m(w,x){return w.minY-x.minY}function _(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function E(w){return w.maxX-w.minX+(w.maxY-w.minY)}function S(w,x){return w.minX<=x.minX&&w.minY<=x.minY&&x.maxX<=w.maxX&&x.maxY<=w.maxY}function b(w,x){return x.minX<=w.maxX&&x.minY<=w.maxY&&x.maxX>=w.minX&&x.maxY>=w.minY}function A(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(w,x,R,C,F){for(var V=[x,R];V.length;)if(!((R=V.pop())-(x=V.pop())<=C)){var X=x+Math.ceil((R-x)/C/2)*C;n(w,X,x,R,F),V.push(x,X,X,R)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(w){var x=this.data,R=[];if(!b(w,x))return R;for(var C=this.toBBox,F=[];x;){for(var V=0;V<x.children.length;V++){var X=x.children[V],q=x.leaf?C(X):X;b(w,q)&&(x.leaf?R.push(X):S(w,q)?this._all(X,R):F.push(X))}x=F.pop()}return R},o.prototype.collides=function(w){var x=this.data;if(!b(w,x))return!1;for(var R=[];x;){for(var C=0;C<x.children.length;C++){var F=x.children[C],V=x.leaf?this.toBBox(F):F;if(b(w,V)){if(x.leaf||S(w,V))return!0;R.push(F)}}x=R.pop()}return!1},o.prototype.load=function(w){if(!w||!w.length)return this;if(w.length<this._minEntries){for(var x=0;x<w.length;x++)this.insert(w[x]);return this}var R=this._build(w.slice(),0,w.length-1,0);if(this.data.children.length)if(this.data.height===R.height)this._splitRoot(this.data,R);else{if(this.data.height<R.height){var C=this.data;this.data=R,R=C}this._insert(R,this.data.height-R.height-1,!0)}else this.data=R;return this},o.prototype.insert=function(w){return w&&this._insert(w,this.data.height-1),this},o.prototype.clear=function(){return this.data=A([]),this},o.prototype.remove=function(w,x){if(!w)return this;for(var R,C,F,V=this.data,X=this.toBBox(w),q=[],D=[];V||q.length;){if(V||(V=q.pop(),C=q[q.length-1],R=D.pop(),F=!0),V.leaf){var xt=s(w,V.children,x);if(xt!==-1)return V.children.splice(xt,1),q.push(V),this._condense(q),this}F||V.leaf||!S(V,X)?C?(R++,V=C.children[R],F=!1):V=null:(q.push(V),D.push(R),R=0,C=V,V=V.children[0])}return this},o.prototype.toBBox=function(w){return w},o.prototype.compareMinX=function(w,x){return w.minX-x.minX},o.prototype.compareMinY=function(w,x){return w.minY-x.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(w){return this.data=w,this},o.prototype._all=function(w,x){for(var R=[];w;)w.leaf?x.push.apply(x,w.children):R.push.apply(R,w.children),w=R.pop();return x},o.prototype._build=function(w,x,R,C){var F,V=R-x+1,X=this._maxEntries;if(V<=X)return l(F=A(w.slice(x,R+1)),this.toBBox),F;C||(C=Math.ceil(Math.log(V)/Math.log(X)),X=Math.ceil(V/Math.pow(X,C-1))),(F=A([])).leaf=!1,F.height=C;var q=Math.ceil(V/X),D=q*Math.ceil(Math.sqrt(X));I(w,x,R,D,this.compareMinX);for(var xt=x;xt<=R;xt+=D){var B=Math.min(xt+D-1,R);I(w,xt,B,q,this.compareMinY);for(var j=xt;j<=B;j+=q){var J=Math.min(j+q-1,B);F.children.push(this._build(w,j,J,C-1))}}return l(F,this.toBBox),F},o.prototype._chooseSubtree=function(w,x,R,C){for(;C.push(x),!x.leaf&&C.length-1!==R;){for(var F=1/0,V=1/0,X=void 0,q=0;q<x.children.length;q++){var D=x.children[q],xt=_(D),B=(j=w,J=D,(Math.max(J.maxX,j.maxX)-Math.min(J.minX,j.minX))*(Math.max(J.maxY,j.maxY)-Math.min(J.minY,j.minY))-xt);B<V?(V=B,F=xt<F?xt:F,X=D):B===V&&xt<F&&(F=xt,X=D)}x=X||x.children[0]}var j,J;return x},o.prototype._insert=function(w,x,R){var C=R?w:this.toBBox(w),F=[],V=this._chooseSubtree(C,this.data,x,F);for(V.children.push(w),h(V,C);x>=0&&F[x].children.length>this._maxEntries;)this._split(F,x),x--;this._adjustParentBBoxes(C,F,x)},o.prototype._split=function(w,x){var R=w[x],C=R.children.length,F=this._minEntries;this._chooseSplitAxis(R,F,C);var V=this._chooseSplitIndex(R,F,C),X=A(R.children.splice(V,R.children.length-V));X.height=R.height,X.leaf=R.leaf,l(R,this.toBBox),l(X,this.toBBox),x?w[x-1].children.push(X):this._splitRoot(R,X)},o.prototype._splitRoot=function(w,x){this.data=A([w,x]),this.data.height=w.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(w,x,R){for(var C,F,V,X,q,D,xt,B=1/0,j=1/0,J=x;J<=R-x;J++){var Dt=p(w,0,J,this.toBBox),Q=p(w,J,R,this.toBBox),At=(F=Dt,V=Q,X=void 0,q=void 0,D=void 0,xt=void 0,X=Math.max(F.minX,V.minX),q=Math.max(F.minY,V.minY),D=Math.min(F.maxX,V.maxX),xt=Math.min(F.maxY,V.maxY),Math.max(0,D-X)*Math.max(0,xt-q)),Mt=_(Dt)+_(Q);At<B?(B=At,C=J,j=Mt<j?Mt:j):At===B&&Mt<j&&(j=Mt,C=J)}return C||R-x},o.prototype._chooseSplitAxis=function(w,x,R){var C=w.leaf?this.compareMinX:g,F=w.leaf?this.compareMinY:m;this._allDistMargin(w,x,R,C)<this._allDistMargin(w,x,R,F)&&w.children.sort(C)},o.prototype._allDistMargin=function(w,x,R,C){w.children.sort(C);for(var F=this.toBBox,V=p(w,0,x,F),X=p(w,R-x,R,F),q=E(V)+E(X),D=x;D<R-x;D++){var xt=w.children[D];h(V,w.leaf?F(xt):xt),q+=E(V)}for(var B=R-x-1;B>=x;B--){var j=w.children[B];h(X,w.leaf?F(j):j),q+=E(X)}return q},o.prototype._adjustParentBBoxes=function(w,x,R){for(var C=R;C>=0;C--)h(x[C],w)},o.prototype._condense=function(w){for(var x=w.length-1,R=void 0;x>=0;x--)w[x].children.length===0?x>0?(R=w[x-1].children).splice(R.indexOf(w[x]),1):this.clear():l(w[x],this.toBBox)},o})});var PC=ot((qv,Hv)=>{(function(n,t){typeof qv=="object"&&typeof Hv!="undefined"?Hv.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.TinyQueue=t())})(qv,function(){"use strict";var n=function(o,s){if(o===void 0&&(o=[]),s===void 0&&(s=t),this.data=o,this.length=this.data.length,this.compare=s,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};n.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},n.prototype.pop=function(){if(this.length!==0){var o=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),o}},n.prototype.peek=function(){return this.data[0]},n.prototype._up=function(o){for(var s=this,l=s.data,p=s.compare,h=l[o];o>0;){var g=o-1>>1,m=l[g];if(p(h,m)>=0)break;l[o]=m,o=g}l[o]=h},n.prototype._down=function(o){for(var s=this,l=s.data,p=s.compare,h=this.length>>1,g=l[o];o<h;){var m=(o<<1)+1,_=l[m],E=m+1;if(E<this.length&&p(l[E],_)<0&&(m=E,_=l[E]),p(_,g)>=0)break;l[o]=_,o=m}l[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return n})});var RC=ot((uet,IC)=>{IC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=(s-o)/2,m=0,_=g-1;m<g;_=m++){var E=e[o+m*2+0],S=e[o+m*2+1],b=e[o+_*2+0],A=e[o+_*2+1],I=S>p!=A>p&&l<(b-E)*(p-S)/(A-S)+E;I&&(h=!h)}return h}});var NC=ot((cet,LC)=>{LC.exports=function(t,e,o,s){var l=t[0],p=t[1],h=!1;o===void 0&&(o=0),s===void 0&&(s=e.length);for(var g=s-o,m=0,_=g-1;m<g;_=m++){var E=e[m+o][0],S=e[m+o][1],b=e[_+o][0],A=e[_+o][1],I=S>p!=A>p&&l<(b-E)*(p-S)/(A-S)+E;I&&(h=!h)}return h}});var FC=ot((fet,Zd)=>{var OC=RC(),DC=NC();Zd.exports=function(t,e,o,s){return e.length>0&&Array.isArray(e[0])?DC(t,e,o,s):OC(t,e,o,s)};Zd.exports.nested=DC;Zd.exports.flat=OC});var BC=ot((Jd,UC)=>{(function(n,t){typeof Jd=="object"&&typeof UC!="undefined"?t(Jd):typeof define=="function"&&define.amd?define(["exports"],t):t((n=n||self).predicates={})})(Jd,function(n){"use strict";let e=33306690738754706e-32;function o(b,A,I,w,x){let R,C,F,V,X=A[0],q=w[0],D=0,xt=0;q>X==q>-X?(R=X,X=A[++D]):(R=q,q=w[++xt]);let B=0;if(D<b&&xt<I)for(q>X==q>-X?(F=R-((C=X+R)-X),X=A[++D]):(F=R-((C=q+R)-q),q=w[++xt]),R=C,F!==0&&(x[B++]=F);D<b&&xt<I;)q>X==q>-X?(F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D]):(F=R-((C=R+q)-(V=C-R))+(q-V),q=w[++xt]),R=C,F!==0&&(x[B++]=F);for(;D<b;)F=R-((C=R+X)-(V=C-R))+(X-V),X=A[++D],R=C,F!==0&&(x[B++]=F);for(;xt<I;)F=R-((C=R+q)-(V=C-R))+(q-V),q=w[++xt],R=C,F!==0&&(x[B++]=F);return R===0&&B!==0||(x[B++]=R),B}function s(b){return new Float64Array(b)}let l=33306690738754716e-32,p=22204460492503146e-32,h=11093356479670487e-47,g=s(4),m=s(8),_=s(12),E=s(16),S=s(4);n.orient2d=function(b,A,I,w,x,R){let C=(A-R)*(I-x),F=(b-x)*(w-R),V=C-F;if(C===0||F===0||C>0!=F>0)return V;let X=Math.abs(C+F);return Math.abs(V)>=l*X?V:-function(q,D,xt,B,j,J,Dt){let Q,At,Mt,Lt,pt,yt,K,Bt,Gt,ae,ut,Ut,jt,ce,te,$t,qt,xe,ft=q-j,Xe=xt-j,ee=D-J,ge=B-J;pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=ft*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=ee*Xe)-K*Gt-Bt*Gt-K*ae))),g[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),g[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,g[2]=Ut-(xe-pt)+(ut-pt),g[3]=xe;let fe=function(tt,z){let It=z[0];for(let Ot=1;Ot<tt;Ot++)It+=z[Ot];return It}(4,g),Te=p*Dt;if(fe>=Te||-fe>=Te||(Q=q-(ft+(pt=q-ft))+(pt-j),Mt=xt-(Xe+(pt=xt-Xe))+(pt-j),At=D-(ee+(pt=D-ee))+(pt-J),Lt=B-(ge+(pt=B-ge))+(pt-J),Q===0&&At===0&&Mt===0&&Lt===0)||(Te=h*Dt+e*Math.abs(fe),(fe+=ft*Lt+ge*Q-(ee*Mt+Xe*At))>=Te||-fe>=Te))return fe;pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=ge-(Gt=(yt=134217729*ge)-(yt-ge)))-((ce=Q*ge)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=Xe-(Gt=(yt=134217729*Xe)-(yt-Xe)))-(($t=At*Xe)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let be=o(4,g,4,S,m);pt=(te=(Bt=ft-(K=(yt=134217729*ft)-(yt-ft)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=ft*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=ee-(K=(yt=134217729*ee)-(yt-ee)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=ee*Mt)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Wt=o(be,m,4,S,_);pt=(te=(Bt=Q-(K=(yt=134217729*Q)-(yt-Q)))*(ae=Lt-(Gt=(yt=134217729*Lt)-(yt-Lt)))-((ce=Q*Lt)-K*Gt-Bt*Gt-K*ae))-(ut=te-(qt=(Bt=At-(K=(yt=134217729*At)-(yt-At)))*(ae=Mt-(Gt=(yt=134217729*Mt)-(yt-Mt)))-(($t=At*Mt)-K*Gt-Bt*Gt-K*ae))),S[0]=te-(ut+pt)+(pt-qt),pt=(jt=ce-((Ut=ce+ut)-(pt=Ut-ce))+(ut-pt))-(ut=jt-$t),S[1]=jt-(ut+pt)+(pt-$t),pt=(xe=Ut+ut)-Ut,S[2]=Ut-(xe-pt)+(ut-pt),S[3]=xe;let Me=o(Wt,_,4,S,E);return E[Me-1]}(b,A,I,w,x,R,X)},n.orient2dfast=function(b,A,I,w,x,R){return(A-R)*(I-x)-(b-x)*(w-R)},Object.defineProperty(n,"__esModule",{value:!0})})});var VC=ot((het,Yv)=>{"use strict";var zC=kv(),jd=PC(),RX=FC(),LX=BC().orient2d;jd.default&&(jd=jd.default);Yv.exports=HC;Yv.exports.default=HC;function HC(n,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=UX(n),s=new zC(16);s.toBBox=function(R){return{minX:R[0],minY:R[1],maxX:R[0],maxY:R[1]}},s.compareMinX=function(R,C){return R[0]-C[0]},s.compareMinY=function(R,C){return R[1]-C[1]},s.load(n);for(var l=[],p=0,h;p<o.length;p++){var g=o[p];s.remove(g),h=qC(g,h),l.push(h)}var m=new zC(16);for(p=0;p<l.length;p++)m.insert(Vv(l[p]));for(var _=t*t,E=e*e;l.length;){var S=l.shift(),b=S.p,A=S.next.p,I=Wv(b,A);if(!(I<E)){var w=I/_;g=NX(s,S.prev.p,b,A,S.next.next.p,w,m),g&&Math.min(Wv(g,b),Wv(g,A))<=w&&(l.push(S),l.push(qC(g,S)),s.remove(g),m.remove(S),m.insert(Vv(S)),m.insert(Vv(S.next)))}}S=h;var x=[];do x.push(S.p),S=S.next;while(S!==h);return x.push(S.p),x}function NX(n,t,e,o,s,l,p){for(var h=new jd([],OX),g=n.data;g;){for(var m=0;m<g.children.length;m++){var _=g.children[m],E=g.leaf?Xv(_,e,o):DX(e,o,_);E>l||h.push({node:_,dist:E})}for(;h.length&&!h.peek().node.children;){var S=h.pop(),b=S.node,A=Xv(b,t,e),I=Xv(b,o,s);if(S.dist<A&&S.dist<I&&kC(e,b,p)&&kC(o,b,p))return b}g=h.pop(),g&&(g=g.node)}return null}function OX(n,t){return n.dist-t.dist}function DX(n,t,e){if(GC(n,e)||GC(t,e))return 0;var o=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var s=Kd(n[0],n[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(s===0)return 0;var l=Kd(n[0],n[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var p=Kd(n[0],n[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,s,l,p)}function GC(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function kC(n,t,e){for(var o=Math.min(n[0],t[0]),s=Math.min(n[1],t[1]),l=Math.max(n[0],t[0]),p=Math.max(n[1],t[1]),h=e.search({minX:o,minY:s,maxX:l,maxY:p}),g=0;g<h.length;g++)if(FX(h[g].p,h[g].next.p,n,t))return!1;return!0}function $c(n,t,e){return LX(n[0],n[1],t[0],t[1],e[0],e[1])}function FX(n,t,e,o){return n!==o&&t!==e&&$c(n,t,e)>0!=$c(n,t,o)>0&&$c(e,o,n)>0!=$c(e,o,t)>0}function Vv(n){var t=n.p,e=n.next.p;return n.minX=Math.min(t[0],e[0]),n.minY=Math.min(t[1],e[1]),n.maxX=Math.max(t[0],e[0]),n.maxY=Math.max(t[1],e[1]),n}function UX(n){for(var t=n[0],e=n[0],o=n[0],s=n[0],l=0;l<n.length;l++){var p=n[l];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>s[1]&&(s=p)}var h=[t,e,o,s],g=h.slice();for(l=0;l<n.length;l++)RX(n[l],h)||g.push(n[l]);return zX(g)}function qC(n,t){var e={p:n,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Wv(n,t){var e=n[0]-t[0],o=n[1]-t[1];return e*e+o*o}function Xv(n,t,e){var o=t[0],s=t[1],l=e[0]-o,p=e[1]-s;if(l!==0||p!==0){var h=((n[0]-o)*l+(n[1]-s)*p)/(l*l+p*p);h>1?(o=e[0],s=e[1]):h>0&&(o+=l*h,s+=p*h)}return l=n[0]-o,p=n[1]-s,l*l+p*p}function Kd(n,t,e,o,s,l,p,h){var g=e-n,m=o-t,_=p-s,E=h-l,S=n-s,b=t-l,A=g*g+m*m,I=g*_+m*E,w=_*_+E*E,x=g*S+m*b,R=_*S+E*b,C=A*w-I*I,F,V,X,q,D=C,xt=C;C===0?(V=0,D=1,q=R,xt=w):(V=I*R-w*x,q=A*R-I*x,V<0?(V=0,q=R,xt=w):V>D&&(V=D,q=R+I,xt=w)),q<0?(q=0,-x<0?V=0:-x>A?V=D:(V=-x,D=A)):q>xt&&(q=xt,-x+I<0?V=0:-x+I>A?V=D:(V=-x+I,D=A)),F=V===0?0:V/D,X=q===0?0:q/xt;var B=(1-F)*n+F*e,j=(1-F)*t+F*o,J=(1-X)*s+X*p,Dt=(1-X)*l+X*h,Q=J-B,At=Dt-j;return Q*Q+At*At}function BX(n,t){return n[0]===t[0]?n[1]-t[1]:n[0]-t[0]}function zX(n){n.sort(BX);for(var t=[],e=0;e<n.length;e++){for(;t.length>=2&&$c(t[t.length-2],t[t.length-1],n[e])<=0;)t.pop();t.push(n[e])}for(var o=[],s=n.length-1;s>=0;s--){for(;o.length>=2&&$c(o[o.length-2],o[o.length-1],n[s])<=0;)o.pop();o.push(n[s])}return o.pop(),t.pop(),t.concat(o)}});var JC=ot((Zv,Jv)=>{(function(n,t){typeof Zv=="object"&&typeof Jv!="undefined"?Jv.exports=t():typeof define=="function"&&define.amd?define(t):n.quickselect=t()})(Zv,function(){"use strict";function n(s,l,p,h,g){t(s,l,p||0,h||s.length-1,g||o)}function t(s,l,p,h,g){for(;h>p;){if(h-p>600){var m=h-p+1,_=l-p+1,E=Math.log(m),S=.5*Math.exp(2*E/3),b=.5*Math.sqrt(E*S*(m-S)/m)*(_-m/2<0?-1:1),A=Math.max(p,Math.floor(l-_*S/m+b)),I=Math.min(h,Math.floor(l+(m-_)*S/m+b));t(s,l,A,I,g)}var w=s[l],x=p,R=h;for(e(s,p,l),g(s[h],w)>0&&e(s,p,h);x<R;){for(e(s,x,R),x++,R--;g(s[x],w)<0;)x++;for(;g(s[R],w)>0;)R--}g(s[p],w)===0?e(s,p,R):(R++,e(s,R,h)),R<=l&&(p=R+1),l<=R&&(h=R-1)}}function e(s,l,p){var h=s[l];s[l]=s[p],s[p]=h}function o(s,l){return s<l?-1:s>l?1:0}return n})});var t_=ot((zrt,Qv)=>{"use strict";Qv.exports=fh;Qv.exports.default=fh;var jX=JC();function fh(n,t){if(!(this instanceof fh))return new fh(n,t);this._maxEntries=Math.max(4,n||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}fh.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,e=[],o=this.toBBox;if(!tg(n,t))return e;for(var s=[],l,p,h,g;t;){for(l=0,p=t.children.length;l<p;l++)h=t.children[l],g=t.leaf?o(h):h,tg(n,g)&&(t.leaf?e.push(h):jv(n,g)?this._all(h,e):s.push(h));t=s.pop()}return e},collides:function(n){var t=this.data,e=this.toBBox;if(!tg(n,t))return!1;for(var o=[],s,l,p,h;t;){for(s=0,l=t.children.length;s<l;s++)if(p=t.children[s],h=t.leaf?e(p):p,tg(n,h)){if(t.leaf||jv(n,h))return!0;o.push(p)}t=o.pop()}return!1},load:function(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(var t=0,e=n.length;t<e;t++)this.insert(n[t]);return this}var o=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var s=this.data;this.data=o,o=s}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=Kc([]),this},remove:function(n,t){if(!n)return this;for(var e=this.data,o=this.toBBox(n),s=[],l=[],p,h,g,m;e||s.length;){if(e||(e=s.pop(),h=s[s.length-1],p=l.pop(),m=!0),e.leaf&&(g=QX(n,e.children,t),g!==-1))return e.children.splice(g,1),s.push(e),this._condense(s),this;!m&&!e.leaf&&jv(e,o)?(s.push(e),l.push(p),p=0,h=e,e=e.children[0]):h?(p++,e=h.children[p],m=!1):e=null}return this},toBBox:function(n){return n},compareMinX:KC,compareMinY:jC,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var e=[];n;)n.leaf?t.push.apply(t,n.children):e.push.apply(e,n.children),n=e.pop();return t},_build:function(n,t,e,o){var s=e-t+1,l=this._maxEntries,p;if(s<=l)return p=Kc(n.slice(t,e+1)),Jc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(s)/Math.log(l)),l=Math.ceil(s/Math.pow(l,o-1))),p=Kc([]),p.leaf=!1,p.height=o;var h=Math.ceil(s/l),g=h*Math.ceil(Math.sqrt(l)),m,_,E,S;for(QC(n,t,e,g,this.compareMinX),m=t;m<=e;m+=g)for(E=Math.min(m+g-1,e),QC(n,m,E,h,this.compareMinY),_=m;_<=E;_+=h)S=Math.min(_+h-1,E),p.children.push(this._build(n,_,S,o-1));return Jc(p,this.toBBox),p},_chooseSubtree:function(n,t,e,o){for(var s,l,p,h,g,m,_,E;o.push(t),!(t.leaf||o.length-1===e);){for(_=E=1/0,s=0,l=t.children.length;s<l;s++)p=t.children[s],g=Kv(p),m=t7(n,p)-g,m<E?(E=m,_=g<_?g:_,h=p):m===E&&g<_&&(_=g,h=p);t=h||t.children[0]}return t},_insert:function(n,t,e){var o=this.toBBox,s=e?n:o(n),l=[],p=this._chooseSubtree(s,this.data,t,l);for(p.children.push(n),ch(p,s);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(s,l,t)},_split:function(n,t){var e=n[t],o=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,o);var l=this._chooseSplitIndex(e,s,o),p=Kc(e.children.splice(l,e.children.length-l));p.height=e.height,p.leaf=e.leaf,Jc(e,this.toBBox),Jc(p,this.toBBox),t?n[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(n,t){this.data=Kc([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Jc(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,e){var o,s,l,p,h,g,m,_;for(g=m=1/0,o=t;o<=e-t;o++)s=lh(n,0,o,this.toBBox),l=lh(n,o,e,this.toBBox),p=e7(s,l),h=Kv(s)+Kv(l),p<g?(g=p,_=o,m=h<m?h:m):p===g&&h<m&&(m=h,_=o);return _},_chooseSplitAxis:function(n,t,e){var o=n.leaf?this.compareMinX:KC,s=n.leaf?this.compareMinY:jC,l=this._allDistMargin(n,t,e,o),p=this._allDistMargin(n,t,e,s);l<p&&n.children.sort(o)},_allDistMargin:function(n,t,e,o){n.children.sort(o);var s=this.toBBox,l=lh(n,0,t,s),p=lh(n,e-t,e,s),h=Qd(l)+Qd(p),g,m;for(g=t;g<e-t;g++)m=n.children[g],ch(l,n.leaf?s(m):m),h+=Qd(l);for(g=e-t-1;g>=t;g--)m=n.children[g],ch(p,n.leaf?s(m):m),h+=Qd(p);return h},_adjustParentBBoxes:function(n,t,e){for(var o=e;o>=0;o--)ch(t[o],n)},_condense:function(n){for(var t=n.length-1,e;t>=0;t--)n[t].children.length===0?t>0?(e=n[t-1].children,e.splice(e.indexOf(n[t]),1)):this.clear():Jc(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0])),this.compareMinY=new Function("a","b",t.join(n[1])),this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};function QX(n,t,e){if(!e)return t.indexOf(n);for(var o=0;o<t.length;o++)if(e(n,t[o]))return o;return-1}function Jc(n,t){lh(n,0,n.children.length,t,n)}function lh(n,t,e,o,s){s||(s=Kc(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var l=t,p;l<e;l++)p=n.children[l],ch(s,n.leaf?o(p):p);return s}function ch(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function KC(n,t){return n.minX-t.minX}function jC(n,t){return n.minY-t.minY}function Kv(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Qd(n){return n.maxX-n.minX+(n.maxY-n.minY)}function t7(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}function e7(n,t){var e=Math.max(n.minX,t.minX),o=Math.max(n.minY,t.minY),s=Math.min(n.maxX,t.maxX),l=Math.min(n.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,l-o)}function jv(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function tg(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function Kc(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function QC(n,t,e,o,s){for(var l=[t,e],p;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,jX(n,p,t,e,s),l.push(t,p,p,e))}});var oP=ot((jit,s_)=>{"use strict";s_.exports=ig;s_.exports.default=ig;function ig(n,t,e){e=e||2;var o=t&&t.length,s=o?t[0]*e:n.length,l=nP(n,0,s,e,!0),p=[];if(!l||l.next===l.prev)return p;var h,g,m,_,E,S,b;if(o&&(l=f7(n,t,l,e)),n.length>80*e){h=m=n[0],g=_=n[1];for(var A=e;A<s;A+=e)E=n[A],S=n[A+1],E<h&&(h=E),S<g&&(g=S),E>m&&(m=E),S>_&&(_=S);b=Math.max(m-h,_-g),b=b!==0?32767/b:0}return dh(l,p,e,h,g,b,0),p}function nP(n,t,e,o,s){var l,p;if(s===o_(n,t,e,o)>0)for(l=t;l<e;l+=o)p=eP(l,n[l],n[l+1],p);else for(l=e-o;l>=t;l-=o)p=eP(l,n[l],n[l+1],p);return p&&og(p,p.next)&&(mh(p),p=p.next),p}function kl(n,t){if(!n)return n;t||(t=n);var e=n,o;do if(o=!1,!e.steiner&&(og(e,e.next)||Hr(e.prev,e,e.next)===0)){if(mh(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function dh(n,t,e,o,s,l,p){if(n){!p&&l&&m7(n,o,s,l);for(var h=n,g,m;n.prev!==n.next;){if(g=n.prev,m=n.next,l?u7(n,o,s,l):a7(n)){t.push(g.i/e|0),t.push(n.i/e|0),t.push(m.i/e|0),mh(n),n=m.next,h=m.next;continue}if(n=m,n===h){p?p===1?(n=l7(kl(n),t,e),dh(n,t,e,o,s,l,2)):p===2&&c7(n,t,e,o,s,l):dh(kl(n),t,e,o,s,l,1);break}}}}function a7(n){var t=n.prev,e=n,o=n.next;if(Hr(t,e,o)>=0)return!1;for(var s=t.x,l=e.x,p=o.x,h=t.y,g=e.y,m=o.y,_=s<l?s<p?s:p:l<p?l:p,E=h<g?h<m?h:m:g<m?g:m,S=s>l?s>p?s:p:l>p?l:p,b=h>g?h>m?h:m:g>m?g:m,A=o.next;A!==t;){if(A.x>=_&&A.x<=S&&A.y>=E&&A.y<=b&&tf(s,h,l,g,p,m,A.x,A.y)&&Hr(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function u7(n,t,e,o){var s=n.prev,l=n,p=n.next;if(Hr(s,l,p)>=0)return!1;for(var h=s.x,g=l.x,m=p.x,_=s.y,E=l.y,S=p.y,b=h<g?h<m?h:m:g<m?g:m,A=_<E?_<S?_:S:E<S?E:S,I=h>g?h>m?h:m:g>m?g:m,w=_>E?_>S?_:S:E>S?E:S,x=r_(b,A,t,e,o),R=r_(I,w,t,e,o),C=n.prevZ,F=n.nextZ;C&&C.z>=x&&F&&F.z<=R;){if(C.x>=b&&C.x<=I&&C.y>=A&&C.y<=w&&C!==s&&C!==p&&tf(h,_,g,E,m,S,C.x,C.y)&&Hr(C.prev,C,C.next)>=0||(C=C.prevZ,F.x>=b&&F.x<=I&&F.y>=A&&F.y<=w&&F!==s&&F!==p&&tf(h,_,g,E,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0))return!1;F=F.nextZ}for(;C&&C.z>=x;){if(C.x>=b&&C.x<=I&&C.y>=A&&C.y<=w&&C!==s&&C!==p&&tf(h,_,g,E,m,S,C.x,C.y)&&Hr(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;F&&F.z<=R;){if(F.x>=b&&F.x<=I&&F.y>=A&&F.y<=w&&F!==s&&F!==p&&tf(h,_,g,E,m,S,F.x,F.y)&&Hr(F.prev,F,F.next)>=0)return!1;F=F.nextZ}return!0}function l7(n,t,e){var o=n;do{var s=o.prev,l=o.next.next;!og(s,l)&&rP(s,o,o.next,l)&&gh(s,l)&&gh(l,s)&&(t.push(s.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),mh(o),mh(o.next),o=n=l),o=o.next}while(o!==n);return kl(o)}function c7(n,t,e,o,s,l){var p=n;do{for(var h=p.next.next;h!==p.prev;){if(p.i!==h.i&&_7(p,h)){var g=iP(p,h);p=kl(p,p.next),g=kl(g,g.next),dh(p,t,e,o,s,l,0),dh(g,t,e,o,s,l,0);return}h=h.next}p=p.next}while(p!==n)}function f7(n,t,e,o){var s=[],l,p,h,g,m;for(l=0,p=t.length;l<p;l++)h=t[l]*o,g=l<p-1?t[l+1]*o:n.length,m=nP(n,h,g,o,!1),m===m.next&&(m.steiner=!0),s.push(v7(m));for(s.sort(h7),l=0;l<s.length;l++)e=p7(s[l],e);return e}function h7(n,t){return n.x-t.x}function p7(n,t){var e=d7(n,t);if(!e)return t;var o=iP(e,n);return kl(o,o.next),kl(e,e.next)}function d7(n,t){var e=t,o=n.x,s=n.y,l=-1/0,p;do{if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=o&&h>l&&(l=h,p=e.x<e.next.x?e:e.next,h===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,m=p.x,_=p.y,E=1/0,S;e=p;do o>=e.x&&e.x>=m&&o!==e.x&&tf(s<_?o:l,s,m,_,s<_?l:o,s,e.x,e.y)&&(S=Math.abs(s-e.y)/(o-e.x),gh(e,n)&&(S<E||S===E&&(e.x>p.x||e.x===p.x&&g7(p,e)))&&(p=e,E=S)),e=e.next;while(e!==g);return p}function g7(n,t){return Hr(n.prev,n,t.prev)<0&&Hr(t.next,n,n.next)<0}function m7(n,t,e,o){var s=n;do s.z===0&&(s.z=r_(s.x,s.y,t,e,o)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,y7(s)}function y7(n){var t,e,o,s,l,p,h,g,m=1;do{for(e=n,n=null,l=null,p=0;e;){for(p++,o=e,h=0,t=0;t<m&&(h++,o=o.nextZ,!!o);t++);for(g=m;h>0||g>0&&o;)h!==0&&(g===0||!o||e.z<=o.z)?(s=e,e=e.nextZ,h--):(s=o,o=o.nextZ,g--),l?l.nextZ=s:n=s,s.prevZ=l,l=s;e=o}l.nextZ=null,m*=2}while(p>1);return n}function r_(n,t,e,o,s){return n=(n-e)*s|0,t=(t-o)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function v7(n){var t=n,e=n;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==n);return e}function tf(n,t,e,o,s,l,p,h){return(s-p)*(t-h)>=(n-p)*(l-h)&&(n-p)*(o-h)>=(e-p)*(t-h)&&(e-p)*(l-h)>=(s-p)*(o-h)}function _7(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!x7(n,t)&&(gh(n,t)&&gh(t,n)&&E7(n,t)&&(Hr(n.prev,n,t.prev)||Hr(n,t.prev,t))||og(n,t)&&Hr(n.prev,n,n.next)>0&&Hr(t.prev,t,t.next)>0)}function Hr(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function og(n,t){return n.x===t.x&&n.y===t.y}function rP(n,t,e,o){var s=rg(Hr(n,t,e)),l=rg(Hr(n,t,o)),p=rg(Hr(e,o,n)),h=rg(Hr(e,o,t));return!!(s!==l&&p!==h||s===0&&ng(n,e,t)||l===0&&ng(n,o,t)||p===0&&ng(e,n,o)||h===0&&ng(e,t,o))}function ng(n,t,e){return t.x<=Math.max(n.x,e.x)&&t.x>=Math.min(n.x,e.x)&&t.y<=Math.max(n.y,e.y)&&t.y>=Math.min(n.y,e.y)}function rg(n){return n>0?1:n<0?-1:0}function x7(n,t){var e=n;do{if(e.i!==n.i&&e.next.i!==n.i&&e.i!==t.i&&e.next.i!==t.i&&rP(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function gh(n,t){return Hr(n.prev,n,n.next)<0?Hr(n,t,n.next)>=0&&Hr(n,n.prev,t)>=0:Hr(n,t,n.prev)<0||Hr(n,n.next,t)<0}function E7(n,t){var e=n,o=!1,s=(n.x+t.x)/2,l=(n.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&s<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==n);return o}function iP(n,t){var e=new i_(n.i,n.x,n.y),o=new i_(t.i,t.x,t.y),s=n.next,l=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function eP(n,t,e,o){var s=new i_(n,t,e);return o?(s.next=o.next,s.prev=o,o.next.prev=s,o.next=s):(s.prev=s,s.next=s),s}function mh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function i_(n,t,e){this.i=n,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ig.deviation=function(n,t,e,o){var s=t&&t.length,l=s?t[0]*e:n.length,p=Math.abs(o_(n,0,l,e));if(s)for(var h=0,g=t.length;h<g;h++){var m=t[h]*e,_=h<g-1?t[h+1]*e:n.length;p-=Math.abs(o_(n,m,_,e))}var E=0;for(h=0;h<o.length;h+=3){var S=o[h]*e,b=o[h+1]*e,A=o[h+2]*e;E+=Math.abs((n[S]-n[A])*(n[b+1]-n[S+1])-(n[S]-n[b])*(n[A+1]-n[S+1]))}return p===0&&E===0?0:Math.abs((E-p)/p)};function o_(n,t,e,o){for(var s=0,l=t,p=e-o;l<e;l+=o)s+=(n[p]-n[l])*(n[l+1]+n[p+1]),p=l;return s}ig.flatten=function(n){for(var t=n[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,s=0;s<n.length;s++){for(var l=0;l<n[s].length;l++)for(var p=0;p<t;p++)e.vertices.push(n[s][l][p]);s>0&&(o+=n[s-1].length,e.holes.push(o))}return e}});var f_=ot(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.earthRadius=63710088e-1;Oe.factors={centimeters:Oe.earthRadius*100,centimetres:Oe.earthRadius*100,degrees:Oe.earthRadius/111325,feet:Oe.earthRadius*3.28084,inches:Oe.earthRadius*39.37,kilometers:Oe.earthRadius/1e3,kilometres:Oe.earthRadius/1e3,meters:Oe.earthRadius,metres:Oe.earthRadius,miles:Oe.earthRadius/1609.344,millimeters:Oe.earthRadius*1e3,millimetres:Oe.earthRadius*1e3,nauticalmiles:Oe.earthRadius/1852,radians:1,yards:Oe.earthRadius*1.0936};Oe.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Oe.earthRadius,yards:1.0936133};Oe.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function nl(n,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=n,o}Oe.feature=nl;function S7(n,t,e){switch(e===void 0&&(e={}),n){case"Point":return a_(t).geometry;case"LineString":return l_(t).geometry;case"Polygon":return u_(t).geometry;case"MultiPoint":return aP(t).geometry;case"MultiLineString":return sP(t).geometry;case"MultiPolygon":return uP(t).geometry;default:throw new Error(n+" is invalid")}}Oe.geometry=S7;function a_(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!sg(n[0])||!sg(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return nl(o,t,e)}Oe.point=a_;function M7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return a_(o,t)}),e)}Oe.points=M7;function u_(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return nl(h,t,e)}Oe.polygon=u_;function b7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return u_(o,t)}),e)}Oe.polygons=b7;function l_(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return nl(o,t,e)}Oe.lineString=l_;function A7(n,t,e){return e===void 0&&(e={}),ag(n.map(function(o){return l_(o,t)}),e)}Oe.lineStrings=A7;function ag(n,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=n,e}Oe.featureCollection=ag;function sP(n,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:n};return nl(o,t,e)}Oe.multiLineString=sP;function aP(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return nl(o,t,e)}Oe.multiPoint=aP;function uP(n,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:n};return nl(o,t,e)}Oe.multiPolygon=uP;function T7(n,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:n};return nl(o,t,e)}Oe.geometryCollection=T7;function C7(n,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(n*e)/e}Oe.round=C7;function lP(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n*e}Oe.radiansToLength=lP;function c_(n,t){t===void 0&&(t="kilometers");var e=Oe.factors[t];if(!e)throw new Error(t+" units is invalid");return n/e}Oe.lengthToRadians=c_;function P7(n,t){return cP(c_(n,t))}Oe.lengthToDegrees=P7;function I7(n){var t=n%360;return t<0&&(t+=360),t}Oe.bearingToAzimuth=I7;function cP(n){var t=n%(2*Math.PI);return t*180/Math.PI}Oe.radiansToDegrees=cP;function R7(n){var t=n%360;return t*Math.PI/180}Oe.degreesToRadians=R7;function L7(n,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("length must be a positive number");return lP(c_(n,t),e)}Oe.convertLength=L7;function N7(n,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(n>=0))throw new Error("area must be a positive number");var o=Oe.areaFactors[t];if(!o)throw new Error("invalid original units");var s=Oe.areaFactors[e];if(!s)throw new Error("invalid final units");return n/o*s}Oe.convertArea=N7;function sg(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}Oe.isNumber=sg;function O7(n){return!!n&&n.constructor===Object}Oe.isObject=O7;function D7(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(n.length!==4&&n.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(t){if(!sg(t))throw new Error("bbox must only contain numbers")})}Oe.validateBBox=D7;function F7(n){if(!n)throw new Error("id is required");if(["string","number"].indexOf(typeof n)===-1)throw new Error("id must be a number or a string")}Oe.validateId=F7});var p_=ot(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var co=f_();function yh(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,_=0,E=0,S,b=n.type,A=b==="FeatureCollection",I=b==="Feature",w=A?n.features.length:1,x=0;x<w;x++){m=A?n.features[x].geometry:I?n.geometry:n,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=S?m.geometries[R]:m,p!==null){g=p.coordinates;var V=p.type;switch(_=e&&(V==="Polygon"||V==="MultiPolygon")?1:0,V){case null:break;case"Point":if(t(g,E,x,C,F)===!1)return!1;E++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],E,x,C,F)===!1)return!1;E++,V==="MultiPoint"&&C++}V==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-_;s++){if(t(g[o][s],E,x,C,F)===!1)return!1;E++}V==="MultiLineString"&&C++,V==="Polygon"&&F++}V==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-_;l++){if(t(g[o][s][l],E,x,C,F)===!1)return!1;E++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(yh(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function U7(n,t,e,o){var s=e;return yh(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function fP(n,t){var e;switch(n.type){case"FeatureCollection":for(e=0;e<n.features.length&&t(n.features[e].properties,e)!==!1;e++);break;case"Feature":t(n.properties,0);break}}function B7(n,t,e){var o=e;return fP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function hP(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e<n.features.length&&t(n.features[e],e)!==!1;e++);}function z7(n,t,e){var o=e;return hP(n,function(s,l){l===0&&e===void 0?o=s:o=t(o,s,l)}),o}function G7(n){var t=[];return yh(n,function(e){t.push(e)}),t}function h_(n,t){var e,o,s,l,p,h,g,m,_,E,S=0,b=n.type==="FeatureCollection",A=n.type==="Feature",I=b?n.features.length:1;for(e=0;e<I;e++){for(h=b?n.features[e].geometry:A?n.geometry:n,m=b?n.features[e].properties:A?n.properties:{},_=b?n.features[e].bbox:A?n.bbox:void 0,E=b?n.features[e].id:A?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,S,m,_,E)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,S,m,_,E)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],S,m,_,E)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}function k7(n,t,e){var o=e;return h_(n,function(s,l,p,h,g){l===0&&e===void 0?o=s:o=t(o,s,l,p,h,g)}),o}function ug(n,t){h_(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(co.feature(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var _=e.coordinates[m],E={type:g,coordinates:_};if(t(co.feature(E,s),o,m)===!1)return!1}})}function q7(n,t,e){var o=e;return ug(n,function(s,l,p){l===0&&p===0&&e===void 0?o=s:o=t(o,s,l,p)}),o}function pP(n,t){ug(n,function(e,o,s){var l=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var h,g=0,m=0,_=0;if(yh(e,function(E,S,b,A,I){if(h===void 0||o>g||A>m||I>_){h=E,g=o,m=A,_=I,l=0;return}var w=co.lineString([h,E],e.properties);if(t(w,o,s,I,l)===!1)return!1;l++,h=E})===!1)return!1}}})}function H7(n,t,e){var o=e,s=!1;return pP(n,function(l,p,h,g,m){s===!1&&e===void 0?o=l:o=t(o,l,p,h,g,m),s=!0}),o}function dP(n,t){if(!n)throw new Error("geojson is required");ug(n,function(e,o,s){if(e.geometry!==null){var l=e.geometry.type,p=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,s,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<p.length;h++)if(t(co.lineString(p[h],e.properties),o,s,h)===!1)return!1;break}}})}function V7(n,t,e){var o=e;return dP(n,function(s,l,p,h){l===0&&e===void 0?o=s:o=t(o,s,l,p,h)}),o}function W7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.segmentIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=g.length+l-1),co.lineString([g[l],g[l+1]],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l-1),co.lineString([g[s][l],g[s][l+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l-1),co.lineString([g[o][l],g[o][l+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l-1),co.lineString([g[o][s][l],g[o][s][l+1]],p,t)}throw new Error("geojson is invalid")}function X7(n,t){if(t=t||{},!co.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,s=t.geometryIndex||0,l=t.coordIndex||0,p=t.properties,h;switch(n.type){case"FeatureCollection":e<0&&(e=n.features.length+e),p=p||n.features[e].properties,h=n.features[e].geometry;break;case"Feature":p=p||n.properties,h=n.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=n;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var g=h.coordinates;switch(h.type){case"Point":return co.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),co.point(g[o],p,t);case"LineString":return l<0&&(l=g.length+l),co.point(g[l],p,t);case"Polygon":return s<0&&(s=g.length+s),l<0&&(l=g[s].length+l),co.point(g[s][l],p,t);case"MultiLineString":return o<0&&(o=g.length+o),l<0&&(l=g[o].length+l),co.point(g[o][l],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),s<0&&(s=g[o].length+s),l<0&&(l=g[o][s].length-l),co.point(g[o][s][l],p,t)}throw new Error("geojson is invalid")}Si.coordAll=G7;Si.coordEach=yh;Si.coordReduce=U7;Si.featureEach=hP;Si.featureReduce=z7;Si.findPoint=X7;Si.findSegment=W7;Si.flattenEach=ug;Si.flattenReduce=q7;Si.geomEach=h_;Si.geomReduce=k7;Si.lineEach=dP;Si.lineReduce=V7;Si.propEach=fP;Si.propReduce=B7;Si.segmentEach=pP;Si.segmentReduce=H7});var gP=ot(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var Y7=p_();function d_(n){var t=[1/0,1/0,-1/0,-1/0];return Y7.coordEach(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}d_.default=d_;g_.default=d_});var lg=ot((dot,m_)=>{var Ra=kv(),yP=f_(),vP=p_(),ef=gP().default,$7=vP.featureEach,hot=vP.coordEach,pot=yP.polygon,mP=yP.featureCollection;function _P(n){var t=new Ra(n);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ef(e),Ra.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}):$7(e,function(s){if(s.type!=="Feature")throw new Error("invalid features");s.bbox=s.bbox?s.bbox:ef(s),o.push(s)}),Ra.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:ef(e),Ra.prototype.remove.call(this,e,o)},t.clear=function(){return Ra.prototype.clear.call(this)},t.search=function(e){var o=Ra.prototype.search.call(this,this.toBBox(e));return mP(o)},t.collides=function(e){return Ra.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Ra.prototype.all.call(this);return mP(e)},t.toJSON=function(){return Ra.prototype.toJSON.call(this)},t.fromJSON=function(e){return Ra.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=ef(e);else if(e.type==="FeatureCollection")o=ef(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}m_.exports=_P;m_.exports.default=_P});var w_=ot((Sat,PP)=>{"use strict";var CP=Object.prototype.toString;PP.exports=function(t){var e=CP.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&CP.call(t.callee)==="[object Function]"),o}});var BP=ot((Mat,UP)=>{"use strict";var FP;Object.keys||(xh=Object.prototype.hasOwnProperty,S_=Object.prototype.toString,IP=w_(),M_=Object.prototype.propertyIsEnumerable,RP=!M_.call({toString:null},"toString"),LP=M_.call(function(){},"prototype"),Eh=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dg=function(n){var t=n.constructor;return t&&t.prototype===n},NP={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},OP=function(){if(typeof window=="undefined")return!1;for(var n in window)try{if(!NP["$"+n]&&xh.call(window,n)&&window[n]!==null&&typeof window[n]=="object")try{dg(window[n])}catch(t){return!0}}catch(t){return!0}return!1}(),DP=function(n){if(typeof window=="undefined"||!OP)return dg(n);try{return dg(n)}catch(t){return!1}},FP=function(t){var e=t!==null&&typeof t=="object",o=S_.call(t)==="[object Function]",s=IP(t),l=e&&S_.call(t)==="[object String]",p=[];if(!e&&!o&&!s)throw new TypeError("Object.keys called on a non-object");var h=LP&&o;if(l&&t.length>0&&!xh.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(s&&t.length>0)for(var m=0;m<t.length;++m)p.push(String(m));else for(var _ in t)!(h&&_==="prototype")&&xh.call(t,_)&&p.push(String(_));if(RP)for(var E=DP(t),S=0;S<Eh.length;++S)!(E&&Eh[S]==="constructor")&&xh.call(t,Eh[S])&&p.push(Eh[S]);return p});var xh,S_,IP,M_,RP,LP,Eh,dg,NP,OP,DP;UP.exports=FP});var b_=ot((bat,kP)=>{"use strict";var iY=Array.prototype.slice,oY=w_(),zP=Object.keys,gg=zP?function(t){return zP(t)}:BP(),GP=Object.keys;gg.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return oY(o)?GP(iY.call(o)):GP(o)})}else Object.keys=gg;return Object.keys||gg};kP.exports=gg});var A_=ot((Aat,qP)=>{"use strict";qP.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var s=42;t[e]=s;for(var l in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==s||h.enumerable!==!0)return!1}return!0}});var mg=ot((Tat,HP)=>{"use strict";var sY=A_();HP.exports=function(){return sY()&&!!Symbol.toStringTag}});var T_=ot((Cat,VP)=>{"use strict";VP.exports=Object});var C_=ot((Pat,WP)=>{"use strict";WP.exports=Error});var YP=ot((Iat,XP)=>{"use strict";XP.exports=EvalError});var ZP=ot((Rat,$P)=>{"use strict";$P.exports=RangeError});var KP=ot((Lat,JP)=>{"use strict";JP.exports=ReferenceError});var P_=ot((Nat,jP)=>{"use strict";jP.exports=SyntaxError});var ql=ot((Oat,QP)=>{"use strict";QP.exports=TypeError});var eI=ot((Dat,tI)=>{"use strict";tI.exports=URIError});var rI=ot((Fat,nI)=>{"use strict";nI.exports=Math.abs});var oI=ot((Uat,iI)=>{"use strict";iI.exports=Math.floor});var aI=ot((Bat,sI)=>{"use strict";sI.exports=Math.max});var lI=ot((zat,uI)=>{"use strict";uI.exports=Math.min});var fI=ot((Gat,cI)=>{"use strict";cI.exports=Math.pow});var pI=ot((kat,hI)=>{"use strict";hI.exports=Math.round});var gI=ot((qat,dI)=>{"use strict";dI.exports=Number.isNaN||function(t){return t!==t}});var yI=ot((Hat,mI)=>{"use strict";var aY=gI();mI.exports=function(t){return aY(t)||t===0?t:t<0?-1:1}});var _I=ot((Vat,vI)=>{"use strict";vI.exports=Object.getOwnPropertyDescriptor});var Hl=ot((Wat,xI)=>{"use strict";var yg=_I();if(yg)try{yg([],"length")}catch(n){yg=null}xI.exports=yg});var wh=ot((Xat,EI)=>{"use strict";var vg=Object.defineProperty||!1;if(vg)try{vg({},"a",{value:1})}catch(n){vg=!1}EI.exports=vg});var MI=ot((Yat,SI)=>{"use strict";var wI=typeof Symbol!="undefined"&&Symbol,uY=A_();SI.exports=function(){return typeof wI!="function"||typeof Symbol!="function"||typeof wI("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:uY()}});var I_=ot(($at,bI)=>{"use strict";bI.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var R_=ot((Zat,AI)=>{"use strict";var lY=T_();AI.exports=lY.getPrototypeOf||null});var PI=ot((Jat,CI)=>{"use strict";var cY="Function.prototype.bind called on incompatible ",fY=Object.prototype.toString,hY=Math.max,pY="[object Function]",TI=function(t,e){for(var o=[],s=0;s<t.length;s+=1)o[s]=t[s];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},dY=function(t,e){for(var o=[],s=e||0,l=0;s<t.length;s+=1,l+=1)o[l]=t[s];return o},gY=function(n,t){for(var e="",o=0;o<n.length;o+=1)e+=n[o],o+1<n.length&&(e+=t);return e};CI.exports=function(t){var e=this;if(typeof e!="function"||fY.apply(e)!==pY)throw new TypeError(cY+e);for(var o=dY(arguments,1),s,l=function(){if(this instanceof s){var _=e.apply(this,TI(o,arguments));return Object(_)===_?_:this}return e.apply(t,TI(o,arguments))},p=hY(0,e.length-o.length),h=[],g=0;g<p;g++)h[g]="$"+g;if(s=Function("binder","return function ("+gY(h,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var m=function(){};m.prototype=e.prototype,s.prototype=new m,m.prototype=null}return s}});var nf=ot((Kat,II)=>{"use strict";var mY=PI();II.exports=Function.prototype.bind||mY});var _g=ot((jat,RI)=>{"use strict";RI.exports=Function.prototype.call});var xg=ot((Qat,LI)=>{"use strict";LI.exports=Function.prototype.apply});var OI=ot((tut,NI)=>{"use strict";NI.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var L_=ot((eut,DI)=>{"use strict";var yY=nf(),vY=xg(),_Y=_g(),xY=OI();DI.exports=xY||yY.call(_Y,vY)});var Eg=ot((nut,FI)=>{"use strict";var EY=nf(),wY=ql(),SY=_g(),MY=L_();FI.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new wY("a function is required");return MY(EY,SY,t)}});var qI=ot((rut,kI)=>{"use strict";var bY=Eg(),UI=Hl(),zI;try{zI=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var N_=!!zI&&UI&&UI(Object.prototype,"__proto__"),GI=Object,BI=GI.getPrototypeOf;kI.exports=N_&&typeof N_.get=="function"?bY([N_.get]):typeof BI=="function"?function(t){return BI(t==null?t:GI(t))}:!1});var O_=ot((iut,XI)=>{"use strict";var HI=I_(),VI=R_(),WI=qI();XI.exports=HI?function(t){return HI(t)}:VI?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return VI(t)}:WI?function(t){return WI(t)}:null});var D_=ot((out,YI)=>{"use strict";var AY=Function.prototype.call,TY=Object.prototype.hasOwnProperty,CY=nf();YI.exports=CY.call(AY,TY)});var B_=ot((sut,QI)=>{"use strict";var Un,PY=T_(),IY=C_(),RY=YP(),LY=ZP(),NY=KP(),af=P_(),sf=ql(),OY=eI(),DY=rI(),FY=oI(),UY=aI(),BY=lI(),zY=fI(),GY=pI(),kY=yI(),KI=Function,F_=function(n){try{return KI('"use strict"; return ('+n+").constructor;")()}catch(t){}},Sh=Hl(),qY=wh(),U_=function(){throw new sf},HY=Sh?function(){try{return arguments.callee,U_}catch(n){try{return Sh(arguments,"callee").get}catch(t){return U_}}}():U_,rf=MI()(),qi=O_(),VY=R_(),WY=I_(),jI=xg(),Mh=_g(),of={},XY=typeof Uint8Array=="undefined"||!qi?Un:qi(Uint8Array),Vl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Un:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Un:ArrayBuffer,"%ArrayIteratorPrototype%":rf&&qi?qi([][Symbol.iterator]()):Un,"%AsyncFromSyncIteratorPrototype%":Un,"%AsyncFunction%":of,"%AsyncGenerator%":of,"%AsyncGeneratorFunction%":of,"%AsyncIteratorPrototype%":of,"%Atomics%":typeof Atomics=="undefined"?Un:Atomics,"%BigInt%":typeof BigInt=="undefined"?Un:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Un:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Un:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Un:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":IY,"%eval%":eval,"%EvalError%":RY,"%Float16Array%":typeof Float16Array=="undefined"?Un:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Un:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Un:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Un:FinalizationRegistry,"%Function%":KI,"%GeneratorFunction%":of,"%Int8Array%":typeof Int8Array=="undefined"?Un:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Un:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Un:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":rf&&qi?qi(qi([][Symbol.iterator]())):Un,"%JSON%":typeof JSON=="object"?JSON:Un,"%Map%":typeof Map=="undefined"?Un:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!rf||!qi?Un:qi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":PY,"%Object.getOwnPropertyDescriptor%":Sh,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Un:Promise,"%Proxy%":typeof Proxy=="undefined"?Un:Proxy,"%RangeError%":LY,"%ReferenceError%":NY,"%Reflect%":typeof Reflect=="undefined"?Un:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Un:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!rf||!qi?Un:qi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Un:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":rf&&qi?qi(""[Symbol.iterator]()):Un,"%Symbol%":rf?Symbol:Un,"%SyntaxError%":af,"%ThrowTypeError%":HY,"%TypedArray%":XY,"%TypeError%":sf,"%Uint8Array%":typeof Uint8Array=="undefined"?Un:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Un:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Un:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Un:Uint32Array,"%URIError%":OY,"%WeakMap%":typeof WeakMap=="undefined"?Un:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Un:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Un:WeakSet,"%Function.prototype.call%":Mh,"%Function.prototype.apply%":jI,"%Object.defineProperty%":qY,"%Object.getPrototypeOf%":VY,"%Math.abs%":DY,"%Math.floor%":FY,"%Math.max%":UY,"%Math.min%":BY,"%Math.pow%":zY,"%Math.round%":GY,"%Math.sign%":kY,"%Reflect.getPrototypeOf%":WY};if(qi)try{null.error}catch(n){$I=qi(qi(n)),Vl["%Error.prototype%"]=$I}var $I,YY=function n(t){var e;if(t==="%AsyncFunction%")e=F_("async function () {}");else if(t==="%GeneratorFunction%")e=F_("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=F_("async function* () {}");else if(t==="%AsyncGenerator%"){var o=n("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=n("%AsyncGenerator%");s&&qi&&(e=qi(s.prototype))}return Vl[t]=e,e},ZI={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bh=nf(),wg=D_(),$Y=bh.call(Mh,Array.prototype.concat),ZY=bh.call(jI,Array.prototype.splice),JI=bh.call(Mh,String.prototype.replace),Sg=bh.call(Mh,String.prototype.slice),JY=bh.call(Mh,RegExp.prototype.exec),KY=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,jY=/\\\\(\\\\)?/g,QY=function(t){var e=Sg(t,0,1),o=Sg(t,-1);if(e==="%"&&o!=="%")throw new af("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new af("invalid intrinsic syntax, expected opening \`%\`");var s=[];return JI(t,KY,function(l,p,h,g){s[s.length]=h?JI(g,jY,"$1"):p||l}),s},t$=function(t,e){var o=t,s;if(wg(ZI,o)&&(s=ZI[o],o="%"+s[0]+"%"),wg(Vl,o)){var l=Vl[o];if(l===of&&(l=YY(o)),typeof l=="undefined"&&!e)throw new sf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:o,value:l}}throw new af("intrinsic "+t+" does not exist!")};QI.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new sf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new sf('"allowMissing" argument must be a boolean');if(JY(/^%?[^%]*%?$/,t)===null)throw new af("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=QY(t),s=o.length>0?o[0]:"",l=t$("%"+s+"%",e),p=l.name,h=l.value,g=!1,m=l.alias;m&&(s=m[0],ZY(o,$Y([0,1],m)));for(var _=1,E=!0;_<o.length;_+=1){var S=o[_],b=Sg(S,0,1),A=Sg(S,-1);if((b==='"'||b==="'"||b==="\`"||A==='"'||A==="'"||A==="\`")&&b!==A)throw new af("property names with quotes must have matching quotes");if((S==="constructor"||!E)&&(g=!0),s+="."+S,p="%"+s+"%",wg(Vl,p))h=Vl[p];else if(h!=null){if(!(S in h)){if(!e)throw new sf("base intrinsic for "+t+" exists, but the property is not available.");return}if(Sh&&_+1>=o.length){var I=Sh(h,S);E=!!I,E&&"get"in I&&!("originalValue"in I.get)?h=I.get:h=h[S]}else E=wg(h,S),h=h[S];E&&!g&&(Vl[p]=h)}}return h}});var Mg=ot((aut,nR)=>{"use strict";var tR=B_(),eR=Eg(),e$=eR([tR("%String.prototype.indexOf%")]);nR.exports=function(t,e){var o=tR(t,!!e);return typeof o=="function"&&e$(t,".prototype.")>-1?eR([o]):o}});var oR=ot((uut,iR)=>{"use strict";var n$=mg()(),r$=Mg(),z_=r$("Object.prototype.toString"),bg=function(t){return n$&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:z_(t)==="[object Arguments]"},rR=function(t){return bg(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&z_(t)!=="[object Array]"&&"callee"in t&&z_(t.callee)==="[object Function]"},i$=function(){return bg(arguments)}();bg.isLegacyArguments=rR;iR.exports=i$?bg:rR});var Ag=ot((lut,uR)=>{"use strict";var sR=wh(),o$=P_(),uf=ql(),aR=Hl();uR.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new uf("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new uf("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new uf("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new uf("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new uf("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new uf("\`loose\`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,g=!!aR&&aR(t,e);if(sR)sR(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:s===null&&g?g.enumerable:!s,value:o,writable:l===null&&g?g.writable:!l});else if(h||!s&&!l&&!p)t[e]=o;else throw new o$("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Tg=ot((cut,cR)=>{"use strict";var G_=wh(),lR=function(){return!!G_};lR.hasArrayLengthDefineBug=function(){if(!G_)return null;try{return G_([],"length",{value:1}).length!==1}catch(t){return!0}};cR.exports=lR});var lf=ot((fut,dR)=>{"use strict";var s$=b_(),a$=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",u$=Object.prototype.toString,l$=Array.prototype.concat,fR=Ag(),c$=function(n){return typeof n=="function"&&u$.call(n)==="[object Function]"},hR=Tg()(),f$=function(n,t,e,o){if(t in n){if(o===!0){if(n[t]===e)return}else if(!c$(o)||!o())return}hR?fR(n,t,e,!0):fR(n,t,e)},pR=function(n,t){var e=arguments.length>2?arguments[2]:{},o=s$(t);a$&&(o=l$.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)f$(n,o[s],t[o[s]],e[o[s]])};pR.supportsDescriptors=!!hR;dR.exports=pR});var _R=ot((hut,vR)=>{"use strict";var h$=B_(),gR=Ag(),p$=Tg()(),mR=Hl(),yR=ql(),d$=h$("%Math.floor%");vR.exports=function(t,e){if(typeof t!="function")throw new yR("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||d$(e)!==e)throw new yR("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],s=!0,l=!0;if("length"in t&&mR){var p=mR(t,"length");p&&!p.configurable&&(s=!1),p&&!p.writable&&(l=!1)}return(s||l||!o)&&(p$?gR(t,"length",e,!0,!0):gR(t,"length",e)),t}});var ER=ot((put,xR)=>{"use strict";var g$=nf(),m$=xg(),y$=L_();xR.exports=function(){return y$(g$,m$,arguments)}});var k_=ot((dut,Cg)=>{"use strict";var v$=_R(),wR=wh(),_$=Eg(),SR=ER();Cg.exports=function(t){var e=_$(arguments),o=t.length-(arguments.length-1);return v$(e,1+(o>0?o:0),!0)};wR?wR(Cg.exports,"apply",{value:SR}):Cg.exports.apply=SR});var q_=ot((gut,bR)=>{"use strict";var MR=function(n){return n!==n};bR.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||MR(t)&&MR(e))}});var H_=ot((mut,AR)=>{"use strict";var x$=q_();AR.exports=function(){return typeof Object.is=="function"?Object.is:x$}});var CR=ot((yut,TR)=>{"use strict";var E$=H_(),w$=lf();TR.exports=function(){var t=E$();return w$(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var LR=ot((vut,RR)=>{"use strict";var S$=lf(),M$=k_(),b$=q_(),PR=H_(),A$=CR(),IR=M$(PR(),Object);S$(IR,{getPolyfill:PR,implementation:b$,shim:A$});RR.exports=IR});var BR=ot((_ut,UR)=>{"use strict";var NR=Mg(),T$=mg()(),C$=D_(),P$=Hl(),X_;T$?(OR=NR("RegExp.prototype.exec"),V_={},Pg=function(){throw V_},W_={toString:Pg,valueOf:Pg},typeof Symbol.toPrimitive=="symbol"&&(W_[Symbol.toPrimitive]=Pg),X_=function(t){if(!t||typeof t!="object")return!1;var e=P$(t,"lastIndex"),o=e&&C$(e,"value");if(!o)return!1;try{OR(t,W_)}catch(s){return s===V_}}):(DR=NR("Object.prototype.toString"),FR="[object RegExp]",X_=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:DR(t)===FR});var OR,V_,Pg,W_,DR,FR;UR.exports=X_});var GR=ot((xut,zR)=>{"use strict";var Th=function(){return typeof function(){}.name=="string"},Ah=Object.getOwnPropertyDescriptor;if(Ah)try{Ah([],"length")}catch(n){Ah=null}Th.functionsHaveConfigurableNames=function(){if(!Th()||!Ah)return!1;var t=Ah(function(){},"name");return!!t&&!!t.configurable};var I$=Function.prototype.bind;Th.boundFunctionsHaveNames=function(){return Th()&&typeof I$=="function"&&function(){}.bind().name!==""};zR.exports=Th});var HR=ot((Eut,qR)=>{"use strict";var kR=Ag(),R$=Tg()(),L$=GR().functionsHaveConfigurableNames(),N$=ql();qR.exports=function(t,e){if(typeof t!="function")throw new N$("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||L$)&&(R$?kR(t,"name",e,!0,!0):kR(t,"name",e)),t}});var Y_=ot((wut,VR)=>{"use strict";var O$=HR(),D$=ql(),F$=Object;VR.exports=O$(function(){if(this==null||this!==F$(this))throw new D$("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var $_=ot((Sut,WR)=>{"use strict";var U$=Y_(),B$=lf().supportsDescriptors,z$=Object.getOwnPropertyDescriptor;WR.exports=function(){if(B$&&/a/mig.flags==="gim"){var t=z$(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return U$}});var $R=ot((Mut,YR)=>{"use strict";var G$=lf().supportsDescriptors,k$=$_(),q$=Hl(),H$=Object.defineProperty,V$=C_(),XR=O_(),W$=/a/;YR.exports=function(){if(!G$||!XR)throw new V$("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=k$(),e=XR(W$),o=q$(e,"flags");return(!o||o.get!==t)&&H$(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var jR=ot((but,KR)=>{"use strict";var X$=lf(),Y$=k_(),$$=Y_(),ZR=$_(),Z$=$R(),JR=Y$(ZR());X$(JR,{getPolyfill:ZR,implementation:$$,shim:Z$});KR.exports=JR});var eL=ot((Aut,tL)=>{"use strict";var QR=Mg(),J$=QR("Date.prototype.getDay"),K$=function(t){try{return J$(t),!0}catch(e){return!1}},j$=QR("Object.prototype.toString"),Q$="[object Date]",tZ=mg()();tL.exports=function(t){return typeof t!="object"||t===null?!1:tZ?K$(t):j$(t)===Q$}});var Z_=ot((Tut,hL)=>{var nL=b_(),rL=oR(),iL=LR(),oL=BR(),sL=jR(),aL=eL(),uL=Date.prototype.getTime;function fL(n,t,e){var o=e||{};return(o.strict?iL(n,t):n===t)?!0:!n||!t||typeof n!="object"&&typeof t!="object"?o.strict?iL(n,t):n==t:eZ(n,t,o)}function lL(n){return n==null}function cL(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function eZ(n,t,e){var o,s;if(typeof n!=typeof t||lL(n)||lL(t)||n.prototype!==t.prototype||rL(n)!==rL(t))return!1;var l=oL(n),p=oL(t);if(l!==p)return!1;if(l||p)return n.source===t.source&&sL(n)===sL(t);if(aL(n)&&aL(t))return uL.call(n)===uL.call(t);var h=cL(n),g=cL(t);if(h!==g)return!1;if(h||g){if(n.length!==t.length)return!1;for(o=0;o<n.length;o++)if(n[o]!==t[o])return!1;return!0}if(typeof n!=typeof t)return!1;try{var m=nL(n),_=nL(t)}catch(E){return!1}if(m.length!==_.length)return!1;for(m.sort(),_.sort(),o=m.length-1;o>=0;o--)if(m[o]!=_[o])return!1;for(o=m.length-1;o>=0;o--)if(s=m[o],!fL(n[s],t[s],e))return!1;return!0}hL.exports=fL});var a1=ot((Nct,_L)=>{var WZ=Z_(),La=function(n){this.precision=n&&n.precision?n.precision:17,this.direction=n&&n.direction?n.direction:!1,this.pseudoNode=n&&n.pseudoNode?n.pseudoNode:!1,this.objectComparator=n&&n.objectComparator?n.objectComparator:XZ};La.prototype.compare=function(n,t){if(n.type!==t.type||!vL(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(n.type.indexOf("Multi")===0){var e=this,o=yL(n),s=yL(t);return o.every(function(l){return this.some(function(p){return e.compare(l,p)})},s)}}return!1};function yL(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function vL(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}La.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var e=0;e<n.length;e++)if(n[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};La.prototype.compareLine=function(n,t,e,o){if(!vL(n,t))return!1;var s=this.pseudoNode?n:this.removePseudo(n),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(s[0],l[0])&&(l=this.fixStartIndex(l,s),!l))){var p=this.compareCoord(s[e],l[e]);return this.direction||p?this.comparePath(s,l):this.compareCoord(s[e],l[l.length-(1+e)])?this.comparePath(s.slice().reverse(),l):!1}};La.prototype.fixStartIndex=function(n,t){for(var e,o=-1,s=0;s<n.length;s++)if(this.compareCoord(n[s],t[0])){o=s;break}return o>=0&&(e=[].concat(n.slice(o,n.length),n.slice(1,o+1))),e};La.prototype.comparePath=function(n,t){var e=this;return n.every(function(o,s){return e.compareCoord(o,this[s])},t)};La.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var e=n.coordinates.slice(1,n.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),s=this;return e.every(function(l){return this.some(function(p){return s.compareLine(l,p,1,!0)})},o)}else return!1};La.prototype.compareFeature=function(n,t){return n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t)?!1:this.compare(n.geometry,t.geometry)};La.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};La.prototype.removePseudo=function(n){return n};function XZ(n,t){return WZ(n,t,{strict:!0})}_L.exports=La});var xL=ot((Wct,Lg)=>{function il(n,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(n,t,e,o)}il.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0;s<this._datasetLength;s++)if(this._visited[s]!==1){this._visited[s]=1;var l=this._regionQuery(s);if(l.length<this.minPts)this.noise.push(s);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(s,p),this._expandCluster(p,l)}}return this.clusters};il.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this.noise=[],this._datasetLength=n.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};il.prototype._expandCluster=function(n,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var s=this._regionQuery(o);s.length>=this.minPts&&(t=this._mergeArrays(t,s))}this._assigned[o]!==1&&this._addToCluster(o,n)}};il.prototype._addToCluster=function(n,t){this.clusters[t].push(n),this._assigned[n]=1};il.prototype._regionQuery=function(n){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[n],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};il.prototype._mergeArrays=function(n,t){for(var e=t.length,o=0;o<e;o++){var s=t[o];n.indexOf(s)<0&&n.push(s)}return n};il.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof Lg!="undefined"&&Lg.exports&&(Lg.exports=il)});var EL=ot((Xct,Ng)=>{function ol(n,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(n,t,e)}ol.prototype.init=function(n,t,e){this.assignments=[],this.centroids=[],typeof n!="undefined"&&(this.dataset=n),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};ol.prototype.run=function(n,t){this.init(n,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var s=!0;s;){s=this.assign();for(var l=0;l<this.k;l++){for(var p=new Array(_),h=0,g=0;g<_;g++)p[g]=0;for(var m=0;m<e;m++){var _=this.dataset[m].length;if(l===this.assignments[m]){for(var g=0;g<_;g++)p[g]+=this.dataset[m][g];h++}}if(h>0){for(var g=0;g<_;g++)p[g]/=h;this.centroids[l]=p}else this.centroids[l]=this.randomCentroid(),s=!0}}return this.getClusters()};ol.prototype.randomCentroid=function(){var n=this.dataset.length-1,t,e;do e=Math.round(Math.random()*n),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};ol.prototype.assign=function(){for(var n=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,n=!0);return n};ol.prototype.getClusters=function(){for(var n=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof n[t]=="undefined"&&(n[t]=[]),n[t].push(e);return n};ol.prototype.argmin=function(n,t,e){for(var o=Number.MAX_VALUE,s=0,l=t.length,p,h=0;h<l;h++)p=e(n,t[h]),p<o&&(o=p,s=h);return s};ol.prototype.distance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;){var s=n[o]-t[o];e+=s*s}return Math.sqrt(e)};typeof Ng!="undefined"&&Ng.exports&&(Ng.exports=ol)});var u1=ot((Yct,Og)=>{function Na(n,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(n,t,e)}Na.prototype.insert=function(n,t){for(var e=this._queue.length,o=e;o--;){var s=this._priorities[o];this._sorting==="desc"?t>s&&(e=o):t<s&&(e=o)}this._insertAt(n,t,e)};Na.prototype.remove=function(n){for(var t=this._queue.length;t--;){var e=this._queue[t];if(n===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Na.prototype.forEach=function(n){this._queue.forEach(n)};Na.prototype.getElements=function(){return this._queue};Na.prototype.getElementPriority=function(n){return this._priorities[n]};Na.prototype.getPriorities=function(){return this._priorities};Na.prototype.getElementsWithPriorities=function(){for(var n=[],t=0,e=this._queue.length;t<e;t++)n.push([this._queue[t],this._priorities[t]]);return n};Na.prototype._init=function(n,t,e){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<n.length;o++)this.insert(n[o],t[o])}e&&(this._sorting=e)};Na.prototype._insertAt=function(n,t,e){this._queue.length===e?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(e,0,n),this._priorities.splice(e,0,t))};typeof Og!="undefined"&&Og.exports&&(Og.exports=Na)});var SL=ot(($ct,ff)=>{typeof ff!="undefined"&&ff.exports&&(wL=u1());var wL;function gu(n,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(n,t,e,o)}gu.prototype.run=function(n,t,e,o){this._init(n,t,e,o);for(var s=0,l=this.dataset.length;s<l;s++)if(this._processed[s]!==1){this._processed[s]=1,this.clusters.push([s]);var p=this.clusters.length-1;this._orderedList.push(s);var h=new wL(null,null,"asc"),g=this._regionQuery(s);this._distanceToCore(s)!==void 0&&(this._updateQueue(s,g,h),this._expandCluster(p,h))}return this.clusters};gu.prototype.getReachabilityPlot=function(){for(var n=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],s=this._reachability[o];n.push([o,s])}return n};gu.prototype._init=function(n,t,e,o){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};gu.prototype._updateQueue=function(n,t,e){var o=this;this._coreDistance=this._distanceToCore(n),t.forEach(function(s){if(o._processed[s]===void 0){var l=o.distance(o.dataset[n],o.dataset[s]),p=Math.max(o._coreDistance,l);o._reachability[s]===void 0?(o._reachability[s]=p,e.insert(s,p)):p<o._reachability[s]&&(o._reachability[s]=p,e.remove(s),e.insert(s,p))}})};gu.prototype._expandCluster=function(n,t){for(var e=t.getElements(),o=0,s=e.length;o<s;o++){var l=e[o];if(this._processed[l]===void 0){var p=this._regionQuery(l);this._processed[l]=1,this.clusters[n].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,p,t),this._expandCluster(n,t))}}};gu.prototype._distanceToCore=function(n){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(n,e);if(o.length>=this.minPts)return e}};gu.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var e=[],o=0,s=this.dataset.length;o<s;o++)this.distance(this.dataset[n],this.dataset[o])<t&&e.push(o);return e};gu.prototype._euclideanDistance=function(n,t){for(var e=0,o=Math.min(n.length,t.length);o--;)e+=(n[o]-t[o])*(n[o]-t[o]);return Math.sqrt(e)};typeof ff!="undefined"&&ff.exports&&(ff.exports=gu)});var ML=ot((Zct,Dg)=>{typeof Dg!="undefined"&&Dg.exports&&(Dg.exports={DBSCAN:xL(),KMEANS:EL(),OPTICS:SL(),PriorityQueue:u1()})});var l1=ot((eft,AL)=>{"use strict";AL.exports={eudist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++){var h=(t[p]||0)-(e[p]||0);l+=h*h}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var s=t.length,l=0,p=0;p<s;p++)l+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var s=Math.abs(t-e);return o?s:s*s}}});var PL=ot((nft,CL)=>{"use strict";var TL=l1(),jZ=TL.eudist,QZ=TL.dist;CL.exports={kmrand:function(t,e){for(var o={},s=[],l=e<<2,p=t.length,h=t[0].length>0;s.length<e&&l-- >0;){var g=t[Math.floor(Math.random()*p)],m=h?g.join("_"):""+g;o[m]||(o[m]=!0,s.push(g))}if(s.length<e)throw new Error("Error initializating clusters");return s},kmpp:function(t,e){var o=t[0].length?jZ:QZ,s=[],l=t.length,p=t[0].length>0,h={},g=t[Math.floor(Math.random()*l)],m=p?g.join("_"):""+g;for(s.push(g),h[m]=!0;s.length<e;){for(var _=[],E=s.length,S=0,b=[],A=0;A<l;A++){for(var I=1/0,w=0;w<E;w++){var x=o(t[A],s[w]);x<=I&&(I=x)}_[A]=I}for(var R=0;R<l;R++)S+=_[R];for(var C=0;C<l;C++)b[C]={i:C,v:t[C],pr:_[C]/S,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var F=1;F<l;F++)b[F].cs=b[F-1].cs+b[F].pr;for(var V=Math.random(),X=0;X<l-1&&b[X++].cs<V;);s.push(b[X-1].v)}return s}}});var OL=ot((oft,NL)=>{"use strict";var c1=l1(),LL=PL(),tJ=c1.eudist,rft=c1.mandist,ift=c1.dist,eJ=LL.kmrand,nJ=LL.kmpp,IL=1e4;function RL(n,t,e){e=e||[];for(var o=0;o<n;o++)e[o]=t;return e}function rJ(n,t,e,o){var s=[],l=[],p=[],h=[],g=!1,m=o||IL,_=n.length,E=n[0].length,S=E>0,b=[];if(e)e=="kmrand"?s=eJ(n,t):e=="kmpp"?s=nJ(n,t):s=e;else for(var A={};s.length<t;){var I=Math.floor(Math.random()*_);A[I]||(A[I]=!0,s.push(n[I]))}do{RL(t,0,b);for(var w=0;w<_;w++){for(var x=1/0,R=0,C=0;C<t;C++){var h=S?tJ(n[w],s[C]):Math.abs(n[w]-s[C]);h<=x&&(x=h,R=C)}p[w]=R,b[R]++}for(var F=[],l=[],V=0,X=0;X<t;X++)F[X]=S?RL(E,0,F[X]):0,l[X]=s[X];if(S){for(var q=0;q<t;q++)s[q]=[];for(var D=0;D<_;D++)for(var xt=p[D],B=F[xt],j=n[D],J=0;J<E;J++)B[J]+=j[J];g=!0;for(var Dt=0;Dt<t;Dt++){for(var Q=s[Dt],At=F[Dt],Mt=l[Dt],Lt=b[Dt],pt=0;pt<E;pt++)Q[pt]=At[pt]/Lt||0;if(g){for(var yt=0;yt<E;yt++)if(Mt[yt]!=Q[yt]){g=!1;break}}}}else{for(var K=0;K<_;K++){var Bt=p[K];F[Bt]+=n[K]}for(var Gt=0;Gt<t;Gt++)s[Gt]=F[Gt]/b[Gt]||0;g=!0;for(var ae=0;ae<t;ae++)if(l[ae]!=s[ae]){g=!1;break}}g=g||--m<=0}while(!g);return{it:IL-m,k:t,idxs:p,centroids:s}}NL.exports=rJ});var mf=ot((m1,y1)=>{(function(n,t){typeof m1=="object"&&typeof y1!="undefined"?y1.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.polygonClipping=t())})(m1,function(){"use strict";function n(rt,P){var N={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},k,$,W,ht;return ht={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function at(Et){return function(G){return wt([Et,G])}}function wt(Et){if(k)throw new TypeError("Generator is already executing.");for(;N;)try{if(k=1,$&&(W=Et[0]&2?$.return:Et[0]?$.throw||((W=$.return)&&W.call($),0):$.next)&&!(W=W.call($,Et[1])).done)return W;switch($=0,W&&(Et=[Et[0]&2,W.value]),Et[0]){case 0:case 1:W=Et;break;case 4:return N.label++,{value:Et[1],done:!1};case 5:N.label++,$=Et[1],Et=[0];continue;case 7:Et=N.ops.pop(),N.trys.pop();continue;default:if(W=N.trys,!(W=W.length>0&&W[W.length-1])&&(Et[0]===6||Et[0]===2)){N=0;continue}if(Et[0]===3&&(!W||Et[1]>W[0]&&Et[1]<W[3])){N.label=Et[1];break}if(Et[0]===6&&N.label<W[1]){N.label=W[1],W=Et;break}if(W&&N.label<W[2]){N.label=W[2],N.ops.push(Et);break}W[2]&&N.ops.pop(),N.trys.pop();continue}Et=P.call(rt,N)}catch(G){Et=[6,G],$=0}finally{k=W=0}if(Et[0]&5)throw Et[1];return{value:Et[0]?Et[1]:void 0,done:!0}}}var t=function(){function rt(P,N){this.next=null,this.key=P,this.data=N,this.left=null,this.right=null}return rt}();function e(rt,P){return rt>P?1:rt<P?-1:0}function o(rt,P,N){for(var k=new t(null,null),$=k,W=k;;){var ht=N(rt,P.key);if(ht<0){if(P.left===null)break;if(N(rt,P.left.key)<0){var at=P.left;if(P.left=at.right,at.right=P,P=at,P.left===null)break}W.left=P,W=P,P=P.left}else if(ht>0){if(P.right===null)break;if(N(rt,P.right.key)>0){var at=P.right;if(P.right=at.left,at.left=P,P=at,P.right===null)break}$.right=P,$=P,P=P.right}else break}return $.right=P.left,W.left=P.right,P.left=k.right,P.right=k.left,P}function s(rt,P,N,k){var $=new t(rt,P);if(N===null)return $.left=$.right=null,$;N=o(rt,N,k);var W=k(rt,N.key);return W<0?($.left=N.left,$.right=N,N.left=null):W>=0&&($.right=N.right,$.left=N,N.right=null),$}function l(rt,P,N){var k=null,$=null;if(P){P=o(rt,P,N);var W=N(P.key,rt);W===0?(k=P.left,$=P.right):W<0?($=P.right,P.right=null,k=P):(k=P.left,P.left=null,$=P)}return{left:k,right:$}}function p(rt,P,N){return P===null?rt:(rt===null||(P=o(rt.key,P,N),P.left=rt),P)}function h(rt,P,N,k,$){if(rt){k(""+P+(N?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+$(rt)+\`
11821
11821
  \`);var W=P+(N?" ":"\\u2502 ");rt.left&&h(rt.left,W,!1,k,$),rt.right&&h(rt.right,W,!0,k,$)}}var g=function(){function rt(P){P===void 0&&(P=e),this._root=null,this._size=0,this._comparator=P}return rt.prototype.insert=function(P,N){return this._size++,this._root=s(P,N,this._root,this._comparator)},rt.prototype.add=function(P,N){var k=new t(P,N);this._root===null&&(k.left=k.right=null,this._size++,this._root=k);var $=this._comparator,W=o(P,this._root,$),ht=$(P,W.key);return ht===0?this._root=W:(ht<0?(k.left=W.left,k.right=W,W.left=null):ht>0&&(k.right=W.right,k.left=W,W.right=null),this._size++,this._root=k),this._root},rt.prototype.remove=function(P){this._root=this._remove(P,this._root,this._comparator)},rt.prototype._remove=function(P,N,k){var $;if(N===null)return null;N=o(P,N,k);var W=k(P,N.key);return W===0?(N.left===null?$=N.right:($=o(P,N.left,k),$.right=N.right),this._size--,$):N},rt.prototype.pop=function(){var P=this._root;if(P){for(;P.left;)P=P.left;return this._root=o(P.key,this._root,this._comparator),this._root=this._remove(P.key,this._root,this._comparator),{key:P.key,data:P.data}}return null},rt.prototype.findStatic=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return N;$<0?N=N.left:N=N.right}return null},rt.prototype.find=function(P){return this._root&&(this._root=o(P,this._root,this._comparator),this._comparator(P,this._root.key)!==0)?null:this._root},rt.prototype.contains=function(P){for(var N=this._root,k=this._comparator;N;){var $=k(P,N.key);if($===0)return!0;$<0?N=N.left:N=N.right}return!1},rt.prototype.forEach=function(P,N){for(var k=this._root,$=[],W=!1;!W;)k!==null?($.push(k),k=k.left):$.length!==0?(k=$.pop(),P.call(N,k),k=k.right):W=!0;return this},rt.prototype.range=function(P,N,k,$){for(var W=[],ht=this._comparator,at=this._root,wt;W.length!==0||at;)if(at)W.push(at),at=at.left;else{if(at=W.pop(),wt=ht(at.key,N),wt>0)break;if(ht(at.key,P)>=0&&k.call($,at))return this;at=at.right}return this},rt.prototype.keys=function(){var P=[];return this.forEach(function(N){var k=N.key;return P.push(k)}),P},rt.prototype.values=function(){var P=[];return this.forEach(function(N){var k=N.data;return P.push(k)}),P},rt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},rt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},rt.prototype.minNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.left;)P=P.left;return P},rt.prototype.maxNode=function(P){if(P===void 0&&(P=this._root),P)for(;P.right;)P=P.right;return P},rt.prototype.at=function(P){for(var N=this._root,k=!1,$=0,W=[];!k;)if(N)W.push(N),N=N.left;else if(W.length>0){if(N=W.pop(),$===P)return N;$++,N=N.right}else k=!0;return null},rt.prototype.next=function(P){var N=this._root,k=null;if(P.right){for(k=P.right;k.left;)k=k.left;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?(k=N,N=N.left):N=N.right}return k},rt.prototype.prev=function(P){var N=this._root,k=null;if(P.left!==null){for(k=P.left;k.right;)k=k.right;return k}for(var $=this._comparator;N;){var W=$(P.key,N.key);if(W===0)break;W<0?N=N.left:(k=N,N=N.right)}return k},rt.prototype.clear=function(){return this._root=null,this._size=0,this},rt.prototype.toList=function(){return E(this._root)},rt.prototype.load=function(P,N,k){N===void 0&&(N=[]),k===void 0&&(k=!1);var $=P.length,W=this._comparator;if(k&&A(P,N,0,$-1,W),this._root===null)this._root=m(P,N,0,$),this._size=$;else{var ht=b(this.toList(),_(P,N),W);$=this._size+$,this._root=S({head:ht},0,$)}return this},rt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(rt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(rt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),rt.prototype.toString=function(P){P===void 0&&(P=function(k){return String(k.key)});var N=[];return h(this._root,"",!0,function(k){return N.push(k)},P),N.join("")},rt.prototype.update=function(P,N,k){var $=this._comparator,W=l(P,this._root,$),ht=W.left,at=W.right;$(P,N)<0?at=s(N,k,at,$):ht=s(N,k,ht,$),this._root=p(ht,at,$)},rt.prototype.split=function(P){return l(P,this._root,this._comparator)},rt.prototype[Symbol.iterator]=function(){var P,N,k;return n(this,function($){switch($.label){case 0:P=this._root,N=[],k=!1,$.label=1;case 1:return k?[3,6]:P===null?[3,2]:(N.push(P),P=P.left,[3,5]);case 2:return N.length===0?[3,4]:(P=N.pop(),[4,P]);case 3:return $.sent(),P=P.right,[3,5];case 4:k=!0,$.label=5;case 5:return[3,1];case 6:return[2]}})},rt}();function m(rt,P,N,k){var $=k-N;if($>0){var W=N+Math.floor($/2),ht=rt[W],at=P[W],wt=new t(ht,at);return wt.left=m(rt,P,N,W),wt.right=m(rt,P,W+1,k),wt}return null}function _(rt,P){for(var N=new t(null,null),k=N,$=0;$<rt.length;$++)k=k.next=new t(rt[$],P[$]);return k.next=null,N.next}function E(rt){for(var P=rt,N=[],k=!1,$=new t(null,null),W=$;!k;)P?(N.push(P),P=P.left):N.length>0?(P=W=W.next=N.pop(),P=P.right):k=!0;return W.next=null,$.next}function S(rt,P,N){var k=N-P;if(k>0){var $=P+Math.floor(k/2),W=S(rt,P,$),ht=rt.head;return ht.left=W,rt.head=rt.head.next,ht.right=S(rt,$+1,N),ht}return null}function b(rt,P,N){for(var k=new t(null,null),$=k,W=rt,ht=P;W!==null&&ht!==null;)N(W.key,ht.key)<0?($.next=W,W=W.next):($.next=ht,ht=ht.next),$=$.next;return W!==null?$.next=W:ht!==null&&($.next=ht),k.next}function A(rt,P,N,k,$){if(!(N>=k)){for(var W=rt[N+k>>1],ht=N-1,at=k+1;;){do ht++;while($(rt[ht],W)<0);do at--;while($(rt[at],W)>0);if(ht>=at)break;var wt=rt[ht];rt[ht]=rt[at],rt[at]=wt,wt=P[ht],P[ht]=P[at],P[at]=wt}A(rt,P,N,at,$),A(rt,P,at+1,k,$)}}let I=(rt,P)=>rt.ll.x<=P.x&&P.x<=rt.ur.x&&rt.ll.y<=P.y&&P.y<=rt.ur.y,w=(rt,P)=>{if(P.ur.x<rt.ll.x||rt.ur.x<P.ll.x||P.ur.y<rt.ll.y||rt.ur.y<P.ll.y)return null;let N=rt.ll.x<P.ll.x?P.ll.x:rt.ll.x,k=rt.ur.x<P.ur.x?rt.ur.x:P.ur.x,$=rt.ll.y<P.ll.y?P.ll.y:rt.ll.y,W=rt.ur.y<P.ur.y?rt.ur.y:P.ur.y;return{ll:{x:N,y:$},ur:{x:k,y:W}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let R=x*x,C=(rt,P)=>{if(-x<rt&&rt<x&&-x<P&&P<x)return 0;let N=rt-P;return N*N<R*rt*P?0:rt<P?-1:1};class F{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(P,N){return{x:this.xRounder.round(P),y:this.yRounder.round(N)}}}class V{constructor(){this.tree=new g,this.round(0)}round(P){let N=this.tree.add(P),k=this.tree.prev(N);if(k!==null&&C(N.key,k.key)===0)return this.tree.remove(P),k.key;let $=this.tree.next(N);return $!==null&&C(N.key,$.key)===0?(this.tree.remove(P),$.key):P}}let X=new F,q=11102230246251565e-32,D=134217729,xt=(3+8*q)*q;function B(rt,P,N,k,$){let W,ht,at,wt,Et=P[0],G=k[0],st=0,et=0;G>Et==G>-Et?(W=Et,Et=P[++st]):(W=G,G=k[++et]);let lt=0;if(st<rt&&et<N)for(G>Et==G>-Et?(ht=Et+W,at=W-(ht-Et),Et=P[++st]):(ht=G+W,at=W-(ht-G),G=k[++et]),W=ht,at!==0&&($[lt++]=at);st<rt&&et<N;)G>Et==G>-Et?(ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st]):(ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et]),W=ht,at!==0&&($[lt++]=at);for(;st<rt;)ht=W+Et,wt=ht-W,at=W-(ht-wt)+(Et-wt),Et=P[++st],W=ht,at!==0&&($[lt++]=at);for(;et<N;)ht=W+G,wt=ht-W,at=W-(ht-wt)+(G-wt),G=k[++et],W=ht,at!==0&&($[lt++]=at);return(W!==0||lt===0)&&($[lt++]=W),lt}function j(rt,P){let N=P[0];for(let k=1;k<rt;k++)N+=P[k];return N}function J(rt){return new Float64Array(rt)}let Dt=(3+16*q)*q,Q=(2+12*q)*q,At=(9+64*q)*q*q,Mt=J(4),Lt=J(8),pt=J(12),yt=J(16),K=J(4);function Bt(rt,P,N,k,$,W,ht){let at,wt,Et,G,st,et,lt,Ft,Kt,me,ve,He,Ue,Ye,je,wr,Jr,nr,Ie=rt-$,rr=N-$,pr=P-W,ur=k-W;Ye=Ie*ur,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=pr*rr,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,Mt[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,Mt[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,Mt[2]=He-(nr-st)+(ve-st),Mt[3]=nr;let Qn=j(4,Mt),bi=Q*ht;if(Qn>=bi||-Qn>=bi||(st=rt-Ie,at=rt-(Ie+st)+(st-$),st=N-rr,Et=N-(rr+st)+(st-$),st=P-pr,wt=P-(pr+st)+(st-W),st=k-ur,G=k-(ur+st)+(st-W),at===0&&wt===0&&Et===0&&G===0)||(bi=At*ht+xt*Math.abs(Qn),Qn+=Ie*G+ur*at-(pr*Et+rr*wt),Qn>=bi||-Qn>=bi))return Qn;Ye=at*ur,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*ur,Kt=et-(et-ur),me=ur-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=wt*rr,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*rr,Kt=et-(et-rr),me=rr-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let oi=B(4,Mt,4,K,Lt);Ye=Ie*G,et=D*Ie,lt=et-(et-Ie),Ft=Ie-lt,et=D*G,Kt=et-(et-G),me=G-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=pr*Et,et=D*pr,lt=et-(et-pr),Ft=pr-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let Z=B(oi,Lt,4,K,pt);Ye=at*G,et=D*at,lt=et-(et-at),Ft=at-lt,et=D*G,Kt=et-(et-G),me=G-Kt,je=Ft*me-(Ye-lt*Kt-Ft*Kt-lt*me),wr=wt*Et,et=D*wt,lt=et-(et-wt),Ft=wt-lt,et=D*Et,Kt=et-(et-Et),me=Et-Kt,Jr=Ft*me-(wr-lt*Kt-Ft*Kt-lt*me),ve=je-Jr,st=je-ve,K[0]=je-(ve+st)+(st-Jr),He=Ye+ve,st=He-Ye,Ue=Ye-(He-st)+(ve-st),ve=Ue-wr,st=Ue-ve,K[1]=Ue-(ve+st)+(st-wr),nr=He+ve,st=nr-He,K[2]=He-(nr-st)+(ve-st),K[3]=nr;let mt=B(Z,pt,4,K,yt);return yt[mt-1]}function Gt(rt,P,N,k,$,W){let ht=(P-W)*(N-$),at=(rt-$)*(k-W),wt=ht-at,Et=Math.abs(ht+at);return Math.abs(wt)>=Dt*Et?wt:-Bt(rt,P,N,k,$,W,Et)}let ae=(rt,P)=>rt.x*P.y-rt.y*P.x,ut=(rt,P)=>rt.x*P.x+rt.y*P.y,Ut=(rt,P,N)=>{let k=Gt(rt.x,rt.y,P.x,P.y,N.x,N.y);return k>0?-1:k<0?1:0},jt=rt=>Math.sqrt(ut(rt,rt)),ce=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ae($,k)/jt($)/jt(k)},te=(rt,P,N)=>{let k={x:P.x-rt.x,y:P.y-rt.y},$={x:N.x-rt.x,y:N.y-rt.y};return ut($,k)/jt($)/jt(k)},$t=(rt,P,N)=>P.y===0?null:{x:rt.x+P.x/P.y*(N-rt.y),y:N},qt=(rt,P,N)=>P.x===0?null:{x:N,y:rt.y+P.y/P.x*(N-rt.x)},xe=(rt,P,N,k)=>{if(P.x===0)return qt(N,k,rt.x);if(k.x===0)return qt(rt,P,N.x);if(P.y===0)return $t(N,k,rt.y);if(k.y===0)return $t(rt,P,N.y);let $=ae(P,k);if($==0)return null;let W={x:N.x-rt.x,y:N.y-rt.y},ht=ae(W,P)/$,at=ae(W,k)/$,wt=rt.x+at*P.x,Et=N.x+ht*k.x,G=rt.y+at*P.y,st=N.y+ht*k.y,et=(wt+Et)/2,lt=(G+st)/2;return{x:et,y:lt}};class ft{static compare(P,N){let k=ft.comparePoints(P.point,N.point);return k!==0?k:(P.point!==N.point&&P.link(N),P.isLeft!==N.isLeft?P.isLeft?1:-1:ee.compare(P.segment,N.segment))}static comparePoints(P,N){return P.x<N.x?-1:P.x>N.x?1:P.y<N.y?-1:P.y>N.y?1:0}constructor(P,N){P.events===void 0?P.events=[this]:P.events.push(this),this.point=P,this.isLeft=N}link(P){if(P.point===this.point)throw new Error("Tried to link already linked events");let N=P.point.events;for(let k=0,$=N.length;k<$;k++){let W=N[k];this.point.events.push(W),W.point=this.point}this.checkForConsuming()}checkForConsuming(){let P=this.point.events.length;for(let N=0;N<P;N++){let k=this.point.events[N];if(k.segment.consumedBy===void 0)for(let $=N+1;$<P;$++){let W=this.point.events[$];W.consumedBy===void 0&&k.otherSE.point.events===W.otherSE.point.events&&k.segment.consume(W.segment)}}}getAvailableLinkedEvents(){let P=[];for(let N=0,k=this.point.events.length;N<k;N++){let $=this.point.events[N];$!==this&&!$.segment.ringOut&&$.segment.isInResult()&&P.push($)}return P}getLeftmostComparator(P){let N=new Map,k=$=>{let W=$.otherSE;N.set($,{sine:ce(this.point,P.point,W.point),cosine:te(this.point,P.point,W.point)})};return($,W)=>{N.has($)||k($),N.has(W)||k(W);let{sine:ht,cosine:at}=N.get($),{sine:wt,cosine:Et}=N.get(W);return ht>=0&&wt>=0?at<Et?1:at>Et?-1:0:ht<0&&wt<0?at<Et?-1:at>Et?1:0:wt<ht?-1:wt>ht?1:0}}}let Xe=0;class ee{static compare(P,N){let k=P.leftSE.point.x,$=N.leftSE.point.x,W=P.rightSE.point.x,ht=N.rightSE.point.x;if(ht<k)return 1;if(W<$)return-1;let at=P.leftSE.point.y,wt=N.leftSE.point.y,Et=P.rightSE.point.y,G=N.rightSE.point.y;if(k<$){if(wt<at&&wt<Et)return 1;if(wt>at&&wt>Et)return-1;let st=P.comparePoint(N.leftSE.point);if(st<0)return 1;if(st>0)return-1;let et=N.comparePoint(P.rightSE.point);return et!==0?et:-1}if(k>$){if(at<wt&&at<G)return-1;if(at>wt&&at>G)return 1;let st=N.comparePoint(P.leftSE.point);if(st!==0)return st;let et=P.comparePoint(N.rightSE.point);return et<0?1:et>0?-1:1}if(at<wt)return-1;if(at>wt)return 1;if(W<ht){let st=N.comparePoint(P.rightSE.point);if(st!==0)return st}if(W>ht){let st=P.comparePoint(N.rightSE.point);if(st<0)return 1;if(st>0)return-1}if(W!==ht){let st=Et-at,et=W-k,lt=G-wt,Ft=ht-$;if(st>et&&lt<Ft)return 1;if(st<et&&lt>Ft)return-1}return W>ht?1:W<ht||Et<G?-1:Et>G?1:P.id<N.id?-1:P.id>N.id?1:0}constructor(P,N,k,$){this.id=++Xe,this.leftSE=P,P.segment=this,P.otherSE=N,this.rightSE=N,N.segment=this,N.otherSE=P,this.rings=k,this.windings=$}static fromRing(P,N,k){let $,W,ht,at=ft.comparePoints(P,N);if(at<0)$=P,W=N,ht=1;else if(at>0)$=N,W=P,ht=-1;else throw new Error(\`Tried to create degenerate segment at [\${P.x}, \${P.y}]\`);let wt=new ft($,!0),Et=new ft(W,!1);return new ee(wt,Et,[k],[ht])}replaceRightSE(P){this.rightSE=P,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let P=this.leftSE.point.y,N=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:P<N?P:N},ur:{x:this.rightSE.point.x,y:P>N?P:N}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(P){return P.x===this.leftSE.point.x&&P.y===this.leftSE.point.y||P.x===this.rightSE.point.x&&P.y===this.rightSE.point.y}comparePoint(P){if(this.isAnEndpoint(P))return 0;let N=this.leftSE.point,k=this.rightSE.point,$=this.vector();if(N.x===k.x)return P.x===N.x?0:P.x<N.x?1:-1;let W=(P.y-N.y)/$.y,ht=N.x+W*$.x;if(P.x===ht)return 0;let at=(P.x-N.x)/$.x,wt=N.y+at*$.y;return P.y===wt?0:P.y<wt?-1:1}getIntersection(P){let N=this.bbox(),k=P.bbox(),$=w(N,k);if($===null)return null;let W=this.leftSE.point,ht=this.rightSE.point,at=P.leftSE.point,wt=P.rightSE.point,Et=I(N,at)&&this.comparePoint(at)===0,G=I(k,W)&&P.comparePoint(W)===0,st=I(N,wt)&&this.comparePoint(wt)===0,et=I(k,ht)&&P.comparePoint(ht)===0;if(G&&Et)return et&&!st?ht:!et&&st?wt:null;if(G)return st&&W.x===wt.x&&W.y===wt.y?null:W;if(Et)return et&&ht.x===at.x&&ht.y===at.y?null:at;if(et&&st)return null;if(et)return ht;if(st)return wt;let lt=xe(W,this.vector(),at,P.vector());return lt===null||!I($,lt)?null:X.round(lt.x,lt.y)}split(P){let N=[],k=P.events!==void 0,$=new ft(P,!0),W=new ft(P,!1),ht=this.rightSE;this.replaceRightSE(W),N.push(W),N.push($);let at=new ee($,ht,this.rings.slice(),this.windings.slice());return ft.comparePoints(at.leftSE.point,at.rightSE.point)>0&&at.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),k&&($.checkForConsuming(),W.checkForConsuming()),N}swapEvents(){let P=this.rightSE;this.rightSE=this.leftSE,this.leftSE=P,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let N=0,k=this.windings.length;N<k;N++)this.windings[N]*=-1}consume(P){let N=this,k=P;for(;N.consumedBy;)N=N.consumedBy;for(;k.consumedBy;)k=k.consumedBy;let $=ee.compare(N,k);if($!==0){if($>0){let W=N;N=k,k=W}if(N.prev===k){let W=N;N=k,k=W}for(let W=0,ht=k.rings.length;W<ht;W++){let at=k.rings[W],wt=k.windings[W],Et=N.rings.indexOf(at);Et===-1?(N.rings.push(at),N.windings.push(wt)):N.windings[Et]+=wt}k.rings=null,k.windings=null,k.consumedBy=N,k.leftSE.consumedBy=N.leftSE,k.rightSE.consumedBy=N.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let P=this.prev.consumedBy||this.prev;this._beforeState=P.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let P=this.beforeState();this._afterState={rings:P.rings.slice(0),windings:P.windings.slice(0),multiPolys:[]};let N=this._afterState.rings,k=this._afterState.windings,$=this._afterState.multiPolys;for(let at=0,wt=this.rings.length;at<wt;at++){let Et=this.rings[at],G=this.windings[at],st=N.indexOf(Et);st===-1?(N.push(Et),k.push(G)):k[st]+=G}let W=[],ht=[];for(let at=0,wt=N.length;at<wt;at++){if(k[at]===0)continue;let Et=N[at],G=Et.poly;if(ht.indexOf(G)===-1)if(Et.isExterior)W.push(G);else{ht.indexOf(G)===-1&&ht.push(G);let st=W.indexOf(Et.poly);st!==-1&&W.splice(st,1)}}for(let at=0,wt=W.length;at<wt;at++){let Et=W[at].multiPoly;$.indexOf(Et)===-1&&$.push(Et)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let P=this.beforeState().multiPolys,N=this.afterState().multiPolys;switch(dt.type){case"union":{let k=P.length===0,$=N.length===0;this._isInResult=k!==$;break}case"intersection":{let k,$;P.length<N.length?(k=P.length,$=N.length):(k=N.length,$=P.length),this._isInResult=$===dt.numMultiPolys&&k<$;break}case"xor":{let k=Math.abs(P.length-N.length);this._isInResult=k%2===1;break}case"difference":{let k=$=>$.length===1&&$[0].isSubject;this._isInResult=k(P)!==k(N);break}default:throw new Error(\`Unrecognized operation type found \${dt.type}\`)}return this._isInResult}}class ge{constructor(P,N,k){if(!Array.isArray(P)||P.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=N,this.isExterior=k,this.segments=[],typeof P[0][0]!="number"||typeof P[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let $=X.round(P[0][0],P[0][1]);this.bbox={ll:{x:$.x,y:$.y},ur:{x:$.x,y:$.y}};let W=$;for(let ht=1,at=P.length;ht<at;ht++){if(typeof P[ht][0]!="number"||typeof P[ht][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let wt=X.round(P[ht][0],P[ht][1]);wt.x===W.x&&wt.y===W.y||(this.segments.push(ee.fromRing(W,wt,this)),wt.x<this.bbox.ll.x&&(this.bbox.ll.x=wt.x),wt.y<this.bbox.ll.y&&(this.bbox.ll.y=wt.y),wt.x>this.bbox.ur.x&&(this.bbox.ur.x=wt.x),wt.y>this.bbox.ur.y&&(this.bbox.ur.y=wt.y),W=wt)}($.x!==W.x||$.y!==W.y)&&this.segments.push(ee.fromRing(W,$,this))}getSweepEvents(){let P=[];for(let N=0,k=this.segments.length;N<k;N++){let $=this.segments[N];P.push($.leftSE),P.push($.rightSE)}return P}}class fe{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new ge(P[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let k=1,$=P.length;k<$;k++){let W=new ge(P[k],this,!1);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.interiorRings.push(W)}this.multiPoly=N}getSweepEvents(){let P=this.exteriorRing.getSweepEvents();for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class Te{constructor(P,N){if(!Array.isArray(P))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof P[0][0][0]=="number"&&(P=[P])}catch(k){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let k=0,$=P.length;k<$;k++){let W=new fe(P[k],this);W.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=W.bbox.ll.x),W.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=W.bbox.ll.y),W.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=W.bbox.ur.x),W.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=W.bbox.ur.y),this.polys.push(W)}this.isSubject=N}getSweepEvents(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getSweepEvents();for(let W=0,ht=$.length;W<ht;W++)P.push($[W])}return P}}class be{static factory(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.isInResult()||W.ringOut)continue;let ht=null,at=W.leftSE,wt=W.rightSE,Et=[at],G=at.point,st=[];for(;ht=at,at=wt,Et.push(at),at.point!==G;)for(;;){let et=at.getAvailableLinkedEvents();if(et.length===0){let Kt=Et[0].point,me=Et[Et.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${Kt.x}, \${Kt.y}]. Last matching segment found ends at [\${me.x}, \${me.y}].\`)}if(et.length===1){wt=et[0].otherSE;break}let lt=null;for(let Kt=0,me=st.length;Kt<me;Kt++)if(st[Kt].point===at.point){lt=Kt;break}if(lt!==null){let Kt=st.splice(lt)[0],me=Et.splice(Kt.index);me.unshift(me[0].otherSE),N.push(new be(me.reverse()));continue}st.push({index:Et.length,point:at.point});let Ft=at.getLeftmostComparator(ht);wt=et.sort(Ft)[0].otherSE;break}N.push(new be(Et))}return N}constructor(P){this.events=P;for(let N=0,k=P.length;N<k;N++)P[N].segment.ringOut=this;this.poly=null}getGeom(){let P=this.events[0].point,N=[P];for(let Et=1,G=this.events.length-1;Et<G;Et++){let st=this.events[Et].point,et=this.events[Et+1].point;Ut(st,P,et)!==0&&(N.push(st),P=st)}if(N.length===1)return null;let k=N[0],$=N[1];Ut(k,P,$)===0&&N.shift(),N.push(N[0]);let W=this.isExteriorRing()?1:-1,ht=this.isExteriorRing()?0:N.length-1,at=this.isExteriorRing()?N.length:-1,wt=[];for(let Et=ht;Et!=at;Et+=W)wt.push([N[Et].x,N[Et].y]);return wt}isExteriorRing(){if(this._isExteriorRing===void 0){let P=this.enclosingRing();this._isExteriorRing=P?!P.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let P=this.events[0];for(let $=1,W=this.events.length;$<W;$++){let ht=this.events[$];ft.compare(P,ht)>0&&(P=ht)}let N=P.segment.prevInResult(),k=N?N.prevInResult():null;for(;;){if(!N)return null;if(!k)return N.ringOut;if(k.ringOut!==N.ringOut)return k.ringOut.enclosingRing()!==N.ringOut?N.ringOut:N.ringOut.enclosingRing();N=k.prevInResult(),k=N?N.prevInResult():null}}}class Wt{constructor(P){this.exteriorRing=P,P.poly=this,this.interiorRings=[]}addInterior(P){this.interiorRings.push(P),P.poly=this}getGeom(){let P=[this.exteriorRing.getGeom()];if(P[0]===null)return null;for(let N=0,k=this.interiorRings.length;N<k;N++){let $=this.interiorRings[N].getGeom();$!==null&&P.push($)}return P}}class Me{constructor(P){this.rings=P,this.polys=this._composePolys(P)}getGeom(){let P=[];for(let N=0,k=this.polys.length;N<k;N++){let $=this.polys[N].getGeom();$!==null&&P.push($)}return P}_composePolys(P){let N=[];for(let k=0,$=P.length;k<$;k++){let W=P[k];if(!W.poly)if(W.isExteriorRing())N.push(new Wt(W));else{let ht=W.enclosingRing();ht.poly||N.push(new Wt(ht)),ht.poly.addInterior(W)}}return N}}class tt{constructor(P){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ee.compare;this.queue=P,this.tree=new g(N),this.segments=[]}process(P){let N=P.segment,k=[];if(P.consumedBy)return P.isLeft?this.queue.remove(P.otherSE):this.tree.remove(N),k;let $=P.isLeft?this.tree.add(N):this.tree.find(N);if(!$)throw new Error(\`Unable to find segment #\${N.id} [\${N.leftSE.point.x}, \${N.leftSE.point.y}] -> [\${N.rightSE.point.x}, \${N.rightSE.point.y}] in SweepLine tree.\`);let W=$,ht=$,at,wt;for(;at===void 0;)W=this.tree.prev(W),W===null?at=null:W.key.consumedBy===void 0&&(at=W.key);for(;wt===void 0;)ht=this.tree.next(ht),ht===null?wt=null:ht.key.consumedBy===void 0&&(wt=ht.key);if(P.isLeft){let Et=null;if(at){let st=at.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(Et=st),!at.isAnEndpoint(st))){let et=this._splitSafely(at,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}let G=null;if(wt){let st=wt.getIntersection(N);if(st!==null&&(N.isAnEndpoint(st)||(G=st),!wt.isAnEndpoint(st))){let et=this._splitSafely(wt,st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}}if(Et!==null||G!==null){let st=null;Et===null?st=G:G===null?st=Et:st=ft.comparePoints(Et,G)<=0?Et:G,this.queue.remove(N.rightSE),k.push(N.rightSE);let et=N.split(st);for(let lt=0,Ft=et.length;lt<Ft;lt++)k.push(et[lt])}k.length>0?(this.tree.remove(N),k.push(P)):(this.segments.push(N),N.prev=at)}else{if(at&&wt){let Et=at.getIntersection(wt);if(Et!==null){if(!at.isAnEndpoint(Et)){let G=this._splitSafely(at,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}if(!wt.isAnEndpoint(Et)){let G=this._splitSafely(wt,Et);for(let st=0,et=G.length;st<et;st++)k.push(G[st])}}}this.tree.remove(N)}return k}_splitSafely(P,N){this.tree.remove(P);let k=P.rightSE;this.queue.remove(k);let $=P.split(N);return $.push(k),P.consumedBy===void 0&&this.tree.add(P),$}}let z=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,It=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ot{run(P,N,k){dt.type=P,X.reset();let $=[new Te(N,!0)];for(let st=0,et=k.length;st<et;st++)$.push(new Te(k[st],!1));if(dt.numMultiPolys=$.length,dt.type==="difference"){let st=$[0],et=1;for(;et<$.length;)w($[et].bbox,st.bbox)!==null?et++:$.splice(et,1)}if(dt.type==="intersection")for(let st=0,et=$.length;st<et;st++){let lt=$[st];for(let Ft=st+1,Kt=$.length;Ft<Kt;Ft++)if(w(lt.bbox,$[Ft].bbox)===null)return[]}let W=new g(ft.compare);for(let st=0,et=$.length;st<et;st++){let lt=$[st].getSweepEvents();for(let Ft=0,Kt=lt.length;Ft<Kt;Ft++)if(W.insert(lt[Ft]),W.size>z)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let ht=new tt(W),at=W.size,wt=W.pop();for(;wt;){let st=wt.key;if(W.size===at){let lt=st.segment;throw new Error(\`Unable to pop() \${st.isLeft?"left":"right"} SweepEvent [\${st.point.x}, \${st.point.y}] from segment #\${lt.id} [\${lt.leftSE.point.x}, \${lt.leftSE.point.y}] -> [\${lt.rightSE.point.x}, \${lt.rightSE.point.y}] from queue.\`)}if(W.size>z)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(ht.segments.length>It)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let et=ht.process(st);for(let lt=0,Ft=et.length;lt<Ft;lt++){let Kt=et[lt];Kt.consumedBy===void 0&&W.insert(Kt)}at=W.size,wt=W.pop()}X.reset();let Et=be.factory(ht.segments);return new Me(Et).getGeom()}}let dt=new Ot;var ne={union:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("union",rt,N)},intersection:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("intersection",rt,N)},xor:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("xor",rt,N)},difference:function(rt){for(var P=arguments.length,N=new Array(P>1?P-1:0),k=1;k<P;k++)N[k-1]=arguments[k];return dt.run("difference",rt,N)}};return ne})});var QL=ot((zg,jL)=>{(function(n,t){typeof zg=="object"&&typeof jL!="undefined"?t(zg):typeof define=="function"&&define.amd?define(["exports"],t):t(n.jsts={})})(zg,function(n){"use strict";function t(){}function e(r){this.message=r||""}function o(r){this.message=r||""}function s(r){this.message=r||""}function l(){}function p(r){return r===null?je:r.color}function h(r){return r===null?null:r.parent}function g(r,i){r!==null&&(r.color=i)}function m(r){return r===null?null:r.left}function _(r){return r===null?null:r.right}function E(){this.root_=null,this.size_=0}function S(){}function b(){this.array_=[],arguments[0]instanceof at&&this.addAll(arguments[0])}function A(){}function I(r){this.message=r||""}function w(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(r){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),a=Math.max(Math.min(i.length,9007199254740991),0)||0,c=1 in arguments&&parseInt(Number(arguments[1]),10)||0;c=c<0?Math.max(a+c,0):Math.min(c,a);var d=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:a;for(d=d<0?Math.max(a+arguments[2],0):Math.min(d,a);c<d;)i[c]=r,++c;return i},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!=r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var x=function(){};x.prototype.interfaces_=function(){return[]},x.prototype.getClass=function(){return x},x.prototype.equalsWithTolerance=function(r,i,a){return Math.abs(r-i)<=a};var R=function(r){function i(a){r.call(this,a),this.name="IllegalArgumentException",this.message=a,this.stack=new r().stack}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i}(Error),C=function(){},F={MAX_VALUE:{configurable:!0}};C.isNaN=function(r){return Number.isNaN(r)},C.doubleToLongBits=function(r){return r},C.longBitsToDouble=function(r){return r},C.isInfinite=function(r){return!Number.isFinite(r)},F.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(C,F);var V=function(){},X=function(){},q=function(){},D=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},xt={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(r,i){switch(r){case D.X:this.x=i;break;case D.Y:this.y=i;break;case D.Z:this.z=i;break;default:throw new R("Invalid ordinate index: "+r)}},D.prototype.equals2D=function(){if(arguments.length===1){var r=arguments[0];return this.x===r.x&&this.y===r.y}if(arguments.length===2){var i=arguments[0],a=arguments[1];return!!x.equalsWithTolerance(this.x,i.x,a)&&!!x.equalsWithTolerance(this.y,i.y,a)}},D.prototype.getOrdinate=function(r){switch(r){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new R("Invalid ordinate index: "+r)},D.prototype.equals3D=function(r){return this.x===r.x&&this.y===r.y&&(this.z===r.z||C.isNaN(this.z))&&C.isNaN(r.z)},D.prototype.equals=function(r){return r instanceof D&&this.equals2D(r)},D.prototype.equalInZ=function(r,i){return x.equalsWithTolerance(this.z,r.z,i)},D.prototype.compareTo=function(r){var i=r;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(r){var i=this.x-r.x,a=this.y-r.y,c=this.z-r.z;return Math.sqrt(i*i+a*a+c*c)},D.prototype.distance=function(r){var i=this.x-r.x,a=this.y-r.y;return Math.sqrt(i*i+a*a)},D.prototype.hashCode=function(){var r=17;return r=37*r+D.hashCode(this.x),r=37*r+D.hashCode(this.y)},D.prototype.setCoordinate=function(r){this.x=r.x,this.y=r.y,this.z=r.z},D.prototype.interfaces_=function(){return[V,X,t]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var r=arguments[0],i=C.doubleToLongBits(r);return Math.trunc((i^i)>>>32)}},xt.DimensionalComparator.get=function(){return B},xt.serialVersionUID.get=function(){return 6683108902428367e3},xt.NULL_ORDINATE.get=function(){return C.NaN},xt.X.get=function(){return 0},xt.Y.get=function(){return 1},xt.Z.get=function(){return 2},Object.defineProperties(D,xt);var B=function(r){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new R("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};B.prototype.compare=function(r,i){var a=r,c=i,d=B.compare(a.x,c.x);if(d!==0)return d;var v=B.compare(a.y,c.y);return v!==0?v:this._dimensionsToTest<=2?0:B.compare(a.z,c.z)},B.prototype.interfaces_=function(){return[q]},B.prototype.getClass=function(){return B},B.compare=function(r,i){return r<i?-1:r>i?1:C.isNaN(r)?C.isNaN(i)?0:-1:C.isNaN(i)?1:0};var j=function(){};j.prototype.create=function(){},j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j};var J=function(){},Dt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.toLocationSymbol=function(r){switch(r){case J.EXTERIOR:return"e";case J.BOUNDARY:return"b";case J.INTERIOR:return"i";case J.NONE:return"-"}throw new R("Unknown location value: "+r)},Dt.INTERIOR.get=function(){return 0},Dt.BOUNDARY.get=function(){return 1},Dt.EXTERIOR.get=function(){return 2},Dt.NONE.get=function(){return-1},Object.defineProperties(J,Dt);var Q=function(r,i){return r.interfaces_&&r.interfaces_().indexOf(i)>-1},At=function(){},Mt={LOG_10:{configurable:!0}};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.log10=function(r){var i=Math.log(r);return C.isInfinite(i)||C.isNaN(i)?i:i/At.LOG_10},At.min=function(r,i,a,c){var d=r;return i<d&&(d=i),a<d&&(d=a),c<d&&(d=c),d},At.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1],a=arguments[2];return r<i?i:r>a?a:r}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var c=arguments[0],d=arguments[1],v=arguments[2];return c<d?d:c>v?v:c}},At.wrap=function(r,i){return r<0?i- -r%i:r%i},At.max=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],a=arguments[2],c=r;return i>c&&(c=i),a>c&&(c=a),c}if(arguments.length===4){var d=arguments[0],v=arguments[1],M=arguments[2],L=arguments[3],H=d;return v>H&&(H=v),M>H&&(H=M),L>H&&(H=L),H}},At.average=function(r,i){return(r+i)/2},Mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(At,Mt);var Lt=function(r){this.str=r};Lt.prototype.append=function(r){this.str+=r},Lt.prototype.setCharAt=function(r,i){this.str=this.str.substr(0,r)+i+this.str.substr(r+1)},Lt.prototype.toString=function(r){return this.str};var pt=function(r){this.value=r};pt.prototype.intValue=function(){return this.value},pt.prototype.compareTo=function(r){return this.value<r?-1:this.value>r?1:0},pt.isNaN=function(r){return Number.isNaN(r)};var yt=function(){};yt.isWhitespace=function(r){return r<=32&&r>=0||r===127},yt.toUpperCase=function(r){return r.toUpperCase()};var K=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var i=arguments[0];this.init(i)}else if(arguments[0]instanceof r){var a=arguments[0];this.init(a)}else if(typeof arguments[0]=="string"){var c=arguments[0];r.call(this,r.parse(c))}}else if(arguments.length===2){var d=arguments[0],v=arguments[1];this.init(d,v)}},Bt={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};K.prototype.le=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<=r._lo},K.prototype.extractSignificantDigits=function(r,i){var a=this.abs(),c=K.magnitude(a._hi),d=K.TEN.pow(c);(a=a.divide(d)).gt(K.TEN)?(a=a.divide(K.TEN),c+=1):a.lt(K.ONE)&&(a=a.multiply(K.TEN),c-=1);for(var v=c+1,M=new Lt,L=K.MAX_PRINT_DIGITS-1,H=0;H<=L;H++){r&&H===v&&M.append(".");var it=Math.trunc(a._hi);if(it<0)break;var bt=!1,Tt=0;it>9?(bt=!0,Tt="9"):Tt="0"+it,M.append(Tt),a=a.subtract(K.valueOf(it)).multiply(K.TEN),bt&&a.selfAdd(K.TEN);var Jt=!0,Qt=K.magnitude(a._hi);if(Qt<0&&Math.abs(Qt)>=L-H&&(Jt=!1),!Jt)break}return i[0]=c,M.toString()},K.prototype.sqr=function(){return this.multiply(this)},K.prototype.doubleValue=function(){return this._hi+this._lo},K.prototype.subtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.add(r.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},K.prototype.equals=function(){if(arguments.length===1){var r=arguments[0];return this._hi===r._hi&&this._lo===r._lo}},K.prototype.isZero=function(){return this._hi===0&&this._lo===0},K.prototype.selfSubtract=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.isNaN()?this:this.selfAdd(-r._hi,-r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},K.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},K.prototype.min=function(r){return this.le(r)?this:r},K.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfDivide(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null,bt=null,Tt=null;return H=this._hi/a,it=K.SPLIT*H,d=it-H,Tt=K.SPLIT*a,d=it-d,v=H-d,M=Tt-a,bt=H*a,M=Tt-M,L=a-M,Tt=d*M-bt+d*L+v*M+v*L,it=(this._hi-bt-Tt+this._lo-H*c)/a,Tt=H+it,this._hi=Tt,this._lo=H-Tt+it,this}},K.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},K.prototype.divide=function(){if(arguments[0]instanceof K){var r=arguments[0],i=null,a=null,c=null,d=null,v=null,M=null,L=null,H=null;return a=(v=this._hi/r._hi)-(i=(M=K.SPLIT*v)-(i=M-v)),H=i*(c=(H=K.SPLIT*r._hi)-(c=H-r._hi))-(L=v*r._hi)+i*(d=r._hi-c)+a*c+a*d,M=(this._hi-L-H+this._lo-v*r._lo)/r._hi,new K(H=v+M,v-H+M)}if(typeof arguments[0]=="number"){var it=arguments[0];return C.isNaN(it)?K.createNaN():K.copy(this).selfDivide(it,0)}},K.prototype.ge=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>=r._lo},K.prototype.pow=function(r){if(r===0)return K.valueOf(1);var i=new K(this),a=K.valueOf(1),c=Math.abs(r);if(c>1)for(;c>0;)c%2==1&&a.selfMultiply(i),(c/=2)>0&&(i=i.sqr());else a=i;return r<0?a.reciprocal():a},K.prototype.ceil=function(){if(this.isNaN())return K.NaN;var r=Math.ceil(this._hi),i=0;return r===this._hi&&(i=Math.ceil(this._lo)),new K(r,i)},K.prototype.compareTo=function(r){var i=r;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},K.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},K.prototype.setValue=function(){if(arguments[0]instanceof K){var r=arguments[0];return this.init(r),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},K.prototype.max=function(r){return this.ge(r)?this:r},K.prototype.sqrt=function(){if(this.isZero())return K.valueOf(0);if(this.isNegative())return K.NaN;var r=1/Math.sqrt(this._hi),i=this._hi*r,a=K.valueOf(i),c=this.subtract(a.sqr())._hi*(.5*r);return a.add(c)},K.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfAdd(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],a=null,c=null,d=null,v=null,M=null,L=null;return d=this._hi+i,M=d-this._hi,v=d-M,v=i-M+(this._hi-v),L=v+this._lo,a=d+L,c=L+(d-a),this._hi=a+c,this._lo=c+(a-this._hi),this}}else if(arguments.length===2){var H=arguments[0],it=arguments[1],bt=null,Tt=null,Jt=null,Qt=null,le=null,Ee=null,Dn=null;Qt=this._hi+H,Tt=this._lo+it,le=Qt-(Ee=Qt-this._hi),Jt=Tt-(Dn=Tt-this._lo);var Kn=(bt=Qt+(Ee=(le=H-Ee+(this._hi-le))+Tt))+(Ee=(Jt=it-Dn+(this._lo-Jt))+(Ee+(Qt-bt))),fi=Ee+(bt-Kn);return this._hi=Kn,this._lo=fi,this}},K.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof K){var r=arguments[0];return this.selfMultiply(r._hi,r._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var a=arguments[0],c=arguments[1],d=null,v=null,M=null,L=null,H=null,it=null;d=(H=K.SPLIT*this._hi)-this._hi,it=K.SPLIT*a,d=H-d,v=this._hi-d,M=it-a;var bt=(H=this._hi*a)+(it=d*(M=it-M)-H+d*(L=a-M)+v*M+v*L+(this._hi*c+this._lo*a)),Tt=it+(d=H-bt);return this._hi=bt,this._lo=Tt,this}},K.prototype.selfSqr=function(){return this.selfMultiply(this)},K.prototype.floor=function(){if(this.isNaN())return K.NaN;var r=Math.floor(this._hi),i=0;return r===this._hi&&(i=Math.floor(this._lo)),new K(r,i)},K.prototype.negate=function(){return this.isNaN()?this:new K(-this._hi,-this._lo)},K.prototype.clone=function(){},K.prototype.multiply=function(){if(arguments[0]instanceof K){var r=arguments[0];return r.isNaN()?K.createNaN():K.copy(this).selfMultiply(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return C.isNaN(i)?K.createNaN():K.copy(this).selfMultiply(i,0)}},K.prototype.isNaN=function(){return C.isNaN(this._hi)},K.prototype.intValue=function(){return Math.trunc(this._hi)},K.prototype.toString=function(){var r=K.magnitude(this._hi);return r>=-3&&r<=20?this.toStandardNotation():this.toSciNotation()},K.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!0,i),c=i[0]+1,d=a;if(a.charAt(0)===".")d="0"+a;else if(c<0)d="0."+K.stringOfChar("0",-c)+a;else if(a.indexOf(".")===-1){var v=c-a.length;d=a+K.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+d:d},K.prototype.reciprocal=function(){var r=null,i=null,a=null,c=null,d=null,v=null,M=null,L=null;i=(d=1/this._hi)-(r=(v=K.SPLIT*d)-(r=v-d)),a=(L=K.SPLIT*this._hi)-this._hi;var H=d+(v=(1-(M=d*this._hi)-(L=r*(a=L-a)-M+r*(c=this._hi-a)+i*a+i*c)-d*this._lo)/this._hi);return new K(H,d-H+v)},K.prototype.toSciNotation=function(){if(this.isZero())return K.SCI_NOT_ZERO;var r=this.getSpecialNumberString();if(r!==null)return r;var i=new Array(1).fill(null),a=this.extractSignificantDigits(!1,i),c=K.SCI_NOT_EXPONENT_CHAR+i[0];if(a.charAt(0)==="0")throw new Error("Found leading zero: "+a);var d="";a.length>1&&(d=a.substring(1));var v=a.charAt(0)+"."+d;return this.isNegative()?"-"+v+c:v+c},K.prototype.abs=function(){return this.isNaN()?K.NaN:this.isNegative()?this.negate():new K(this)},K.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},K.prototype.lt=function(r){return(this._hi<r._hi||this._hi===r._hi)&&this._lo<r._lo},K.prototype.add=function(){if(arguments[0]instanceof K){var r=arguments[0];return K.copy(this).selfAdd(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return K.copy(this).selfAdd(i)}},K.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var r=arguments[0];this._hi=r,this._lo=0}else if(arguments[0]instanceof K){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var a=arguments[0],c=arguments[1];this._hi=a,this._lo=c}},K.prototype.gt=function(r){return(this._hi>r._hi||this._hi===r._hi)&&this._lo>r._lo},K.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},K.prototype.trunc=function(){return this.isNaN()?K.NaN:this.isPositive()?this.floor():this.ceil()},K.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},K.prototype.interfaces_=function(){return[t,V,X]},K.prototype.getClass=function(){return K},K.sqr=function(r){return K.valueOf(r).selfMultiply(r)},K.valueOf=function(){if(typeof arguments[0]=="string"){var r=arguments[0];return K.parse(r)}if(typeof arguments[0]=="number"){var i=arguments[0];return new K(i)}},K.sqrt=function(r){return K.valueOf(r).sqrt()},K.parse=function(r){for(var i=0,a=r.length;yt.isWhitespace(r.charAt(i));)i++;var c=!1;if(i<a){var d=r.charAt(i);d!=="-"&&d!=="+"||(i++,d==="-"&&(c=!0))}for(var v=new K,M=0,L=0,H=0;!(i>=a);){var it=r.charAt(i);if(i++,yt.isDigit(it)){var bt=it-"0";v.selfMultiply(K.TEN),v.selfAdd(bt),M++}else{if(it!=="."){if(it==="e"||it==="E"){var Tt=r.substring(i);try{H=pt.parseInt(Tt)}catch(Dn){throw Dn instanceof Error?new Error("Invalid exponent "+Tt+" in string "+r):Dn}break}throw new Error("Unexpected character '"+it+"' at position "+i+" in string "+r)}L=M}}var Jt=v,Qt=M-L-H;if(Qt===0)Jt=v;else if(Qt>0){var le=K.TEN.pow(Qt);Jt=v.divide(le)}else if(Qt<0){var Ee=K.TEN.pow(-Qt);Jt=v.multiply(Ee)}return c?Jt.negate():Jt},K.createNaN=function(){return new K(C.NaN,C.NaN)},K.copy=function(r){return new K(r)},K.magnitude=function(r){var i=Math.abs(r),a=Math.log(i)/Math.log(10),c=Math.trunc(Math.floor(a));return 10*Math.pow(10,c)<=i&&(c+=1),c},K.stringOfChar=function(r,i){for(var a=new Lt,c=0;c<i;c++)a.append(r);return a.toString()},Bt.PI.get=function(){return new K(3.141592653589793,12246467991473532e-32)},Bt.TWO_PI.get=function(){return new K(6.283185307179586,24492935982947064e-32)},Bt.PI_2.get=function(){return new K(1.5707963267948966,6123233995736766e-32)},Bt.E.get=function(){return new K(2.718281828459045,14456468917292502e-32)},Bt.NaN.get=function(){return new K(C.NaN,C.NaN)},Bt.EPS.get=function(){return 123259516440783e-46},Bt.SPLIT.get=function(){return 134217729},Bt.MAX_PRINT_DIGITS.get=function(){return 32},Bt.TEN.get=function(){return K.valueOf(10)},Bt.ONE.get=function(){return K.valueOf(1)},Bt.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Bt.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(K,Bt);var Gt=function(){},ae={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(r,i,a){var c=Gt.orientationIndexFilter(r,i,a);if(c<=1)return c;var d=K.valueOf(i.x).selfAdd(-r.x),v=K.valueOf(i.y).selfAdd(-r.y),M=K.valueOf(a.x).selfAdd(-i.x),L=K.valueOf(a.y).selfAdd(-i.y);return d.selfMultiply(L).selfSubtract(v.selfMultiply(M)).signum()},Gt.signOfDet2x2=function(r,i,a,c){return r.multiply(c).selfSubtract(i.multiply(a)).signum()},Gt.intersection=function(r,i,a,c){var d=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(i.x).selfSubtract(r.x)),v=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(i.y).selfSubtract(r.y)),M=d.subtract(v),L=K.valueOf(c.x).selfSubtract(a.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),H=K.valueOf(c.y).selfSubtract(a.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),it=L.subtract(H).selfDivide(M).doubleValue(),bt=K.valueOf(r.x).selfAdd(K.valueOf(i.x).selfSubtract(r.x).selfMultiply(it)).doubleValue(),Tt=K.valueOf(i.x).selfSubtract(r.x).selfMultiply(K.valueOf(r.y).selfSubtract(a.y)),Jt=K.valueOf(i.y).selfSubtract(r.y).selfMultiply(K.valueOf(r.x).selfSubtract(a.x)),Qt=Tt.subtract(Jt).selfDivide(M).doubleValue(),le=K.valueOf(a.y).selfAdd(K.valueOf(c.y).selfSubtract(a.y).selfMultiply(Qt)).doubleValue();return new D(bt,le)},Gt.orientationIndexFilter=function(r,i,a){var c=null,d=(r.x-a.x)*(i.y-a.y),v=(r.y-a.y)*(i.x-a.x),M=d-v;if(d>0){if(v<=0)return Gt.signum(M);c=d+v}else{if(!(d<0)||v>=0)return Gt.signum(M);c=-d-v}var L=Gt.DP_SAFE_EPSILON*c;return M>=L||-M>=L?Gt.signum(M):2},Gt.signum=function(r){return r>0?1:r<0?-1:0},ae.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,ae);var ut=function(){},Ut={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ut.X.get=function(){return 0},Ut.Y.get=function(){return 1},Ut.Z.get=function(){return 2},Ut.M.get=function(){return 3},ut.prototype.setOrdinate=function(r,i,a){},ut.prototype.size=function(){},ut.prototype.getOrdinate=function(r,i){},ut.prototype.getCoordinate=function(){},ut.prototype.getCoordinateCopy=function(r){},ut.prototype.getDimension=function(){},ut.prototype.getX=function(r){},ut.prototype.clone=function(){},ut.prototype.expandEnvelope=function(r){},ut.prototype.copy=function(){},ut.prototype.getY=function(r){},ut.prototype.toCoordinateArray=function(){},ut.prototype.interfaces_=function(){return[X]},ut.prototype.getClass=function(){return ut},Object.defineProperties(ut,Ut);var jt=function(){},ce=function(r){function i(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(jt),te=function(){};te.arraycopy=function(r,i,a,c,d){for(var v=0,M=i;M<i+d;M++)a[c+v]=r[M],v++},te.getProperty=function(r){return{"line.separator":\`