@mappedin/mappedin-js 6.0.1-beta.27 → 6.0.1-beta.29

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.
@@ -0,0 +1 @@
1
+ import{$ as _g,A as B,Aa as $g,B as j7,Ba as Jg,C as Mg,Ca as Qg,D as Wt,Da as Kg,E as Pg,Ea as Dh,F as Tt,Fa as Eo,G as Sh,Ga as e1,H as Tg,Ha as t1,I as is,Ia as r1,J as wg,Ja as i1,K as Fi,Ka as vp,L as xh,La as Oh,M as _i,Ma as o1,N as Ie,Na as n1,O as Ih,Oa as a1,P as Dg,Pa as s1,Q as _n,Qa as l1,R as wo,Ra as Lh,S as Og,Sa as c1,T as Mh,Ta as p1,U as Lg,Ua as u1,Va as d1,W as fp,Wa as je,X as mp,Xa as h1,Y as Ag,Ya as Yt,Z as Fg,Za as Ee,_ as yp,aa as kg,ba as Bg,c as O,ca as Rg,d as yh,da as ki,e as ip,ea as Ph,f as op,fa as os,g as tg,ga as Ng,h as np,ha as Gg,i as rg,ia as Vg,j as Z,ja as jg,k as he,ka as Bi,l as En,la as gp,m as gh,ma as kn,n as gr,na as Hg,o as ap,p as Zr,pa as Ug,q as Po,qa as Xg,r as ig,ra as xr,s as og,sa as Wg,t as ng,ta as Yg,u as Qa,ua as Zg,v as yt,va as Th,w as vh,wa as zg,x as vr,xa as wh,y as ag,ya as Eh,z as sp,za as qg}from"./chunk-PDOJBYQZ.js";import{j as Eg}from"./chunk-IJDVDF27.js";import{a as Ri}from"./chunk-3RUMFBSI.js";import{A as J,Ba as br,Ca as Cr,Da as vg,E as sg,Ea as bg,F as lg,Fa as Cg,G as cg,H as z,Ha as Ai,I as zr,J as pg,K as On,L as Ln,M as es,N as ze,P as Xt,Pa as Fn,Q as ts,R as ug,S as me,Sa as hp,T as cp,Ta as Sg,V as rs,W as dg,X as bh,Xa as xg,Y as hg,Z as qr,_a as Sr,a as lp,ab as Ig,d as To,da as fg,e as Ka,ea as mg,fa as An,na as pp,oa as up,pa as yg,ra as Ch,w as Dn,xa as gg,ya as Li,z as ae,za as dp}from"./chunk-EXW3BL3F.js";import{a as f,b as x}from"./chunk-IKRJZNLL.js";import{b as G,c as V7,d as rp,e as u,f as a,g as b,h as I,i as j}from"./chunk-H2E2454S.js";var R1=G((jh,Hh)=>{f();(function(r,t){typeof jh=="object"&&typeof Hh<"u"?Hh.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(jh,function(){"use strict";function r(v,C,w,P,T){(function E(A,k,N,F,V){for(;F>N;){if(F-N>600){var R=F-N+1,q=k-N+1,$=Math.log(R),pe=.5*Math.exp(2*$/3),ve=.5*Math.sqrt($*pe*(R-pe)/R)*(q-R/2<0?-1:1),Be=Math.max(N,Math.floor(k-q*pe/R+ve)),Pt=Math.min(F,Math.floor(k+(R-q)*pe/R+ve));E(A,k,Be,Pt,V)}var de=A[k],Oe=N,be=F;for(t(A,N,k),V(A[F],de)>0&&t(A,N,F);Oe<be;){for(t(A,Oe,be),Oe++,be--;V(A[Oe],de)<0;)Oe++;for(;V(A[be],de)>0;)be--}V(A[N],de)===0?t(A,N,be):t(A,++be,F),be<=k&&(N=be+1),k<=be&&(F=be-1)}})(v,C,w||0,P||v.length-1,T||e)}function t(v,C,w){var P=v[C];v[C]=v[w],v[w]=P}function e(v,C){return v<C?-1:v>C?1:0}var i=function(v){v===void 0&&(v=9),this._maxEntries=Math.max(4,v),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(v,C,w){if(!w)return C.indexOf(v);for(var P=0;P<C.length;P++)if(w(v,C[P]))return P;return-1}function n(v,C){s(v,0,v.children.length,C,v)}function s(v,C,w,P,T){T||(T=S(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var E=C;E<w;E++){var A=v.children[E];c(T,v.leaf?P(A):A)}return T}function c(v,C){return v.minX=Math.min(v.minX,C.minX),v.minY=Math.min(v.minY,C.minY),v.maxX=Math.max(v.maxX,C.maxX),v.maxY=Math.max(v.maxY,C.maxY),v}function l(v,C){return v.minX-C.minX}function p(v,C){return v.minY-C.minY}function h(v){return(v.maxX-v.minX)*(v.maxY-v.minY)}function m(v){return v.maxX-v.minX+(v.maxY-v.minY)}function y(v,C){return v.minX<=C.minX&&v.minY<=C.minY&&C.maxX<=v.maxX&&C.maxY<=v.maxY}function g(v,C){return C.minX<=v.maxX&&C.minY<=v.maxY&&C.maxX>=v.minX&&C.maxY>=v.minY}function S(v){return{children:v,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function M(v,C,w,P,T){for(var E=[C,w];E.length;)if(!((w=E.pop())-(C=E.pop())<=P)){var A=C+Math.ceil((w-C)/P/2)*P;r(v,A,C,w,T),E.push(C,A,A,w)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(v){var C=this.data,w=[];if(!g(v,C))return w;for(var P=this.toBBox,T=[];C;){for(var E=0;E<C.children.length;E++){var A=C.children[E],k=C.leaf?P(A):A;g(v,k)&&(C.leaf?w.push(A):y(v,k)?this._all(A,w):T.push(A))}C=T.pop()}return w},i.prototype.collides=function(v){var C=this.data;if(!g(v,C))return!1;for(var w=[];C;){for(var P=0;P<C.children.length;P++){var T=C.children[P],E=C.leaf?this.toBBox(T):T;if(g(v,E)){if(C.leaf||y(v,E))return!0;w.push(T)}}C=w.pop()}return!1},i.prototype.load=function(v){if(!v||!v.length)return this;if(v.length<this._minEntries){for(var C=0;C<v.length;C++)this.insert(v[C]);return this}var w=this._build(v.slice(),0,v.length-1,0);if(this.data.children.length)if(this.data.height===w.height)this._splitRoot(this.data,w);else{if(this.data.height<w.height){var P=this.data;this.data=w,w=P}this._insert(w,this.data.height-w.height-1,!0)}else this.data=w;return this},i.prototype.insert=function(v){return v&&this._insert(v,this.data.height-1),this},i.prototype.clear=function(){return this.data=S([]),this},i.prototype.remove=function(v,C){if(!v)return this;for(var w,P,T,E=this.data,A=this.toBBox(v),k=[],N=[];E||k.length;){if(E||(E=k.pop(),P=k[k.length-1],w=N.pop(),T=!0),E.leaf){var F=o(v,E.children,C);if(F!==-1)return E.children.splice(F,1),k.push(E),this._condense(k),this}T||E.leaf||!y(E,A)?P?(w++,E=P.children[w],T=!1):E=null:(k.push(E),N.push(w),w=0,P=E,E=E.children[0])}return this},i.prototype.toBBox=function(v){return v},i.prototype.compareMinX=function(v,C){return v.minX-C.minX},i.prototype.compareMinY=function(v,C){return v.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(v){return this.data=v,this},i.prototype._all=function(v,C){for(var w=[];v;)v.leaf?C.push.apply(C,v.children):w.push.apply(w,v.children),v=w.pop();return C},i.prototype._build=function(v,C,w,P){var T,E=w-C+1,A=this._maxEntries;if(E<=A)return n(T=S(v.slice(C,w+1)),this.toBBox),T;P||(P=Math.ceil(Math.log(E)/Math.log(A)),A=Math.ceil(E/Math.pow(A,P-1))),(T=S([])).leaf=!1,T.height=P;var k=Math.ceil(E/A),N=k*Math.ceil(Math.sqrt(A));M(v,C,w,N,this.compareMinX);for(var F=C;F<=w;F+=N){var V=Math.min(F+N-1,w);M(v,F,V,k,this.compareMinY);for(var R=F;R<=V;R+=k){var q=Math.min(R+k-1,V);T.children.push(this._build(v,R,q,P-1))}}return n(T,this.toBBox),T},i.prototype._chooseSubtree=function(v,C,w,P){for(;P.push(C),!C.leaf&&P.length-1!==w;){for(var T=1/0,E=1/0,A=void 0,k=0;k<C.children.length;k++){var N=C.children[k],F=h(N),V=(R=v,q=N,(Math.max(q.maxX,R.maxX)-Math.min(q.minX,R.minX))*(Math.max(q.maxY,R.maxY)-Math.min(q.minY,R.minY))-F);V<E?(E=V,T=F<T?F:T,A=N):V===E&&F<T&&(T=F,A=N)}C=A||C.children[0]}var R,q;return C},i.prototype._insert=function(v,C,w){var P=w?v:this.toBBox(v),T=[],E=this._chooseSubtree(P,this.data,C,T);for(E.children.push(v),c(E,P);C>=0&&T[C].children.length>this._maxEntries;)this._split(T,C),C--;this._adjustParentBBoxes(P,T,C)},i.prototype._split=function(v,C){var w=v[C],P=w.children.length,T=this._minEntries;this._chooseSplitAxis(w,T,P);var E=this._chooseSplitIndex(w,T,P),A=S(w.children.splice(E,w.children.length-E));A.height=w.height,A.leaf=w.leaf,n(w,this.toBBox),n(A,this.toBBox),C?v[C-1].children.push(A):this._splitRoot(w,A)},i.prototype._splitRoot=function(v,C){this.data=S([v,C]),this.data.height=v.height+1,this.data.leaf=!1,n(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(v,C,w){for(var P,T,E,A,k,N,F,V=1/0,R=1/0,q=C;q<=w-C;q++){var $=s(v,0,q,this.toBBox),pe=s(v,q,w,this.toBBox),ve=(T=$,E=pe,A=void 0,k=void 0,N=void 0,F=void 0,A=Math.max(T.minX,E.minX),k=Math.max(T.minY,E.minY),N=Math.min(T.maxX,E.maxX),F=Math.min(T.maxY,E.maxY),Math.max(0,N-A)*Math.max(0,F-k)),Be=h($)+h(pe);ve<V?(V=ve,P=q,R=Be<R?Be:R):ve===V&&Be<R&&(R=Be,P=q)}return P||w-C},i.prototype._chooseSplitAxis=function(v,C,w){var P=v.leaf?this.compareMinX:l,T=v.leaf?this.compareMinY:p;this._allDistMargin(v,C,w,P)<this._allDistMargin(v,C,w,T)&&v.children.sort(P)},i.prototype._allDistMargin=function(v,C,w,P){v.children.sort(P);for(var T=this.toBBox,E=s(v,0,C,T),A=s(v,w-C,w,T),k=m(E)+m(A),N=C;N<w-C;N++){var F=v.children[N];c(E,v.leaf?T(F):F),k+=m(E)}for(var V=w-C-1;V>=C;V--){var R=v.children[V];c(A,v.leaf?T(R):R),k+=m(A)}return k},i.prototype._adjustParentBBoxes=function(v,C,w){for(var P=w;P>=0;P--)c(C[P],v)},i.prototype._condense=function(v){for(var C=v.length-1,w=void 0;C>=0;C--)v[C].children.length===0?C>0?(w=v[C-1].children).splice(w.indexOf(v[C]),1):this.clear():n(v[C],this.toBBox)},i})});var Zh=G(U=>{"use strict";f();Object.defineProperty(U,"__esModule",{value:!0});U.earthRadius=63710088e-1;U.factors={centimeters:U.earthRadius*100,centimetres:U.earthRadius*100,degrees:U.earthRadius/111325,feet:U.earthRadius*3.28084,inches:U.earthRadius*39.37,kilometers:U.earthRadius/1e3,kilometres:U.earthRadius/1e3,meters:U.earthRadius,metres:U.earthRadius,miles:U.earthRadius/1609.344,millimeters:U.earthRadius*1e3,millimetres:U.earthRadius*1e3,nauticalmiles:U.earthRadius/1852,radians:1,yards:U.earthRadius*1.0936};U.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/U.earthRadius,yards:1.0936133};U.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 Gi(r,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=r,i}U.feature=Gi;function gC(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Uh(t).geometry;case"LineString":return Wh(t).geometry;case"Polygon":return Xh(t).geometry;case"MultiPoint":return G1(t).geometry;case"MultiLineString":return N1(t).geometry;case"MultiPolygon":return V1(t).geometry;default:throw new Error(r+" is invalid")}}U.geometry=gC;function Uh(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!wp(r[0])||!wp(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Gi(i,t,e)}U.point=Uh;function vC(r,t,e){return e===void 0&&(e={}),Ep(r.map(function(i){return Uh(i,t)}),e)}U.points=vC;function Xh(r,t,e){e===void 0&&(e={});for(var i=0,o=r;i<o.length;i++){var n=o[i];if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<n[n.length-1].length;s++)if(n[n.length-1][s]!==n[0][s])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:r};return Gi(c,t,e)}U.polygon=Xh;function bC(r,t,e){return e===void 0&&(e={}),Ep(r.map(function(i){return Xh(i,t)}),e)}U.polygons=bC;function Wh(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return Gi(i,t,e)}U.lineString=Wh;function CC(r,t,e){return e===void 0&&(e={}),Ep(r.map(function(i){return Wh(i,t)}),e)}U.lineStrings=CC;function Ep(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}U.featureCollection=Ep;function N1(r,t,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:r};return Gi(i,t,e)}U.multiLineString=N1;function G1(r,t,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:r};return Gi(i,t,e)}U.multiPoint=G1;function V1(r,t,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:r};return Gi(i,t,e)}U.multiPolygon=V1;function SC(r,t,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:r};return Gi(i,t,e)}U.geometryCollection=SC;function xC(r,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(r*e)/e}U.round=xC;function j1(r,t){t===void 0&&(t="kilometers");var e=U.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}U.radiansToLength=j1;function Yh(r,t){t===void 0&&(t="kilometers");var e=U.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}U.lengthToRadians=Yh;function IC(r,t){return H1(Yh(r,t))}U.lengthToDegrees=IC;function MC(r){var t=r%360;return t<0&&(t+=360),t}U.bearingToAzimuth=MC;function H1(r){var t=r%(2*Math.PI);return t*180/Math.PI}U.radiansToDegrees=H1;function PC(r){var t=r%360;return t*Math.PI/180}U.degreesToRadians=PC;function TC(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return j1(Yh(r,t),e)}U.convertLength=TC;function wC(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var i=U.areaFactors[t];if(!i)throw new Error("invalid original units");var o=U.areaFactors[e];if(!o)throw new Error("invalid final units");return r/i*o}U.convertArea=wC;function wp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}U.isNumber=wp;function EC(r){return!!r&&r.constructor===Object}U.isObject=EC;function DC(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!wp(t))throw new Error("bbox must only contain numbers")})}U.validateBBox=DC;function OC(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}U.validateId=OC});var Z1=G(Re=>{"use strict";f();Object.defineProperty(Re,"__esModule",{value:!0});var qe=Zh();function hs(r,t,e){if(r!==null)for(var i,o,n,s,c,l,p,h=0,m=0,y,g=r.type,S=g==="FeatureCollection",M=g==="Feature",v=S?r.features.length:1,C=0;C<v;C++){p=S?r.features[C].geometry:M?r.geometry:r,y=p?p.type==="GeometryCollection":!1,c=y?p.geometries.length:1;for(var w=0;w<c;w++){var P=0,T=0;if(s=y?p.geometries[w]:p,s!==null){l=s.coordinates;var E=s.type;switch(h=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(l,m,C,P,T)===!1)return!1;m++,P++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],m,C,P,T)===!1)return!1;m++,E==="MultiPoint"&&P++}E==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-h;o++){if(t(l[i][o],m,C,P,T)===!1)return!1;m++}E==="MultiLineString"&&P++,E==="Polygon"&&T++}E==="Polygon"&&P++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(T=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-h;n++){if(t(l[i][o][n],m,C,P,T)===!1)return!1;m++}T++}P++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(hs(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function LC(r,t,e,i){var o=e;return hs(r,function(n,s,c,l,p){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,p)},i),o}function U1(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function AC(r,t,e){var i=e;return U1(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}function X1(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function FC(r,t,e){var i=e;return X1(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}function _C(r){var t=[];return hs(r,function(e){t.push(e)}),t}function zh(r,t){var e,i,o,n,s,c,l,p,h,m,y=0,g=r.type==="FeatureCollection",S=r.type==="Feature",M=g?r.features.length:1;for(e=0;e<M;e++){for(c=g?r.features[e].geometry:S?r.geometry:r,p=g?r.features[e].properties:S?r.properties:{},h=g?r.features[e].bbox:S?r.bbox:void 0,m=g?r.features[e].id:S?r.id:void 0,l=c?c.type==="GeometryCollection":!1,s=l?c.geometries.length:1,o=0;o<s;o++){if(n=l?c.geometries[o]:c,n===null){if(t(null,y,p,h,m)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,y,p,h,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],y,p,h,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}function kC(r,t,e){var i=e;return zh(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}function Dp(r,t){zh(r,function(e,i,o,n,s){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(qe.feature(e,o,{bbox:n,id:s}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<e.coordinates.length;p++){var h=e.coordinates[p],m={type:l,coordinates:h};if(t(qe.feature(m,o),i,p)===!1)return!1}})}function BC(r,t,e){var i=e;return Dp(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}function W1(r,t){Dp(r,function(e,i,o){var n=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var c,l=0,p=0,h=0;if(hs(e,function(m,y,g,S,M){if(c===void 0||i>l||S>p||M>h){c=m,l=i,p=S,h=M,n=0;return}var v=qe.lineString([c,m],e.properties);if(t(v,i,o,M,n)===!1)return!1;n++,c=m})===!1)return!1}}})}function RC(r,t,e){var i=e,o=!1;return W1(r,function(n,s,c,l,p){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,p),o=!0}),i}function Y1(r,t){if(!r)throw new Error("geojson is required");Dp(r,function(e,i,o){if(e.geometry!==null){var n=e.geometry.type,s=e.geometry.coordinates;switch(n){case"LineString":if(t(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<s.length;c++)if(t(qe.lineString(s[c],e.properties),i,o,c)===!1)return!1;break}}})}function NC(r,t,e){var i=e;return Y1(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}function GC(r,t){if(t=t||{},!qe.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.segmentIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return n<0&&(n=l.length+n-1),qe.lineString([l[n],l[n+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n-1),qe.lineString([l[o][n],l[o][n+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n-1),qe.lineString([l[i][n],l[i][n+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n-1),qe.lineString([l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}function VC(r,t){if(t=t||{},!qe.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.coordIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return qe.point(l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),qe.point(l[i],s,t);case"LineString":return n<0&&(n=l.length+n),qe.point(l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),qe.point(l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),qe.point(l[i][n],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n),qe.point(l[i][o][n],s,t)}throw new Error("geojson is invalid")}Re.coordAll=_C;Re.coordEach=hs;Re.coordReduce=LC;Re.featureEach=X1;Re.featureReduce=FC;Re.findPoint=VC;Re.findSegment=GC;Re.flattenEach=Dp;Re.flattenReduce=BC;Re.geomEach=zh;Re.geomReduce=kC;Re.lineEach=Y1;Re.lineReduce=NC;Re.propEach=U1;Re.propReduce=AC;Re.segmentEach=W1;Re.segmentReduce=RC});var qh=G((lw,q1)=>{"use strict";f();var z1=Object.prototype.toString;q1.exports=function(t){var e=z1.call(t),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&z1.call(t.callee)==="[object Function]"),i}});var o0=G((pw,i0)=>{"use strict";f();var r0;Object.keys||(fs=Object.prototype.hasOwnProperty,$h=Object.prototype.toString,$1=qh(),Jh=Object.prototype.propertyIsEnumerable,J1=!Jh.call({toString:null},"toString"),Q1=Jh.call(function(){},"prototype"),ms=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Op=function(r){var t=r.constructor;return t&&t.prototype===r},K1={$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},e0=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!K1["$"+r]&&fs.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Op(window[r])}catch{return!0}}catch{return!0}return!1}(),t0=function(r){if(typeof window>"u"||!e0)return Op(r);try{return Op(r)}catch{return!1}},r0=function(t){var e=t!==null&&typeof t=="object",i=$h.call(t)==="[object Function]",o=$1(t),n=e&&$h.call(t)==="[object String]",s=[];if(!e&&!i&&!o)throw new TypeError("Object.keys called on a non-object");var c=Q1&&i;if(n&&t.length>0&&!fs.call(t,0))for(var l=0;l<t.length;++l)s.push(String(l));if(o&&t.length>0)for(var p=0;p<t.length;++p)s.push(String(p));else for(var h in t)!(c&&h==="prototype")&&fs.call(t,h)&&s.push(String(h));if(J1)for(var m=t0(t),y=0;y<ms.length;++y)!(m&&ms[y]==="constructor")&&fs.call(t,ms[y])&&s.push(ms[y]);return s});var fs,$h,$1,Jh,J1,Q1,ms,Op,K1,e0,t0;i0.exports=r0});var Ap=G((dw,s0)=>{"use strict";f();var jC=Array.prototype.slice,HC=qh(),n0=Object.keys,Lp=n0?function(t){return n0(t)}:o0(),a0=Object.keys;Lp.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 HC(i)?a0(jC.call(i)):a0(i)})}else Object.keys=Lp;return Object.keys||Lp};s0.exports=Lp});var c0=G((fw,l0)=>{"use strict";f();l0.exports=Error});var u0=G((yw,p0)=>{"use strict";f();p0.exports=EvalError});var h0=G((vw,d0)=>{"use strict";f();d0.exports=RangeError});var m0=G((Cw,f0)=>{"use strict";f();f0.exports=ReferenceError});var Qh=G((xw,y0)=>{"use strict";f();y0.exports=SyntaxError});var Kr=G((Mw,g0)=>{"use strict";f();g0.exports=TypeError});var b0=G((Tw,v0)=>{"use strict";f();v0.exports=URIError});var ys=G((Ew,C0)=>{"use strict";f();C0.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 o=42;t[e]=o;for(e 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 n=Object.getOwnPropertySymbols(t);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0}});var Fp=G((Ow,x0)=>{"use strict";f();var S0=typeof Symbol<"u"&&Symbol,UC=ys();x0.exports=function(){return typeof S0!="function"||typeof Symbol!="function"||typeof S0("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:UC()}});var M0=G((Aw,I0)=>{"use strict";f();var Kh={__proto__:null,foo:{}},XC=Object;I0.exports=function(){return{__proto__:Kh}.foo===Kh.foo&&!(Kh instanceof XC)}});var w0=G((_w,T0)=>{"use strict";f();var WC="Function.prototype.bind called on incompatible ",YC=Object.prototype.toString,ZC=Math.max,zC="[object Function]",P0=function(t,e){for(var i=[],o=0;o<t.length;o+=1)i[o]=t[o];for(var n=0;n<e.length;n+=1)i[n+t.length]=e[n];return i},qC=function(t,e){for(var i=[],o=e||0,n=0;o<t.length;o+=1,n+=1)i[n]=t[o];return i},$C=function(r,t){for(var e="",i=0;i<r.length;i+=1)e+=r[i],i+1<r.length&&(e+=t);return e};T0.exports=function(t){var e=this;if(typeof e!="function"||YC.apply(e)!==zC)throw new TypeError(WC+e);for(var i=qC(arguments,1),o,n=function(){if(this instanceof o){var h=e.apply(this,P0(i,arguments));return Object(h)===h?h:this}return e.apply(t,P0(i,arguments))},s=ZC(0,e.length-i.length),c=[],l=0;l<s;l++)c[l]="$"+l;if(o=Function("binder","return function ("+$C(c,",")+"){ return binder.apply(this,arguments); }")(n),e.prototype){var p=function(){};p.prototype=e.prototype,o.prototype=new p,p.prototype=null}return o}});var _p=G((Bw,E0)=>{"use strict";f();var JC=w0();E0.exports=Function.prototype.bind||JC});var ef=G((Nw,D0)=>{"use strict";f();var QC=Function.prototype.call,KC=Object.prototype.hasOwnProperty,eS=_p();D0.exports=eS.call(QC,KC)});var zt=G((Vw,_0)=>{"use strict";f();var ie,tS=c0(),rS=u0(),iS=h0(),oS=m0(),Un=Qh(),Hn=Kr(),nS=b0(),F0=Function,tf=function(r){try{return F0('"use strict"; return ('+r+").constructor;")()}catch{}},Lo=Object.getOwnPropertyDescriptor;if(Lo)try{Lo({},"")}catch{Lo=null}var rf=function(){throw new Hn},aS=Lo?function(){try{return arguments.callee,rf}catch{try{return Lo(arguments,"callee").get}catch{return rf}}}():rf,Vn=Fp()(),sS=M0()(),He=Object.getPrototypeOf||(sS?function(r){return r.__proto__}:null),jn={},lS=typeof Uint8Array>"u"||!He?ie:He(Uint8Array),Ao={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ie:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ie:ArrayBuffer,"%ArrayIteratorPrototype%":Vn&&He?He([][Symbol.iterator]()):ie,"%AsyncFromSyncIteratorPrototype%":ie,"%AsyncFunction%":jn,"%AsyncGenerator%":jn,"%AsyncGeneratorFunction%":jn,"%AsyncIteratorPrototype%":jn,"%Atomics%":typeof Atomics>"u"?ie:Atomics,"%BigInt%":typeof BigInt>"u"?ie:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ie:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ie:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ie:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":tS,"%eval%":eval,"%EvalError%":rS,"%Float32Array%":typeof Float32Array>"u"?ie:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ie:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ie:FinalizationRegistry,"%Function%":F0,"%GeneratorFunction%":jn,"%Int8Array%":typeof Int8Array>"u"?ie:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ie:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ie:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vn&&He?He(He([][Symbol.iterator]())):ie,"%JSON%":typeof JSON=="object"?JSON:ie,"%Map%":typeof Map>"u"?ie:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Vn||!He?ie:He(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ie:Promise,"%Proxy%":typeof Proxy>"u"?ie:Proxy,"%RangeError%":iS,"%ReferenceError%":oS,"%Reflect%":typeof Reflect>"u"?ie:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ie:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Vn||!He?ie:He(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ie:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vn&&He?He(""[Symbol.iterator]()):ie,"%Symbol%":Vn?Symbol:ie,"%SyntaxError%":Un,"%ThrowTypeError%":aS,"%TypedArray%":lS,"%TypeError%":Hn,"%Uint8Array%":typeof Uint8Array>"u"?ie:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ie:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ie:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ie:Uint32Array,"%URIError%":nS,"%WeakMap%":typeof WeakMap>"u"?ie:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ie:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ie:WeakSet};if(He)try{null.error}catch(r){O0=He(He(r)),Ao["%Error.prototype%"]=O0}var O0,cS=function r(t){var e;if(t==="%AsyncFunction%")e=tf("async function () {}");else if(t==="%GeneratorFunction%")e=tf("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=tf("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&He&&(e=He(o.prototype))}return Ao[t]=e,e},L0={__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"]},gs=_p(),kp=ef(),pS=gs.call(Function.call,Array.prototype.concat),uS=gs.call(Function.apply,Array.prototype.splice),A0=gs.call(Function.call,String.prototype.replace),Bp=gs.call(Function.call,String.prototype.slice),dS=gs.call(Function.call,RegExp.prototype.exec),hS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fS=/\\(\\)?/g,mS=function(t){var e=Bp(t,0,1),i=Bp(t,-1);if(e==="%"&&i!=="%")throw new Un("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Un("invalid intrinsic syntax, expected opening `%`");var o=[];return A0(t,hS,function(n,s,c,l){o[o.length]=c?A0(l,fS,"$1"):s||n}),o},yS=function(t,e){var i=t,o;if(kp(L0,i)&&(o=L0[i],i="%"+o[0]+"%"),kp(Ao,i)){var n=Ao[i];if(n===jn&&(n=cS(i)),typeof n>"u"&&!e)throw new Hn("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:n}}throw new Un("intrinsic "+t+" does not exist!")};_0.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Hn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Hn('"allowMissing" argument must be a boolean');if(dS(/^%?[^%]*%?$/,t)===null)throw new Un("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=mS(t),o=i.length>0?i[0]:"",n=yS("%"+o+"%",e),s=n.name,c=n.value,l=!1,p=n.alias;p&&(o=p[0],uS(i,pS([0,1],p)));for(var h=1,m=!0;h<i.length;h+=1){var y=i[h],g=Bp(y,0,1),S=Bp(y,-1);if((g==='"'||g==="'"||g==="`"||S==='"'||S==="'"||S==="`")&&g!==S)throw new Un("property names with quotes must have matching quotes");if((y==="constructor"||!m)&&(l=!0),o+="."+y,s="%"+o+"%",kp(Ao,s))c=Ao[s];else if(c!=null){if(!(y in c)){if(!e)throw new Hn("base intrinsic for "+t+" exists, but the property is not available.");return}if(Lo&&h+1>=i.length){var M=Lo(c,y);m=!!M,m&&"get"in M&&!("originalValue"in M.get)?c=M.get:c=c[y]}else m=kp(c,y),c=c[y];m&&!l&&(Ao[s]=c)}}return c}});var Np=G((Hw,k0)=>{"use strict";f();var gS=zt(),Rp=gS("%Object.defineProperty%",!0)||!1;if(Rp)try{Rp({},"a",{value:1})}catch{Rp=!1}k0.exports=Rp});var Vp=G((Xw,B0)=>{"use strict";f();var vS=zt(),Gp=vS("%Object.getOwnPropertyDescriptor%",!0);if(Gp)try{Gp([],"length")}catch{Gp=null}B0.exports=Gp});var jp=G((Yw,G0)=>{"use strict";f();var R0=Np(),bS=Qh(),Xn=Kr(),N0=Vp();G0.exports=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Xn("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Xn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Xn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Xn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Xn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Xn("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,l=!!N0&&N0(t,e);if(R0)R0(t,e,{configurable:s===null&&l?l.configurable:!s,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:n===null&&l?l.writable:!n});else if(c||!o&&!n&&!s)t[e]=i;else throw new bS("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Hp=G((zw,j0)=>{"use strict";f();var of=Np(),V0=function(){return!!of};V0.hasArrayLengthDefineBug=function(){if(!of)return null;try{return of([],"length",{value:1}).length!==1}catch{return!0}};j0.exports=V0});var Vi=G(($w,W0)=>{"use strict";f();var CS=Ap(),SS=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",xS=Object.prototype.toString,IS=Array.prototype.concat,H0=jp(),MS=function(r){return typeof r=="function"&&xS.call(r)==="[object Function]"},U0=Hp()(),PS=function(r,t,e,i){if(t in r){if(i===!0){if(r[t]===e)return}else if(!MS(i)||!i())return}U0?H0(r,t,e,!0):H0(r,t,e)},X0=function(r,t){var e=arguments.length>2?arguments[2]:{},i=CS(t);SS&&(i=IS.call(i,Object.getOwnPropertySymbols(t)));for(var o=0;o<i.length;o+=1)PS(r,i[o],t[i[o]],e[i[o]])};X0.supportsDescriptors=!!U0;W0.exports=X0});var $0=G((Qw,q0)=>{"use strict";f();var TS=zt(),Y0=jp(),wS=Hp()(),Z0=Vp(),z0=Kr(),ES=TS("%Math.floor%");q0.exports=function(t,e){if(typeof t!="function")throw new z0("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||ES(e)!==e)throw new z0("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,n=!0;if("length"in t&&Z0){var s=Z0(t,"length");s&&!s.configurable&&(o=!1),s&&!s.writable&&(n=!1)}return(o||n||!i)&&(wS?Y0(t,"length",e,!0,!0):Y0(t,"length",e)),t}});var Fo=G((eE,Up)=>{"use strict";f();var nf=_p(),Xp=zt(),DS=$0(),OS=Kr(),K0=Xp("%Function.prototype.apply%"),e2=Xp("%Function.prototype.call%"),t2=Xp("%Reflect.apply%",!0)||nf.call(e2,K0),J0=Np(),LS=Xp("%Math.max%");Up.exports=function(t){if(typeof t!="function")throw new OS("a function is required");var e=t2(nf,e2,arguments);return DS(e,1+LS(0,t.length-(arguments.length-1)),!0)};var Q0=function(){return t2(nf,K0,arguments)};J0?J0(Up.exports,"apply",{value:Q0}):Up.exports.apply=Q0});var Et=G((rE,o2)=>{"use strict";f();var r2=zt(),i2=Fo(),AS=i2(r2("String.prototype.indexOf"));o2.exports=function(t,e){var i=r2(t,!!e);return typeof i=="function"&&AS(t,".prototype.")>-1?i2(i):i}});var af=G((oE,c2)=>{"use strict";f();var FS=Ap(),s2=ys()(),l2=Et(),n2=Object,_S=l2("Array.prototype.push"),a2=l2("Object.prototype.propertyIsEnumerable"),kS=s2?Object.getOwnPropertySymbols:null;c2.exports=function(t,e){if(t==null)throw new TypeError("target must be an object");var i=n2(t);if(arguments.length===1)return i;for(var o=1;o<arguments.length;++o){var n=n2(arguments[o]),s=FS(n),c=s2&&(Object.getOwnPropertySymbols||kS);if(c)for(var l=c(n),p=0;p<l.length;++p){var h=l[p];a2(n,h)&&_S(s,h)}for(var m=0;m<s.length;++m){var y=s[m];if(a2(n,y)){var g=n[y];i[y]=g}}}return i}});var lf=G((aE,p2)=>{"use strict";f();var sf=af(),BS=function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",t=r.split(""),e={},i=0;i<t.length;++i)e[t[i]]=t[i];var o=Object.assign({},e),n="";for(var s in o)n+=s;return r!==n},RS=function(){if(!Object.assign||!Object.preventExtensions)return!1;var r=Object.preventExtensions({1:2});try{Object.assign(r,"xy")}catch{return r[1]==="y"}return!1};p2.exports=function(){return!Object.assign||BS()||RS()?sf:Object.assign}});var d2=G((lE,u2)=>{"use strict";f();var NS=Vi(),GS=lf();u2.exports=function(){var t=GS();return NS(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}});var y2=G((pE,m2)=>{"use strict";f();var VS=Vi(),jS=Fo(),HS=af(),h2=lf(),US=d2(),XS=jS.apply(h2()),f2=function(t,e){return XS(Object,arguments)};VS(f2,{getPolyfill:h2,implementation:HS,shim:US});m2.exports=f2});var v2=G((dE,g2)=>{"use strict";f();var bs=function(){return typeof(function(){}).name=="string"},vs=Object.getOwnPropertyDescriptor;if(vs)try{vs([],"length")}catch{vs=null}bs.functionsHaveConfigurableNames=function(){if(!bs()||!vs)return!1;var t=vs(function(){},"name");return!!t&&!!t.configurable};var WS=Function.prototype.bind;bs.boundFunctionsHaveNames=function(){return bs()&&typeof WS=="function"&&(function(){}).bind().name!==""};g2.exports=bs});var S2=G((fE,C2)=>{"use strict";f();var b2=jp(),YS=Hp()(),ZS=v2().functionsHaveConfigurableNames(),zS=Kr();C2.exports=function(t,e){if(typeof t!="function")throw new zS("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||ZS)&&(YS?b2(t,"name",e,!0,!0):b2(t,"name",e)),t}});var cf=G((yE,x2)=>{"use strict";f();var qS=S2(),$S=Kr(),JS=Object;x2.exports=qS(function(){if(this==null||this!==JS(this))throw new $S("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 pf=G((vE,I2)=>{"use strict";f();var QS=cf(),KS=Vi().supportsDescriptors,e6=Object.getOwnPropertyDescriptor;I2.exports=function(){if(KS&&/a/mig.flags==="gim"){var t=e6(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),e==="dy")return t.get}}return QS}});var T2=G((CE,P2)=>{"use strict";f();var t6=Vi().supportsDescriptors,r6=pf(),i6=Object.getOwnPropertyDescriptor,o6=Object.defineProperty,n6=TypeError,M2=Object.getPrototypeOf,a6=/a/;P2.exports=function(){if(!t6||!M2)throw new n6("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=r6(),e=M2(a6),i=i6(e,"flags");return(!i||i.get!==t)&&o6(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var O2=G((xE,D2)=>{"use strict";f();var s6=Vi(),l6=Fo(),c6=cf(),w2=pf(),p6=T2(),E2=l6(w2());s6(E2,{getPolyfill:w2,implementation:c6,shim:p6});D2.exports=E2});var ji=G((ME,L2)=>{"use strict";f();var u6=ys();L2.exports=function(){return u6()&&!!Symbol.toStringTag}});var df=G((TE,F2)=>{"use strict";f();var d6=ji()(),h6=Et(),uf=h6("Object.prototype.toString"),Wp=function(t){return d6&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:uf(t)==="[object Arguments]"},A2=function(t){return Wp(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&uf(t)!=="[object Array]"&&uf(t.callee)==="[object Function]"},f6=function(){return Wp(arguments)}();Wp.isLegacyArguments=A2;F2.exports=f6?Wp:A2});var _2=G(()=>{f()});var ev=G((LE,K2)=>{f();var xf=typeof Map=="function"&&Map.prototype,hf=Object.getOwnPropertyDescriptor&&xf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Zp=xf&&hf&&typeof hf.get=="function"?hf.get:null,k2=xf&&Map.prototype.forEach,If=typeof Set=="function"&&Set.prototype,ff=Object.getOwnPropertyDescriptor&&If?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,zp=If&&ff&&typeof ff.get=="function"?ff.get:null,B2=If&&Set.prototype.forEach,m6=typeof WeakMap=="function"&&WeakMap.prototype,Ss=m6?WeakMap.prototype.has:null,y6=typeof WeakSet=="function"&&WeakSet.prototype,xs=y6?WeakSet.prototype.has:null,g6=typeof WeakRef=="function"&&WeakRef.prototype,R2=g6?WeakRef.prototype.deref:null,v6=Boolean.prototype.valueOf,b6=Object.prototype.toString,C6=Function.prototype.toString,S6=String.prototype.match,Mf=String.prototype.slice,Ui=String.prototype.replace,x6=String.prototype.toUpperCase,N2=String.prototype.toLowerCase,Z2=RegExp.prototype.test,G2=Array.prototype.concat,Ir=Array.prototype.join,I6=Array.prototype.slice,V2=Math.floor,gf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,mf=Object.getOwnPropertySymbols,vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Wn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",$e=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Wn||!0)?Symbol.toStringTag:null,z2=Object.prototype.propertyIsEnumerable,j2=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function H2(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Z2.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-V2(-r):V2(r);if(i!==r){var o=String(i),n=Mf.call(t,o.length+1);return Ui.call(o,e,"$&_")+"."+Ui.call(Ui.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ui.call(t,e,"$&_")}var bf=_2(),U2=bf.custom,X2=$2(U2)?U2:null;K2.exports=function r(t,e,i,o){var n=e||{};if(Hi(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Hi(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Hi(n,"customInspect")?n.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Hi(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Hi(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=n.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Q2(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return c?H2(t,l):l}if(typeof t=="bigint"){var p=String(t)+"n";return c?H2(t,p):p}var h=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=h&&h>0&&typeof t=="object")return Cf(t)?"[Array]":"[Object]";var m=j6(n,i);if(typeof o>"u")o=[];else if(J2(o,t)>=0)return"[Circular]";function y($,pe,ve){if(pe&&(o=I6.call(o),o.push(pe)),ve){var Be={depth:n.depth};return Hi(n,"quoteStyle")&&(Be.quoteStyle=n.quoteStyle),r($,Be,i+1,o)}return r($,n,i+1,o)}if(typeof t=="function"&&!W2(t)){var g=A6(t),S=Yp(t,y);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(S.length>0?" { "+Ir.call(S,", ")+" }":"")}if($2(t)){var M=Wn?Ui.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):vf.call(t);return typeof t=="object"&&!Wn?Cs(M):M}if(N6(t)){for(var v="<"+N2.call(String(t.nodeName)),C=t.attributes||[],w=0;w<C.length;w++)v+=" "+C[w].name+"="+q2(M6(C[w].value),"double",n);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+N2.call(String(t.nodeName))+">",v}if(Cf(t)){if(t.length===0)return"[]";var P=Yp(t,y);return m&&!V6(P)?"["+Sf(P,m)+"]":"[ "+Ir.call(P,", ")+" ]"}if(T6(t)){var T=Yp(t,y);return!("cause"in Error.prototype)&&"cause"in t&&!z2.call(t,"cause")?"{ ["+String(t)+"] "+Ir.call(G2.call("[cause]: "+y(t.cause),T),", ")+" }":T.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Ir.call(T,", ")+" }"}if(typeof t=="object"&&s){if(X2&&typeof t[X2]=="function"&&bf)return bf(t,{depth:h-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(F6(t)){var E=[];return k2&&k2.call(t,function($,pe){E.push(y(pe,t,!0)+" => "+y($,t))}),Y2("Map",Zp.call(t),E,m)}if(B6(t)){var A=[];return B2&&B2.call(t,function($){A.push(y($,t))}),Y2("Set",zp.call(t),A,m)}if(_6(t))return yf("WeakMap");if(R6(t))return yf("WeakSet");if(k6(t))return yf("WeakRef");if(E6(t))return Cs(y(Number(t)));if(O6(t))return Cs(y(gf.call(t)));if(D6(t))return Cs(v6.call(t));if(w6(t))return Cs(y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(t===global)return"{ [object globalThis] }";if(!P6(t)&&!W2(t)){var k=Yp(t,y),N=j2?j2(t)===Object.prototype:t instanceof Object||t.constructor===Object,F=t instanceof Object?"":"null prototype",V=!N&&$e&&Object(t)===t&&$e in t?Mf.call(Xi(t),8,-1):F?"Object":"",R=N||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",q=R+(V||F?"["+Ir.call(G2.call([],V||[],F||[]),": ")+"] ":"");return k.length===0?q+"{}":m?q+"{"+Sf(k,m)+"}":q+"{ "+Ir.call(k,", ")+" }"}return String(t)};function q2(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function M6(r){return Ui.call(String(r),/"/g,"&quot;")}function Cf(r){return Xi(r)==="[object Array]"&&(!$e||!(typeof r=="object"&&$e in r))}function P6(r){return Xi(r)==="[object Date]"&&(!$e||!(typeof r=="object"&&$e in r))}function W2(r){return Xi(r)==="[object RegExp]"&&(!$e||!(typeof r=="object"&&$e in r))}function T6(r){return Xi(r)==="[object Error]"&&(!$e||!(typeof r=="object"&&$e in r))}function w6(r){return Xi(r)==="[object String]"&&(!$e||!(typeof r=="object"&&$e in r))}function E6(r){return Xi(r)==="[object Number]"&&(!$e||!(typeof r=="object"&&$e in r))}function D6(r){return Xi(r)==="[object Boolean]"&&(!$e||!(typeof r=="object"&&$e in r))}function $2(r){if(Wn)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!vf)return!1;try{return vf.call(r),!0}catch{}return!1}function O6(r){if(!r||typeof r!="object"||!gf)return!1;try{return gf.call(r),!0}catch{}return!1}var L6=Object.prototype.hasOwnProperty||function(r){return r in this};function Hi(r,t){return L6.call(r,t)}function Xi(r){return b6.call(r)}function A6(r){if(r.name)return r.name;var t=S6.call(C6.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function J2(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;e<i;e++)if(r[e]===t)return e;return-1}function F6(r){if(!Zp||!r||typeof r!="object")return!1;try{Zp.call(r);try{zp.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function _6(r){if(!Ss||!r||typeof r!="object")return!1;try{Ss.call(r,Ss);try{xs.call(r,xs)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function k6(r){if(!R2||!r||typeof r!="object")return!1;try{return R2.call(r),!0}catch{}return!1}function B6(r){if(!zp||!r||typeof r!="object")return!1;try{zp.call(r);try{Zp.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function R6(r){if(!xs||!r||typeof r!="object")return!1;try{xs.call(r,xs);try{Ss.call(r,Ss)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function N6(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Q2(r,t){if(r.length>t.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return Q2(Mf.call(r,0,t.maxStringLength),t)+i}var o=Ui.call(Ui.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,G6);return q2(o,"single",t)}function G6(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+x6.call(t.toString(16))}function Cs(r){return"Object("+r+")"}function yf(r){return r+" { ? }"}function Y2(r,t,e,i){var o=i?Sf(e,i):Ir.call(e,", ");return r+" ("+t+") {"+o+"}"}function V6(r){for(var t=0;t<r.length;t++)if(J2(r[t],"\n")>=0)return!1;return!0}function j6(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=Ir.call(Array(r.indent+1)," ");else return null;return{base:e,prev:Ir.call(Array(t+1),e)}}function Sf(r,t){if(r.length===0)return"";var e="\n"+t.prev+t.base;return e+Ir.call(r,","+e)+"\n"+t.prev}function Yp(r,t){var e=Cf(r),i=[];if(e){i.length=r.length;for(var o=0;o<r.length;o++)i[o]=Hi(r,o)?t(r[o],r):""}var n=typeof mf=="function"?mf(r):[],s;if(Wn){s={};for(var c=0;c<n.length;c++)s["$"+n[c]]=n[c]}for(var l in r)Hi(r,l)&&(e&&String(Number(l))===l&&l<r.length||Wn&&s["$"+l]instanceof Symbol||(Z2.call(/[^\w$]/,l)?i.push(t(l,r)+": "+t(r[l],r)):i.push(l+": "+t(r[l],r))));if(typeof mf=="function")for(var p=0;p<n.length;p++)z2.call(r,n[p])&&i.push("["+t(n[p])+"]: "+t(r[n[p]],r));return i}});var Tf=G((FE,rv)=>{"use strict";f();var tv=zt(),Yn=Et(),H6=ev(),U6=Kr(),qp=tv("%WeakMap%",!0),$p=tv("%Map%",!0),X6=Yn("WeakMap.prototype.get",!0),W6=Yn("WeakMap.prototype.set",!0),Y6=Yn("WeakMap.prototype.has",!0),Z6=Yn("Map.prototype.get",!0),z6=Yn("Map.prototype.set",!0),q6=Yn("Map.prototype.has",!0),Pf=function(r,t){for(var e=r,i;(i=e.next)!==null;e=i)if(i.key===t)return e.next=i.next,i.next=r.next,r.next=i,i},$6=function(r,t){var e=Pf(r,t);return e&&e.value},J6=function(r,t,e){var i=Pf(r,t);i?i.value=e:r.next={key:t,next:r.next,value:e}},Q6=function(r,t){return!!Pf(r,t)};rv.exports=function(){var t,e,i,o={assert:function(n){if(!o.has(n))throw new U6("Side channel does not contain "+H6(n))},get:function(n){if(qp&&n&&(typeof n=="object"||typeof n=="function")){if(t)return X6(t,n)}else if($p){if(e)return Z6(e,n)}else if(i)return $6(i,n)},has:function(n){if(qp&&n&&(typeof n=="object"||typeof n=="function")){if(t)return Y6(t,n)}else if($p){if(e)return q6(e,n)}else if(i)return Q6(i,n);return!1},set:function(n,s){qp&&n&&(typeof n=="object"||typeof n=="function")?(t||(t=new qp),W6(t,n,s)):$p?(e||(e=new $p),z6(e,n,s)):(i||(i={key:{},next:null}),J6(i,n,s))}};return o}});var ov=G((kE,iv)=>{"use strict";f();var K6=ef(),Is=Tf()(),ei=Kr(),wf={assert:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new ei("`O` is not an object");if(typeof t!="string")throw new ei("`slot` must be a string");if(Is.assert(r),!wf.has(r,t))throw new ei("`"+t+"` is not present on `O`")},get:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new ei("`O` is not an object");if(typeof t!="string")throw new ei("`slot` must be a string");var e=Is.get(r);return e&&e["$"+t]},has:function(r,t){if(!r||typeof r!="object"&&typeof r!="function")throw new ei("`O` is not an object");if(typeof t!="string")throw new ei("`slot` must be a string");var e=Is.get(r);return!!e&&K6(e,"$"+t)},set:function(r,t,e){if(!r||typeof r!="object"&&typeof r!="function")throw new ei("`O` is not an object");if(typeof t!="string")throw new ei("`slot` must be a string");var i=Is.get(r);i||(i={},Is.set(r,i)),i["$"+t]=e}};Object.freeze&&Object.freeze(wf);iv.exports=wf});var sv=G((RE,av)=>{"use strict";f();var Ms=ov(),ex=SyntaxError,nv=typeof StopIteration=="object"?StopIteration:null;av.exports=function(t){if(!nv)throw new ex("this environment lacks StopIteration");Ms.set(t,"[[Done]]",!1);var e={next:function(){var o=Ms.get(this,"[[Iterator]]"),n=Ms.get(o,"[[Done]]");try{return{done:n,value:n?void 0:o.next()}}catch(s){if(Ms.set(o,"[[Done]]",!0),s!==nv)throw s;return{done:!0,value:void 0}}}};return Ms.set(e,"[[Iterator]]",t),e}});var Ef=G((GE,lv)=>{f();var tx={}.toString;lv.exports=Array.isArray||function(r){return tx.call(r)=="[object Array]"}});var Df=G((jE,cv)=>{"use strict";f();var rx=String.prototype.valueOf,ix=function(t){try{return rx.call(t),!0}catch{return!1}},ox=Object.prototype.toString,nx="[object String]",ax=ji()();cv.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:ax?ix(t):ox.call(t)===nx}});var Lf=G((UE,dv)=>{"use strict";f();var Of=typeof Map=="function"&&Map.prototype?Map:null,sx=typeof Set=="function"&&Set.prototype?Set:null,Jp;Of||(Jp=function(t){return!1});var uv=Of?Map.prototype.has:null,pv=sx?Set.prototype.has:null;!Jp&&!uv&&(Jp=function(t){return!1});dv.exports=Jp||function(t){if(!t||typeof t!="object")return!1;try{if(uv.call(t),pv)try{pv.call(t)}catch{return!0}return t instanceof Of}catch{}return!1}});var Ff=G((WE,mv)=>{"use strict";f();var lx=typeof Map=="function"&&Map.prototype?Map:null,Af=typeof Set=="function"&&Set.prototype?Set:null,Qp;Af||(Qp=function(t){return!1});var hv=lx?Map.prototype.has:null,fv=Af?Set.prototype.has:null;!Qp&&!fv&&(Qp=function(t){return!1});mv.exports=Qp||function(t){if(!t||typeof t!="object")return!1;try{if(fv.call(t),hv)try{hv.call(t)}catch{return!0}return t instanceof Af}catch{}return!1}});var wv=G((ZE,tu)=>{"use strict";f();var yv=df(),gv=sv();Fp()()||ys()()?(Kp=Symbol.iterator,tu.exports=function(t){if(t!=null&&typeof t[Kp]<"u")return t[Kp]();if(yv(t))return Array.prototype[Kp].call(t)}):(vv=Ef(),bv=Df(),_f=zt(),Cv=_f("%Map%",!0),Sv=_f("%Set%",!0),Nt=Et(),kf=Nt("Array.prototype.push"),Bf=Nt("String.prototype.charCodeAt"),xv=Nt("String.prototype.slice"),Iv=function(t,e){var i=t.length;if(e+1>=i)return e+1;var o=Bf(t,e);if(o<55296||o>56319)return e+1;var n=Bf(t,e+1);return n<56320||n>57343?e+1:e+2},eu=function(t){var e=0;return{next:function(){var o=e>=t.length,n;return o||(n=t[e],e+=1),{done:o,value:n}}}},Rf=function(t,e){if(vv(t)||yv(t))return eu(t);if(bv(t)){var i=0;return{next:function(){var n=Iv(t,i),s=xv(t,i,n);return i=n,{done:n>t.length,value:s}}}}if(e&&typeof t["_es6-shim iterator_"]<"u")return t["_es6-shim iterator_"]()},!Cv&&!Sv?tu.exports=function(t){if(t!=null)return Rf(t,!0)}:(Mv=Lf(),Pv=Ff(),Nf=Nt("Map.prototype.forEach",!0),Gf=Nt("Set.prototype.forEach",!0),(typeof x>"u"||!x.versions||!x.versions.node)&&(Vf=Nt("Map.prototype.iterator",!0),jf=Nt("Set.prototype.iterator",!0)),Hf=Nt("Map.prototype.@@iterator",!0)||Nt("Map.prototype._es6-shim iterator_",!0),Uf=Nt("Set.prototype.@@iterator",!0)||Nt("Set.prototype._es6-shim iterator_",!0),Tv=function(t){if(Mv(t)){if(Vf)return gv(Vf(t));if(Hf)return Hf(t);if(Nf){var e=[];return Nf(t,function(o,n){kf(e,[n,o])}),eu(e)}}if(Pv(t)){if(jf)return gv(jf(t));if(Uf)return Uf(t);if(Gf){var i=[];return Gf(t,function(o){kf(i,o)}),eu(i)}}},tu.exports=function(t){return Tv(t)||Rf(t)}));var Kp,vv,bv,_f,Cv,Sv,Nt,kf,Bf,xv,Iv,eu,Rf,Mv,Pv,Nf,Gf,Vf,jf,Hf,Uf,Tv});var Xf=G((qE,Dv)=>{"use strict";f();var Ev=function(r){return r!==r};Dv.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||Ev(t)&&Ev(e))}});var Wf=G((JE,Ov)=>{"use strict";f();var cx=Xf();Ov.exports=function(){return typeof Object.is=="function"?Object.is:cx}});var Av=G((KE,Lv)=>{"use strict";f();var px=Wf(),ux=Vi();Lv.exports=function(){var t=px();return ux(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Bv=G((tD,kv)=>{"use strict";f();var dx=Vi(),hx=Fo(),fx=Xf(),Fv=Wf(),mx=Av(),_v=hx(Fv(),Object);dx(_v,{getPolyfill:Fv,implementation:fx,shim:mx});kv.exports=_v});var Zf=G((iD,Vv)=>{"use strict";f();var yx=Fo(),Gv=Et(),gx=zt(),Yf=gx("%ArrayBuffer%",!0),ru=Gv("ArrayBuffer.prototype.byteLength",!0),vx=Gv("Object.prototype.toString"),Rv=!!Yf&&!ru&&new Yf(0).slice,Nv=!!Rv&&yx(Rv);Vv.exports=ru||Nv?function(t){if(!t||typeof t!="object")return!1;try{return ru?ru(t):Nv(t,0),!0}catch{return!1}}:Yf?function(t){return vx(t)==="[object ArrayBuffer]"}:function(t){return!1}});var Hv=G((nD,jv)=>{"use strict";f();var bx=Date.prototype.getDay,Cx=function(t){try{return bx.call(t),!0}catch{return!1}},Sx=Object.prototype.toString,xx="[object Date]",Ix=ji()();jv.exports=function(t){return typeof t!="object"||t===null?!1:Ix?Cx(t):Sx.call(t)===xx}});var Zv=G((sD,Yv)=>{"use strict";f();var zf=Et(),Uv=ji()(),Xv,Wv,qf,$f;Uv&&(Xv=zf("Object.prototype.hasOwnProperty"),Wv=zf("RegExp.prototype.exec"),qf={},iu=function(){throw qf},$f={toString:iu,valueOf:iu},typeof Symbol.toPrimitive=="symbol"&&($f[Symbol.toPrimitive]=iu));var iu,Mx=zf("Object.prototype.toString"),Px=Object.getOwnPropertyDescriptor,Tx="[object RegExp]";Yv.exports=Uv?function(t){if(!t||typeof t!="object")return!1;var e=Px(t,"lastIndex"),i=e&&Xv(e,"value");if(!i)return!1;try{Wv(t,$f)}catch(o){return o===qf}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Mx(t)===Tx}});var $v=G((cD,qv)=>{"use strict";f();var wx=Et(),zv=wx("SharedArrayBuffer.prototype.byteLength",!0);qv.exports=zv?function(t){if(!t||typeof t!="object")return!1;try{return zv(t),!0}catch{return!1}}:function(t){return!1}});var Qv=G((uD,Jv)=>{"use strict";f();var Ex=Number.prototype.toString,Dx=function(t){try{return Ex.call(t),!0}catch{return!1}},Ox=Object.prototype.toString,Lx="[object Number]",Ax=ji()();Jv.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:Ax?Dx(t):Ox.call(t)===Lx}});var tb=G((hD,eb)=>{"use strict";f();var Kv=Et(),Fx=Kv("Boolean.prototype.toString"),_x=Kv("Object.prototype.toString"),kx=function(t){try{return Fx(t),!0}catch{return!1}},Bx="[object Boolean]",Rx=ji()();eb.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:Rx&&Symbol.toStringTag in t?kx(t):_x(t)===Bx}});var nb=G((mD,Jf)=>{"use strict";f();var Nx=Object.prototype.toString,Gx=Fp()();Gx?(rb=Symbol.prototype.toString,ib=/^Symbol\(.*\)$/,ob=function(t){return typeof t.valueOf()!="symbol"?!1:ib.test(rb.call(t))},Jf.exports=function(t){if(typeof t=="symbol")return!0;if(Nx.call(t)!=="[object Symbol]")return!1;try{return ob(t)}catch{return!1}}):Jf.exports=function(t){return!1};var rb,ib,ob});var lb=G((gD,sb)=>{"use strict";f();var ab=typeof BigInt<"u"&&BigInt;sb.exports=function(){return typeof ab=="function"&&typeof BigInt=="function"&&typeof ab(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var ub=G((bD,Qf)=>{"use strict";f();var Vx=lb()();Vx?(cb=BigInt.prototype.valueOf,pb=function(t){try{return cb.call(t),!0}catch{}return!1},Qf.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:pb(t)}):Qf.exports=function(t){return!1};var cb,pb});var hb=G((SD,db)=>{"use strict";f();var jx=Df(),Hx=Qv(),Ux=tb(),Xx=nb(),Wx=ub();db.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(jx(t))return"String";if(Hx(t))return"Number";if(Ux(t))return"Boolean";if(Xx(t))return"Symbol";if(Wx(t))return"BigInt"}});var yb=G((ID,mb)=>{"use strict";f();var ou=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,fb=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,nu;ou||(nu=function(t){return!1});var em=ou?ou.prototype.has:null,Kf=fb?fb.prototype.has:null;!nu&&!em&&(nu=function(t){return!1});mb.exports=nu||function(t){if(!t||typeof t!="object")return!1;try{if(em.call(t,em),Kf)try{Kf.call(t,Kf)}catch{return!0}return t instanceof ou}catch{}return!1}});var vb=G((PD,rm)=>{"use strict";f();var Yx=zt(),gb=Et(),Zx=Yx("%WeakSet%",!0),tm=gb("WeakSet.prototype.has",!0);tm?(au=gb("WeakMap.prototype.has",!0),rm.exports=function(t){if(!t||typeof t!="object")return!1;try{if(tm(t,tm),au)try{au(t,au)}catch{return!0}return t instanceof Zx}catch{}return!1}):rm.exports=function(t){return!1};var au});var Cb=G((wD,bb)=>{"use strict";f();var zx=Lf(),qx=Ff(),$x=yb(),Jx=vb();bb.exports=function(t){if(t&&typeof t=="object"){if(zx(t))return"Map";if(qx(t))return"Set";if($x(t))return"WeakMap";if(Jx(t))return"WeakSet"}return!1}});var Mb=G((DD,Ib)=>{"use strict";f();var xb=Function.prototype.toString,Zn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,om,su;if(typeof Zn=="function"&&typeof Object.defineProperty=="function")try{om=Object.defineProperty({},"length",{get:function(){throw su}}),su={},Zn(function(){throw 42},null,om)}catch(r){r!==su&&(Zn=null)}else Zn=null;var Qx=/^\s*class\b/,nm=function(t){try{var e=xb.call(t);return Qx.test(e)}catch{return!1}},im=function(t){try{return nm(t)?!1:(xb.call(t),!0)}catch{return!1}},lu=Object.prototype.toString,Kx="[object Object]",e8="[object Function]",t8="[object GeneratorFunction]",r8="[object HTMLAllCollection]",i8="[object HTML document.all class]",o8="[object HTMLCollection]",n8=typeof Symbol=="function"&&!!Symbol.toStringTag,a8=!(0 in[,]),am=function(){return!1};typeof document=="object"&&(Sb=document.all,lu.call(Sb)===lu.call(document.all)&&(am=function(t){if((a8||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=lu.call(t);return(e===r8||e===i8||e===o8||e===Kx)&&t("")==null}catch{}return!1}));var Sb;Ib.exports=Zn?function(t){if(am(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Zn(t,null,om)}catch(e){if(e!==su)return!1}return!nm(t)&&im(t)}:function(t){if(am(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(n8)return im(t);if(nm(t))return!1;var e=lu.call(t);return e!==e8&&e!==t8&&!/^\[object HTML/.test(e)?!1:im(t)}});var wb=G((LD,Tb)=>{"use strict";f();var s8=Mb(),l8=Object.prototype.toString,Pb=Object.prototype.hasOwnProperty,c8=function(t,e,i){for(var o=0,n=t.length;o<n;o++)Pb.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},p8=function(t,e,i){for(var o=0,n=t.length;o<n;o++)i==null?e(t.charAt(o),o,t):e.call(i,t.charAt(o),o,t)},u8=function(t,e,i){for(var o in t)Pb.call(t,o)&&(i==null?e(t[o],o,t):e.call(i,t[o],o,t))},d8=function(t,e,i){if(!s8(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=i),l8.call(t)==="[object Array]"?c8(t,e,o):typeof t=="string"?p8(t,e,o):u8(t,e,o)};Tb.exports=d8});var Db=G((FD,Eb)=>{"use strict";f();Eb.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Lb=G((kD,Ob)=>{"use strict";f();var sm=Db(),h8=typeof globalThis>"u"?global:globalThis;Ob.exports=function(){for(var t=[],e=0;e<sm.length;e++)typeof h8[sm[e]]=="function"&&(t[t.length]=sm[e]);return t}});var Bb=G((RD,kb)=>{"use strict";f();var pu=wb(),f8=Lb(),Ab=Fo(),pm=Et(),cu=Vp(),m8=pm("Object.prototype.toString"),_b=ji()(),Fb=typeof globalThis>"u"?global:globalThis,cm=f8(),um=pm("String.prototype.slice"),lm=Object.getPrototypeOf,y8=pm("Array.prototype.indexOf",!0)||function(t,e){for(var i=0;i<t.length;i+=1)if(t[i]===e)return i;return-1},uu={__proto__:null};_b&&cu&&lm?pu(cm,function(r){var t=new Fb[r];if(Symbol.toStringTag in t){var e=lm(t),i=cu(e,Symbol.toStringTag);if(!i){var o=lm(e);i=cu(o,Symbol.toStringTag)}uu["$"+r]=Ab(i.get)}}):pu(cm,function(r){var t=new Fb[r],e=t.slice||t.set;e&&(uu["$"+r]=Ab(e))});var g8=function(t){var e=!1;return pu(uu,function(i,o){if(!e)try{"$"+i(t)===o&&(e=um(o,1))}catch{}}),e},v8=function(t){var e=!1;return pu(uu,function(i,o){if(!e)try{i(t),e=um(o,1)}catch{}}),e};kb.exports=function(t){if(!t||typeof t!="object")return!1;if(!_b){var e=um(m8(t),8,-1);return y8(cm,e)>-1?e:e!=="Object"?!1:v8(t)}return cu?g8(t):null}});var Gb=G((GD,Nb)=>{"use strict";f();var b8=Et(),Rb=b8("ArrayBuffer.prototype.byteLength",!0),C8=Zf();Nb.exports=function(t){return C8(t)?Rb?Rb(t):t.byteLength:NaN}});var p3=G((jD,c3)=>{"use strict";f();var a3=y2(),Mr=Et(),Vb=O2(),S8=zt(),zn=wv(),x8=Tf(),jb=Bv(),Hb=df(),Ub=Ef(),Xb=Zf(),Wb=Hv(),Yb=Zv(),Zb=$v(),zb=Ap(),qb=hb(),$b=Cb(),Jb=Bb(),Qb=Gb(),Kb=Mr("SharedArrayBuffer.prototype.byteLength",!0),e3=Mr("Date.prototype.getTime"),dm=Object.getPrototypeOf,t3=Mr("Object.prototype.toString"),hu=S8("%Set%",!0),hm=Mr("Map.prototype.has",!0),fu=Mr("Map.prototype.get",!0),r3=Mr("Map.prototype.size",!0),mu=Mr("Set.prototype.add",!0),s3=Mr("Set.prototype.delete",!0),yu=Mr("Set.prototype.has",!0),du=Mr("Set.prototype.size",!0);function i3(r,t,e,i){for(var o=zn(r),n;(n=o.next())&&!n.done;)if(qt(t,n.value,e,i))return s3(r,n.value),!0;return!1}function l3(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}function I8(r,t,e,i,o,n){var s=l3(e);if(s!=null)return s;var c=fu(t,s),l=a3({},o,{strict:!1});return typeof c>"u"&&!hm(t,s)||!qt(i,c,l,n)?!1:!hm(r,s)&&qt(i,c,l,n)}function M8(r,t,e){var i=l3(e);return i!=null?i:yu(t,i)&&!yu(r,i)}function o3(r,t,e,i,o,n){for(var s=zn(r),c,l;(c=s.next())&&!c.done;)if(l=c.value,qt(e,l,o,n)&&qt(i,fu(t,l),o,n))return s3(r,l),!0;return!1}function qt(r,t,e,i){var o=e||{};if(o.strict?jb(r,t):r===t)return!0;var n=qb(r),s=qb(t);if(n!==s)return!1;if(!r||!t||typeof r!="object"&&typeof t!="object")return o.strict?jb(r,t):r==t;var c=i.has(r),l=i.has(t),p;if(c&&l){if(i.get(r)===i.get(t))return!0}else p={};return c||i.set(r,p),l||i.set(t,p),w8(r,t,o,i)}function n3(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}function P8(r,t,e,i){if(du(r)!==du(t))return!1;for(var o=zn(r),n=zn(t),s,c,l;(s=o.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new hu),mu(l,s.value);else if(!yu(t,s.value)){if(e.strict||!M8(r,t,s.value))return!1;l||(l=new hu),mu(l,s.value)}if(l){for(;(c=n.next())&&!c.done;)if(c.value&&typeof c.value=="object"){if(!i3(l,c.value,e.strict,i))return!1}else if(!e.strict&&!yu(r,c.value)&&!i3(l,c.value,e.strict,i))return!1;return du(l)===0}return!0}function T8(r,t,e,i){if(r3(r)!==r3(t))return!1;for(var o=zn(r),n=zn(t),s,c,l,p,h,m;(s=o.next())&&!s.done;)if(p=s.value[0],h=s.value[1],p&&typeof p=="object")l||(l=new hu),mu(l,p);else if(m=fu(t,p),typeof m>"u"&&!hm(t,p)||!qt(h,m,e,i)){if(e.strict||!I8(r,t,p,h,e,i))return!1;l||(l=new hu),mu(l,p)}if(l){for(;(c=n.next())&&!c.done;)if(p=c.value[0],m=c.value[1],p&&typeof p=="object"){if(!o3(l,r,p,m,e,i))return!1}else if(!e.strict&&(!r.has(p)||!qt(fu(r,p),m,e,i))&&!o3(l,r,p,m,a3({},e,{strict:!1}),i))return!1;return du(l)===0}return!0}function w8(r,t,e,i){var o,n;if(typeof r!=typeof t||r==null||t==null||t3(r)!==t3(t)||Hb(r)!==Hb(t))return!1;var s=Ub(r),c=Ub(t);if(s!==c)return!1;var l=r instanceof Error,p=t instanceof Error;if(l!==p||(l||p)&&(r.name!==t.name||r.message!==t.message))return!1;var h=Yb(r),m=Yb(t);if(h!==m||(h||m)&&(r.source!==t.source||Vb(r)!==Vb(t)))return!1;var y=Wb(r),g=Wb(t);if(y!==g||(y||g)&&e3(r)!==e3(t)||e.strict&&dm&&dm(r)!==dm(t))return!1;var S=Jb(r),M=Jb(t);if(S!==M)return!1;if(S||M){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}var v=n3(r),C=n3(t);if(v!==C)return!1;if(v||C){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}var w=Xb(r),P=Xb(t);if(w!==P)return!1;if(w||P)return Qb(r)!==Qb(t)?!1:typeof Uint8Array=="function"&&qt(new Uint8Array(r),new Uint8Array(t),e,i);var T=Zb(r),E=Zb(t);if(T!==E)return!1;if(T||E)return Kb(r)!==Kb(t)?!1:typeof Uint8Array=="function"&&qt(new Uint8Array(r),new Uint8Array(t),e,i);if(typeof r!=typeof t)return!1;var A=zb(r),k=zb(t);if(A.length!==k.length)return!1;for(A.sort(),k.sort(),o=A.length-1;o>=0;o--)if(A[o]!=k[o])return!1;for(o=A.length-1;o>=0;o--)if(n=A[o],!qt(r[n],t[n],e,i))return!1;var N=$b(r),F=$b(t);return N!==F?!1:N==="Set"||F==="Set"?P8(r,t,e,i):N==="Map"?T8(r,t,e,i):!0}c3.exports=function(t,e,i){return qt(t,e,i,x8())}});var T3=G(ne=>{"use strict";f();Object.defineProperty(ne,"__esModule",{value:!0});function E8(r){return r&&r.__esModule?r:{default:r}}var D8=Object.defineProperty,le=(r,t)=>D8(r,"name",{value:t,configurable:!0}),O8=p3(),L8=E8(O8),u3=class{constructor(t){this.direction=!1,this.compareProperties=!0;var e,i,o;this.precision=10**-((e=t==null?void 0:t.precision)!=null?e:17),this.direction=(i=t==null?void 0:t.direction)!=null?i:!1,this.compareProperties=(o=t==null?void 0:t.compareProperties)!=null?o:!0}compare(t,e){if(t.type!==e.type||!Ps(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){let i=fm(t),o=fm(e);return i.every(n=>o.some(s=>this.compare(n,s)))}}return!1}compareCoord(t,e){return t.length===e.length&&t.every((i,o)=>Math.abs(i-e[o])<this.precision)}compareLine(t,e,i=0,o=!1){if(!Ps(t,e))return!1;let n=t,s=e;if(o&&!this.compareCoord(n[0],s[0])){let l=this.fixStartIndex(s,n);if(l)s=l;else return!1}let c=this.compareCoord(n[i],s[i]);return this.direction||c?this.comparePath(n,s):this.compareCoord(n[i],s[s.length-(1+i)])?this.comparePath(n.slice().reverse(),s):!1}fixStartIndex(t,e){let i,o=-1;for(let n=0;n<t.length;n++)if(this.compareCoord(t[n],e[0])){o=n;break}return o>=0&&(i=[].concat(t.slice(o,t.length),t.slice(1,o+1))),i}comparePath(t,e){return t.every((i,o)=>this.compareCoord(i,e[o]))}comparePolygon(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){let i=t.coordinates.slice(1,t.coordinates.length),o=e.coordinates.slice(1,e.coordinates.length);return i.every(n=>o.some(s=>this.compareLine(n,s,1,!0)))}return!1}compareGeometryCollection(t,e){return Ps(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((i,o)=>this.compare(i,e.geometries[o]))}compareFeature(t,e){return t.id===e.id&&(this.compareProperties?L8.default.call(void 0,t.properties,e.properties):!0)&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}compareFeatureCollection(t,e){return Ps(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((i,o)=>this.compare(i,e.features[o]))}compareBBox(t,e){return!t.bbox&&!e.bbox||(t.bbox&&e.bbox?this.compareCoord(t.bbox,e.bbox):!1)}};le(u3,"GeojsonEquality");var A8=u3;function Ps(r,t){return r.coordinates?r.coordinates.length===t.coordinates.length:r.length===t.length}le(Ps,"sameLength");function fm(r){return r.coordinates.map(t=>({type:r.type.replace("Multi",""),coordinates:t}))}le(fm,"explode");var gt=63710088e-1,ym={centimeters:gt*100,centimetres:gt*100,degrees:360/(2*Math.PI),feet:gt*3.28084,inches:gt*39.37,kilometers:gt/1e3,kilometres:gt/1e3,meters:gt,metres:gt,miles:gt/1609.344,millimeters:gt*1e3,millimetres:gt*1e3,nauticalmiles:gt/1852,radians:1,yards:gt*1.0936},mm={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,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function ti(r,t,e={}){let i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}le(ti,"feature");function d3(r,t,e={}){switch(r){case"Point":return gu(t).geometry;case"LineString":return bu(t).geometry;case"Polygon":return vu(t).geometry;case"MultiPoint":return vm(t).geometry;case"MultiLineString":return gm(t).geometry;case"MultiPolygon":return bm(t).geometry;default:throw new Error(r+" is invalid")}}le(d3,"geometry");function gu(r,t,e={}){if(!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ts(r[0])||!Ts(r[1]))throw new Error("coordinates must contain numbers");return ti({type:"Point",coordinates:r},t,e)}le(gu,"point");function h3(r,t,e={}){return ws(r.map(i=>gu(i,t)),e)}le(h3,"points");function vu(r,t,e={}){for(let o of r){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let n=0;n<o[o.length-1].length;n++)if(o[o.length-1][n]!==o[0][n])throw new Error("First and last Position are not equivalent.")}return ti({type:"Polygon",coordinates:r},t,e)}le(vu,"polygon");function f3(r,t,e={}){return ws(r.map(i=>vu(i,t)),e)}le(f3,"polygons");function bu(r,t,e={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return ti({type:"LineString",coordinates:r},t,e)}le(bu,"lineString");function m3(r,t,e={}){return ws(r.map(i=>bu(i,t)),e)}le(m3,"lineStrings");function ws(r,t={}){let e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}le(ws,"featureCollection");function gm(r,t,e={}){return ti({type:"MultiLineString",coordinates:r},t,e)}le(gm,"multiLineString");function vm(r,t,e={}){return ti({type:"MultiPoint",coordinates:r},t,e)}le(vm,"multiPoint");function bm(r,t,e={}){return ti({type:"MultiPolygon",coordinates:r},t,e)}le(bm,"multiPolygon");function y3(r,t,e={}){return ti({type:"GeometryCollection",geometries:r},t,e)}le(y3,"geometryCollection");function g3(r,t=0){if(t&&!(t>=0))throw new Error("precision must be a positive number");let e=Math.pow(10,t||0);return Math.round(r*e)/e}le(g3,"round");function Cm(r,t="kilometers"){let e=ym[t];if(!e)throw new Error(t+" units is invalid");return r*e}le(Cm,"radiansToLength");function Cu(r,t="kilometers"){let e=ym[t];if(!e)throw new Error(t+" units is invalid");return r/e}le(Cu,"lengthToRadians");function v3(r,t){return Sm(Cu(r,t))}le(v3,"lengthToDegrees");function b3(r){let t=r%360;return t<0&&(t+=360),t}le(b3,"bearingToAzimuth");function Sm(r){return r%(2*Math.PI)*180/Math.PI}le(Sm,"radiansToDegrees");function C3(r){return r%360*Math.PI/180}le(C3,"degreesToRadians");function S3(r,t="kilometers",e="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return Cm(Cu(r,t),e)}le(S3,"convertLength");function x3(r,t="meters",e="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=mm[t];if(!i)throw new Error("invalid original units");let o=mm[e];if(!o)throw new Error("invalid final units");return r/i*o}le(x3,"convertArea");function Ts(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}le(Ts,"isNumber");function I3(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}le(I3,"isObject");function M3(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(t=>{if(!Ts(t))throw new Error("bbox must only contain numbers")})}le(M3,"validateBBox");function P3(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}le(P3,"validateId");ne.GeojsonEquality=A8;ne.areaFactors=mm;ne.bearingToAzimuth=b3;ne.convertArea=x3;ne.convertLength=S3;ne.degreesToRadians=C3;ne.earthRadius=gt;ne.factors=ym;ne.feature=ti;ne.featureCollection=ws;ne.geometry=d3;ne.geometryCollection=y3;ne.isNumber=Ts;ne.isObject=I3;ne.lengthToDegrees=v3;ne.lengthToRadians=Cu;ne.lineString=bu;ne.lineStrings=m3;ne.multiLineString=gm;ne.multiPoint=vm;ne.multiPolygon=bm;ne.point=gu;ne.points=h3;ne.polygon=vu;ne.polygons=f3;ne.radiansToDegrees=Sm;ne.radiansToLength=Cm;ne.round=g3;ne.validateBBox=M3;ne.validateId=P3});var R3=G(Ne=>{"use strict";f();Object.defineProperty(Ne,"__esModule",{value:!0});var F8=Object.defineProperty,We=(r,t)=>F8(r,"name",{value:t,configurable:!0}),Je=T3();function qn(r,t,e){if(r!==null)for(var i,o,n,s,c,l,p,h=0,m=0,y,g=r.type,S=g==="FeatureCollection",M=g==="Feature",v=S?r.features.length:1,C=0;C<v;C++){p=S?r.features[C].geometry:M?r.geometry:r,y=p?p.type==="GeometryCollection":!1,c=y?p.geometries.length:1;for(var w=0;w<c;w++){var P=0,T=0;if(s=y?p.geometries[w]:p,s!==null){l=s.coordinates;var E=s.type;switch(h=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(t(l,m,C,P,T)===!1)return!1;m++,P++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(t(l[i],m,C,P,T)===!1)return!1;m++,E==="MultiPoint"&&P++}E==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-h;o++){if(t(l[i][o],m,C,P,T)===!1)return!1;m++}E==="MultiLineString"&&P++,E==="Polygon"&&T++}E==="Polygon"&&P++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(T=0,o=0;o<l[i].length;o++){for(n=0;n<l[i][o].length-h;n++){if(t(l[i][o][n],m,C,P,T)===!1)return!1;m++}T++}P++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(qn(s.geometries[i],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}We(qn,"coordEach");function w3(r,t,e,i){var o=e;return qn(r,function(n,s,c,l,p){s===0&&e===void 0?o=n:o=t(o,n,s,c,l,p)},i),o}We(w3,"coordReduce");function xm(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}We(xm,"propEach");function E3(r,t,e){var i=e;return xm(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}We(E3,"propReduce");function Im(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}We(Im,"featureEach");function D3(r,t,e){var i=e;return Im(r,function(o,n){n===0&&e===void 0?i=o:i=t(i,o,n)}),i}We(D3,"featureReduce");function O3(r){var t=[];return qn(r,function(e){t.push(e)}),t}We(O3,"coordAll");function Su(r,t){var e,i,o,n,s,c,l,p,h,m,y=0,g=r.type==="FeatureCollection",S=r.type==="Feature",M=g?r.features.length:1;for(e=0;e<M;e++){for(c=g?r.features[e].geometry:S?r.geometry:r,p=g?r.features[e].properties:S?r.properties:{},h=g?r.features[e].bbox:S?r.bbox:void 0,m=g?r.features[e].id:S?r.id:void 0,l=c?c.type==="GeometryCollection":!1,s=l?c.geometries.length:1,o=0;o<s;o++){if(n=l?c.geometries[o]:c,n===null){if(t(null,y,p,h,m)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,y,p,h,m)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<n.geometries.length;i++)if(t(n.geometries[i],y,p,h,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}y++}}We(Su,"geomEach");function L3(r,t,e){var i=e;return Su(r,function(o,n,s,c,l){n===0&&e===void 0?i=o:i=t(i,o,n,s,c,l)}),i}We(L3,"geomReduce");function Es(r,t){Su(r,function(e,i,o,n,s){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(Je.feature.call(void 0,e,o,{bbox:n,id:s}),i,0)===!1?!1:void 0}var l;switch(c){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<e.coordinates.length;p++){var h=e.coordinates[p],m={type:l,coordinates:h};if(t(Je.feature.call(void 0,m,o),i,p)===!1)return!1}})}We(Es,"flattenEach");function A3(r,t,e){var i=e;return Es(r,function(o,n,s){n===0&&s===0&&e===void 0?i=o:i=t(i,o,n,s)}),i}We(A3,"flattenReduce");function Mm(r,t){Es(r,function(e,i,o){var n=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var c,l=0,p=0,h=0;if(qn(e,function(m,y,g,S,M){if(c===void 0||i>l||S>p||M>h){c=m,l=i,p=S,h=M,n=0;return}var v=Je.lineString.call(void 0,[c,m],e.properties);if(t(v,i,o,M,n)===!1)return!1;n++,c=m})===!1)return!1}}})}We(Mm,"segmentEach");function F3(r,t,e){var i=e,o=!1;return Mm(r,function(n,s,c,l,p){o===!1&&e===void 0?i=n:i=t(i,n,s,c,l,p),o=!0}),i}We(F3,"segmentReduce");function Pm(r,t){if(!r)throw new Error("geojson is required");Es(r,function(e,i,o){if(e.geometry!==null){var n=e.geometry.type,s=e.geometry.coordinates;switch(n){case"LineString":if(t(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<s.length;c++)if(t(Je.lineString.call(void 0,s[c],e.properties),i,o,c)===!1)return!1;break}}})}We(Pm,"lineEach");function _3(r,t,e){var i=e;return Pm(r,function(o,n,s,c){n===0&&e===void 0?i=o:i=t(i,o,n,s,c)}),i}We(_3,"lineReduce");function k3(r,t){if(t=t||{},!Je.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.segmentIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return n<0&&(n=l.length+n-1),Je.lineString.call(void 0,[l[n],l[n+1]],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n-1),Je.lineString.call(void 0,[l[o][n],l[o][n+1]],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n-1),Je.lineString.call(void 0,[l[i][n],l[i][n+1]],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n-1),Je.lineString.call(void 0,[l[i][o][n],l[i][o][n+1]],s,t)}throw new Error("geojson is invalid")}We(k3,"findSegment");function B3(r,t){if(t=t||{},!Je.isObject.call(void 0,t))throw new Error("options is invalid");var e=t.featureIndex||0,i=t.multiFeatureIndex||0,o=t.geometryIndex||0,n=t.coordIndex||0,s=t.properties,c;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),s=s||r.features[e].properties,c=r.features[e].geometry;break;case"Feature":s=s||r.properties,c=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=r;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var l=c.coordinates;switch(c.type){case"Point":return Je.point.call(void 0,l,s,t);case"MultiPoint":return i<0&&(i=l.length+i),Je.point.call(void 0,l[i],s,t);case"LineString":return n<0&&(n=l.length+n),Je.point.call(void 0,l[n],s,t);case"Polygon":return o<0&&(o=l.length+o),n<0&&(n=l[o].length+n),Je.point.call(void 0,l[o][n],s,t);case"MultiLineString":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),Je.point.call(void 0,l[i][n],s,t);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),n<0&&(n=l[i][o].length-n),Je.point.call(void 0,l[i][o][n],s,t)}throw new Error("geojson is invalid")}We(B3,"findPoint");Ne.coordAll=O3;Ne.coordEach=qn;Ne.coordReduce=w3;Ne.featureEach=Im;Ne.featureReduce=D3;Ne.findPoint=B3;Ne.findSegment=k3;Ne.flattenEach=Es;Ne.flattenReduce=A3;Ne.geomEach=Su;Ne.geomReduce=L3;Ne.lineEach=Pm;Ne.lineReduce=_3;Ne.propEach=xm;Ne.propReduce=E3;Ne.segmentEach=Mm;Ne.segmentReduce=F3});var N3=G(xu=>{"use strict";f();Object.defineProperty(xu,"__esModule",{value:!0});var _8=Object.defineProperty,k8=(r,t)=>_8(r,"name",{value:t,configurable:!0}),B8=R3();function Tm(r,t={}){if(r.bbox!=null&&t.recompute!==!0)return r.bbox;let e=[1/0,1/0,-1/0,-1/0];return B8.coordEach.call(void 0,r,i=>{e[0]>i[0]&&(e[0]=i[0]),e[1]>i[1]&&(e[1]=i[1]),e[2]<i[0]&&(e[2]=i[0]),e[3]<i[1]&&(e[3]=i[1])}),e}k8(Tm,"bbox");var R8=Tm;xu.bbox=Tm;xu.default=R8});var U3=G((QD,wm)=>{f();var Pr=R1(),V3=Zh(),j3=Z1(),$n=N3().default,N8=j3.featureEach,$D=j3.coordEach,JD=V3.polygon,G3=V3.featureCollection;function H3(r){var t=new Pr(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:$n(e),Pr.prototype.insert.call(this,e)},t.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:$n(o),i.push(o)}):N8(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:$n(o),i.push(o)}),Pr.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:$n(e),Pr.prototype.remove.call(this,e,i)},t.clear=function(){return Pr.prototype.clear.call(this)},t.search=function(e){var i=Pr.prototype.search.call(this,this.toBBox(e));return G3(i)},t.collides=function(e){return Pr.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Pr.prototype.all.call(this);return G3(e)},t.toJSON=function(){return Pr.prototype.toJSON.call(this)},t.fromJSON=function(e){return Pr.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=$n(e);else if(e.type==="FeatureCollection")i=$n(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},t}wm.exports=H3;wm.exports.default=H3});var u5=G((UR,yl)=>{"use strict";f();var b9=!1,en=!1,o5=!0,n5=!1,d={},a5=!1;typeof yl<"u"&&yl.exports?(yl.exports=d,a5=!0):typeof document<"u"?window.ClipperLib=d:self.ClipperLib=d;var id;a5?(Ve="chrome",id="Netscape"):(Ve=navigator.userAgent.toString().toLowerCase(),id=navigator.appName);var Ve,ee={};Ve.indexOf("chrome")!=-1&&Ve.indexOf("chromium")==-1?ee.chrome=1:ee.chrome=0;Ve.indexOf("chromium")!=-1?ee.chromium=1:ee.chromium=0;Ve.indexOf("safari")!=-1&&Ve.indexOf("chrome")==-1&&Ve.indexOf("chromium")==-1?ee.safari=1:ee.safari=0;Ve.indexOf("firefox")!=-1?ee.firefox=1:ee.firefox=0;Ve.indexOf("firefox/17")!=-1?ee.firefox17=1:ee.firefox17=0;Ve.indexOf("firefox/15")!=-1?ee.firefox15=1:ee.firefox15=0;Ve.indexOf("firefox/3")!=-1?ee.firefox3=1:ee.firefox3=0;Ve.indexOf("opera")!=-1?ee.opera=1:ee.opera=0;Ve.indexOf("msie 10")!=-1?ee.msie10=1:ee.msie10=0;Ve.indexOf("msie 9")!=-1?ee.msie9=1:ee.msie9=0;Ve.indexOf("msie 8")!=-1?ee.msie8=1:ee.msie8=0;Ve.indexOf("msie 7")!=-1?ee.msie7=1:ee.msie7=0;Ve.indexOf("msie ")!=-1?ee.msie=1:ee.msie=0;d.biginteger_used=null;var no,C9=0xdeadbeefcafe,r5=(C9&16777215)==15715070;function _(r,t,e){d.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}function oe(){return new _(null)}function S9(r,t,e,i,o,n){for(;--n>=0;){var s=t*this[r++]+e[i]+o;o=Math.floor(s/67108864),e[i++]=s&67108863}return o}function x9(r,t,e,i,o,n){for(var s=t&32767,c=t>>15;--n>=0;){var l=this[r]&32767,p=this[r++]>>15,h=c*l+p*s;l=s*l+((h&32767)<<15)+e[i]+(o&1073741823),o=(l>>>30)+(h>>>15)+c*p+(o>>>30),e[i++]=l&1073741823}return o}function I9(r,t,e,i,o,n){for(var s=t&16383,c=t>>14;--n>=0;){var l=this[r]&16383,p=this[r++]>>14,h=c*l+p*s;l=s*l+((h&16383)<<14)+e[i]+o,o=(l>>28)+(h>>14)+c*p,e[i++]=l&268435455}return o}r5&&id=="Microsoft Internet Explorer"?(_.prototype.am=x9,no=30):r5&&id!="Netscape"?(_.prototype.am=S9,no=26):(_.prototype.am=I9,no=28);_.prototype.DB=no;_.prototype.DM=(1<<no)-1;_.prototype.DV=1<<no;var py=52;_.prototype.FV=Math.pow(2,py);_.prototype.F1=py-no;_.prototype.F2=2*no-py;var M9="0123456789abcdefghijklmnopqrstuvwxyz",nd=new Array,da,jt;da=48;for(jt=0;jt<=9;++jt)nd[da++]=jt;da=97;for(jt=10;jt<36;++jt)nd[da++]=jt;da=65;for(jt=10;jt<36;++jt)nd[da++]=jt;function i5(r){return M9.charAt(r)}function s5(r,t){var e=nd[r.charCodeAt(t)];return e==null?-1:e}function P9(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}function T9(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}function oo(r){var t=oe();return t.fromInt(r),t}function w9(r,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(r,t);return}this.t=0,this.s=0;for(var i=r.length,o=!1,n=0;--i>=0;){var s=e==8?r[i]&255:s5(r,i);if(s<0){r.charAt(i)=="-"&&(o=!0);continue}o=!1,n==0?this[this.t++]=s:n+e>this.DB?(this[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this[this.t++]=s>>this.DB-n):this[this.t-1]|=s<<n,n+=e,n>=this.DB&&(n-=this.DB)}e==8&&r[0]&128&&(this.s=-1,n>0&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),o&&_.ZERO.subTo(this,this)}function E9(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}function D9(r){if(this.s<0)return"-"+this.negate().toString(r);var t;if(r==16)t=4;else if(r==8)t=3;else if(r==2)t=1;else if(r==32)t=5;else if(r==4)t=2;else return this.toRadix(r);var e=(1<<t)-1,i,o=!1,n="",s=this.t,c=this.DB-s*this.DB%t;if(s-- >0)for(c<this.DB&&(i=this[s]>>c)>0&&(o=!0,n=i5(i));s>=0;)c<t?(i=(this[s]&(1<<c)-1)<<t-c,i|=this[--s]>>(c+=this.DB-t)):(i=this[s]>>(c-=t)&e,c<=0&&(c+=this.DB,--s)),i>0&&(o=!0),o&&(n+=i5(i));return o?n:"0"}function O9(){var r=oe();return _.ZERO.subTo(this,r),r}function L9(){return this.s<0?this.negate():this}function A9(r){var t=this.s-r.s;if(t!=0)return t;var e=this.t;if(t=e-r.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-r[e])!=0)return t;return 0}function ad(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}function F9(){return this.t<=0?0:this.DB*(this.t-1)+ad(this[this.t-1]^this.s&this.DM)}function _9(r,t){var e;for(e=this.t-1;e>=0;--e)t[e+r]=this[e];for(e=r-1;e>=0;--e)t[e]=0;t.t=this.t+r,t.s=this.s}function k9(r,t){for(var e=r;e<this.t;++e)t[e-r]=this[e];t.t=Math.max(this.t-r,0),t.s=this.s}function B9(r,t){var e=r%this.DB,i=this.DB-e,o=(1<<i)-1,n=Math.floor(r/this.DB),s=this.s<<e&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+n+1]=this[c]>>i|s,s=(this[c]&o)<<e;for(c=n-1;c>=0;--c)t[c]=0;t[n]=s,t.t=this.t+n+1,t.s=this.s,t.clamp()}function R9(r,t){t.s=this.s;var e=Math.floor(r/this.DB);if(e>=this.t){t.t=0;return}var i=r%this.DB,o=this.DB-i,n=(1<<i)-1;t[0]=this[e]>>i;for(var s=e+1;s<this.t;++s)t[s-e-1]|=(this[s]&n)<<o,t[s-e]=this[s]>>i;i>0&&(t[this.t-e-1]|=(this.s&n)<<o),t.t=this.t-e,t.clamp()}function N9(r,t){for(var e=0,i=0,o=Math.min(r.t,this.t);e<o;)i+=this[e]-r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i-=r[e],t[e++]=i&this.DM,i>>=this.DB;i-=r.s}t.s=i<0?-1:0,i<-1?t[e++]=this.DV+i:i>0&&(t[e++]=i),t.t=e,t.clamp()}function G9(r,t){var e=this.abs(),i=r.abs(),o=e.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o<i.t;++o)t[o+e.t]=e.am(0,i[o],t,o,0,e.t);t.s=0,t.clamp(),this.s!=r.s&&_.ZERO.subTo(t,t)}function V9(r){for(var t=this.abs(),e=r.t=2*t.t;--e>=0;)r[e]=0;for(e=0;e<t.t-1;++e){var i=t.am(e,t[e],r,2*e,0,1);(r[e+t.t]+=t.am(e+1,2*t[e],r,2*e+1,i,t.t-e-1))>=t.DV&&(r[e+t.t]-=t.DV,r[e+t.t+1]=1)}r.t>0&&(r[r.t-1]+=t.am(e,t[e],r,2*e,0,1)),r.s=0,r.clamp()}function j9(r,t,e){var i=r.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=oe());var n=oe(),s=this.s,c=r.s,l=this.DB-ad(i[i.t-1]);l>0?(i.lShiftTo(l,n),o.lShiftTo(l,e)):(i.copyTo(n),o.copyTo(e));var p=n.t,h=n[p-1];if(h!=0){var m=h*(1<<this.F1)+(p>1?n[p-2]>>this.F2:0),y=this.FV/m,g=(1<<this.F1)/m,S=1<<this.F2,M=e.t,v=M-p,C=t==null?oe():t;for(n.dlShiftTo(v,C),e.compareTo(C)>=0&&(e[e.t++]=1,e.subTo(C,e)),_.ONE.dlShiftTo(p,C),C.subTo(n,n);n.t<p;)n[n.t++]=0;for(;--v>=0;){var w=e[--M]==h?this.DM:Math.floor(e[M]*y+(e[M-1]+S)*g);if((e[M]+=n.am(0,w,e,v,0,p))<w)for(n.dlShiftTo(v,C),e.subTo(C,e);e[M]<--w;)e.subTo(C,e)}t!=null&&(e.drShiftTo(p,t),s!=c&&_.ZERO.subTo(t,t)),e.t=p,e.clamp(),l>0&&e.rShiftTo(l,e),s<0&&_.ZERO.subTo(e,e)}}}function H9(r){var t=oe();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(_.ZERO)>0&&r.subTo(t,t),t}function tn(r){this.m=r}function U9(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}function X9(r){return r}function W9(r){r.divRemTo(this.m,null,r)}function Y9(r,t,e){r.multiplyTo(t,e),this.reduce(e)}function Z9(r,t){r.squareTo(t),this.reduce(t)}tn.prototype.convert=U9;tn.prototype.revert=X9;tn.prototype.reduce=W9;tn.prototype.mulTo=Y9;tn.prototype.sqrTo=Z9;function z9(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}function rn(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}function q9(r){var t=oe();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t}function $9(r){var t=oe();return r.copyTo(t),this.reduce(t),t}function J9(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var t=0;t<this.m.t;++t){var e=r[t]&32767,i=e*this.mpl+((e*this.mph+(r[t]>>15)*this.mpl&this.um)<<15)&r.DM;for(e=t+this.m.t,r[e]+=this.m.am(0,i,r,t,0,this.m.t);r[e]>=r.DV;)r[e]-=r.DV,r[++e]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}function Q9(r,t){r.squareTo(t),this.reduce(t)}function K9(r,t,e){r.multiplyTo(t,e),this.reduce(e)}rn.prototype.convert=q9;rn.prototype.revert=$9;rn.prototype.reduce=J9;rn.prototype.mulTo=K9;rn.prototype.sqrTo=Q9;function eI(){return(this.t>0?this[0]&1:this.s)==0}function tI(r,t){if(r>4294967295||r<1)return _.ONE;var e=oe(),i=oe(),o=t.convert(this),n=ad(r)-1;for(o.copyTo(e);--n>=0;)if(t.sqrTo(e,i),(r&1<<n)>0)t.mulTo(i,o,e);else{var s=e;e=i,i=s}return t.revert(e)}function rI(r,t){var e;return r<256||t.isEven()?e=new tn(t):e=new rn(t),this.exp(r,e)}_.prototype.copyTo=P9;_.prototype.fromInt=T9;_.prototype.fromString=w9;_.prototype.clamp=E9;_.prototype.dlShiftTo=_9;_.prototype.drShiftTo=k9;_.prototype.lShiftTo=B9;_.prototype.rShiftTo=R9;_.prototype.subTo=N9;_.prototype.multiplyTo=G9;_.prototype.squareTo=V9;_.prototype.divRemTo=j9;_.prototype.invDigit=z9;_.prototype.isEven=eI;_.prototype.exp=tI;_.prototype.toString=D9;_.prototype.negate=O9;_.prototype.abs=L9;_.prototype.compareTo=A9;_.prototype.bitLength=F9;_.prototype.mod=H9;_.prototype.modPowInt=rI;_.ZERO=oo(0);_.ONE=oo(1);function iI(){var r=oe();return this.copyTo(r),r}function oI(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function nI(){return this.t==0?this.s:this[0]<<24>>24}function aI(){return this.t==0?this.s:this[0]<<16>>16}function sI(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}function lI(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function cI(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var t=this.chunkSize(r),e=Math.pow(r,t),i=oo(e),o=oe(),n=oe(),s="";for(this.divRemTo(i,o,n);o.signum()>0;)s=(e+n.intValue()).toString(r).substr(1)+s,o.divRemTo(i,o,n);return n.intValue().toString(r)+s}function pI(r,t){this.fromInt(0),t==null&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),o=!1,n=0,s=0,c=0;c<r.length;++c){var l=s5(r,c);if(l<0){r.charAt(c)=="-"&&this.signum()==0&&(o=!0);continue}s=t*s+l,++n>=e&&(this.dMultiply(i),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(s,0)),o&&_.ZERO.subTo(this,this)}function uI(r,t,e){if(typeof t=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,e),this.testBit(r-1)||this.bitwiseTo(_.ONE.shiftLeft(r-1),uy,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(_.ONE.shiftLeft(r-1),this);else{var i=new Array,o=r&7;i.length=(r>>3)+1,t.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}}function dI(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,i,o=0;if(r-- >0)for(e<this.DB&&(i=this[r]>>e)!=(this.s&this.DM)>>e&&(t[o++]=i|this.s<<this.DB-e);r>=0;)e<8?(i=(this[r]&(1<<e)-1)<<8-e,i|=this[--r]>>(e+=this.DB-8)):(i=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),i&128&&(i|=-256),o==0&&(this.s&128)!=(i&128)&&++o,(o>0||i!=this.s)&&(t[o++]=i);return t}function hI(r){return this.compareTo(r)==0}function fI(r){return this.compareTo(r)<0?this:r}function mI(r){return this.compareTo(r)>0?this:r}function yI(r,t,e){var i,o,n=Math.min(r.t,this.t);for(i=0;i<n;++i)e[i]=t(this[i],r[i]);if(r.t<this.t){for(o=r.s&this.DM,i=n;i<this.t;++i)e[i]=t(this[i],o);e.t=this.t}else{for(o=this.s&this.DM,i=n;i<r.t;++i)e[i]=t(o,r[i]);e.t=r.t}e.s=t(this.s,r.s),e.clamp()}function gI(r,t){return r&t}function vI(r){var t=oe();return this.bitwiseTo(r,gI,t),t}function uy(r,t){return r|t}function bI(r){var t=oe();return this.bitwiseTo(r,uy,t),t}function l5(r,t){return r^t}function CI(r){var t=oe();return this.bitwiseTo(r,l5,t),t}function c5(r,t){return r&~t}function SI(r){var t=oe();return this.bitwiseTo(r,c5,t),t}function xI(){for(var r=oe(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}function II(r){var t=oe();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}function MI(r){var t=oe();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}function PI(r){if(r==0)return-1;var t=0;return r&65535||(r>>=16,t+=16),r&255||(r>>=8,t+=8),r&15||(r>>=4,t+=4),r&3||(r>>=2,t+=2),r&1||++t,t}function TI(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+PI(this[r]);return this.s<0?this.t*this.DB:-1}function wI(r){for(var t=0;r!=0;)r&=r-1,++t;return t}function EI(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=wI(this[e]^t);return r}function DI(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}function OI(r,t){var e=_.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}function LI(r){return this.changeBit(r,uy)}function AI(r){return this.changeBit(r,c5)}function FI(r){return this.changeBit(r,l5)}function _I(r,t){for(var e=0,i=0,o=Math.min(r.t,this.t);e<o;)i+=this[e]+r[e],t[e++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;e<this.t;)i+=this[e],t[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;e<r.t;)i+=r[e],t[e++]=i&this.DM,i>>=this.DB;i+=r.s}t.s=i<0?-1:0,i>0?t[e++]=i:i<-1&&(t[e++]=this.DV+i),t.t=e,t.clamp()}function kI(r){var t=oe();return this.addTo(r,t),t}function BI(r){var t=oe();return this.subTo(r,t),t}function RI(r){var t=oe();return this.multiplyTo(r,t),t}function NI(){var r=oe();return this.squareTo(r),r}function GI(r){var t=oe();return this.divRemTo(r,t,null),t}function VI(r){var t=oe();return this.divRemTo(r,null,t),t}function jI(r){var t=oe(),e=oe();return this.divRemTo(r,t,e),new Array(t,e)}function HI(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}function UI(r,t){if(r!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=r;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function gl(){}function p5(r){return r}function XI(r,t,e){r.multiplyTo(t,e)}function WI(r,t){r.squareTo(t)}gl.prototype.convert=p5;gl.prototype.revert=p5;gl.prototype.mulTo=XI;gl.prototype.sqrTo=WI;function YI(r){return this.exp(r,new gl)}function ZI(r,t,e){var i=Math.min(this.t+r.t,t);for(e.s=0,e.t=i;i>0;)e[--i]=0;var o;for(o=e.t-this.t;i<o;++i)e[i+this.t]=this.am(0,r[i],e,i,0,this.t);for(o=Math.min(r.t,t);i<o;++i)this.am(0,r[i],e,i,0,t-i);e.clamp()}function zI(r,t,e){--t;var i=e.t=this.t+r.t-t;for(e.s=0;--i>=0;)e[i]=0;for(i=Math.max(t-this.t,0);i<r.t;++i)e[this.t+i-t]=this.am(t-i,r[i],e,0,0,this.t+i-t);e.clamp(),e.drShiftTo(1,e)}function ha(r){this.r2=oe(),this.q3=oe(),_.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}function qI(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var t=oe();return r.copyTo(t),this.reduce(t),t}function $I(r){return r}function JI(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}function QI(r,t){r.squareTo(t),this.reduce(t)}function KI(r,t,e){r.multiplyTo(t,e),this.reduce(e)}ha.prototype.convert=qI;ha.prototype.revert=$I;ha.prototype.reduce=JI;ha.prototype.mulTo=KI;ha.prototype.sqrTo=QI;function eM(r,t){var e=r.bitLength(),i,o=oo(1),n;if(e<=0)return o;e<18?i=1:e<48?i=3:e<144?i=4:e<768?i=5:i=6,e<8?n=new tn(t):t.isEven()?n=new ha(t):n=new rn(t);var s=new Array,c=3,l=i-1,p=(1<<i)-1;if(s[1]=n.convert(this),i>1){var h=oe();for(n.sqrTo(s[1],h);c<=p;)s[c]=oe(),n.mulTo(h,s[c-2],s[c]),c+=2}var m=r.t-1,y,g=!0,S=oe(),M;for(e=ad(r[m])-1;m>=0;){for(e>=l?y=r[m]>>e-l&p:(y=(r[m]&(1<<e+1)-1)<<l-e,m>0&&(y|=r[m-1]>>this.DB+e-l)),c=i;!(y&1);)y>>=1,--c;if((e-=c)<0&&(e+=this.DB,--m),g)s[y].copyTo(o),g=!1;else{for(;c>1;)n.sqrTo(o,S),n.sqrTo(S,o),c-=2;c>0?n.sqrTo(o,S):(M=o,o=S,S=M),n.mulTo(S,s[y],o)}for(;m>=0&&!(r[m]&1<<e);)n.sqrTo(o,S),M=o,o=S,S=M,--e<0&&(e=this.DB-1,--m)}return n.revert(o)}function tM(r){var t=this.s<0?this.negate():this.clone(),e=r.s<0?r.negate():r.clone();if(t.compareTo(e)<0){var i=t;t=e,e=i}var o=t.getLowestSetBit(),n=e.getLowestSetBit();if(n<0)return t;for(o<n&&(n=o),n>0&&(t.rShiftTo(n,t),e.rShiftTo(n,e));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return n>0&&e.lShiftTo(n,e),e}function rM(r){if(r<=0)return 0;var t=this.DV%r,e=this.s<0?r-1:0;if(this.t>0)if(t==0)e=this[0]%r;else for(var i=this.t-1;i>=0;--i)e=(t*e+this[i])%r;return e}function iM(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return _.ZERO;for(var e=r.clone(),i=this.clone(),o=oo(1),n=oo(0),s=oo(0),c=oo(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!o.isEven()||!n.isEven())&&(o.addTo(this,o),n.subTo(r,n)),o.rShiftTo(1,o)):n.isEven()||n.subTo(r,n),n.rShiftTo(1,n);for(;i.isEven();)i.rShiftTo(1,i),t?((!s.isEven()||!c.isEven())&&(s.addTo(this,s),c.subTo(r,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(r,c),c.rShiftTo(1,c);e.compareTo(i)>=0?(e.subTo(i,e),t&&o.subTo(s,o),n.subTo(c,n)):(i.subTo(e,i),t&&s.subTo(o,s),c.subTo(n,c))}if(i.compareTo(_.ONE)!=0)return _.ZERO;if(c.compareTo(r)>=0)return c.subtract(r);if(c.signum()<0)c.addTo(r,c);else return c;return c.signum()<0?c.add(r):c}var ct=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],oM=(1<<26)/ct[ct.length-1];function nM(r){var t,e=this.abs();if(e.t==1&&e[0]<=ct[ct.length-1]){for(t=0;t<ct.length;++t)if(e[0]==ct[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<ct.length;){for(var i=ct[t],o=t+1;o<ct.length&&i<oM;)i*=ct[o++];for(i=e.modInt(i);t<o;)if(i%ct[t++]==0)return!1}return e.millerRabin(r)}function aM(r){var t=this.subtract(_.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var i=t.shiftRight(e);r=r+1>>1,r>ct.length&&(r=ct.length);for(var o=oe(),n=0;n<r;++n){o.fromInt(ct[Math.floor(Math.random()*ct.length)]);var s=o.modPow(i,this);if(s.compareTo(_.ONE)!=0&&s.compareTo(t)!=0){for(var c=1;c++<e&&s.compareTo(t)!=0;)if(s=s.modPowInt(2,this),s.compareTo(_.ONE)==0)return!1;if(s.compareTo(t)!=0)return!1}}return!0}_.prototype.chunkSize=sI;_.prototype.toRadix=cI;_.prototype.fromRadix=pI;_.prototype.fromNumber=uI;_.prototype.bitwiseTo=yI;_.prototype.changeBit=OI;_.prototype.addTo=_I;_.prototype.dMultiply=HI;_.prototype.dAddOffset=UI;_.prototype.multiplyLowerTo=ZI;_.prototype.multiplyUpperTo=zI;_.prototype.modInt=rM;_.prototype.millerRabin=aM;_.prototype.clone=iI;_.prototype.intValue=oI;_.prototype.byteValue=nI;_.prototype.shortValue=aI;_.prototype.signum=lI;_.prototype.toByteArray=dI;_.prototype.equals=hI;_.prototype.min=fI;_.prototype.max=mI;_.prototype.and=vI;_.prototype.or=bI;_.prototype.xor=CI;_.prototype.andNot=SI;_.prototype.not=xI;_.prototype.shiftLeft=II;_.prototype.shiftRight=MI;_.prototype.getLowestSetBit=TI;_.prototype.bitCount=EI;_.prototype.testBit=DI;_.prototype.setBit=LI;_.prototype.clearBit=AI;_.prototype.flipBit=FI;_.prototype.add=kI;_.prototype.subtract=BI;_.prototype.multiply=RI;_.prototype.divide=GI;_.prototype.remainder=VI;_.prototype.divideAndRemainder=jI;_.prototype.modPow=eM;_.prototype.modInverse=iM;_.prototype.pow=YI;_.prototype.gcd=tM;_.prototype.isProbablePrime=nM;_.prototype.square=NI;var K=_;K.prototype.IsNegative=function(){return this.compareTo(K.ZERO)==-1};K.op_Equality=function(r,t){return r.compareTo(t)==0};K.op_Inequality=function(r,t){return r.compareTo(t)!=0};K.op_GreaterThan=function(r,t){return r.compareTo(t)>0};K.op_LessThan=function(r,t){return r.compareTo(t)<0};K.op_Addition=function(r,t){return new K(r).add(new K(t))};K.op_Subtraction=function(r,t){return new K(r).subtract(new K(t))};K.Int128Mul=function(r,t){return new K(r).multiply(new K(t))};K.op_Division=function(r,t){return r.divide(t)};K.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof od>"u"&&(od=function(r,t){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in t.prototype)(typeof r.prototype[e]>"u"||r.prototype[e]==Object.prototype[e])&&(r.prototype[e]=t.prototype[e]);for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}else{for(var i=Object.getOwnPropertyNames(t.prototype),o=0;o<i.length;o++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[o])>"u"&&Object.defineProperty(r.prototype,i[o],Object.getOwnPropertyDescriptor(t.prototype,i[o]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}});var od;d.Path=function(){return[]};d.Paths=function(){return[]};d.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};d.DoublePoint0=function(){this.X=0,this.Y=0};d.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};d.DoublePoint2=function(r,t){this.X=r,this.Y=t};d.PolyNode=function(){this.m_Parent=null,this.m_polygon=new d.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};d.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};d.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};d.PolyNode.prototype.Contour=function(){return this.m_polygon};d.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};d.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};d.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};d.PolyNode.prototype.Childs=function(){return this.m_Childs};d.PolyNode.prototype.Parent=function(){return this.m_Parent};d.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};d.PolyTree=function(){this.m_AllPolys=[],d.PolyNode.call(this)};d.PolyTree.prototype.Clear=function(){for(var r=0,t=this.m_AllPolys.length;r<t;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};d.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};d.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};od(d.PolyTree,d.PolyNode);d.Math_Abs_Int64=d.Math_Abs_Int32=d.Math_Abs_Double=function(r){return Math.abs(r)};d.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};ee.msie||ee.opera||ee.safari?d.Cast_Int32=function(r){return r|0}:d.Cast_Int32=function(r){return~~r};ee.chrome?d.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:ee.firefox&&typeof Number.toInteger=="function"?d.Cast_Int64=function(r){return Number.toInteger(r)}:ee.msie7||ee.msie8?d.Cast_Int64=function(r){return parseInt(r,10)}:ee.msie?d.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:d.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};d.Clear=function(r){r.length=0};d.PI=3.141592653589793;d.PI2=2*3.141592653589793;d.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,en)if(this.Z=0,t==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(t==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(t==1)if(r[0]instanceof d.DoublePoint){var e=r[0];this.X=d.Clipper.Round(e.X),this.Y=d.Clipper.Round(e.Y),this.Z=0}else{var i=r[0];typeof i.Z>"u"&&(i.Z=0),this.X=i.X,this.Y=i.Y,this.Z=i.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=r[0],this.Y=r[1];else if(t==1)if(r[0]instanceof d.DoublePoint){var e=r[0];this.X=d.Clipper.Round(e.X),this.Y=d.Clipper.Round(e.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};d.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};d.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};en?(d.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},d.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},d.IntPoint1dp=function(r){this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y),this.Z=0},d.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},d.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(d.IntPoint0=function(){this.X=0,this.Y=0},d.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},d.IntPoint1dp=function(r){this.X=d.Clipper.Round(r.X),this.Y=d.Clipper.Round(r.Y)},d.IntPoint2=function(r,t){this.X=r,this.Y=t});d.IntRect=function(){var r=arguments,t=r.length;t==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};d.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};d.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};d.IntRect4=function(r,t,e,i){this.left=r,this.top=t,this.right=e,this.bottom=i};d.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};d.PolyType={ptSubject:0,ptClip:1};d.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};d.JoinType={jtSquare:0,jtRound:1,jtMiter:2};d.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};n5&&(d.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});d.EdgeSide={esLeft:0,esRight:1};d.Direction={dRightToLeft:0,dLeftToRight:1};d.TEdge=function(){this.Bot=new d.IntPoint,this.Curr=new d.IntPoint,this.Top=new d.IntPoint,this.Delta=new d.IntPoint,this.Dx=0,this.PolyTyp=d.PolyType.ptSubject,this.Side=d.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};d.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new d.IntPoint};d.MyIntersectNodeSort=function(){};d.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};d.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};d.Scanbeam=function(){this.Y=0,this.Next=null};d.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};d.OutPt=function(){this.Idx=0,this.Pt=new d.IntPoint,this.Next=null,this.Prev=null};d.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new d.IntPoint};d.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};d.ClipperBase.horizontal=-9007199254740992;d.ClipperBase.Skip=-2;d.ClipperBase.Unassigned=-1;d.ClipperBase.tolerance=1e-20;b9?(d.ClipperBase.loRange=46340,d.ClipperBase.hiRange=46340):(d.ClipperBase.loRange=47453132,d.ClipperBase.hiRange=0xfffffffffffff);d.ClipperBase.near_zero=function(r){return r>-d.ClipperBase.tolerance&&r<d.ClipperBase.tolerance};d.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};d.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(d.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};d.ClipperBase.prototype.PointOnLineSegment=function(r,t,e,i){return i?r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&K.op_Equality(K.Int128Mul(r.X-t.X,e.Y-t.Y),K.Int128Mul(e.X-t.X,r.Y-t.Y)):r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&(r.X-t.X)*(e.Y-t.Y)==(e.X-t.X)*(r.Y-t.Y)};d.ClipperBase.prototype.PointOnPolygon=function(r,t,e){for(var i=t;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,e))return!0;if(i=i.Next,i==t)break}return!1};d.ClipperBase.prototype.SlopesEqual=d.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,i,o,n,s,c,l;return t==3?(e=r[0],i=r[1],l=r[2],l?K.op_Equality(K.Int128Mul(e.Delta.Y,i.Delta.X),K.Int128Mul(e.Delta.X,i.Delta.Y)):d.Cast_Int64(e.Delta.Y*i.Delta.X)==d.Cast_Int64(e.Delta.X*i.Delta.Y)):t==4?(o=r[0],n=r[1],s=r[2],l=r[3],l?K.op_Equality(K.Int128Mul(o.Y-n.Y,n.X-s.X),K.Int128Mul(o.X-n.X,n.Y-s.Y)):d.Cast_Int64((o.Y-n.Y)*(n.X-s.X))-d.Cast_Int64((o.X-n.X)*(n.Y-s.Y))===0):(o=r[0],n=r[1],s=r[2],c=r[3],l=r[4],l?K.op_Equality(K.Int128Mul(o.Y-n.Y,s.X-c.X),K.Int128Mul(o.X-n.X,s.Y-c.Y)):d.Cast_Int64((o.Y-n.Y)*(s.X-c.X))-d.Cast_Int64((o.X-n.X)*(s.Y-c.Y))===0)};d.ClipperBase.SlopesEqual3=function(r,t,e){return e?K.op_Equality(K.Int128Mul(r.Delta.Y,t.Delta.X),K.Int128Mul(r.Delta.X,t.Delta.Y)):d.Cast_Int64(r.Delta.Y*t.Delta.X)==d.Cast_Int64(r.Delta.X*t.Delta.Y)};d.ClipperBase.SlopesEqual4=function(r,t,e,i){return i?K.op_Equality(K.Int128Mul(r.Y-t.Y,t.X-e.X),K.Int128Mul(r.X-t.X,t.Y-e.Y)):d.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-d.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};d.ClipperBase.SlopesEqual5=function(r,t,e,i,o){return o?K.op_Equality(K.Int128Mul(r.Y-t.Y,e.X-i.X),K.Int128Mul(r.X-t.X,e.Y-i.Y)):d.Cast_Int64((r.Y-t.Y)*(e.X-i.X))-d.Cast_Int64((r.X-t.X)*(e.Y-i.Y))===0};d.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,t=this.m_edges.length;r<t;++r){for(var e=0,i=this.m_edges[r].length;e<i;++e)this.m_edges[r][e]=null;d.Clear(this.m_edges[r])}d.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};d.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};d.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>d.ClipperBase.hiRange||r.Y>d.ClipperBase.hiRange||-r.X>d.ClipperBase.hiRange||-r.Y>d.ClipperBase.hiRange)&&d.Error("Coordinate outside allowed range in RangeTest()."):(r.X>d.ClipperBase.loRange||r.Y>d.ClipperBase.loRange||-r.X>d.ClipperBase.loRange||-r.Y>d.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};d.ClipperBase.prototype.InitEdge=function(r,t,e,i){r.Next=t,r.Prev=e,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};d.ClipperBase.prototype.InitEdge2=function(r,t){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=t};d.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;d.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||d.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=d.ClipperBase.horizontal&&r.Prev.Dx!=d.ClipperBase.horizontal)break;for(;r.Prev.Dx==d.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==d.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){t.Prev.Bot.X<r.Bot.X&&(r=t);break}}return r};d.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,i=r,o,n;if(r.Dx==d.ClipperBase.horizontal&&(t?n=r.Prev.Bot.X:n=r.Next.Bot.X,r.Bot.X!=n&&this.ReverseHorizontal(r)),i.OutIdx!=d.ClipperBase.Skip)if(t){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=d.ClipperBase.Skip;)i=i.Next;if(i.Dx==d.ClipperBase.horizontal&&i.Next.OutIdx!=d.ClipperBase.Skip){for(o=i;o.Prev.Dx==d.ClipperBase.horizontal;)o=o.Prev;o.Prev.Top.X==i.Next.Top.X?t||(i=o.Prev):o.Prev.Top.X>i.Next.Top.X&&(i=o.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==d.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==d.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),i=i.Next}else{for(;i.Top.Y==i.Prev.Bot.Y&&i.Prev.OutIdx!=d.ClipperBase.Skip;)i=i.Prev;if(i.Dx==d.ClipperBase.horizontal&&i.Prev.OutIdx!=d.ClipperBase.Skip){for(o=i;o.Next.Dx==d.ClipperBase.horizontal;)o=o.Next;o.Next.Top.X==i.Prev.Top.X?t||(i=o.Next):o.Next.Top.X>i.Prev.Top.X&&(i=o.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==d.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==d.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==d.ClipperBase.Skip){if(r=i,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==d.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==d.ClipperBase.horizontal;)r=r.Next}if(r==i)t?i=r.Next:i=r.Prev;else{t?r=i.Next:r=i.Prev;var s=new d.LocalMinima;s.Next=null,s.Y=r.Bot.Y,s.LeftBound=null,s.RightBound=r,s.RightBound.WindDelta=0,i=this.ProcessBound(s.RightBound,t),this.InsertLocalMinima(s)}}return i};d.ClipperBase.prototype.AddPath=function(r,t,e){o5?!e&&t==d.PolyType.ptClip&&d.Error("AddPath: Open paths must be subject."):e||d.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(e)for(;i>0&&d.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&d.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(e&&i<2||!e&&i<1)return!1;for(var o=new Array,n=0;n<=i;n++)o.push(new d.TEdge);var s=!0;o[1].Curr.X=r[1].X,o[1].Curr.Y=r[1].Y;var c={Value:this.m_UseFullRange};this.RangeTest(r[0],c),this.m_UseFullRange=c.Value,c.Value=this.m_UseFullRange,this.RangeTest(r[i],c),this.m_UseFullRange=c.Value,this.InitEdge(o[0],o[1],o[i],r[0]),this.InitEdge(o[i],o[0],o[i-1],r[i]);for(var n=i-1;n>=1;--n)c.Value=this.m_UseFullRange,this.RangeTest(r[n],c),this.m_UseFullRange=c.Value,this.InitEdge(o[n],o[n+1],o[n-1],r[n]);for(var l=o[0],p=l,h=l;;){if(d.IntPoint.op_Equality(p.Curr,p.Next.Curr)){if(p==p.Next)break;p==l&&(l=p.Next),p=this.RemoveEdge(p),h=p;continue}if(p.Prev==p.Next)break;if(e&&d.ClipperBase.SlopesEqual(p.Prev.Curr,p.Curr,p.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(p.Prev.Curr,p.Curr,p.Next.Curr))){p==l&&(l=p.Next),p=this.RemoveEdge(p),p=p.Prev,h=p;continue}if(p=p.Next,p==h)break}if(!e&&p==p.Next||e&&p.Prev==p.Next)return!1;e||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=d.ClipperBase.Skip);var m=l;p=l;do this.InitEdge2(p,t),p=p.Next,s&&p.Curr.Y!=l.Curr.Y&&(s=!1);while(p!=l);if(s){if(e)return!1;p.Prev.OutIdx=d.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var y=new d.LocalMinima;for(y.Next=null,y.Y=p.Bot.Y,y.LeftBound=null,y.RightBound=p,y.RightBound.Side=d.EdgeSide.esRight,y.RightBound.WindDelta=0;p.Next.OutIdx!=d.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(y),this.m_edges.push(o),!0}this.m_edges.push(o);for(var g,S=null;p=this.FindNextLocMin(p),p!=S;){S==null&&(S=p);var y=new d.LocalMinima;y.Next=null,y.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(y.LeftBound=p.Prev,y.RightBound=p,g=!1):(y.LeftBound=p,y.RightBound=p.Prev,g=!0),y.LeftBound.Side=d.EdgeSide.esLeft,y.RightBound.Side=d.EdgeSide.esRight,e?y.LeftBound.Next==y.RightBound?y.LeftBound.WindDelta=-1:y.LeftBound.WindDelta=1:y.LeftBound.WindDelta=0,y.RightBound.WindDelta=-y.LeftBound.WindDelta,p=this.ProcessBound(y.LeftBound,g);var M=this.ProcessBound(y.RightBound,!g);y.LeftBound.OutIdx==d.ClipperBase.Skip?y.LeftBound=null:y.RightBound.OutIdx==d.ClipperBase.Skip&&(y.RightBound=null),this.InsertLocalMinima(y),g||(p=M)}return!0};d.ClipperBase.prototype.AddPaths=function(r,t,e){for(var i=!1,o=0,n=r.length;o<n;++o)this.AddPath(r[o],t,e)&&(i=!0);return i};d.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return d.IntPoint.op_Equality(r,e)||d.IntPoint.op_Equality(r,t)||d.IntPoint.op_Equality(e,t)?!1:r.X!=e.X?t.X>r.X==t.X<e.X:t.Y>r.Y==t.Y<e.Y};d.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};d.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=d.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};d.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var t=this.m_MinimaList;t.Next!==null&&r.Y<t.Next.Y;)t=t.Next;r.Next=t.Next,t.Next=r}};d.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};d.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,en&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};d.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var t=r.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=d.EdgeSide.esLeft,t.OutIdx=d.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=d.EdgeSide.esRight,t.OutIdx=d.ClipperBase.Unassigned),r=r.Next}};d.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=d.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=d.PolyFillType.pftEvenOdd,this.m_SubjFillType=d.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,d.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=d.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,en&&(this.ZFillFunction=null)};d.Clipper.ioReverseSolution=1;d.Clipper.ioStrictlySimple=2;d.Clipper.ioPreserveCollinear=4;d.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),d.ClipperBase.prototype.Clear.call(this))};d.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};d.Clipper.prototype.Reset=function(){d.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};d.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new d.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new d.Scanbeam;t.Y=r,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var e=this.m_Scanbeam;e.Next!==null&&r<=e.Next.Y;)e=e.Next;if(r==e.Y)return;var t=new d.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};d.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof d.PolyTree;if(t==4&&!e){var i=r[0],o=r[1],n=r[2],s=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&d.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,d.Clear(o),this.m_SubjFillType=n,this.m_ClipFillType=s,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(o)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==4&&e){var i=r[0],l=r[1],n=r[2],s=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=n,this.m_ClipFillType=s,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==2&&!e){var i=r[0],o=r[1];return this.Execute(i,o,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}else if(t==2&&e){var i=r[0],l=r[1];return this.Execute(i,l,d.PolyFillType.pftEvenOdd,d.PolyFillType.pftEvenOdd)}};d.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var t=r.FirstLeft;t!==null&&(t.IsHole==r.IsHole||t.Pts===null);)t=t.FirstLeft;r.FirstLeft=t}};d.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),d.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(r,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),r=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts===null||o.IsOpen||(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)}this.JoinCommonEdges();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts!==null&&!o.IsOpen&&this.FixupOutPolygon(o)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{d.Clear(this.m_Joins),d.Clear(this.m_GhostJoins)}};d.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,r};d.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);d.Clear(this.m_PolyOuts)};d.Clipper.prototype.DisposeOutRec=function(r){var t=this.m_PolyOuts[r];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[r]=null};d.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var t=null;for(r.Prev.Next=null;r!==null;)t=r,r=r.Next,t=null}};d.Clipper.prototype.AddJoin=function(r,t,e){var i=new d.Join;i.OutPt1=r,i.OutPt2=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_Joins.push(i)};d.Clipper.prototype.AddGhostJoin=function(r,t){var e=new d.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};en&&(d.Clipper.prototype.SetZ=function(r,t){r.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,r):this.ZFillFunction(t.Top,t.Bot,r))});d.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var t=this.m_CurrentLM.LeftBound,e=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(t===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot))):e==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(e,t),this.SetWindingCount(t),e.WindCnt=t.WindCnt,e.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(i=this.AddLocalMinPoly(t,e,t.Bot)),this.InsertScanbeam(t.Top.Y)),e!=null&&(d.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(i!==null&&d.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var o=0,n=this.m_GhostJoins.length;o<n;o++){var s=this.m_GhostJoins[o];this.HorzSegmentsOverlap(s.OutPt1.Pt,s.OffPt,e.Bot,e.Top)&&this.AddJoin(s.OutPt1,i,s.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,c,t.Top)}if(t.NextInAEL!=e){if(e.OutIdx>=0&&e.PrevInAEL.OutIdx>=0&&d.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,c,e.Top)}var l=t.NextInAEL;if(l!==null)for(;l!=e;)this.IntersectEdges(e,l,t.Curr,!1),l=l.NextInAEL}}}};d.Clipper.prototype.InsertEdgeIntoAEL=function(r,t){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,r);)t=t.NextInAEL;r.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=r),r.PrevInAEL=t,t.NextInAEL=r}};d.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<d.Clipper.TopX(r,t.Top.Y):r.Top.X>d.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};d.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==d.PolyType.ptSubject?this.m_SubjFillType==d.PolyFillType.pftEvenOdd:this.m_ClipFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==d.PolyType.ptSubject?this.m_ClipFillType==d.PolyFillType.pftEvenOdd:this.m_SubjFillType==d.PolyFillType.pftEvenOdd};d.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==d.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case d.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case d.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case d.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case d.ClipType.ctIntersection:switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2!==0;case d.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case d.ClipType.ctUnion:switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case d.ClipType.ctDifference:if(r.PolyTyp==d.PolyType.ptSubject)switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2!==0;case d.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case d.ClipType.ctXor:if(r.WindDelta===0)switch(e){case d.PolyFillType.pftEvenOdd:case d.PolyFillType.pftNonZero:return r.WindCnt2===0;case d.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};d.Clipper.prototype.SetWindingCount=function(r){for(var t=r.PrevInAEL;t!==null&&(t.PolyTyp!=r.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,t=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=d.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var e=!0,i=t.PrevInAEL;i!==null;)i.PolyTyp==t.PolyTyp&&i.WindDelta!==0&&(e=!e),i=i.PrevInAEL;r.WindCnt=e?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;t!=r;)t.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=r;)r.WindCnt2+=t.WindDelta,t=t.NextInAEL};d.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};d.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};d.Clipper.prototype.SwapPositionsInAEL=function(r,t){if(!(r.NextInAEL==r.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(r.NextInAEL==t){var e=t.NextInAEL;e!==null&&(e.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=t),t.PrevInAEL=i,t.NextInAEL=r,r.PrevInAEL=t,r.NextInAEL=e}else if(t.NextInAEL==r){var e=r.NextInAEL;e!==null&&(e.PrevInAEL=t);var i=t.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=t,t.PrevInAEL=r,t.NextInAEL=e}else{var e=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=t.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=t.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),t.NextInAEL=e,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=i,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}r.PrevInAEL===null?this.m_ActiveEdges=r:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};d.Clipper.prototype.SwapPositionsInSEL=function(r,t){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(r.NextInSEL==t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=t),t.PrevInSEL=i,t.NextInSEL=r,r.PrevInSEL=t,r.NextInSEL=e}else if(t.NextInSEL==r){var e=r.NextInSEL;e!==null&&(e.PrevInSEL=t);var i=t.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=t,t.PrevInSEL=r,t.NextInSEL=e}else{var e=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=t.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=t.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),t.NextInSEL=e,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=i,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}r.PrevInSEL===null?this.m_SortedEdges=r:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};d.Clipper.prototype.AddLocalMaxPoly=function(r,t,e){this.AddOutPt(r,e),t.WindDelta==0&&this.AddOutPt(t,e),r.OutIdx==t.OutIdx?(r.OutIdx=-1,t.OutIdx=-1):r.OutIdx<t.OutIdx?this.AppendPolygon(r,t):this.AppendPolygon(t,r)};d.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var i,o,n;if(d.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(i=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=d.EdgeSide.esLeft,t.Side=d.EdgeSide.esRight,o=r,o.PrevInAEL==t?n=t.PrevInAEL:n=o.PrevInAEL):(i=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=d.EdgeSide.esRight,t.Side=d.EdgeSide.esLeft,o=t,o.PrevInAEL==r?n=r.PrevInAEL:n=o.PrevInAEL),n!==null&&n.OutIdx>=0&&d.Clipper.TopX(n,e.Y)==d.Clipper.TopX(o,e.Y)&&d.ClipperBase.SlopesEqual(o,n,this.m_UseFullRange)&&o.WindDelta!==0&&n.WindDelta!==0){var s=this.AddOutPt(n,e);this.AddJoin(i,s,o.Top)}return i};d.Clipper.prototype.CreateOutRec=function(){var r=new d.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};d.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==d.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var o=new d.OutPt;return i.Pts=o,o.Idx=i.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=o,o.Prev=o,i.IsOpen||this.SetHoleState(r,i),en&&(d.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):d.IntPoint.op_Equality(t,r.Top)?(o.Pt.X=r.Top.X,o.Pt.Y=r.Top.Y,o.Pt.Z=r.Top.Z):this.SetZ(o.Pt,r)),r.OutIdx=i.Idx,o}else{var i=this.m_PolyOuts[r.OutIdx],n=i.Pts;if(e&&d.IntPoint.op_Equality(t,n.Pt))return n;if(!e&&d.IntPoint.op_Equality(t,n.Prev.Pt))return n.Prev;var o=new d.OutPt;return o.Idx=i.Idx,o.Pt.X=t.X,o.Pt.Y=t.Y,o.Next=n,o.Prev=n.Prev,o.Prev.Next=o,n.Prev=o,e&&(i.Pts=o),en&&(d.IntPoint.op_Equality(t,r.Bot)?(o.Pt.X=r.Bot.X,o.Pt.Y=r.Bot.Y,o.Pt.Z=r.Bot.Z):d.IntPoint.op_Equality(t,r.Top)?(o.Pt.X=r.Top.X,o.Pt.Y=r.Top.Y,o.Pt.Z=r.Top.Z):this.SetZ(o.Pt,r)),o}};d.Clipper.prototype.SwapPoints=function(r,t){var e=new d.IntPoint(r.Value);r.Value.X=t.Value.X,r.Value.Y=t.Value.Y,t.Value.X=e.X,t.Value.Y=e.Y};d.Clipper.prototype.HorzSegmentsOverlap=function(r,t,e,i){return r.X>e.X==r.X<i.X||t.X>e.X==t.X<i.X||e.X>r.X==e.X<t.X||i.X>r.X==i.X<t.X||r.X==e.X&&t.X==i.X?!0:r.X==i.X&&t.X==e.X};d.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var i=new d.OutPt;return i.Pt.X=e.X,i.Pt.Y=e.Y,t==r.Next?(r.Next=i,t.Prev=i,i.Next=t,i.Prev=r):(t.Next=i,r.Prev=i,i.Next=r,i.Prev=t),i};d.Clipper.prototype.SetHoleState=function(r,t){for(var e=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(e=!e,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;e&&(t.IsHole=!0)};d.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?d.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};d.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;d.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Prev;var i=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=r.Next;d.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var o=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;d.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var n=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;d.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var s=Math.abs(this.GetDx(t.Pt,e.Pt));return i>=n&&i>=s||o>=n&&o>=s};d.Clipper.prototype.GetBottomPt=function(r){for(var t=null,e=r.Next;e!=r;)e.Pt.Y>r.Pt.Y?(r=e,t=null):e.Pt.Y==r.Pt.Y&&e.Pt.X<=r.Pt.X&&(e.Pt.X<r.Pt.X?(t=null,r=e):e.Next!=r&&e.Prev!=r&&(t=e)),e=e.Next;if(t!==null)for(;t!=e;)for(this.FirstIsBottomPt(e,t)||(r=t),t=t.Next;d.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};d.Clipper.prototype.GetLowermostRec=function(r,t){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var e=r.BottomPt,i=t.BottomPt;return e.Pt.Y>i.Pt.Y?r:e.Pt.Y<i.Pt.Y?t:e.Pt.X<i.Pt.X?r:e.Pt.X>i.Pt.X||e.Next==e?t:i.Next==i||this.FirstIsBottomPt(e,i)?r:t};d.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};d.Clipper.prototype.GetOutRec=function(r){for(var t=this.m_PolyOuts[r];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};d.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[t.OutIdx],o;this.Param1RightOfParam2(e,i)?o=i:this.Param1RightOfParam2(i,e)?o=e:o=this.GetLowermostRec(e,i);var n=e.Pts,s=n.Prev,c=i.Pts,l=c.Prev,p;r.Side==d.EdgeSide.esLeft?(t.Side==d.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=n,n.Prev=c,s.Next=l,l.Prev=s,e.Pts=l):(l.Next=n,n.Prev=l,c.Prev=s,s.Next=c,e.Pts=c),p=d.EdgeSide.esLeft):(t.Side==d.EdgeSide.esRight?(this.ReversePolyPtLinks(c),s.Next=l,l.Prev=s,c.Next=n,n.Prev=c):(s.Next=c,c.Prev=s,n.Prev=l,l.Next=n),p=d.EdgeSide.esRight),e.BottomPt=null,o==i&&(i.FirstLeft!=e&&(e.FirstLeft=i.FirstLeft),e.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=e;var h=r.OutIdx,m=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var y=this.m_ActiveEdges;y!==null;){if(y.OutIdx==m){y.OutIdx=h,y.Side=p;break}y=y.NextInAEL}i.Idx=e.Idx};d.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};d.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};d.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};d.Clipper.prototype.IntersectEdges=function(r,t,e,i){var o=!i&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,n=!i&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,s=r.OutIdx>=0,c=t.OutIdx>=0;if(o5&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(o||n)&&s&&c&&this.AddLocalMaxPoly(r,t,e):r.PolyTyp==t.PolyTyp&&r.WindDelta!=t.WindDelta&&this.m_ClipType==d.ClipType.ctUnion?r.WindDelta===0?c&&(this.AddOutPt(r,e),s&&(r.OutIdx=-1)):s&&(this.AddOutPt(t,e),c&&(t.OutIdx=-1)):r.PolyTyp!=t.PolyTyp&&(r.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),s&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=d.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),c&&(t.OutIdx=-1))),o&&(r.OutIdx<0?this.DeleteFromAEL(r):d.Error("Error intersecting polylines")),n&&(t.OutIdx<0?this.DeleteFromAEL(t):d.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var l=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=l}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var p,h,m,y;r.PolyTyp==d.PolyType.ptSubject?(p=this.m_SubjFillType,m=this.m_ClipFillType):(p=this.m_ClipFillType,m=this.m_SubjFillType),t.PolyTyp==d.PolyType.ptSubject?(h=this.m_SubjFillType,y=this.m_ClipFillType):(h=this.m_ClipFillType,y=this.m_SubjFillType);var g,S;switch(p){case d.PolyFillType.pftPositive:g=r.WindCnt;break;case d.PolyFillType.pftNegative:g=-r.WindCnt;break;default:g=Math.abs(r.WindCnt);break}switch(h){case d.PolyFillType.pftPositive:S=t.WindCnt;break;case d.PolyFillType.pftNegative:S=-t.WindCnt;break;default:S=Math.abs(t.WindCnt);break}if(s&&c)o||n||g!==0&&g!=1||S!==0&&S!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=d.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t));else if(s)(S===0||S==1)&&(this.AddOutPt(r,e),d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t));else if(c)(g===0||g==1)&&(this.AddOutPt(t,e),d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t));else if((g===0||g==1)&&(S===0||S==1)&&!o&&!n){var M,v;switch(m){case d.PolyFillType.pftPositive:M=r.WindCnt2;break;case d.PolyFillType.pftNegative:M=-r.WindCnt2;break;default:M=Math.abs(r.WindCnt2);break}switch(y){case d.PolyFillType.pftPositive:v=t.WindCnt2;break;case d.PolyFillType.pftNegative:v=-t.WindCnt2;break;default:v=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(g==1&&S==1)switch(this.m_ClipType){case d.ClipType.ctIntersection:M>0&&v>0&&this.AddLocalMinPoly(r,t,e);break;case d.ClipType.ctUnion:M<=0&&v<=0&&this.AddLocalMinPoly(r,t,e);break;case d.ClipType.ctDifference:(r.PolyTyp==d.PolyType.ptClip&&M>0&&v>0||r.PolyTyp==d.PolyType.ptSubject&&M<=0&&v<=0)&&this.AddLocalMinPoly(r,t,e);break;case d.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else d.Clipper.SwapSides(r,t)}o!=n&&(o&&r.OutIdx>=0||n&&t.OutIdx>=0)&&(d.Clipper.SwapSides(r,t),d.Clipper.SwapPolyIndexes(r,t)),o&&this.DeleteFromAEL(r),n&&this.DeleteFromAEL(t)};d.Clipper.prototype.DeleteFromAEL=function(r){var t=r.PrevInAEL,e=r.NextInAEL;t===null&&e===null&&r!=this.m_ActiveEdges||(t!==null?t.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=t),r.NextInAEL=null,r.PrevInAEL=null)};d.Clipper.prototype.DeleteFromSEL=function(r){var t=r.PrevInSEL,e=r.NextInSEL;t===null&&e===null&&r!=this.m_SortedEdges||(t!==null?t.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=t),r.NextInSEL=null,r.PrevInSEL=null)};d.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&d.Error("UpdateEdgeIntoAEL: invalid call");var t=r.PrevInAEL,e=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,t!==null?t.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,e!==null&&(e.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=t,r.NextInAEL=e,d.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};d.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};d.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=d.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=d.Direction.dRightToLeft)};d.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=d.EdgeSide.esLeft&&(e=e.Prev),t&&(d.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};d.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var i=e.Dir,o=e.Left,n=e.Right,s=r,c=null;s.NextInLML!==null&&d.ClipperBase.IsHorizontal(s.NextInLML);)s=s.NextInLML;for(s.NextInLML===null&&(c=this.GetMaximaPair(s));;){for(var l=r==s,p=this.GetNextInAEL(r,i);p!==null&&!(p.Curr.X==r.Top.X&&r.NextInLML!==null&&p.Dx<r.NextInLML.Dx);){var h=this.GetNextInAEL(p,i);if(i==d.Direction.dLeftToRight&&p.Curr.X<=n||i==d.Direction.dRightToLeft&&p.Curr.X>=o){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),p==c&&l){i==d.Direction.dLeftToRight?this.IntersectEdges(r,p,p.Top,!1):this.IntersectEdges(p,r,p.Top,!1),c.OutIdx>=0&&d.Error("ProcessHorizontal error");return}else if(i==d.Direction.dLeftToRight){var m=new d.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(r,p,m,!0)}else{var m=new d.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(p,r,m,!0)}this.SwapPositionsInAEL(r,p)}else if(i==d.Direction.dLeftToRight&&p.Curr.X>=n||i==d.Direction.dRightToLeft&&p.Curr.X<=o)break;p=h}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&d.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:i,Left:o,Right:n};this.GetHorzDirection(r,e),i=e.Dir,o=e.Left,n=e.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var y=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var g=r.PrevInAEL,h=r.NextInAEL;if(g!==null&&g.Curr.X==r.Bot.X&&g.Curr.Y==r.Bot.Y&&g.WindDelta!==0&&g.OutIdx>=0&&g.Curr.Y>g.Top.Y&&d.ClipperBase.SlopesEqual(r,g,this.m_UseFullRange)){var S=this.AddOutPt(g,r.Bot);this.AddJoin(y,S,r.Top)}else if(h!==null&&h.Curr.X==r.Bot.X&&h.Curr.Y==r.Bot.Y&&h.WindDelta!==0&&h.OutIdx>=0&&h.Curr.Y>h.Top.Y&&d.ClipperBase.SlopesEqual(r,h,this.m_UseFullRange)){var S=this.AddOutPt(h,r.Bot);this.AddJoin(y,S,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else c!==null?c.OutIdx>=0?(i==d.Direction.dLeftToRight?this.IntersectEdges(r,c,r.Top,!1):this.IntersectEdges(c,r,r.Top,!1),c.OutIdx>=0&&d.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(c)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};d.Clipper.prototype.GetNextInAEL=function(r,t){return t==d.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};d.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};d.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};d.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};d.Clipper.prototype.GetMaximaPair=function(r){var t=null;return d.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:d.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!d.ClipperBase.IsHorizontal(t))?null:t};d.Clipper.prototype.ProcessIntersections=function(r,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,d.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};d.Clipper.prototype.BuildIntersectList=function(r,t){if(this.m_ActiveEdges!==null){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=d.Clipper.TopX(e,t),e=e.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,e=this.m_SortedEdges;e.NextInSEL!==null;){var o=e.NextInSEL,n=new d.IntPoint;if(e.Curr.X>o.Curr.X){!this.IntersectPoint(e,o,n)&&e.Curr.X>o.Curr.X+1&&d.Error("Intersection error"),n.Y>r&&(n.Y=r,Math.abs(e.Dx)>Math.abs(o.Dx)?n.X=d.Clipper.TopX(o,r):n.X=d.Clipper.TopX(e,r));var s=new d.IntersectNode;s.Edge1=e,s.Edge2=o,s.Pt.X=n.X,s.Pt.Y=n.Y,this.m_IntersectList.push(s),this.SwapPositionsInSEL(e,o),i=!0}else e=o}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};d.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};d.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};d.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,t=0;t<r;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var e=t+1;e<r&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e==r)return!1;var i=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[e],this.m_IntersectList[e]=i}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};d.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,t=this.m_IntersectList.length;r<t;r++){var e=this.m_IntersectList[r];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt,!0),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var sM=function(r){return r<0?Math.ceil(r-.5):Math.round(r)},lM=function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},cM=function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},pM=function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)};ee.msie?d.Clipper.Round=sM:ee.chromium?d.Clipper.Round=cM:ee.safari?d.Clipper.Round=pM:d.Clipper.Round=lM;d.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+d.Clipper.Round(r.Dx*(t-r.Bot.Y))};d.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var i,o;if(d.ClipperBase.SlopesEqual(r,t,this.m_UseFullRange)||r.Dx==t.Dx)return t.Bot.Y>r.Bot.Y?(e.X=t.Bot.X,e.Y=t.Bot.Y):(e.X=r.Bot.X,e.Y=r.Bot.Y),!1;if(r.Delta.X===0)e.X=r.Bot.X,d.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(o=t.Bot.Y-t.Bot.X/t.Dx,e.Y=d.Clipper.Round(e.X/t.Dx+o));else if(t.Delta.X===0)e.X=t.Bot.X,d.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,e.Y=d.Clipper.Round(e.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,o=t.Bot.X-t.Bot.Y*t.Dx;var n=(o-i)/(r.Dx-t.Dx);e.Y=d.Clipper.Round(n),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=d.Clipper.Round(r.Dx*n+i):e.X=d.Clipper.Round(t.Dx*n+o)}if(e.Y<r.Top.Y||e.Y<t.Top.Y){if(r.Top.Y>t.Top.Y)return e.Y=r.Top.Y,e.X=d.Clipper.TopX(t,r.Top.Y),e.X<r.Top.X;e.Y=t.Top.Y,Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=d.Clipper.TopX(r,e.Y):e.X=d.Clipper.TopX(t,e.Y)}return!0};d.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var t=this.m_ActiveEdges;t!==null;){var e=this.IsMaxima(t,r);if(e){var i=this.GetMaximaPair(t);e=i===null||!d.ClipperBase.IsHorizontal(i)}if(e){var o=t.PrevInAEL;this.DoMaxima(t),o===null?t=this.m_ActiveEdges:t=o.NextInAEL}else{if(this.IsIntermediate(t,r)&&d.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=d.Clipper.TopX(t,r),t.Curr.Y=r),this.StrictlySimple){var o=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&o!==null&&o.OutIdx>=0&&o.Curr.X==t.Curr.X&&o.WindDelta!==0){var n=this.AddOutPt(o,t.Curr),s=this.AddOutPt(t,t.Curr);this.AddJoin(n,s,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var n=null;t.OutIdx>=0&&(n=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var o=t.PrevInAEL,c=t.NextInAEL;if(o!==null&&o.Curr.X==t.Bot.X&&o.Curr.Y==t.Bot.Y&&n!==null&&o.OutIdx>=0&&o.Curr.Y>o.Top.Y&&d.ClipperBase.SlopesEqual(t,o,this.m_UseFullRange)&&t.WindDelta!==0&&o.WindDelta!==0){var s=this.AddOutPt(o,t.Bot);this.AddJoin(n,s,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&n!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&d.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)&&t.WindDelta!==0&&c.WindDelta!==0){var s=this.AddOutPt(c,t.Bot);this.AddJoin(n,s,t.Top)}}t=t.NextInAEL}};d.Clipper.prototype.DoMaxima=function(r){var t=this.GetMaximaPair(r);if(t===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var e=r.NextInAEL,i=!0;e!==null&&e!=t;)this.IntersectEdges(r,e,r.Top,!0),this.SwapPositionsInAEL(r,e),e=r.NextInAEL;r.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(t)):r.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(r,t,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),t.OutIdx>=0&&(this.AddOutPt(t,r.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):d.Error("DoMaxima error")};d.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};d.Clipper.Orientation=function(r){return d.Clipper.Area(r)>=0};d.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var t=0,e=r;do t++,e=e.Next;while(e!=r);return t};d.Clipper.prototype.BuildResult=function(r){d.Clear(r);for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];if(i.Pts!==null){var o=i.Pts.Prev,n=this.PointCount(o);if(!(n<2)){for(var s=new Array(n),c=0;c<n;c++)s[c]=o.Pt,o=o.Prev;r.push(s)}}}};d.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t],o=this.PointCount(i.Pts);if(!(i.IsOpen&&o<2||!i.IsOpen&&o<3)){this.FixHoleLinkage(i);var n=new d.PolyNode;r.m_AllPolys.push(n),i.PolyNode=n,n.m_polygon.length=o;for(var s=i.Pts.Prev,c=0;c<o;c++)n.m_polygon[c]=s.Pt,s=s.Prev}}for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var i=this.m_PolyOuts[t];i.PolyNode!==null&&(i.IsOpen?(i.PolyNode.IsOpen=!0,r.AddChild(i.PolyNode)):i.FirstLeft!==null&&i.FirstLeft.PolyNode!=null?i.FirstLeft.PolyNode.AddChild(i.PolyNode):r.AddChild(i.PolyNode))}};d.Clipper.prototype.FixupOutPolygon=function(r){var t=null;r.BottomPt=null;for(var e=r.Pts;;){if(e.Prev==e||e.Prev==e.Next){this.DisposeOutPts(e),r.Pts=null;return}if(d.IntPoint.op_Equality(e.Pt,e.Next.Pt)||d.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||d.ClipperBase.SlopesEqual(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt))){t=null;var i=e;e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev,i=null}else{if(e==t)break;t===null&&(t=e),e=e.Next}}r.Pts=e};d.Clipper.prototype.DupOutPt=function(r,t){var e=new d.OutPt;return e.Pt.X=r.Pt.X,e.Pt.Y=r.Pt.Y,e.Idx=r.Idx,t?(e.Next=r.Next,e.Prev=r,r.Next.Prev=e,r.Next=e):(e.Prev=r.Prev,e.Next=r,r.Prev.Next=e,r.Prev=e),e};d.Clipper.prototype.GetOverlap=function(r,t,e,i,o){return r<t?e<i?(o.Left=Math.max(r,e),o.Right=Math.min(t,i)):(o.Left=Math.max(r,i),o.Right=Math.min(t,e)):e<i?(o.Left=Math.max(t,e),o.Right=Math.min(r,i)):(o.Left=Math.max(t,i),o.Right=Math.min(r,e)),o.Left<o.Right};d.Clipper.prototype.JoinHorz=function(r,t,e,i,o,n){var s=r.Pt.X>t.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight,c=e.Pt.X>i.Pt.X?d.Direction.dRightToLeft:d.Direction.dLeftToRight;if(s==c)return!1;if(s==d.Direction.dLeftToRight){for(;r.Next.Pt.X<=o.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;n&&r.Pt.X!=o.X&&(r=r.Next),t=this.DupOutPt(r,!n),d.IntPoint.op_Inequality(t.Pt,o)&&(r=t,r.Pt.X=o.X,r.Pt.Y=o.Y,t=this.DupOutPt(r,!n))}else{for(;r.Next.Pt.X>=o.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==o.Y;)r=r.Next;!n&&r.Pt.X!=o.X&&(r=r.Next),t=this.DupOutPt(r,n),d.IntPoint.op_Inequality(t.Pt,o)&&(r=t,r.Pt.X=o.X,r.Pt.Y=o.Y,t=this.DupOutPt(r,n))}if(c==d.Direction.dLeftToRight){for(;e.Next.Pt.X<=o.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;n&&e.Pt.X!=o.X&&(e=e.Next),i=this.DupOutPt(e,!n),d.IntPoint.op_Inequality(i.Pt,o)&&(e=i,e.Pt.X=o.X,e.Pt.Y=o.Y,i=this.DupOutPt(e,!n))}else{for(;e.Next.Pt.X>=o.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==o.Y;)e=e.Next;!n&&e.Pt.X!=o.X&&(e=e.Next),i=this.DupOutPt(e,n),d.IntPoint.op_Inequality(i.Pt,o)&&(e=i,e.Pt.X=o.X,e.Pt.Y=o.Y,i=this.DupOutPt(e,n))}return s==d.Direction.dLeftToRight==n?(r.Prev=e,e.Next=r,t.Next=i,i.Prev=t):(r.Next=e,e.Prev=r,t.Prev=i,i.Next=t),!0};d.Clipper.prototype.JoinPoints=function(r,t,e){var i=r.OutPt1,o=new d.OutPt,n=r.OutPt2,s=new d.OutPt,c=r.OutPt1.Pt.Y==r.OffPt.Y;if(c&&d.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&d.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(o=r.OutPt1.Next;o!=i&&d.IntPoint.op_Equality(o.Pt,r.OffPt);)o=o.Next;var l=o.Pt.Y>r.OffPt.Y;for(s=r.OutPt2.Next;s!=n&&d.IntPoint.op_Equality(s.Pt,r.OffPt);)s=s.Next;var p=s.Pt.Y>r.OffPt.Y;return l==p?!1:l?(o=this.DupOutPt(i,!1),s=this.DupOutPt(n,!0),i.Prev=n,n.Next=i,o.Next=s,s.Prev=o,r.OutPt1=i,r.OutPt2=o,!0):(o=this.DupOutPt(i,!0),s=this.DupOutPt(n,!1),i.Next=n,n.Prev=i,o.Prev=s,s.Next=o,r.OutPt1=i,r.OutPt2=o,!0)}else if(c){for(o=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=o&&i.Prev!=n;)i=i.Prev;for(;o.Next.Pt.Y==o.Pt.Y&&o.Next!=i&&o.Next!=n;)o=o.Next;if(o.Next==i||o.Next==n)return!1;for(s=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=s&&n.Prev!=o;)n=n.Prev;for(;s.Next.Pt.Y==s.Pt.Y&&s.Next!=n&&s.Next!=i;)s=s.Next;if(s.Next==n||s.Next==i)return!1;var h={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,o.Pt.X,n.Pt.X,s.Pt.X,h))return!1;var m=h.Left,y=h.Right,g=new d.IntPoint,S;return i.Pt.X>=m&&i.Pt.X<=y?(g.X=i.Pt.X,g.Y=i.Pt.Y,S=i.Pt.X>o.Pt.X):n.Pt.X>=m&&n.Pt.X<=y?(g.X=n.Pt.X,g.Y=n.Pt.Y,S=n.Pt.X>s.Pt.X):o.Pt.X>=m&&o.Pt.X<=y?(g.X=o.Pt.X,g.Y=o.Pt.Y,S=o.Pt.X>i.Pt.X):(g.X=s.Pt.X,g.Y=s.Pt.Y,S=s.Pt.X>n.Pt.X),r.OutPt1=i,r.OutPt2=n,this.JoinHorz(i,o,n,s,g,S)}else{for(o=i.Next;d.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Next;var M=o.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange);if(M){for(o=i.Prev;d.IntPoint.op_Equality(o.Pt,i.Pt)&&o!=i;)o=o.Prev;if(o.Pt.Y>i.Pt.Y||!d.ClipperBase.SlopesEqual(i.Pt,o.Pt,r.OffPt,this.m_UseFullRange))return!1}for(s=n.Next;d.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Next;var v=s.Pt.Y>n.Pt.Y||!d.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange);if(v){for(s=n.Prev;d.IntPoint.op_Equality(s.Pt,n.Pt)&&s!=n;)s=s.Prev;if(s.Pt.Y>n.Pt.Y||!d.ClipperBase.SlopesEqual(n.Pt,s.Pt,r.OffPt,this.m_UseFullRange))return!1}return o==i||s==n||o==s||t==e&&M==v?!1:M?(o=this.DupOutPt(i,!1),s=this.DupOutPt(n,!0),i.Prev=n,n.Next=i,o.Next=s,s.Prev=o,r.OutPt1=i,r.OutPt2=o,!0):(o=this.DupOutPt(i,!0),s=this.DupOutPt(n,!1),i.Next=n,n.Prev=i,o.Prev=s,s.Next=o,r.OutPt1=i,r.OutPt2=o,!0)}};d.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new d.IntRect(0,0,0,0);var i=new d.IntRect;for(i.left=r[t][0].X,i.right=i.left,i.top=r[t][0].Y,i.bottom=i.top;t<e;t++)for(var o=0,n=r[t].length;o<n;o++)r[t][o].X<i.left?i.left=r[t][o].X:r[t][o].X>i.right&&(i.right=r[t][o].X),r[t][o].Y<i.top?i.top=r[t][o].Y:r[t][o].Y>i.bottom&&(i.bottom=r[t][o].Y);return i};d.Clipper.prototype.GetBounds2=function(r){var t=r,e=new d.IntRect;for(e.left=r.Pt.X,e.right=r.Pt.X,e.top=r.Pt.Y,e.bottom=r.Pt.Y,r=r.Next;r!=t;)r.Pt.X<e.left&&(e.left=r.Pt.X),r.Pt.X>e.right&&(e.right=r.Pt.X),r.Pt.Y<e.top&&(e.top=r.Pt.Y),r.Pt.Y>e.bottom&&(e.bottom=r.Pt.Y),r=r.Next;return e};d.Clipper.PointInPolygon=function(r,t){var e=0,i=t.length;if(i<3)return 0;for(var o=t[0],n=1;n<=i;++n){var s=n==i?t[0]:t[n];if(s.Y==r.Y&&(s.X==r.X||o.Y==r.Y&&s.X>r.X==o.X<r.X))return-1;if(o.Y<r.Y!=s.Y<r.Y){if(o.X>=r.X)if(s.X>r.X)e=1-e;else{var c=(o.X-r.X)*(s.Y-r.Y)-(s.X-r.X)*(o.Y-r.Y);if(c==0)return-1;c>0==s.Y>o.Y&&(e=1-e)}else if(s.X>r.X){var c=(o.X-r.X)*(s.Y-r.Y)-(s.X-r.X)*(o.Y-r.Y);if(c==0)return-1;c>0==s.Y>o.Y&&(e=1-e)}}o=s}return e};d.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,i=t;;){var o=t.Pt.X,n=t.Pt.Y,s=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==r.Y&&(s==r.X||n==r.Y&&s>r.X==o<r.X))return-1;if(n<r.Y!=c<r.Y){if(o>=r.X)if(s>r.X)e=1-e;else{var l=(o-r.X)*(c-r.Y)-(s-r.X)*(n-r.Y);if(l==0)return-1;l>0==c>n&&(e=1-e)}else if(s>r.X){var l=(o-r.X)*(c-r.Y)-(s-r.X)*(n-r.Y);if(l==0)return-1;l>0==c>n&&(e=1-e)}}if(t=t.Next,i==t)break}return e};d.Clipper.prototype.Poly2ContainsPoly1=function(r,t){var e=r;do{var i=this.PointInPolygon(e.Pt,t);if(i>=0)return i!=0;e=e.Next}while(e!=r);return!0};d.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var o=this.m_PolyOuts[e];o.Pts!==null&&o.FirstLeft==r&&this.Poly2ContainsPoly1(o.Pts,t.Pts)&&(o.FirstLeft=t)}};d.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,i=this.m_PolyOuts,o=i.length,n=i[e];e<o;e++,n=i[e])n.FirstLeft==r&&(n.FirstLeft=t)};d.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};d.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,t=this.m_Joins.length;r<t;r++){var e=this.m_Joins[r],i=this.GetOutRec(e.OutPt1.Idx),o=this.GetOutRec(e.OutPt2.Idx);if(!(i.Pts==null||o.Pts==null)){var n;if(i==o?n=i:this.Param1RightOfParam2(i,o)?n=o:this.Param1RightOfParam2(o,i)?n=i:n=this.GetLowermostRec(i,o),!!this.JoinPoints(e,i,o))if(i==o){if(i.Pts=e.OutPt1,i.BottomPt=null,o=this.CreateOutRec(),o.Pts=e.OutPt2,this.UpdateOutPtIdxs(o),this.m_UsingPolyTree)for(var s=0,c=this.m_PolyOuts.length;s<c-1;s++){var l=this.m_PolyOuts[s];l.Pts==null||d.Clipper.ParseFirstLeft(l.FirstLeft)!=i||l.IsHole==i.IsHole||this.Poly2ContainsPoly1(l.Pts,e.OutPt2)&&(l.FirstLeft=o)}this.Poly2ContainsPoly1(o.Pts,i.Pts)?(o.IsHole=!i.IsHole,o.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,i),(o.IsHole^this.ReverseSolution)==this.Area(o)>0&&this.ReversePolyPtLinks(o.Pts)):this.Poly2ContainsPoly1(i.Pts,o.Pts)?(o.IsHole=i.IsHole,i.IsHole=!o.IsHole,o.FirstLeft=i.FirstLeft,i.FirstLeft=o,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,o),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(o.IsHole=i.IsHole,o.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,o))}else o.Pts=null,o.BottomPt=null,o.Idx=i.Idx,i.IsHole=n.IsHole,n==o&&(i.FirstLeft=o.FirstLeft),o.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,i)}}};d.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};d.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var t=this.m_PolyOuts[r++],e=t.Pts;if(e!==null)do{for(var i=e.Next;i!=t.Pts;){if(d.IntPoint.op_Equality(e.Pt,i.Pt)&&i.Next!=e&&i.Prev!=e){var o=e.Prev,n=i.Prev;e.Prev=n,n.Next=e,i.Prev=o,o.Next=i,t.Pts=e;var s=this.CreateOutRec();s.Pts=i,this.UpdateOutPtIdxs(s),this.Poly2ContainsPoly1(s.Pts,t.Pts)?(s.IsHole=!t.IsHole,s.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,s.Pts)?(s.IsHole=t.IsHole,t.IsHole=!s.IsHole,s.FirstLeft=t.FirstLeft,t.FirstLeft=s):(s.IsHole=t.IsHole,s.FirstLeft=t.FirstLeft),i=e}i=i.Next}e=e.Next}while(e!=t.Pts)}};d.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,i=0,o=t-1;i<t;++i)e+=(r[o].X+r[i].X)*(r[o].Y-r[i].Y),o=i;return-e*.5};d.Clipper.prototype.Area=function(r){var t=r.Pts;if(t==null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=r.Pts);return e*.5};n5&&(d.Clipper.OffsetPaths=function(r,t,e,i,o){var n=new d.Paths,s=new d.ClipperOffset(o,o);return s.AddPaths(r,e,i),s.Execute(n,t),n});d.Clipper.SimplifyPolygon=function(r,t){var e=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,e,t,t),e};d.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=d.PolyFillType.pftEvenOdd);var e=new Array,i=new d.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,d.PolyType.ptSubject,!0),i.Execute(d.ClipType.ctUnion,e,t,t),e};d.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,i=r.Y-t.Y;return e*e+i*i};d.Clipper.DistanceFromLineSqrd=function(r,t,e){var i=t.Y-e.Y,o=e.X-t.X,n=i*t.X+o*t.Y;return n=i*r.X+o*r.Y-n,n*n/(i*i+o*o)};d.Clipper.SlopesNearCollinear=function(r,t,e,i){return d.Clipper.DistanceFromLineSqrd(t,r,e)<i};d.Clipper.PointsAreClose=function(r,t,e){var i=r.X-t.X,o=r.Y-t.Y;return i*i+o*o<=e};d.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};d.Clipper.CleanPolygon=function(r,t){typeof t>"u"&&(t=1.415);var e=r.length;if(e==0)return new Array;for(var i=new Array(e),o=0;o<e;++o)i[o]=new d.OutPt;for(var o=0;o<e;++o)i[o].Pt=r[o],i[o].Next=i[(o+1)%e],i[o].Next.Prev=i[o],i[o].Idx=0;for(var n=t*t,s=i[0];s.Idx==0&&s.Next!=s.Prev;)d.Clipper.PointsAreClose(s.Pt,s.Prev.Pt,n)?(s=d.Clipper.ExcludeOp(s),e--):d.Clipper.PointsAreClose(s.Prev.Pt,s.Next.Pt,n)?(d.Clipper.ExcludeOp(s.Next),s=d.Clipper.ExcludeOp(s),e-=2):d.Clipper.SlopesNearCollinear(s.Prev.Pt,s.Pt,s.Next.Pt,n)?(s=d.Clipper.ExcludeOp(s),e--):(s.Idx=1,s=s.Next);e<3&&(e=0);for(var c=new Array(e),o=0;o<e;++o)c[o]=new d.IntPoint(s.Pt),s=s.Next;return i=null,c};d.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),i=0,o=r.length;i<o;i++)e[i]=d.Clipper.CleanPolygon(r[i],t);return e};d.Clipper.Minkowski=function(r,t,e,i){var o=i?1:0,n=r.length,s=t.length,c=new Array;if(e)for(var l=0;l<s;l++){for(var p=new Array(n),h=0,m=r.length,y=r[h];h<m;h++,y=r[h])p[h]=new d.IntPoint(t[l].X+y.X,t[l].Y+y.Y);c.push(p)}else for(var l=0;l<s;l++){for(var p=new Array(n),h=0,m=r.length,y=r[h];h<m;h++,y=r[h])p[h]=new d.IntPoint(t[l].X-y.X,t[l].Y-y.Y);c.push(p)}for(var g=new Array,l=0;l<s-1+o;l++)for(var h=0;h<n;h++){var S=new Array;S.push(c[l%s][h%n]),S.push(c[(l+1)%s][h%n]),S.push(c[(l+1)%s][(h+1)%n]),S.push(c[l%s][(h+1)%n]),d.Clipper.Orientation(S)||S.reverse(),g.push(S)}var M=new d.Clipper(0);return M.AddPaths(g,d.PolyType.ptSubject,!0),M.Execute(d.ClipType.ctUnion,c,d.PolyFillType.pftNonZero,d.PolyFillType.pftNonZero),c};d.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],i=r[1],o=r[2];return d.Clipper.Minkowski(e,i,!0,o)}else if(t==4){for(var e=r[0],n=r[1],s=r[2],o=r[3],c=new d.Clipper,l,p=0,h=n.length;p<h;++p){var l=d.Clipper.Minkowski(e,n[p],!0,o);c.AddPaths(l,d.PolyType.ptSubject,!0)}o&&c.AddPaths(n,d.PolyType.ptClip,!0);var m=new d.Paths;return c.Execute(d.ClipType.ctUnion,m,s,s),m}};d.Clipper.MinkowskiDiff=function(r,t,e){return d.Clipper.Minkowski(r,t,!1,e)};d.Clipper.PolyTreeToPaths=function(r){var t=new Array;return d.Clipper.AddPolyNodeToPaths(r,d.Clipper.NodeType.ntAny,t),t};d.Clipper.AddPolyNodeToPaths=function(r,t,e){var i=!0;switch(t){case d.Clipper.NodeType.ntOpen:return;case d.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&e.push(r.m_polygon);for(var o=0,n=r.Childs(),s=n.length,c=n[o];o<s;o++,c=n[o])d.Clipper.AddPolyNodeToPaths(c,t,e)};d.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new d.Paths,e=0,i=r.ChildCount();e<i;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};d.Clipper.ClosedPathsFromPolyTree=function(r){var t=new d.Paths;return d.Clipper.AddPolyNodeToPaths(r,d.Clipper.NodeType.ntClosed,t),t};od(d.Clipper,d.ClipperBase);d.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};d.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=d.ClipperOffset.def_arc_tolerance),this.m_destPolys=new d.Paths,this.m_srcPoly=new d.Path,this.m_destPoly=new d.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new d.IntPoint,this.m_polyNodes=new d.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};d.ClipperOffset.two_pi=6.28318530717959;d.ClipperOffset.def_arc_tolerance=.25;d.ClipperOffset.prototype.Clear=function(){d.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};d.ClipperOffset.Round=d.Clipper.Round;d.ClipperOffset.prototype.AddPath=function(r,t,e){var i=r.length-1;if(!(i<0)){var o=new d.PolyNode;if(o.m_jointype=t,o.m_endtype=e,e==d.EndType.etClosedLine||e==d.EndType.etClosedPolygon)for(;i>0&&d.IntPoint.op_Equality(r[0],r[i]);)i--;o.m_polygon.push(r[0]);for(var n=0,s=0,c=1;c<=i;c++)d.IntPoint.op_Inequality(o.m_polygon[n],r[c])&&(n++,o.m_polygon.push(r[c]),(r[c].Y>o.m_polygon[s].Y||r[c].Y==o.m_polygon[s].Y&&r[c].X<o.m_polygon[s].X)&&(s=n));if(!(e==d.EndType.etClosedPolygon&&n<2||e!=d.EndType.etClosedPolygon&&n<0)&&(this.m_polyNodes.AddChild(o),e==d.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new d.IntPoint(0,s);else{var l=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(o.m_polygon[s].Y>l.Y||o.m_polygon[s].Y==l.Y&&o.m_polygon[s].X<l.X)&&(this.m_lowest=new d.IntPoint(this.m_polyNodes.ChildCount()-1,s))}}};d.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var i=0,o=r.length;i<o;i++)this.AddPath(r[i],t,e)};d.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!d.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];(t.m_endtype==d.EndType.etClosedPolygon||t.m_endtype==d.EndType.etClosedLine&&d.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];t.m_endtype==d.EndType.etClosedLine&&!d.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};d.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,i=t.Y-r.Y;if(e==0&&i==0)return new d.DoublePoint(0,0);var o=1/Math.sqrt(e*e+i*i);return e*=o,i*=o,new d.DoublePoint(i,-e)};d.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,d.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==d.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=d.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*d.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*d.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var o=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(d.ClipperOffset.two_pi/o),this.m_cos=Math.cos(d.ClipperOffset.two_pi/o),this.m_StepsPerRad=o/d.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];this.m_srcPoly=e.m_polygon;var n=this.m_srcPoly.length;if(!(n==0||r<=0&&(n<3||e.m_endtype!=d.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,n==1){if(e.m_jointype==d.JoinType.jtRound)for(var s=1,c=0,l=1;l<=o;l++){this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r)));var p=s;s=s*this.m_cos-this.m_sin*c,c=p*this.m_sin+c*this.m_cos}else for(var s=-1,c=-1,l=0;l<4;++l)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+s*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+c*r))),s<0?s=1:c<0?c=1:s=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<n-1;l++)this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(e.m_endtype==d.EndType.etClosedLine||e.m_endtype==d.EndType.etClosedPolygon?this.m_normals.push(d.ClipperOffset.GetUnitNormal(this.m_srcPoly[n-1],this.m_srcPoly[0])):this.m_normals.push(new d.DoublePoint(this.m_normals[n-2])),e.m_endtype==d.EndType.etClosedPolygon){for(var h=n-1,l=0;l<n;l++)h=this.OffsetPoint(l,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==d.EndType.etClosedLine){for(var h=n-1,l=0;l<n;l++)h=this.OffsetPoint(l,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var m=this.m_normals[n-1],l=n-1;l>0;l--)this.m_normals[l]=new d.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new d.DoublePoint(-m.X,-m.Y),h=0;for(var l=n-1;l>=0;l--)h=this.OffsetPoint(l,h,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var h=0,l=1;l<n-1;++l)h=this.OffsetPoint(l,h,e.m_jointype);var y;if(e.m_endtype==d.EndType.etOpenButt){var l=n-1;y=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*r),d.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*r)),this.m_destPoly.push(y),y=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*r),d.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*r)),this.m_destPoly.push(y)}else{var l=n-1;h=n-2,this.m_sinA=0,this.m_normals[l]=new d.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),e.m_endtype==d.EndType.etOpenSquare?this.DoSquare(l,h):this.DoRound(l,h)}for(var l=n-1;l>0;l--)this.m_normals[l]=new d.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new d.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),h=n-1;for(var l=h-1;l>0;--l)h=this.OffsetPoint(l,h,e.m_jointype);e.m_endtype==d.EndType.etOpenButt?(y=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(y),y=new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),d.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(y)):(h=1,this.m_sinA=0,e.m_endtype==d.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};d.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof d.PolyTree;if(t){var e=r[0],i=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(i);var o=new d.Clipper(0);if(o.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)o.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var n=d.Clipper.GetBounds(this.m_destPolys),s=new d.Path;if(s.push(new d.IntPoint(n.left-10,n.bottom+10)),s.push(new d.IntPoint(n.right+10,n.bottom+10)),s.push(new d.IntPoint(n.right+10,n.top-10)),s.push(new d.IntPoint(n.left-10,n.top-10)),o.AddPath(s,d.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),e.ChildCount()==1&&e.Childs()[0].ChildCount()>0){var c=e.Childs()[0];e.Childs()[0]=c.Childs()[0];for(var l=1;l<c.ChildCount();l++)e.AddChild(c.Childs()[l])}else e.Clear()}}else{var e=r[0],i=r[1];d.Clear(e),this.FixOrientations(),this.DoOffset(i);var o=new d.Clipper(0);if(o.AddPaths(this.m_destPolys,d.PolyType.ptSubject,!0),i>0)o.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftPositive,d.PolyFillType.pftPositive);else{var n=d.Clipper.GetBounds(this.m_destPolys),s=new d.Path;s.push(new d.IntPoint(n.left-10,n.bottom+10)),s.push(new d.IntPoint(n.right+10,n.bottom+10)),s.push(new d.IntPoint(n.right+10,n.top-10)),s.push(new d.IntPoint(n.left-10,n.top-10)),o.AddPath(s,d.PolyType.ptSubject,!0),o.ReverseSolution=!0,o.Execute(d.ClipType.ctUnion,e,d.PolyFillType.pftNegative,d.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};d.ClipperOffset.prototype.OffsetPoint=function(r,t,e){if(this.m_sinA=this.m_normals[t].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new d.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case d.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[t].X+this.m_normals[r].Y*this.m_normals[t].Y);i>=this.m_miterLim?this.DoMiter(r,t,i):this.DoSquare(r,t);break}case d.JoinType.jtSquare:this.DoSquare(r,t);break;case d.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};d.ClipperOffset.prototype.DoSquare=function(r,t){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*e)))),this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};d.ClipperOffset.prototype.DoMiter=function(r,t,e){var i=this.m_delta/e;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*i),d.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*i)))};d.ClipperOffset.prototype.DoRound=function(r,t){for(var e=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y),i=d.Cast_Int32(d.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),o=this.m_normals[t].X,n=this.m_normals[t].Y,s,c=0;c<i;++c)this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+o*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+n*this.m_delta))),s=o,o=o*this.m_cos-this.m_sin*n,n=s*this.m_sin+n*this.m_cos;this.m_destPoly.push(new d.IntPoint(d.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),d.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};d.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};d.JS={};d.JS.AreaOfPolygon=function(r,t){return t||(t=1),d.Clipper.Area(r)/(t*t)};d.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,i=0;i<r.length;i++)e+=d.Clipper.Area(r[i]);return e/(t*t)};d.JS.BoundsOfPath=function(r,t){return d.JS.BoundsOfPaths([r],t)};d.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=d.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};d.JS.Clean=function(i,t){if(!(i instanceof Array))return[];var e=i[0]instanceof Array,i=d.JS.Clone(i);if(typeof t!="number"||t===null)return d.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||t<0)return i;e||(i=[i]);for(var o=i.length,n,s,c,l,p,h,m,y=[],g=0;g<o;g++)if(s=i[g],n=s.length,n!==0){if(n<3){c=s,y.push(c);continue}for(c=s,l=t*t,p=s[0],h=1,m=1;m<n;m++)(s[m].X-p.X)*(s[m].X-p.X)+(s[m].Y-p.Y)*(s[m].Y-p.Y)<=l||(c[h]=s[m],p=s[m],h++);p=s[h-1],(s[0].X-p.X)*(s[0].X-p.X)+(s[0].Y-p.Y)*(s[0].Y-p.Y)<=l&&h--,h<n&&c.splice(h,n-h),c.length&&y.push(c)}return!e&&y.length?y=y[0]:!e&&y.length===0?y=[]:e&&y.length===0&&(y=[[]]),y};d.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,i,o,n,s,c=new Array(e);for(o=0;o<e;o++){for(i=r[o].length,s=new Array(i),n=0;n<i;n++)s[n]={X:r[o][n].X,Y:r[o][n].Y};c[o]=s}return t||(c=c[0]),c};d.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return d.Error("Tolerance is not a number in Lighten()."),d.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return d.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,i,o,n,s,c,l,p,h,m,y,g,S,M,v,C,w,P=r.length,T=t*t,E=[];for(e=0;e<P;e++)if(o=r[e],c=o.length,c!=0){for(n=0;n<1e6;n++){for(s=[],c=o.length,o[c-1].X!=o[0].X||o[c-1].Y!=o[0].Y?(g=1,o.push({X:o[0].X,Y:o[0].Y}),c=o.length):g=0,y=[],i=0;i<c-2;i++)l=o[i],h=o[i+1],p=o[i+2],C=l.X,w=l.Y,S=p.X-C,M=p.Y-w,(S!==0||M!==0)&&(v=((h.X-C)*S+(h.Y-w)*M)/(S*S+M*M),v>1?(C=p.X,w=p.Y):v>0&&(C+=S*v,w+=M*v)),S=h.X-C,M=h.Y-w,m=S*S+M*M,m<=T&&(y[i+1]=1,i++);for(s.push({X:o[0].X,Y:o[0].Y}),i=1;i<c-1;i++)y[i]||s.push({X:o[i].X,Y:o[i].Y});if(s.push({X:o[c-1].X,Y:o[c-1].Y}),g&&o.pop(),y.length)o=s;else break}c=s.length,s[c-1].X==s[0].X&&s[c-1].Y==s[0].Y&&s.pop(),s.length>2&&E.push(s)}return!r[0]instanceof Array&&(E=E[0]),typeof E>"u"&&(E=[[]]),E};d.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var i=Math.sqrt,o=0,n,s,c=0,l=0,p=0,h=0,m=r.length;if(m<2)return 0;for(t&&(r[m]=r[0],m++);--m;)n=r[m],c=n.X,l=n.Y,s=r[m-1],p=s.X,h=s.Y,o+=i((c-p)*(c-p)+(l-h)*(l-h));return t&&r.pop(),o/e};d.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var i=0,o=0;o<r.length;o++)i+=d.JS.PerimeterOfPath(r[o],t,e);return i};d.JS.ScaleDownPath=function(r,t){var e,i;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=i.X/t,i.Y=i.Y/t};d.JS.ScaleDownPaths=function(r,t){var e,i,o,n=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)o=r[e][i],o.X=o.X/t,o.Y=o.Y/t};d.JS.ScaleUpPath=function(r,t){var e,i,o=Math.round;for(t||(t=1),e=r.length;e--;)i=r[e],i.X=o(i.X*t),i.Y=o(i.Y*t)};d.JS.ScaleUpPaths=function(r,t){var e,i,o,n=Math.round;for(t||(t=1),e=r.length;e--;)for(i=r[e].length;i--;)o=r[e][i],o.X=n(o.X*t),o.Y=n(o.Y*t)};d.ExPolygons=function(){return[]};d.ExPolygon=function(){this.outer=null,this.holes=null};d.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new d.ExPolygon;e.outer=r.Contour();var i=r.Childs(),o=i.length;e.holes=new Array(o);var n,s,c,l,p,h;for(c=0;c<o;c++)for(n=i[c],e.holes[c]=n.Contour(),l=0,p=n.Childs(),h=p.length;l<h;l++)s=p[l],d.JS.AddOuterPolyNodeToExPolygons(s,t);t.push(e)};d.JS.ExPolygonsToPaths=function(r){var t,e,i,o,n=new d.Paths;for(t=0,i=r.length;t<i;t++)for(n.push(r[t].outer),e=0,o=r[t].holes.length;e<o;e++)n.push(r[t].holes[e]);return n};d.JS.PolyTreeToExPolygons=function(r){var t=new d.ExPolygons,e,i,o,n;for(i=0,o=r.Childs(),n=o.length;i<n;i++)e=o[i],d.JS.AddOuterPolyNodeToExPolygons(e,t);return t};yl.exports=d});var P7=G((kZ,oh)=>{f();(function(){"use strict";function r(s,c){var l=s.x-c.x,p=s.y-c.y;return l*l+p*p}function t(s,c,l){var p=c.x,h=c.y,m=l.x-p,y=l.y-h;if(m!==0||y!==0){var g=((s.x-p)*m+(s.y-h)*y)/(m*m+y*y);g>1?(p=l.x,h=l.y):g>0&&(p+=m*g,h+=y*g)}return m=s.x-p,y=s.y-h,m*m+y*y}function e(s,c){for(var l=s[0],p=[l],h,m=1,y=s.length;m<y;m++)h=s[m],r(h,l)>c&&(p.push(h),l=h);return l!==h&&p.push(h),p}function i(s,c,l,p,h){for(var m=p,y,g=c+1;g<l;g++){var S=t(s[g],s[c],s[l]);S>m&&(y=g,m=S)}m>p&&(y-c>1&&i(s,c,y,p,h),h.push(s[y]),l-y>1&&i(s,y,l,p,h))}function o(s,c){var l=s.length-1,p=[s[0]];return i(s,0,l,c,p),p.push(s[l]),p}function n(s,c,l){if(s.length<=2)return s;var p=c!==void 0?c*c:1;return s=l?s:e(s,p),s=o(s,p),s}typeof define=="function"&&define.amd?define(function(){return n}):typeof oh<"u"?(oh.exports=n,oh.exports.default=n):typeof self<"u"?self.simplify=n:window.simplify=n})()});f();f();f();f();f();f();var ns=r=>r!=null;var H7=function(){let t=globalThis.fetch;return{fetch(...e){if(!ns(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...e)},setFetch(e){t=e}}}(),f1=H7.fetch;var v1=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],m1=v1[0],b1="https://api-gateway.mappedin.com/track-analytics/a/",C1="deny-watchposition",S1="load-mapview",x1="load-mapdata",I1="change-language",M1="query-directions";var $r,Zt,Bn,bp,Rn=class{constructor(){b(this,Bn);b(this,$r,Object.freeze({}));b(this,Zt,void 0);u(this,"oneTimeEventsSent",new Set);u(this,"sendGetDirectionsEvent",rg((t,e)=>this.sendAnalyticEvent(M1,{start:t,end:e,type:"location_to_location"}),2500));I(this,Zt,j(this,Bn,bp).call(this,a(this,$r)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){I(this,$r,{}),I(this,Zt,j(this,Bn,bp).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return I(this,$r,Object.freeze(Object.assign({},a(this,$r),t))),I(this,Zt,j(this,Bn,bp).call(this,t)),a(this,Zt)}updateState(t){let e={...t};e.mapId&&(e.analyticsBaseUrl=Ah({...a(this,Zt),mapId:e.mapId})),e.context&&(e.context=g1(e.context)),e.baseUri&&(e.analyticsBaseUrl=Ah({baseUri:e.baseUri,mapId:a(this,Zt).mapId})),Object.assign(a(this,Zt),e),this.handleStateUpdate(t)}handleStateUpdate(t){var e;(e=t.userPosition)!=null&&e.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:e,accessToken:i}=this.getState();return!!(t&&e)||!!i}getState(){return a(this,Zt)}getContext(){return this.getState().context||a(this,$r).context||m1}getSessionId(){return this.getState().sessionId||a(this,$r).sessionId||y1()}sendAnalyticEvent(t,e={}){let i=this.getState(),o=X7(i.analyticsBaseUrl,t),n={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&O.log("Analytics.track",o,n),!i.sendEvents)return Promise.resolve();if(!this.authReady)return O.warn("Auth needs to be ready to send analytics.");let s={...e,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(s,i.userPosition),n["Content-Type"]="application/json",i.accessToken?n.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(n["x-mappedin-key"]=btoa(i.key),n["x-mappedin-secret"]=btoa(i.secret)),f1(o,{method:"POST",mode:"cors",headers:n,body:JSON.stringify(s)})}capture(t,e){if(Y7.includes(t))return O.warn("".concat(t," event is sent internally.")),Promise.resolve();let i=W7.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(i,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(x1,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(I1,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(C1)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e}){return this.sendAnalyticEvent(S1,{type:"3d",firstRenderDuration:t,width:e.width,height:e.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};$r=new WeakMap,Zt=new WeakMap,Bn=new WeakSet,bp=function(t){var i,o,n,s;let e=(i=t.baseUri)!=null?i:b1;return{baseUri:e,analyticsBaseUrl:Ah({...t,baseUri:e}),version:((o=x==null?void 0:x.env)==null?void 0:o.npm_package_version)||"v6",deviceId:t.deviceId||U7(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||y1(),platformString:t.platformString||"",context:g1(t.context)||m1,geolocationMode:!1,sendEvents:(n=t.sendEvents)!=null?n:!0,logEvents:(s=t.logEvents)!=null?s:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}};function Ah({mapId:r,baseUri:t=b1}){return"".concat(t).concat(r,"/")}function U7(){return En.getInstance().loadLocalData("deviceId")}function y1(){return En.getInstance().loadSessionData("id")}function X7(r,t){return r+t}function g1(r){return v1.find(t=>t===r)}var W7=["$select-location","$select-category","$query-suggest","$query-search"],Y7=[S1,x1,M1,C1,I1],eT=new Rn,Jr,as=class{constructor(t){b(this,Jr,void 0);u(this,"capture");u(this,"updateState");I(this,Jr,t),this.capture=a(this,Jr).capture.bind(a(this,Jr)),this.updateState=a(this,Jr).updateState.bind(a(this,Jr))}getState(){return Object.assign({},a(this,Jr).getState())}};Jr=new WeakMap;f();f();var ls,cs,ps,ss=class{constructor(t,e,{enabled:i=!1}={}){b(this,ls,void 0);u(this,"searchInstance");b(this,cs,void 0);b(this,ps,void 0);u(this,"enabled",!1);I(this,ls,t),I(this,cs,e),I(this,ps,()=>{var o;(o=this.searchInstance)==null||o.then(n=>n.populate())}),i&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return O.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(i){return O.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return O.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(i){return O.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-5XNJMK3S.js").then(({InternalSearch:t})=>new t(a(this,ls)))),a(this,cs).on("language-change",a(this,ps)),await this.searchInstance)}};ls=new WeakMap,cs=new WeakMap,ps=new WeakMap;var P1=new WeakMap,Ae,Fh=class extends Z{constructor(e,{search:i}={}){super();b(this,Ae,void 0);u(this,"Analytics");u(this,"Search");u(this,"Query");u(this,"getDirections",(e,i,o)=>a(this,Ae).getDirections(e,i,o));u(this,"getDirectionsMultiDestination",(e,i,o)=>a(this,Ae).getDirectionsMultiDestination(e,i,o));I(this,Ae,e),P1.set(this,e),this.Analytics=new as(e.Analytics),this.Query=e.Query,this.Search=new ss(this,e,{enabled:i==null?void 0:i.enabled}),a(this,Ae).on("language-change",o=>{this.publish("language-change",o)})}getEnv(){return a(this,Ae).getEnv()}get mapName(){return a(this,Ae).mapName}get mapCenter(){return a(this,Ae).mapCenter}get organizationId(){return a(this,Ae).organizationId}get outdoorViewToken(){return a(this,Ae).outdoorViewToken}getByType(e){return a(this,Ae).getByType(e)}getById(e,i){return a(this,Ae).getById(e,i)}getByExternalId(e,i){return a(this,Ae).getByExternalId(e,i)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return a(this,Ae).changeLanguage(e)}get currentLanguage(){return a(this,Ae).currentLanguage}getDistance(e,i){return a(this,Ae).getDistance(e,i)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return a(this,Ae).toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return a(this,Ae).toJSONBundle({downloadLanguagePacks:e})}};Ae=new WeakMap;var Cp=Fh;function us(r){let t=P1.get(r);if(!t)throw new Error("MapDataInternal not found");return t}f();f();f();f();var T1=globalThis.fetch,O1,Z7=(O1=x==null?void 0:x.env)==null?void 0:O1.npm_package_version,kh="https://app.mappedin.com/",z7="https://auth.mappedin.com/",w1="accessTokens",E1="sasTokens";function Qr(){if(T1==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return T1}var L1={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function A1(r){var e;let t={...L1,...r};return t.headers={...t.headers,"mappedin-sdk-version":Z7},t.things=[],"platformString"in r&&(t.headers={...t.headers,"mappedin-platform-version":r.platformString}),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(e=t.language)==null?void 0:e.toLowerCase(),t}function q7(r,t,e=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete i.language;let{headers:o}=r;o["Content-Type"]=o["Content-Type"]||"text/json",r.accessToken?o.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(o["x-mappedin-key"]=btoa(r.clientId),o["x-mappedin-secret"]=btoa(r.clientSecret));let n={method:"GET",headers:o};return r.secure&&(t+="&withcdntoken"),{req:n,url:t}}async function $7(r,t,e=!1){let i=q7(r,t,e),o=await Qr()(i.url,i.req);if(!o.ok)throw new Error("".concat(o.status," ").concat(o.statusText));return o.json()}async function J7(r,t="exports/mvf/1/bundle"){var n;let e=A1({baseUri:"https://api-gateway.mappedin.com/",...L1,...r}),i="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((n=e.version)!=null?n:"2.0.0");return e.headers["Content-Type"]="application/zip",await $7(e,i)}var _h=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function Bh(r,{signal:t}){let e=await(await Qr()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}async function Nn(r){let e=(await import("./browser-JCMKWIF4.js")).unzipSync(r),i={};if(e["enterprise/"]!=null){i.enterprise={};let o=e["enterprise/locations.json"];o&&(i.enterprise.locations=JSON.parse(_h().decode(o)));let n=e["enterprise/categories.json"];n&&(i.enterprise.categories=JSON.parse(_h().decode(n)))}return e["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(_h().decode(e["manifest.json"]))),i}async function F1(r,{signal:t}){try{let e=await(await Qr()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let i=new Uint8Array(e);return await Nn(i)}catch(e){let i=new Error("downloadLanguagePack failed");throw i.cause=e,i}}async function Rh(r){return new Promise(async(t,e)=>{try{let{url:i,locale_packs:o}=await J7(r,"exports/mvf2/1/bundle"),n=await Qr()(i).then(c=>c.arrayBuffer()),s=new Uint8Array(n);t({compressed:s,localePacks:o})}catch(i){e(i)}})}async function Nh(r,t){return new Promise(async(e,i)=>{try{let{url:o}=await Q7(r,t),n=await Qr()(o).then(c=>c.arrayBuffer()),s=new Uint8Array(n);e(s)}catch(o){i(o)}})}function Gh(r){return r.endsWith("/")?r:"".concat(r,"/")}async function Q7(r,t){let e="".concat(r.baseUri?Gh(r.baseUri):kh,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await Qr()(e,{headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}async function ds(r,t=!1){let e="".concat(r.key),i=En.getInstance(),o=(i==null?void 0:i.loadSessionData(w1))||{},n=Math.floor(Date.now()/1e3);if(o[e]&&n<o[e].expiresTimestamp)return o[e];let s=t?await K7(r,n):await eC(r,n),c={...o,[e]:s};return i==null||i.saveSessionData(w1,c),s}async function K7(r,t){var n;let e="".concat((n=r.baseAuthUri)!=null?n:z7,"oauth2/token"),i=await Qr()(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:r.key,client_secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let o=await i.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}async function eC(r,t){let e="".concat(r.baseAuthUri?Gh(r.baseAuthUri):kh,"api/api-key/token"),i=await Qr()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:r.key,secret:r.secret})});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));let o=await i.json();return{accessToken:o.access_token,expiresTimestamp:t+o.expires_in}}function Sp(r){var i,o,n,s,c,l,p,h;let t=new TextDecoder,e=t.decode.bind(t);try{let m={"connection.json":JSON.parse(e(r["connection.json"])),"manifest.geojson":JSON.parse(e(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(e(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(e(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(e(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{}};if(r.enterprise!=null&&(m.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(m.enterprise.locations=JSON.parse(e((o=r.enterprise)==null?void 0:o["locations.json"]))),(n=r.enterprise)!=null&&n["categories.json"]&&(m.enterprise.categories=JSON.parse(e((s=r.enterprise)==null?void 0:s["categories.json"]))),(c=r.enterprise)!=null&&c["venue.json"]&&(m.enterprise.venue=JSON.parse(e((l=r.enterprise)==null?void 0:l["venue.json"]))),(p=r.enterprise)!=null&&p["locationInstances.json"]&&(m.enterprise.locationInstances=JSON.parse(e((h=r.enterprise)==null?void 0:h["locationInstances.json"])))),r["floorstack.json"]!=null?m["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(m["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),m["floorstack.json"]==null&&m["mapstack.json"]==null&&m["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(m["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),m["floor.geojson"]==null&&m["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(m["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(m["shapes.json"]=JSON.parse(e(r["shapes.json"]))),r.annotation!=null){m.annotation={};let g=Object.keys(r.annotation);for(let S of g){let M=S.replace(/\.json|\.geojson/g,"");m.annotation[M]=JSON.parse(e(r.annotation[S]))}}let y=Object.keys(r.space);for(let g of y){let S=g.replace(/\.json|\.geojson/g,"");m.space[S]=JSON.parse(e(r.space[g]))}if(r.obstruction!=null){let g=Object.keys(r.obstruction);for(let S of g){let M=S.replace(/\.json|\.geojson/g,"");m.obstruction[M]=JSON.parse(e(r.obstruction[S]))}}else m.obstruction={};if(r.entrance!=null){let g=Object.keys(r.entrance);for(let S of g){let M=S.replace(/\.json|\.geojson/g,"");m.entrance[M]=JSON.parse(e(r.entrance[S]))}}else m.entrance={};if("floorImages"in r&&r.floorImages!=null){m.floorImages={};for(let g of Object.keys(r.floorImages)){let S=g.replace(/\.json|\.geojson/g,"");m.floorImages[S]=JSON.parse(e(r.floorImages[g]))}}if("textAreas"in r&&r.textAreas!=null){m.textAreas={};for(let g of Object.keys(r.textAreas)){let S=g.replace(/\.json|\.geojson/g,"");m.textAreas[S]=JSON.parse(e(r.textAreas[g]))}}if("facade"in r&&r.facade!=null){m.facade={};for(let g of Object.keys(r.facade)){let S=g.replace(/\.json|\.geojson/g,"");m.facade[S]=JSON.parse(e(r.facade[g]))}}if("area"in r&&r.area!=null){m.area={};for(let g of Object.keys(r.area)){let S=g.replace(/\.json|\.geojson/g,"");m.area[S]=JSON.parse(e(r.area[g]))}}return m}catch(m){throw O.error(m),new Error("MVF parsing failed! Probably encountered a bad file.")}}function tC(r){if(r==null||typeof r!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in r?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in r?"floorstack.json":"mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&t.push("styles.json"),"shapes.json"in r&&t.push("shapes.json");for(let e of t)if(r[e]==null||r[e][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function xp(r){return new Promise(async(t,e)=>{try{if(r==null||typeof r!="object")throw new Error("Error parsing data! Unzipping failed.");if(r[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let o=(await import("./browser-JCMKWIF4.js")).unzipSync(r);if(!tC(o))throw new Error("MVF is missing some expect static files. Unzipping failed.");let n={},s=Object.keys(o);for(let c of s){if(o[c].length===0)continue;let l=c.split("/");if(l.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(l.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(l.length===1){n[l[0]]=o[c];continue}if(l[0]==="image"){O.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else n[l[0]]==null&&(n[l[0]]={}),n[l[0]][l[1]]=o[c]}t(n)}catch(i){e(i)}})}async function Ip(r,t){let e="".concat(t),i=En.getInstance(),o=(i==null?void 0:i.loadSessionData(E1))||{},n=Math.floor(Date.now()/1e3);if(o[e]&&n<o[e].expires)return o[e];let s=await rC(r,t),c={...o,[e]:{token:s.token,expires:n+new Date(s.expires).getTime()/1e3}};return i==null||i.saveSessionData(E1,c),s}async function rC(r,t){let e="".concat(r.baseAuthUri?Gh(r.baseAuthUri):kh,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await Qr()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));return await i.json()}function Do(){let r="us",t={};function e(){return nC(sC(r),t)}return{updateByUserOption(i){var o,n;i.environment&&(r=i.environment),i.baseUri&&(t.baseUri=i.baseUri),i.baseAuthUri&&(t.baseAuthUri=i.baseAuthUri),(o=i.analytics)!=null&&o.baseUri&&(t.analyticsBaseUri=(n=i.analytics)==null?void 0:n.baseUri)},updateTileServerBaseUrl(i){t.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?D1.baseUri:e().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?D1.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}var _1=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),D1=Object.freeze({..._1,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),iC=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),oC=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function nC(r,t){return{...r,...t}}var aC={eu:iC,us:_1,"us-staging":oC};function sC(r){return aC[r]}f();f();f();function Rt(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function wt(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Gn(r){return r.type==="Feature"?r.geometry:r}function k1(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function lC(r,t,e){e===void 0&&(e={});for(var i=Rt(r),o=wt(t),n=0;n<o.length-1;n++){var s=!1;if(e.ignoreEndVertices&&(n===0&&(s="start"),n===o.length-2&&(s="end"),n===0&&n+1===o.length-1&&(s="both")),cC(o[n],o[n+1],i,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function cC(r,t,e,i,o){var n=e[0],s=e[1],c=r[0],l=r[1],p=t[0],h=t[1],m=e[0]-c,y=e[1]-l,g=p-c,S=h-l,M=m*S-y*g;if(o!==null){if(Math.abs(M)>o)return!1}else if(M!==0)return!1;if(i){if(i==="start")return Math.abs(g)>=Math.abs(S)?g>0?c<n&&n<=p:p<=n&&n<c:S>0?l<s&&s<=h:h<=s&&s<l;if(i==="end")return Math.abs(g)>=Math.abs(S)?g>0?c<=n&&n<p:p<n&&n<=c:S>0?l<=s&&s<h:h<s&&s<=l;if(i==="both")return Math.abs(g)>=Math.abs(S)?g>0?c<n&&n<p:p<n&&n<c:S>0?l<s&&s<h:h<s&&s<l}else return Math.abs(g)>=Math.abs(S)?g>0?c<=n&&n<=p:p<=n&&n<=c:S>0?l<=s&&s<=h:h<=s&&s<=l;return!1}var B1=lC;f();function pC(r,t){t===void 0&&(t={});var e=sp(r),i=(e[0]+e[2])/2,o=(e[1]+e[3])/2;return gr([i,o],t.properties,t)}var Mp=pC;f();f();function uC(r,t,e){e===void 0&&(e={});var i=Rt(r),o=Rt(t),n=yt(o[1]-i[1]),s=yt(o[0]-i[0]),c=yt(i[1]),l=yt(o[1]),p=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(c)*Math.cos(l);return og(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),e.units)}var Ni=uC;function Pp(r,t){return t===void 0&&(t={}),ag(r,function(e,i){var o=i.geometry.coordinates;return e+Ni(o[0],o[1],t)},0)}f();f();f();function Tp(r,t,e){if(e===void 0&&(e={}),e.final===!0)return dC(r,t);var i=Rt(r),o=Rt(t),n=yt(i[0]),s=yt(o[0]),c=yt(i[1]),l=yt(o[1]),p=Math.sin(s-n)*Math.cos(l),h=Math.cos(c)*Math.sin(l)-Math.sin(c)*Math.cos(l)*Math.cos(s-n);return Qa(Math.atan2(p,h))}function dC(r,t){var e=Tp(t,r);return e=(e+180)%360,e}f();function Oo(r,t,e,i){i===void 0&&(i={});var o=Rt(r),n=yt(o[0]),s=yt(o[1]),c=yt(e),l=ng(t,i.units),p=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(c)),h=n+Math.atan2(Math.sin(c)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(p)),m=Qa(h),y=Qa(p);return gr([m,y],i.properties)}f();f();function hC(r){if(!r)throw new Error("geojson is required");var t=[];return vr(r,function(e){fC(e,t)}),Po(t)}function fC(r,t){var e=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":e=wt(i);break;case"LineString":e=[wt(i)]}e.forEach(function(o){var n=mC(o,r.properties);n.forEach(function(s){s.id=t.length,t.push(s)})})}}function mC(r,t){var e=[];return r.reduce(function(i,o){var n=Zr([i,o],t);return n.bbox=yC(i,o),e.push(n),o}),e}function yC(r,t){var e=r[0],i=r[1],o=t[0],n=t[1],s=e<o?e:o,c=i<n?i:n,l=e>o?e:o,p=i>n?i:n;return[s,c,l,p]}var Vh=hC;var W3=rp(U3(),1);function G8(r,t){var e={},i=[];if(r.type==="LineString"&&(r=gh(r)),t.type==="LineString"&&(t=gh(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var o=X3(r,t);return o&&i.push(o),Po(i)}var n=(0,W3.default)();return n.load(Vh(t)),vh(Vh(r),function(s){vh(n.search(s),function(c){var l=X3(s,c);if(l){var p=wt(l).join(",");e[p]||(e[p]=!0,i.push(l))}})}),Po(i)}function X3(r,t){var e=wt(r),i=wt(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],n=e[0][1],s=e[1][0],c=e[1][1],l=i[0][0],p=i[0][1],h=i[1][0],m=i[1][1],y=(m-p)*(s-o)-(h-l)*(c-n),g=(h-l)*(n-p)-(m-p)*(o-l),S=(s-o)*(n-p)-(c-n)*(o-l);if(y===0)return null;var M=g/y,v=S/y;if(M>=0&&M<=1&&v>=0&&v<=1){var C=o+M*(s-o),w=n+M*(c-n);return gr([C,w])}return null}var Jn=G8;function V8(r,t,e){e===void 0&&(e={});var i=gr([1/0,1/0],{dist:1/0}),o=0;return vr(r,function(n){for(var s=wt(n),c=0;c<s.length-1;c++){var l=gr(s[c]);l.properties.dist=Ni(t,l,e);var p=gr(s[c+1]);p.properties.dist=Ni(t,p,e);var h=Ni(l,p,e),m=Math.max(l.properties.dist,p.properties.dist),y=Tp(l,p),g=Oo(t,m,y+90,e),S=Oo(t,m,y-90,e),M=Jn(Zr([g.geometry.coordinates,S.geometry.coordinates]),Zr([l.geometry.coordinates,p.geometry.coordinates])),v=null;M.features.length>0&&(v=M.features[0],v.properties.dist=Ni(t,v,e),v.properties.location=o+Ni(l,v,e)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=c,i.properties.location=o),p.properties.dist<i.properties.dist&&(i=p,i.properties.index=c+1,i.properties.location=o+h),v&&v.properties.dist<i.properties.dist&&(i=v,i.properties.index=c),o+=h}}),i}var Ds=V8;function j8(r,t,e){var i=wt(e);if(k1(e)!=="LineString")throw new Error("line must be a LineString");var o=Ds(e,r),n=Ds(e,t),s;o.properties.index<=n.properties.index?s=[o,n]:s=[n,o];for(var c=[s[0].geometry.coordinates],l=s[0].properties.index+1;l<s[1].properties.index+1;l++)c.push(i[l]);return c.push(s[1].geometry.coordinates),Zr(c,e.properties)}var Em=j8;var H8=1e-7;function Dm(r){return{type:"Point",coordinates:r}}function U8(r,t){let{coordinates:e}=t.geometry,{coordinates:i}=r.geometry,o=e.map(n=>Ds(r,Dm(n)));return i.reduce((n,s)=>{let c=Em(Dm(s),o[0],r),l=Em(Dm(s),o[1],r),p=Pp(c)<Pp(l)?c:l;return p.properties={...r.properties,entrances:[]},n.concat([p])},[])}function Om(r,t){return t.reduce((e,i)=>{let o={epsilon:H8},n=e.obstructions.findIndex(c=>B1(Mp(i),c,o)),s=e.obstructions[n];if(s){let[c,l]=U8(s,i);e.entrances.push(i),e.obstructions.splice(n,1,c,l)}return e},{obstructions:[r],entrances:[]})}f();f();f();var Os=class Os{constructor(t,e,i){u(this,"__type",Os.__type);u(this,"id",he());u(this,"latitude");u(this,"longitude");u(this,"floorId");this.latitude=t,this.longitude=e,this.floorId=i}static is(t){return t.__type===Os.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId}}destroy(){}};u(Os,"__type","coordinate");var Lm=Os,Q=Lm;f();var rt=class{constructor(t){u(this,"id");this.id=t}};var Wi,it,_o,Yi,Ls=class Ls extends rt{constructor(e,i){super(i.mvfData.properties.id);u(this,"__type",Ls.__type);b(this,Wi,void 0);b(this,it,{});b(this,_o,void 0);b(this,Yi,void 0);I(this,Wi,e),I(this,_o,i.floorId),I(this,Yi,i.mvfData)}static is(e){return e.__type===Ls.__type}get locations(){return a(this,it).locations?a(this,it).locations:(a(this,it).locations=(a(this,Wi).locationIdsByNodeId[this.id]||[]).map(e=>a(this,Wi).getById("enterprise-location",e)).filter(Boolean),a(this,it).locations)}get floor(){let e=a(this,Wi).getById("floor",a(this,_o));if(e==null)throw new Error("Floor ".concat(a(this,_o)," not found!"));return e}get coordinate(){if(a(this,it).coordinate==null){let[e,i]=a(this,Yi).geometry.coordinates;a(this,it).coordinate=new Q(i,e,a(this,_o))}return a(this,it).coordinate}get externalId(){var e;return(e=a(this,Yi).properties.externalId)!=null?e:""}get neighbors(){if(a(this,it).neighbours==null){let e=a(this,Yi).properties.neighbors.map(i=>{let o=a(this,Wi).getById("node",i.id);if(o==null)throw new Error("Node ".concat(i.id," not found!"));return o});a(this,it).neighbours=e}return a(this,it).neighbours}get geoJSON(){return{...a(this,Yi),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(a(this,it)))delete a(this,it)[e]}};Wi=new WeakMap,it=new WeakMap,_o=new WeakMap,Yi=new WeakMap,u(Ls,"__type","node");var Am=Ls,Zi=Am;f();f();f();f();var As,Qn,Iu=class Iu extends rt{constructor(e){super(String(he()));b(this,As,{});b(this,Qn,void 0);I(this,Qn,e.mvfData)}static is(e){return e.__type===Iu.__type}get url(){return a(this,Qn).url}get name(){return a(this,Qn).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,As)))delete a(this,As)[e]}};As=new WeakMap,Qn=new WeakMap,u(Iu,"__type","hyperlink");var Fm=Iu,Mu=Fm;f();var Fs,ko,Pu=class Pu extends rt{constructor(e){super(String(he()));b(this,Fs,{});b(this,ko,void 0);I(this,ko,e.mvfData)}static is(e){return e.__type===Pu.__type}get url(){return a(this,ko).url}get name(){return a(this,ko).altText}get altText(){return a(this,ko).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(a(this,Fs)))delete a(this,Fs)[e]}};Fs=new WeakMap,ko=new WeakMap,u(Pu,"__type","image");var _m=Pu,Tu=_m;var Me=class{constructor(t,e,i){u(this,"id");u(this,"links");u(this,"images");var o,n,s,c;this.id=t,this.links=(n=(o=i==null?void 0:i.links)==null?void 0:o.map(l=>new Mu({mvfData:l})))!=null?n:[],this.images=(c=(s=i==null?void 0:i.images)==null?void 0:s.map(l=>new Tu({mvfData:{...l,url:e.sasToken?l.url+"?".concat(e.sasToken):l.url}})))!=null?c:[]}};var ks,Bo,Kn,ri,_s=class _s extends Me{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);u(this,"__type",_s.__type);b(this,ks,void 0);b(this,Bo,void 0);b(this,Kn,{});b(this,ri,void 0);I(this,ks,e),I(this,Bo,i.floorId),I(this,ri,i.mvfData)}static is(e){return e.__type===_s.__type}get name(){var e,i;return(i=(e=a(this,ri).properties.details)==null?void 0:e.name)!=null?i:""}get externalId(){var e;return(e=a(this,ri).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,ri).properties.details)==null?void 0:e.description)!=null?i:""}get center(){var e;if(a(this,Kn).center==null){let[i,o]=(e=a(this,ri).properties.center)!=null?e:[0,0];a(this,Kn).center=new Q(o,i,a(this,Bo))}return a(this,Kn).center}get floor(){let e=a(this,ks).getById("floor",a(this,Bo));if(e==null)throw new Error("Floor ".concat(a(this,Bo)," not found!"));return e}get geoJSON(){return{...a(this,ri),properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};ks=new WeakMap,Bo=new WeakMap,Kn=new WeakMap,ri=new WeakMap,u(_s,"__type","area");var km=_s,zi=km;f();var Ro,ii,No,$t,Bs=class Bs extends Me{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);u(this,"__type",Bs.__type);b(this,Ro,void 0);b(this,ii,void 0);b(this,No,void 0);b(this,$t,void 0);I(this,ii,{}),I(this,$t,i.mvfData),I(this,Ro,e),I(this,No,i.floorId)}static is(e){return e.__type===Bs.__type}get name(){var e,i,o;return"details"in a(this,$t).properties?(o=(i=a(this,$t).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,$t).properties.externalId)!=null?e:""}get externalId(){var e;return(e=a(this,$t).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,$t).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=a(this,Ro).getById("floor",a(this,No));if(e==null)throw new Error("Floor ".concat(a(this,No)," not found!"));return e}get center(){if(a(this,ii).center==null){let[[e,i],[o,n]]=a(this,$t).geometry.coordinates,s=(e+o)/2,c=(i+n)/2;a(this,ii).center=new Q(c,s,a(this,No))}return a(this,ii).center}get isExterior(){var o;let e=a(this,Ro).obstructionIdByEntranceId[this.id],i=a(this,Ro).getMVFFeatureById("obstruction",e);return(o=i==null?void 0:i.properties.footprintComponent)!=null?o:!1}get geoJSON(){return{...a(this,$t),properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(a(this,ii)))delete a(this,ii)[e]}};Ro=new WeakMap,ii=new WeakMap,No=new WeakMap,$t=new WeakMap,u(Bs,"__type","door");var Bm=Bs,Tr=Bm;f();var qi,Go,Dt,ot,Rs=class Rs extends Me{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);u(this,"__type",Rs.__type);b(this,qi,void 0);b(this,Go,void 0);b(this,Dt,{});b(this,ot,void 0);I(this,qi,e),I(this,Go,i.floorId),I(this,ot,i.mvfData)}getMvfData(){return a(this,ot)}static is(e){return e.__type===Rs.__type}get name(){var e,i,o;return"details"in a(this,ot).properties?(o=(i=a(this,ot).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,ot).properties.externalId)!=null?e:""}get type(){return W8(a(this,ot).properties.kind)}get description(){var e,i;return(i=(e=a(this,ot).properties.details)==null?void 0:e.description)!=null?i:""}get externalId(){var e;return(e=a(this,ot).properties.externalId)!=null?e:""}get locations(){if(a(this,Dt).locations)return a(this,Dt).locations;a(this,Dt).locations=[];let e=a(this,qi).mvfLocationsBySpaceId[a(this,ot).properties.id];if((e==null?void 0:e.length)>0)for(let i of e){let o=a(this,qi).getById("enterprise-location",i.id);o&&a(this,Dt).locations.push(o)}return a(this,Dt).locations}get floor(){let e=a(this,qi).getById("floor",a(this,Go));if(e==null)throw new Error("Floor ".concat(a(this,Go)," not found!"));return e}get doors(){return a(this,ot).properties.destinationNodes.reduce((e,i)=>{let o=a(this,qi).doorsByNodeId[i];return o&&e.push(o),e},[])}get center(){var e;if(a(this,Dt).center==null){let[i,o]=(e=a(this,ot).properties.center)!=null?e:[0,0];a(this,Dt).center=new Q(o,i,a(this,Go))}return a(this,Dt).center}get geoJSON(){return{...a(this,ot),properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(a(this,Dt)))delete a(this,Dt)[e]}};qi=new WeakMap,Go=new WeakMap,Dt=new WeakMap,ot=new WeakMap,u(Rs,"__type","space");var Rm=Rs,X8=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function W8(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return X8.includes(t)?t:"room"}var Fe=Rm;f();var Jt,fe,oi,Ns=class Ns extends Me{constructor(e,i){super(i.mvfData.id,e);u(this,"__type",Ns.__type);b(this,Jt,void 0);b(this,fe,{});b(this,oi,void 0);I(this,Jt,e),I(this,oi,i.mvfData)}static is(e){return e.__type===Ns.__type}get focusTarget(){return this}get name(){var e,i;return"name"in a(this,oi)?(i=a(this,oi).name)!=null?i:"":(e=a(this,oi).externalId)!=null?e:""}get externalId(){var e;return(e=a(this,oi).externalId)!=null?e:""}get elevation(){return a(this,oi).elevation}get spaces(){if(a(this,fe).spaces==null){let e=a(this,Jt).spaces.filter(i=>i.floor.id===this.id);a(this,fe).spaces=e}return a(this,fe).spaces}get objects(){if(a(this,fe).objects==null){let e=a(this,Jt).objects.filter(i=>i.floor.id===this.id);a(this,fe).objects=e}return a(this,fe).objects}get connections(){if(a(this,fe).connections==null){let e=a(this,Jt).connections.filter(i=>i.floors.includes(this));a(this,fe).connections=e}return a(this,fe).connections}get doors(){if(a(this,fe).doors==null){let e=a(this,Jt).doors.filter(i=>i.floor.id===this.id);a(this,fe).doors=e}return a(this,fe).doors}get annotations(){if(a(this,fe).annotations==null){let e=a(this,Jt).annotations.filter(i=>i.floor.id===this.id);a(this,fe).annotations=e}return a(this,fe).annotations}get pois(){if(a(this,fe).pois==null){let e=a(this,Jt).pointsOfInterest.filter(i=>i.floor.id===this.id);a(this,fe).pois=e}return a(this,fe).pois}get floorStack(){if(a(this,fe).floorStack==null){let e=a(this,Jt).floorStacks.find(i=>i.floors.includes(this));a(this,fe).floorStack=e}return a(this,fe).floorStack}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,fe)))delete a(this,fe)[e]}};Jt=new WeakMap,fe=new WeakMap,oi=new WeakMap,u(Ns,"__type","floor");var Nm=Ns,Vo=Nm;f();f();f();function Gs(r){return typeof r=="string"?r:r.id}function Y3(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}f();function ni(r){let t;if(Fe.is(r)||Tr.is(r)||Qt.is(r)||zi.is(r)||Kt.is(r))t=r.center;else if($i.is(r)||ea.is(r))t=r.coordinate;else if(Q.is(r))t=r;else if(Zi.is(r))t=r.coordinate;else if(ai.is(r))t=r.coordinates[0];else return;return t}f();f();var Vs={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},wr="ExteriorWalls",Ji="Walls",Z3=0,ta="InteriorDoors",ra="ExteriorDoors",Se="GeometryLayer",si="LabelsLayer",Er="MarkersLayer",ia="FootprintLayer",z3="ImagesLayer";var q3=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"];function Gm(r){var t,e;if((t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}function Vm(r,t){var o,n,s,c;let e=((o=r==null?void 0:r.outdoorView)==null?void 0:o.token)||t.outdoorViewToken,i={...Vs,...r!=null?r:{},outdoorView:{enabled:((n=r==null?void 0:r.outdoorView)==null?void 0:n.enabled)===void 0?!!e:(s=r==null?void 0:r.outdoorView)==null?void 0:s.enabled,layersHiddenByGeometry:(c=Vs.outdoorView)==null?void 0:c.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return e&&i.outdoorView&&(i.outdoorView.token=e),i}function $3(r){let t={remove_watermark:!1};if(r)try{let e=ip(r);Object.assign(t,e.capabilities)}catch(e){O.error("Error decoding capabilities from token",e)}return t}var oa,li,er,js=class js extends Me{constructor(e,i){let o=Object.values(i.mvfDataByFloorId)[0];super(o.properties.id,e,"details"in o.properties?o.properties.details:void 0);u(this,"__type",js.__type);b(this,oa,void 0);b(this,li,void 0);b(this,er,void 0);I(this,li,{}),I(this,oa,e),I(this,er,i.mvfDataByFloorId)}static is(e){return e.__type===js.__type}get name(){var i,o,n;let e=Object.values(a(this,er))[0];return"details"in e.properties?(n=(o=e.properties.details)==null?void 0:o.name)!=null?n:"":(i=e.properties.externalId)!=null?i:""}get description(){var e,i;return(i=(e=Object.values(a(this,er))[0].properties.details)==null?void 0:e.description)!=null?i:""}get accessible(){var e;return(e=Object.values(a(this,er))[0].properties.accessible)!=null?e:!1}get externalId(){var e;return(e=Object.values(a(this,er))[0].properties.externalId)!=null?e:""}get type(){var e,i;return(i=(e=Object.values(a(this,er))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?i:"unknown"}get coordinates(){return a(this,li).coordinates==null&&(a(this,li).coordinates=Object.entries(a(this,er)).map(([e,i])=>new Q(i.geometry.coordinates[1],i.geometry.coordinates[0],e))),a(this,li).coordinates}get nodes(){return Object.values(a(this,er))[0].properties.nodes.map(e=>a(this,oa).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?a(this,oa).getById("floor",e.floorId):void 0).filter(ns)}get focusTarget(){return this.coordinates}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id)}}destroy(){for(let e of Object.keys(a(this,li)))delete a(this,li)[e]}};oa=new WeakMap,li=new WeakMap,er=new WeakMap,u(js,"__type","connection");var jm=js,jo=jm;f();var Us,Ho,Qi,Gt,Hs=class Hs extends Me{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);u(this,"__type",Hs.__type);b(this,Us,void 0);b(this,Ho,void 0);b(this,Qi,{});b(this,Gt,void 0);I(this,Us,e),I(this,Ho,i.floorId),I(this,Gt,i.mvfData)}static is(e){return e.__type===Hs.__type}get name(){var e,i,o;return"details"in a(this,Gt).properties?(o=(i=a(this,Gt).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,Gt).properties.externalId)!=null?e:""}get externalId(){var e;return(e=a(this,Gt).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,Gt).properties.details)==null?void 0:e.description)!=null?i:""}get type(){let e=a(this,Gt).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=a(this,Us).getById("floor",a(this,Ho));if(e==null)throw new Error("Floor ".concat(a(this,Ho)," not found!"));return e}get center(){var e;if(a(this,Qi).center==null){let[i,o]=(e=a(this,Gt).properties.center)!=null?e:[0,0];a(this,Qi).center=new Q(o,i,a(this,Ho))}return a(this,Qi).center}get geoJSON(){return{...a(this,Gt),properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(a(this,Qi)))a(this,Qi)[e]=null}};Us=new WeakMap,Ho=new WeakMap,Qi=new WeakMap,Gt=new WeakMap,u(Hs,"__type","object");var Hm=Hs,Qt=Hm;f();var Ws,Uo,Ki,tr,Xs=class Xs extends Me{constructor(e,i){super(i.mvfData.properties.id,e,i.mvfData.properties.details);u(this,"__type",Xs.__type);b(this,Ws,void 0);b(this,Uo,void 0);b(this,Ki,{});b(this,tr,void 0);I(this,Ws,e),I(this,tr,i.mvfData),I(this,Uo,i.floorId)}static is(e){return e.__type===Xs.__type}get name(){var e,i,o;return"details"in a(this,tr).properties?(o=(i=a(this,tr).properties.details)==null?void 0:i.name)!=null?o:"":(e=a(this,tr).properties.externalId)!=null?e:""}get description(){var e,i;return(i=(e=a(this,tr).properties.details)==null?void 0:e.description)!=null?i:""}get floor(){let e=a(this,Ws).getById("floor",a(this,Uo));if(e==null)throw new Error("Floor ".concat(a(this,Uo)," not found!"));return e}get coordinate(){var e;if(a(this,Ki).coordinate==null){let[i,o]=(e=a(this,tr).geometry.coordinates)!=null?e:[0,0];a(this,Ki).coordinate=new Q(o,i,a(this,Uo))}return a(this,Ki).coordinate}get externalId(){var e;return(e=a(this,tr).properties.externalId)!=null?e:""}get geoJSON(){return{...a(this,tr),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in a(this,Ki))a(this,Ki)[e]=null}};Ws=new WeakMap,Uo=new WeakMap,Ki=new WeakMap,tr=new WeakMap,u(Xs,"__type","point-of-interest");var Um=Xs,$i=Um;f();var Zs,Xo,eo,to,zs,Wm,Ys=class Ys extends Me{constructor(e,i){super(i.mvfData.properties.id,e);b(this,zs);u(this,"__type",Ys.__type);b(this,Zs,void 0);b(this,Xo,void 0);b(this,eo,{});b(this,to,void 0);I(this,Zs,e),I(this,Xo,i.floorId),I(this,to,i.mvfData)}static is(e){return e.__type===Ys.__type}get group(){return j(this,zs,Wm).call(this).group}get type(){return j(this,zs,Wm).call(this).type}get externalId(){var e;return(e=a(this,to).properties.externalId)!=null?e:""}get coordinate(){if(a(this,eo).coordinate==null){let[e,i]=a(this,to).geometry.coordinates;a(this,eo).coordinate=new Q(i,e,a(this,Xo))}return a(this,eo).coordinate}get floor(){let e=a(this,Zs).getById("floor",a(this,Xo));if(e==null)throw new Error("Floor ".concat(a(this,Xo)," not found!"));return e}get geoJSON(){return{...a(this,to),properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(a(this,eo)))delete a(this,eo)[e]}};Zs=new WeakMap,Xo=new WeakMap,eo=new WeakMap,to=new WeakMap,zs=new WeakSet,Wm=function(){let[e,i]=a(this,to).properties.symbolId.split("--");return{group:e,type:i}},u(Ys,"__type","annotation");var Xm=Ys,ea=Xm;f();var Wo,Vt,rr,na,qs=class qs extends Me{constructor(e,i){super(i.mvfData.id,e);u(this,"__type",qs.__type);b(this,Wo,void 0);b(this,Vt,{});b(this,rr,void 0);b(this,na,void 0);I(this,Wo,e),I(this,rr,i.mvfData),I(this,na,i.facadeId)}static is(e){return e.__type===qs.__type}get type(){return a(this,rr).type}get name(){var e;return(e=a(this,rr).name)!=null?e:""}get externalId(){var e;return(e=a(this,rr).externalId)!=null?e:""}get floors(){var e,i;if(a(this,Vt).floors==null){let o=((i=(e=a(this,rr).floors)!=null?e:a(this,rr).maps)!=null?i:[]).reduce((n,s)=>{let c=a(this,Wo).floorsById[s];return c&&n.push(c),n},[]);o.length===0&&O.error("Floor stack ".concat(this.id," has no floors")),a(this,Vt).floors=o}return a(this,Vt).floors}get defaultFloor(){if(a(this,Vt).defaultFloor!=null)return a(this,Vt).defaultFloor;let e=a(this,rr).defaultFloor?a(this,Wo).getById("floor",a(this,rr).defaultFloor):void 0;return a(this,Vt).defaultFloor=e||this.floors.reduce((i,o)=>Math.abs(o.elevation)<Math.abs(i.elevation)?o:i),a(this,Vt).defaultFloor}get facade(){return a(this,na)?a(this,Wo).facadesById[a(this,na)]:void 0}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(a(this,Vt)))delete a(this,Vt)[e]}};Wo=new WeakMap,Vt=new WeakMap,rr=new WeakMap,na=new WeakMap,u(qs,"__type","floor-stack");var Ym=qs,wu=Ym;f();var aa,Yo,Js,Dr,$s=class $s extends Me{constructor(e,i){super(i.mvfData.id,e);u(this,"__type",$s.__type);b(this,aa,void 0);b(this,Yo,void 0);b(this,Js,void 0);b(this,Dr,{});I(this,aa,i.mvfData),I(this,Yo,e),I(this,Js,i.floorStackId)}static is(e){return e.__type===$s.__type}get floorStack(){return a(this,Yo).getById("floor-stack",a(this,Js))}get spaces(){if(!a(this,Dr).spaces){a(this,Dr).spaces=[];for(let e of a(this,aa).spaces){let i=a(this,Yo).getById("space",e.spaceId);i&&a(this,Dr).spaces.push(i)}}return a(this,Dr).spaces}get center(){if(!a(this,Dr).center){let e={type:"FeatureCollection",features:[]};for(let o of this.spaces){let n=a(this,Yo).mvfSpacesById[o.id];n&&e.features.push(n)}if(e.features.length===0)throw new Error("No geometry found for facade!");let i=Mp(e);a(this,Dr).center=new Q(i.geometry.coordinates[1],i.geometry.coordinates[0],a(this,aa).spaces[0].floorId)}return a(this,Dr).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};aa=new WeakMap,Yo=new WeakMap,Js=new WeakMap,Dr=new WeakMap,u($s,"__type","facade");var Zm=$s,Kt=Zm;f();var Y8=(r,t)=>{var M,v;let e={},i={},o={},n={},s={},c={},l={},p={},h={},m={},y={},g={},S=globalThis.Object.keys(r.space);for(let C of S){let w=r.space[C];if(w!=null)for(let P of w.features){g[P.properties.id]=C,l[P.properties.id]=P;for(let T of P.properties.destinationNodes)s[T]==null&&(s[T]=[]),s[T].push(P.properties.id);if(P.properties.kind==="desk-entrance"&&(c[P.properties.externalId]==null&&(c[P.properties.externalId]=[]),c[P.properties.externalId].push(...P.properties.destinationNodes)),!["void","desk-entrance"].includes((M=P.properties.kind)!=null?M:"")){if((v=P.properties.kind)!=null&&v.includes("connection")){let T="".concat(P.geometry.coordinates[1],"-").concat(P.geometry.coordinates[0]);m[T]==null&&(m[T]=[]),m[T].push(P.properties.id);continue}if(P.properties.kind==="poi"){let T=new $i(t,{floorId:C,mvfData:P});o[P.properties.id]=T,h[C]||(h[C]=[]),h[C].push(P),P.properties.externalId&&(n[P.properties.externalId]==null&&(n[P.properties.externalId]=[]),n[P.properties.externalId].push(T))}else{let T=new Fe(t,{floorId:C,mvfData:P});e[P.properties.id]=T,P.properties.externalId&&(i[P.properties.externalId]==null&&(i[P.properties.externalId]=[]),i[P.properties.externalId].push(T)),p[C]||(p[C]=[]),p[C].push(P)}}}}for(let C in m){let w=m[C],P={};for(let E of w){let A=g[E],k=l[E];P[A]=k}let T=new jo(t,{mvfDataByFloorId:P});y[T.id]=T}return{spacesById:e,spacesByExternalId:i,poisById:o,poisByExternalId:n,connectionsById:y,spaceIdsByDestinationNodeId:s,objectEntranceNodeIdsByObstructionId:c,mvfSpacesById:l,connectionIdsByLatLon:m,mvfSpacesByFloorId:p,mvfPoisByFloorId:h}},Z8=(r,t)=>{var s,c;let e={},i={},o={},n={};for(let l of r["node.geojson"].features){o[l.properties.id]=l;let p=new Zi(t,{mvfData:l,floorId:(s=l.properties.floor)!=null?s:l.properties.map});e[l.properties.id]=p,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(p));let h=(c=l.properties.floor)!=null?c:l.properties.map;n[h]||(n[h]=[]),n[h].push(l)}return{nodesById:e,nodesByExternalId:i,mvfNodesById:o,mvfNodesByFloorId:n}},z8=(r,t)=>{let e={},i={},o={},n={},s=globalThis.Object.keys(r.obstruction);for(let c of s){let l=r.obstruction[c];if(l!=null)for(let p of l.features){o[p.properties.id]=p;for(let m of p.properties.entrances)n[m]=p.properties.id;if(p.properties.kind==="Wall")continue;let h=new Qt(t,{floorId:c,mvfData:p});e[p.properties.id]=h,p.properties.externalId&&(i[p.properties.externalId]==null&&(i[p.properties.externalId]=[]),i[p.properties.externalId].push(h))}}return{objectsById:e,objectsByExternalId:i,mvfObstructionById:o,obstructionIdByEntranceId:n}},q8=(r,t)=>{let e={},i={},o={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let n of r["floor.geojson"].features){o[n.properties.id]=n.properties;let s=new Vo(t,{mvfData:n.properties});e[n.properties.id]=s,n.properties.externalId&&(i[n.properties.externalId]==null&&(i[n.properties.externalId]=[]),i[n.properties.externalId].push(s))}else for(let n of r["map.geojson"]){o[n.id]=n;let s=new Vo(t,{mvfData:n});e[n.id]=s}return{floorsById:e,floorsByExternalId:i,mvfFloorsById:o}},$8=(r,t)=>{var l;let e={},i={},o={},n={},s={},c=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(c!=null)for(let p of c){let h=(l=r.facade)==null?void 0:l[p.id],m=new wu(t,{mvfData:p,facadeId:h==null?void 0:h.id});if(e[p.id]=m,p.externalId&&(i[p.externalId]==null&&(i[p.externalId]=[]),i[p.externalId].push(m)),o[p.id]=p,h){let y=new Kt(t,{mvfData:h,floorStackId:p.id});n[h.id]=y;for(let g of h.spaces)s[g.spaceId]=y}}return{floorStacksById:e,floorStacksByExternalId:i,mvfFloorStacksById:o,facadesById:n,facadesBySpaceId:s}},J8=r=>{let t={},e=r["connection.json"].reduce((i,o)=>(o.nodes.forEach(n=>i[n]=o),t[o.id]=o,i),{});return{mvfConnectionsById:t,mvfConnectionsByNodeId:e}},Q8=(r,t)=>{let e={},i={},o={},n={},s={},c=globalThis.Object.keys(r.entrance);for(let l of c){let p=r.entrance[l];if(p!=null)for(let h of p.features){n[h.properties.id]=h;let m=new Tr(t,{floorId:l,mvfData:h});h.properties.node&&(o[h.properties.node]=m),e[h.properties.id]=m,h.properties.externalId&&(i[h.properties.externalId]==null&&(i[h.properties.externalId]=[]),i[h.properties.externalId].push(m)),s[l]||(s[l]=[]),s[l].push(h)}}return{doorsById:e,doorsByExternalId:i,doorsByNodeId:o,mvfEntrancesById:n,mvfEntrancesByFloorId:s}},K8=(r,t,e)=>{var i;if(r.textAreas!=null)for(let o in r.textAreas){let n=(i=r.textAreas[o])==null?void 0:i.features;if(n!=null){for(let s of n)if("anchorId"in s.properties){let c=s==null?void 0:s.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let p=l.properties;p.textArea=c,p.textArea&&(p.textArea.position=s.geometry.coordinates)}}}}},e9=(r,t,e)=>{var i;if(r.floorImages!=null)for(let o in r.floorImages){let n=(i=r.floorImages[o])==null?void 0:i.features;if(n!=null){for(let s of n)if("anchorId"in s.properties){let c=s==null?void 0:s.properties,l=t[c.anchorId]||e[c.anchorId];if(l!=null&&c!=null){let p=l.properties;p.image=c,p.image&&(p.image.position=s.geometry.coordinates)}}}}},t9=(r,t)=>{let e={},i={},o={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:o};let n=globalThis.Object.keys(r.annotation);for(let s of n){let c=r.annotation[s];if(c!=null)for(let l of c.features){i[l.properties.id]=l;let p=new ea(t,{floorId:s,mvfData:l});e[l.properties.id]=p,o[s]||(o[s]=[]),o[s].push(l)}}return{annotationsById:e,mvfAnnotationsById:i,mvfAnnotationsByFloorId:o}},r9=(r,t)=>{let e={},i={},o={};if(r.area==null)return{areasById:e,areasByExternalId:i,mvfAreasById:o};let n=globalThis.Object.keys(r.area);for(let s of n){let c=r.area[s];if(c!=null)for(let l of c.features){o[l.properties.id]=l;let p=new zi(t,{floorId:s,mvfData:l});e[l.properties.id]=p,l.properties.externalId&&(i[l.properties.externalId]==null&&(i[l.properties.externalId]=[]),i[l.properties.externalId].push(p))}}return{areasById:e,areasByExternalId:i,mvfAreasById:o}},J3=(r,t)=>{var v,C,w,P,T,E,A,k,N;let e={},i={},o={},n={},s=((C=(v=r.enterprise)==null?void 0:v.locations)!=null?C:[]).reduce((F,V)=>(F[V.id]=V,F),{}),c={},l={},p={},h={},m={},y={},g=((w=r.enterprise)==null?void 0:w.venue)||{},S={};for(let F of(T=(P=r.enterprise)==null?void 0:P.categories)!=null?T:[]){let V=new Eu(t,{mvfData:F});c[F.id]=V,F.externalId&&(l[F.externalId]==null&&(l[F.externalId]=[]),l[F.externalId].push(V)),p[F.id]=F,F.locations.forEach(R=>{m[R]==null&&(m[R]=[]),m[R].push(F.id)})}let M={};for(let F of(A=(E=r.enterprise)==null?void 0:E.locationInstances)!=null?A:[]){let V=s[F.parent],R=Object.keys(V),q={};for(let pe of R)q[pe]=void 0;let $={...q,polygons:[],nodes:[],...F};M[$.parent]==null&&(M[$.parent]=[]),M[$.parent].push(new ai(t,{mvfData:$,categoryIds:m[$.id],parentId:F.parent})),S[$.id]=F}for(let F of(N=(k=r.enterprise)==null?void 0:k.locations)!=null?N:[]){let V=new ai(t,{mvfData:F,categoryIds:m[F.id],locationInstances:M[F.id]});o[F.id]=V,F.externalId&&(n[F.externalId]==null&&(n[F.externalId]=[]),n[F.externalId].push(V)),F.nodes.forEach(R=>{y[R.id]==null&&(y[R.id]=[]),y[R.id].push(F.id)});for(let R of F.polygons)h[R.id]==null&&(h[R.id]=[]),h[R.id].push(F)}if(t.enterpriseMode===!0){for(let F in t.mvfConnectionsById){let V={},R=t.mvfConnectionsById[F];for(let q of t.mvfConnectionsById[F].nodes){let $=t.nodesById[q];$!=null&&(V[$.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[$.coordinate.longitude,$.coordinate.latitude]},properties:{id:F,externalId:R.externalId,kind:"enterprise."+R.type,destinationNodes:[],flags:"",type:R.type,nodes:R.nodes,accessible:R.accessible}})}Object.keys(V).length>0&&(e[F]=new jo(t,{mvfDataByFloorId:V}),R.externalId&&(i[R.externalId]==null&&(i[R.externalId]=[]),i[R.externalId].push(e[F])))}t.connectionsById=e}return{connectionsByExternalId:i,locationIdsByNodeId:y,mvfLocationsBySpaceId:h,mvfLocationsById:s,mvfCategoriesById:p,locationsById:o,locationsByExternalId:n,locationInstancesById:S,categoriesById:c,categoriesByExternalId:l,venue:g}},Q3=(r,t)=>{let{spacesById:e,spacesByExternalId:i,spaceIdsByDestinationNodeId:o,poisById:n,poisByExternalId:s,mvfSpacesById:c,objectEntranceNodeIdsByObstructionId:l,connectionsById:p,connectionIdsByLatLon:h,mvfSpacesByFloorId:m,mvfPoisByFloorId:y}=Y8(r,t),{nodesById:g,nodesByExternalId:S,mvfNodesById:M,mvfNodesByFloorId:v}=Z8(r,t),{objectsById:C,objectsByExternalId:w,mvfObstructionById:P,obstructionIdByEntranceId:T}=z8(r,t),{floorsById:E,floorsByExternalId:A,mvfFloorsById:k}=q8(r,t),{floorStacksById:N,floorStacksByExternalId:F,mvfFloorStacksById:V,facadesById:R,facadesBySpaceId:q}=$8(r,t),{mvfConnectionsById:$,mvfConnectionsByNodeId:pe}=J8(r),{doorsById:ve,doorsByExternalId:Be,doorsByNodeId:Pt,mvfEntrancesById:de,mvfEntrancesByFloorId:Oe}=Q8(r,t),{annotationsById:be,mvfAnnotationsById:et,mvfAnnotationsByFloorId:Ut}=t9(r,t),{areasById:Ze,areasByExternalId:tt,mvfAreasById:Yr}=r9(r,t);return e9(r,c,P),K8(r,c,P),{spacesById:e,spacesByExternalId:i,nodesById:g,nodesByExternalId:S,objectsById:C,objectsByExternalId:w,floorsById:E,floorsByExternalId:A,floorStacksById:N,floorStacksByExternalId:F,facadesById:R,facadesBySpaceId:q,connectionsById:p,doorsById:ve,doorsByExternalId:Be,doorsByNodeId:Pt,poisById:n,poisByExternalId:s,annotationsById:be,areasById:Ze,areasByExternalId:tt,spaceIdsByDestinationNodeId:o,objectEntranceNodeIdsByObstructionId:l,obstructionIdByEntranceId:T,connectionIdsByLatLon:h,mvfSpacesById:c,mvfNodesById:M,mvfObstructionById:P,mvfFloorsById:k,mvfFloorStacksById:V,mvfConnectionsById:$,mvfConnectionsByNodeId:pe,mvfEntrancesById:de,mvfAnnotationsById:et,mvfNodesByFloorId:v,mvfSpacesByFloorId:m,mvfPoisByFloorId:y,mvfAreasById:Yr,mvfEntrancesByFloorId:Oe,mvfAnnotationsByFloorId:Ut}};f();var i9=new Set(["polygons"]),or,xe,vt,Ks,Qs=class Qs extends rt{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",Qs.__type);u(this,"description");u(this,"name","");u(this,"amenity");u(this,"externalId","");u(this,"extra");u(this,"gallery");u(this,"instances");u(this,"logo");u(this,"operationHours");u(this,"phone");u(this,"picture");u(this,"shortName");u(this,"showFloatingLabelWhenImagePresent");u(this,"showLogo");u(this,"siblingGroups");u(this,"social");u(this,"sortOrder",-1);u(this,"states");u(this,"tags");u(this,"type","");b(this,or,void 0);b(this,xe,{});b(this,vt,void 0);b(this,Ks,void 0);I(this,or,e),I(this,vt,i.mvfData),I(this,Ks,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let o in i.mvfData)!i9.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{enumerable:!0,get(){if(i.parentId){let n=a(this,or).locationsById[i.parentId];return a(this,vt)[o]!=null?a(this,or).getPropTranslation(this.__type,o,a(this,vt).id,a(this,vt)[o]):a(this,or).getPropTranslation(this.__type,o,a(this,vt).id,n[o])}return a(this,or).getPropTranslation(this.__type,o,a(this,vt).id,a(this,vt)[o])}})}static is(e){return e.__type===Qs.__type}get focusTarget(){return this.spaces}get categories(){return a(this,xe).categories?a(this,xe).categories:(a(this,xe).categories=(a(this,Ks).map(e=>a(this,or).getById("enterprise-category",e))||[]).filter(Boolean),a(this,xe).categories)}get coordinates(){if(a(this,xe).coordinates)return a(this,xe).coordinates;a(this,xe).coordinates=[];for(let e=0;e<this.nodes.length;e++)a(this,xe).coordinates.push(this.nodes[e].coordinate);return a(this,xe).coordinates}get nodes(){if(a(this,xe).nodes)return a(this,xe).nodes;a(this,xe).nodes=[];for(let e=0;e<a(this,vt).nodes.length;e++){let i=a(this,or).getById("node",a(this,vt).nodes[e].id);i&&a(this,xe).nodes.push(i)}return a(this,xe).nodes}get spaces(){if(a(this,xe).spaces)return a(this,xe).spaces;a(this,xe).spaces=[];for(let e=0;e<a(this,vt).polygons.length;e++){let i=a(this,or).getById("space",a(this,vt).polygons[e].id);i&&a(this,xe).spaces.push(i)}return a(this,xe).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,xe)))delete a(this,xe)[e]}};or=new WeakMap,xe=new WeakMap,vt=new WeakMap,Ks=new WeakMap,u(Qs,"__type","enterprise-location");var zm=Qs,ai=zm;f();var o9=new Set,Zo,nt,Or,el=class el extends rt{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",el.__type);u(this,"name","");u(this,"color");u(this,"externalId","");u(this,"extra");u(this,"icon");u(this,"iconFromDefaultList");u(this,"sortOrder",-1);b(this,Zo,void 0);b(this,nt,{});b(this,Or,void 0);I(this,Zo,e),I(this,Or,i.mvfData);for(let o in i.mvfData)!o9.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&Object.defineProperty(this,o,{get(){return a(this,Zo).getPropTranslation(this.__type,o,a(this,Or).id,a(this,Or)[o])}})}static is(e){return e.__type===el.__type}get children(){if(a(this,nt).children)return a(this,nt).children;a(this,nt).children=[];for(let e=0;e<a(this,Or).children.length;e++){let i=a(this,Zo).getById("enterprise-category",a(this,Or).children[e]);i&&a(this,nt).children.push(i)}return a(this,nt).children}get locations(){if(a(this,nt).locations)return a(this,nt).locations;a(this,nt).locations=[];for(let e=0;e<a(this,Or).locations.length;e++){let i=a(this,Zo).getById("enterprise-location",a(this,Or).locations[e]);i&&a(this,nt).locations.push(i)}return a(this,nt).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,nt)))delete a(this,nt)[e]}};Zo=new WeakMap,nt=new WeakMap,Or=new WeakMap,u(el,"__type","enterprise-category");var qm=el,Eu=qm;f();var n9=new Set,rl,il,tl=class tl extends rt{constructor(e,i){super(i.mvfData.externalId);u(this,"__type",tl.__type);u(this,"countrycode");u(this,"externalId","");u(this,"defaultLanguage",{code:"en",name:"English"});u(this,"defaultMap");u(this,"extra");u(this,"icon");u(this,"languages",[]);u(this,"links",[]);u(this,"logo");u(this,"mappedinWebUrl");u(this,"slug","");u(this,"topLocations");u(this,"tzid");b(this,rl,{});b(this,il,void 0);I(this,il,i.mvfData);for(let o in i.mvfData)!n9.has(o)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),o)&&(this[o]=i.mvfData[o])}static is(e){return e.__type===tl.__type}get name(){var e;return(e=a(this,il).name)!=null?e:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let e of Object.keys(a(this,rl)))delete a(this,rl)[e]}};rl=new WeakMap,il=new WeakMap,u(tl,"__type","enterprise-venue");var $m=tl,Jm=$m;f();function Qm(r){var e,i,o,n,s;let t=((i=(e=r.enterprise)==null?void 0:e.locations)==null?void 0:i.reduce((c,l)=>(c[l.id]=l,c),{}))||{};for(let c of((o=r.enterprise)==null?void 0:o.locationInstances)||[])t[c.id]=c;return{type:"downloaded",data:r,optimized:{locations:t,categories:(s=(n=r.enterprise)==null?void 0:n.categories)==null?void 0:s.reduce((c,l)=>(c[l.id]=l,c),{})}}}f();f();f();f();f();f();f();var zo=class{constructor({origin:t,destination:e,distance:i=0,angle:o=0,pathWeight:n=0}){u(this,"origin");u(this,"destination");u(this,"distance");u(this,"angle");u(this,"weight");this.origin=t,this.destination=e,this.distance=i,this.angle=o;let s=n||0;if(this.weight=s>=0?this.distance+s:0,isNaN(this.angle))throw new Error("nan angle")}};f();f();f();function ci(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=Rt(r),o=Gn(t),n=o.type,s=t.bbox,c=o.coordinates;if(s&&a9(i,s)===!1)return!1;n==="Polygon"&&(c=[c]);for(var l=!1,p=0;p<c.length&&!l;p++)if(K3(i,c[p][0],e.ignoreBoundary)){for(var h=!1,m=1;m<c[p].length&&!h;)K3(i,c[p][m],!e.ignoreBoundary)&&(h=!0),m++;h||(l=!0)}return l}function K3(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var o=0,n=t.length-1;o<t.length;n=o++){var s=t[o][0],c=t[o][1],l=t[n][0],p=t[n][1],h=r[1]*(s-l)+c*(l-r[0])+p*(r[0]-s)===0&&(s-r[0])*(l-r[0])<=0&&(c-r[1])*(p-r[1])<=0;if(h)return!e;var m=c>r[1]!=p>r[1]&&r[0]<(l-s)*(r[1]-c)/(p-c)+s;m&&(i=!i)}return i}function a9(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}f();f();function pi([r,t],[e,i]){let o=t-i,n=r-e;return(Math.atan2(n,o)+Math.PI*3)%(Math.PI*2)}f();var s9=63710088e-1;function nr(r,t){let[e,i]=r.map(h=>h*Math.PI/180),[o,n]=t.map(h=>h*Math.PI/180),s=n-i,c=o-e,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(i)*Math.cos(n)*Math.sin(c/2)*Math.sin(c/2),p=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return s9*p}f();f();function Du(r,t,e,i){let[o,n]=r,[s,c]=t,[l,p]=e,[h,m]=i;if(n===c&&o===s||p===m&&l===h)return null;let y=(h-l)*(c-n)-(m-p)*(s-o);if(y===0)return null;let g=((m-p)*(o-l)-(h-l)*(n-p))/y,S=((c-n)*(o-l)-(s-o)*(n-p))/y;if(g<0||g>1||S<0||S>1)return null;let M=n+g*(c-n);return[o+g*(s-o),M]}f();function Km(r,t,e,i){let o=Oo(r,e/1e3,i),n=Oo(t,e/1e3,i);return[o.geometry.coordinates,n.geometry.coordinates]}f();function ey(r){let t=r*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}function e4(r,t,e=[],i=0){let o=!0,n=r.geometry.coordinates,s=t.geometry.coordinates,c=ey(pi(n,s)-Math.PI/2),l=ey(pi(n,s)+Math.PI/2);return e.forEach(p=>{if(i>0){let h=Km(n,s,i,c),m=Km(n,s,i,l);if(Du(h[0],h[1],p[0],p[1])||Du(m[0],m[1],p[0],p[1])){o=!1;return}}else if(Du(n,s,p[0],p[1])){o=!1;return}}),o}var qo,ol,ty,Lu,t4,Au,r4,Fu,i4,_u,o4,ku,n4,Bu,a4,Ru,Ou=class{constructor({nodes:t,groupBy:e}){b(this,ol);b(this,Lu);b(this,Au);b(this,Fu);b(this,_u);b(this,ku);b(this,Bu);u(this,"edges",{});u(this,"nodesById");u(this,"nodesByGroup",new Map);b(this,qo,void 0);b(this,Ru,(t,e)=>{let i=0;for(let o of e)(!o[a(this,qo)]||o[a(this,qo)]===t.properties[a(this,qo)])&&ci(t.geometry.coordinates,o.geometry.geometry)&&(i+=Math.max(0,o.cost));return i});I(this,qo,e);let{features:i}=t;this.nodesById=j(this,Lu,t4).call(this,i),j(this,Au,r4).call(this),j(this,Fu,i4).call(this,i,e)}getShortestEuclideanDistance(t,e){return e.reduce((i,o)=>{let n=nr(t.geometry.coordinates,o.geometry.coordinates);return Math.min(i,n)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:i,zones:o}){let n=j(this,ol,ty).call(this,t),s=j(this,ol,ty).call(this,e);if(n.length===0||s.length===0)return[];let{frontier:c,cameFrom:l,costSoFar:p}=j(this,_u,o4).call(this,n,s);for(;c.length>0;){let h=c.shift();if(!h)break;if(j(this,ku,n4).call(this,h.origin,s))return j(this,Bu,a4).call(this,l,h.origin.properties.id);for(let m of this.edges[h.origin.properties.id]){let y=p[h.origin.properties.id]+m.weight+a(this,Ru).call(this,m.destination,o);if(!(y===1/0||i!=null&&i.has(m.destination.properties.id))&&(p[m.destination.properties.id]==null||y<p[m.destination.properties.id])){let g=y+this.getShortestEuclideanDistance(m.destination,s);p[m.destination.properties.id]=y,l[m.destination.properties.id]=m,c.push({origin:m.destination,priority:g})}}c.sort((m,y)=>m.priority-y.priority)}return[]}};qo=new WeakMap,ol=new WeakSet,ty=function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},Lu=new WeakSet,t4=function(t){return t.reduce((e,i)=>(e[i.properties.id]=i,e),{})},Au=new WeakSet,r4=function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:e})=>!!this.nodesById[e]))},Fu=new WeakSet,i4=function(t,e){t.forEach(i=>{let o=e==="default"?e:i.properties[e];this.nodesByGroup.has(o)||this.nodesByGroup.set(o,[]),this.nodesByGroup.get(o).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:n,weight:s})=>{let c=this.nodesById[n],l=nr(i.geometry.coordinates,c.geometry.coordinates),p=pi(i.geometry.coordinates,c.geometry.coordinates);return new zo({origin:i,destination:c,pathWeight:s,distance:l,angle:p})})})},_u=new WeakSet,o4=function(t,e){let i=[],o={},n={};return t.forEach(s=>{let c=this.getShortestEuclideanDistance(s,e);i.push({origin:s,priority:c}),o[s.properties.id]=null,n[s.properties.id]=0}),i.sort((s,c)=>s.priority-c.priority),{frontier:i,cameFrom:o,costSoFar:n}},ku=new WeakSet,n4=function(t,e){return e.some(i=>i.properties.id===t.properties.id)},Bu=new WeakSet,a4=function(t,e){let i=[],o=t[e];for(;o;)i.push(o),o=t[o.origin.properties.id];return i.reverse()},Ru=new WeakMap;var l9=.4,sa=class{constructor({nodes:t,geojsonCollection:e,groupBy:i="default"}){u(this,"groupBy");u(this,"graph");u(this,"geometryEdgesByMapId",new Map);u(this,"generatePath",t=>{let{destination:e}=t[t.length-1],i={type:"FeatureCollection",features:[]};for(let n=0;n<t.length;n++){let{origin:s}=t[n],c={id:s.properties.id,angle:t[n].angle,distance:t[n].distance};this.groupBy!=="default"&&(c.groupBy=s.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[s.geometry.coordinates[0],s.geometry.coordinates[1]]},properties:c})}let o={id:e.properties.id};return this.groupBy!=="default"&&(o.groupBy=e.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:o}),i});u(this,"getDistance",(t,e)=>nr(t,e));u(this,"getAngle",(t,e)=>pi(t,e));this.groupBy=i,this.graph=new Ou({nodes:t,groupBy:this.groupBy}),((e==null?void 0:e.features)||[]).forEach(n=>{let s=null;if(n.geometry.type==="LineString"?s=n.geometry.coordinates:n.geometry.type==="Polygon"&&(s=n.geometry.coordinates.flat()),s){let c=this.groupBy==="default"?this.groupBy:n.properties[this.groupBy];this.geometryEdgesByMapId.has(c)||this.geometryEdgesByMapId.set(c,[]),s.forEach((l,p)=>{this.geometryEdgesByMapId.get(c).push([l,s[p+1]||s[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:i,excludedNodeIds:o,simplify:n}){var p,h;let s=(p=n==null?void 0:n.enabled)!=null?p:!0,c=t!=null?t:[],l=this.graph.aStar({originIds:e,destinationNodeIds:i,zones:c,excludedNodeIds:new Set(o)});return l.length===0?{type:"FeatureCollection",features:[]}:(s&&(l=this.simplifyAllSteps(l,(h=n==null?void 0:n.bufferRadius)!=null?h:l9)),this.generatePath(l))}simplifyAllSteps(t,e){var l,p;let i=[],o=[t[0]];for(let h=1;h<t.length;h++)if(this.groupBy!=="default"&&t[h].origin.properties[this.groupBy]!==t[h-1].origin.properties[this.groupBy]){let m=t[h-1].origin.properties[this.groupBy],y=(l=this.geometryEdgesByMapId.get(m))!=null?l:[];i.push(...this.simplifySteps(o,y,e)),o=[t[h]]}else o.push(t[h]);let n=t[t.length-1],s=this.groupBy==="default"?this.groupBy:n.origin.properties[this.groupBy],c=(p=this.geometryEdgesByMapId.get(s))!=null?p:[];return i.push(...this.simplifySteps(o,c,e)),i}simplifySteps(t,e,i){if(t.length<3)return t;let o=[t[0]],n=1;for(let s=n+2;s<t.length;s++)if(!e4(t[n].origin,t[s].origin,e,i)){let c=s-1;o.push(new zo({...t[n],destination:t[c].origin,distance:nr(t[n].origin.geometry.coordinates,t[c].origin.geometry.coordinates),angle:pi(t[n].origin.geometry.coordinates,t[c].origin.geometry.coordinates)})),n=c}return o.push(new zo({...t[n],destination:t[t.length-1].origin,distance:nr(t[n].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:pi(t[n].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates)}),t[t.length-1]),o}};f();function Lr(r){return[r.longitude,r.latitude]}function c9(r){return new Map(r.map(t=>{let{properties:e}=t,{id:i}=e;return[i,t]}))}var ry=(r,t)=>{let e=c9(t),i={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let o of r){let n=[o.geometry.coordinates],s=(o.properties.entrances||[]).reduce((c,l)=>(e.has(l)&&c.push(e.get(l)),c),[]);if(s.length){let{entrances:c,obstructions:l}=Om(o,s);n=l.map(p=>p.geometry.coordinates),i.entrances.features.push(...c)}i.walls.geometry.coordinates.push(...n)}return i};function s4(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}function l4(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),e}function Nu(r,t){var i,o;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function iy(r,t){var i,o;let e={};return t==null||(r.color&&(e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function oy(r,t){var i,o;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(e.texture=r.texture.url),((o=r.topTexture)==null?void 0:o.url)!==void 0&&(e.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(e.hoverColor=r.hoverColor),r.interactive!==void 0&&(e.interactive=r.interactive),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}function c4(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function p4(r,t){let e="Left";return r<=-Math.PI/4?e="Right":r<=-t?e="SlightRight":r<=t?e="Straight":r<=Math.PI/4?e="SlightLeft":e="Left",e}function u4(r){let t={};for(let e in r){let i=r[e];if(i!=null){if(i.id=e,"polygons"in i)for(let o of i.polygons)t[o]=i;else if("lineStrings"in i)for(let o of i.lineStrings)t[o]=i;else if("points"in i)for(let o of i.points)t[o]=i}}return t}function ny(r,t){return r.reduce((e,i)=>{let o=t[i.properties.id];return o==null||(e.has(o)||e.set(o,[]),e.get(o).push(i)),e},new Map)}function nl(r,t={}){var o,n,s,c,l,p;let e={...r},i=(n=(o=t==null?void 0:t.style)==null?void 0:o.shading)!=null?n:t==null?void 0:t.shadingAndOutlines;if(i===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(e.shading={start:i.start,end:i.end,intensity:i.intensity}),e.outline=(c=(s=t==null?void 0:t.style)==null?void 0:s.outlines)!=null?c:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let h=(p=(l=t==null?void 0:t.style)==null?void 0:l.wallTopColor)!=null?p:t==null?void 0:t.wallTopColor;h!=null&&(e.topColor=h)}return e}var d4=(r,t)=>{var o;let i=((o=t.currentMap)==null?void 0:o.currentFloor).layers.get(Se);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(Ji);case"exterior-walls":return i==null?void 0:i.layers.get(wr);case"interior-doors":return i==null?void 0:i.layers.get(ta);case"exterior-doors":return i==null?void 0:i.layers.get(ra);default:return typeof r=="string"?r:r.id}};function ay(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}function h4(r){return r.bbox?r.bbox:sp(r)}function f4(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1]),Math.max(r[2],t[2]),Math.max(r[3],t[3])]}function m4(r){return[...new Set(r)]}var y4=Math.PI*.1,at,st,Ot,ui,$o,Uu,g4,ro,la,Xu,v4,ju=class{constructor(t,e){b(this,Uu);b(this,ro);b(this,Xu);b(this,at,{});b(this,st,void 0);b(this,Ot,void 0);b(this,ui,void 0);b(this,$o,void 0);I(this,st,e),I(this,Ot,t.features),I(this,st,e),I(this,Ot,t.features)}get path(){return a(this,Ot).map(t=>a(this,st).getById("node",t.properties.id)).filter(Boolean)}get coordinates(){return a(this,at).coordinates?a(this,at).coordinates:(a(this,at).coordinates=a(this,Ot).map(t=>new Q(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),a(this,at).coordinates)}get distance(){return a(this,at).distance?a(this,at).distance:(a(this,at).distance=a(this,Ot).reduce((t,e)=>t+(e.properties.distance||0),0),a(this,at).distance)}get instructions(){if(a(this,Ot).length<2)return[];if(a(this,at).instructions)return a(this,at).instructions;let t=[],e=0;for(let i=0;i<a(this,Ot).length;i++){let o=a(this,Ot)[i],n=a(this,Ot)[i-1],s=a(this,Ot)[i+1],c=new Q(o.geometry.coordinates[1],o.geometry.coordinates[0],o.properties.groupBy),l=j(this,Uu,g4).call(this,{prevDirection:n,direction:o,nextDirection:s});e+=(n==null?void 0:n.properties.distance)||0;for(let p of l)p&&(t.push({action:p,distance:e,coordinate:c,node:a(this,st).getById("node",o.properties.id)}),e=0)}return a(this,at).instructions=t,a(this,at).instructions}};at=new WeakMap,st=new WeakMap,Ot=new WeakMap,ui=new WeakMap,$o=new WeakMap,Uu=new WeakSet,g4=function(t){var y,g,S;let{prevDirection:e,direction:i,nextDirection:o}=t,n=e&&a(this,st).getById("floor",e.properties.groupBy),s=a(this,st).getById("floor",i.properties.groupBy),c=o&&a(this,st).getById("floor",o.properties.groupBy),l=[];e||l.push({type:"Departure"});let p=a(this,st).getMVFFeatureByNodeId("connection",i.properties.id),h=a(this,st).getMVFFeatureByNodeId("connection",(y=o==null?void 0:o.properties.id)!=null?y:""),m=p?a(this,st).getById("connection",p.id):void 0;if(p)if(!a(this,ui)||a(this,ui)==="exit")l.push(j(this,ro,la).call(this,"TakeConnection",s,c,m,p)),I(this,ui,"take"),I(this,$o,m);else{let M=a(this,st).getMVFFeatureByNodeId("connection",(g=e==null?void 0:e.properties.id)!=null?g:""),v=a(this,st).getById("connection",(S=M==null?void 0:M.id)!=null?S:"");l.push(j(this,ro,la).call(this,"ExitConnection",s,n,v,M)),I(this,ui,"exit"),I(this,$o,m)}else h&&a(this,ui)==="take"?(l.push(j(this,ro,la).call(this,"ExitConnection",s,n,a(this,$o))),I(this,ui,"exit"),I(this,$o,m)):c&&s.id!==c.id?l.push(j(this,ro,la).call(this,"TakeConnection",s,c,m)):n&&n.id!==s.id?l.push(j(this,ro,la).call(this,"ExitConnection",s,n,m)):l.push(j(this,Xu,v4).call(this,e,i));return o||l.push({type:"Arrival"}),l},ro=new WeakSet,la=function(t,e,i,o,n){var l,p;let s="none";if(e.elevation!=null&&(i==null?void 0:i.elevation)!=null){let h=e.elevation-i.elevation;h>0?s="down":h<0&&(s="up")}let c=(p=(l=o==null?void 0:o.type)!=null?l:n==null?void 0:n.type)!=null?p:"stairs";return{type:t,fromFloor:e,toFloor:i,direction:s,connection:o,connectionType:c}},Xu=new WeakSet,v4=function(t,e){let i=t?-c4(t.properties.angle,e.properties.angle):0;return Math.abs(i)>=y4?{type:"Turn",bearing:p4(i,y4),referencePosition:"At"}:null};var Hu=class{constructor({nodes:t,geojsonCollection:e,connections:i,groupBy:o}){u(this,"navigator");u(this,"connections");u(this,"getDirections",(t,e,i,o)=>{let{accessible:n,smoothing:{enabled:s,radius:c}}=i,l=t.flatMap(g=>this.getNodesFromTarget(g,o)),p=e.flatMap(g=>this.getNodesFromTarget(g,o)),h=this.getExcludedNodeIds(n,i.excludedConnections).filter(g=>!l.includes(g)&&!p.includes(g)),m=this.navigator.getDirections({zones:i.zones.map(g=>{var S;return{geometry:g.geometry,cost:g.cost,map:(S=g.floor)==null?void 0:S.id}}),originIds:l,destinationNodeIds:p,excludedNodeIds:h,simplify:{enabled:s,bufferRadius:c}});this.addCoordinateDirections(m,t,e);let y=new ju(m,o);if(!(y.distance===0&&new Set([...l,...p]).size===l.length+p.length))return y});u(this,"getExcludedNodeIds",(t,e)=>{if(!t&&e.length===0)return[];let i=new Set(e.map(o=>o.id));return this.connections.reduce((o,n)=>n.accessible&&!i.has(n.id)?o:o.concat(n.nodes),[])});u(this,"addCoordinateDirections",(t,[e],[i])=>{if(t.features.length){if(Q.is(e)){let o=this.createDirectionFeature(e,this.navigator.getAngle([e.longitude,e.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([e.longitude,e.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,o)}if(Q.is(i)){let o=this.createDirectionFeature(i,0,0),n=t.features[t.features.length-1];n.properties.distance=this.navigator.getDistance(n.geometry.coordinates,[i.longitude,i.latitude]),n.properties.angle=this.navigator.getAngle(n.geometry.coordinates,[i.longitude,i.latitude]),t.features.push(o)}}});u(this,"getNodesFromTarget",(t,e)=>{var i,o,n,s;if(Q.is(t)){let c=e.Query.nearest(t,{types:["node"]});return(i=c==null?void 0:c[0])!=null&&i.feature.id?[c[0].feature.id]:[]}else if($i.is(t)){let c=e.Query.nearest(t,{types:["node"]});return(o=c==null?void 0:c[0])!=null&&o.feature.id?[c[0].feature.id]:[]}else if(Tr.is(t)){let c=e.Query.nearest(t,{types:["node"]});return(n=c==null?void 0:c[0])!=null&&n.feature.id?[c[0].feature.id]:[]}else if(zi.is(t)){let c=e==null?void 0:e.getMVFFeatureById("area",t.id);return(s=c==null?void 0:c.properties.destinationNodes)!=null?s:[]}else if(Fe.is(t)){let c=e==null?void 0:e.getMVFFeatureById("space",t.id);return c==null?[]:c.properties.destinationNodes}else{if(jo.is(t))return t.coordinates.reduce((c,l)=>{var h;let p=e.Query.nearest(l,{types:["node"]});return(h=p==null?void 0:p[0])!=null&&h.feature.id&&c.push(p[0].feature.id),c},[]);if(Qt.is(t)){let c=e==null?void 0:e.objectEntranceNodeIdsByObstructionId[t.id];return c!=null?c:[]}else return Kt.is(t)?t.spaces.flatMap(c=>{var l,p;return(p=(l=e==null?void 0:e.getMVFFeatureById("space",c.id))==null?void 0:l.properties.destinationNodes)!=null?p:[]}).filter(c=>typeof c=="string"):ai.is(t)?t.nodes.map(c=>c.id):Zi.is(t)?[t.id]:[]}});u(this,"createDirectionFeature",(t,e,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:i}}));this.navigator=new sa({nodes:t,geojsonCollection:this.createCollection(e),groupBy:o}),this.connections=i}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[i,o])=>e.concat(o.features.map(n=>(n.properties.map=i,n))),[])}}};f();f();f();f();f();f();function b4(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return C4(this.cover(t,e),t,e,r)}function C4(r,t,e,i){if(isNaN(t)||isNaN(e))return r;var o,n=r._root,s={data:i},c=r._x0,l=r._y0,p=r._x1,h=r._y1,m,y,g,S,M,v,C,w;if(!n)return r._root=s,r;for(;n.length;)if((M=t>=(m=(c+p)/2))?c=m:p=m,(v=e>=(y=(l+h)/2))?l=y:h=y,o=n,!(n=n[C=v<<1|M]))return o[C]=s,r;if(g=+r._x.call(null,n.data),S=+r._y.call(null,n.data),t===g&&e===S)return s.next=n,o?o[C]=s:r._root=s,r;do o=o?o[C]=new Array(4):r._root=new Array(4),(M=t>=(m=(c+p)/2))?c=m:p=m,(v=e>=(y=(l+h)/2))?l=y:h=y;while((C=v<<1|M)===(w=(S>=y)<<1|g>=m));return o[w]=n,o[C]=s,r}function S4(r){var t,e,i=r.length,o,n,s=new Array(i),c=new Array(i),l=1/0,p=1/0,h=-1/0,m=-1/0;for(e=0;e<i;++e)isNaN(o=+this._x.call(null,t=r[e]))||isNaN(n=+this._y.call(null,t))||(s[e]=o,c[e]=n,o<l&&(l=o),o>h&&(h=o),n<p&&(p=n),n>m&&(m=n));if(l>h||p>m)return this;for(this.cover(l,p).cover(h,m),e=0;e<i;++e)C4(this,s[e],c[e],r[e]);return this}f();function x4(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,i=this._y0,o=this._x1,n=this._y1;if(isNaN(e))o=(e=Math.floor(r))+1,n=(i=Math.floor(t))+1;else{for(var s=o-e||1,c=this._root,l,p;e>r||r>=o||i>t||t>=n;)switch(p=(t<i)<<1|r<e,l=new Array(4),l[p]=c,c=l,s*=2,p){case 0:o=e+s,n=i+s;break;case 1:e=o-s,n=i+s;break;case 2:o=e+s,i=n-s;break;case 3:e=o-s,i=n-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=i,this._x1=o,this._y1=n,this}f();function I4(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}f();function M4(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}f();f();function Ue(r,t,e,i,o){this.node=r,this.x0=t,this.y0=e,this.x1=i,this.y1=o}function P4(r,t,e){var i,o=this._x0,n=this._y0,s,c,l,p,h=this._x1,m=this._y1,y=[],g=this._root,S,M;for(g&&y.push(new Ue(g,o,n,h,m)),e==null?e=1/0:(o=r-e,n=t-e,h=r+e,m=t+e,e*=e);S=y.pop();)if(!(!(g=S.node)||(s=S.x0)>h||(c=S.y0)>m||(l=S.x1)<o||(p=S.y1)<n))if(g.length){var v=(s+l)/2,C=(c+p)/2;y.push(new Ue(g[3],v,C,l,p),new Ue(g[2],s,C,v,p),new Ue(g[1],v,c,l,C),new Ue(g[0],s,c,v,C)),(M=(t>=C)<<1|r>=v)&&(S=y[y.length-1],y[y.length-1]=y[y.length-1-M],y[y.length-1-M]=S)}else{var w=r-+this._x.call(null,g.data),P=t-+this._y.call(null,g.data),T=w*w+P*P;if(T<e){var E=Math.sqrt(e=T);o=r-E,n=t-E,h=r+E,m=t+E,i=g.data}}return i}f();function T4(r){if(isNaN(h=+this._x.call(null,r))||isNaN(m=+this._y.call(null,r)))return this;var t,e=this._root,i,o,n,s=this._x0,c=this._y0,l=this._x1,p=this._y1,h,m,y,g,S,M,v,C;if(!e)return this;if(e.length)for(;;){if((S=h>=(y=(s+l)/2))?s=y:l=y,(M=m>=(g=(c+p)/2))?c=g:p=g,t=e,!(e=e[v=M<<1|S]))return this;if(!e.length)break;(t[v+1&3]||t[v+2&3]||t[v+3&3])&&(i=t,C=v)}for(;e.data!==r;)if(o=e,!(e=e.next))return this;return(n=e.next)&&delete e.next,o?(n?o.next=n:delete o.next,this):t?(n?t[v]=n:delete t[v],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[C]=e:this._root=e),this):(this._root=n,this)}function w4(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}f();function E4(){return this._root}f();function D4(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}f();function O4(r){var t=[],e,i=this._root,o,n,s,c,l;for(i&&t.push(new Ue(i,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(i=e.node,n=e.x0,s=e.y0,c=e.x1,l=e.y1)&&i.length){var p=(n+c)/2,h=(s+l)/2;(o=i[3])&&t.push(new Ue(o,p,h,c,l)),(o=i[2])&&t.push(new Ue(o,n,h,p,l)),(o=i[1])&&t.push(new Ue(o,p,s,c,h)),(o=i[0])&&t.push(new Ue(o,n,s,p,h))}return this}f();function L4(r){var t=[],e=[],i;for(this._root&&t.push(new Ue(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var o=i.node;if(o.length){var n,s=i.x0,c=i.y0,l=i.x1,p=i.y1,h=(s+l)/2,m=(c+p)/2;(n=o[0])&&t.push(new Ue(n,s,c,h,m)),(n=o[1])&&t.push(new Ue(n,h,c,l,m)),(n=o[2])&&t.push(new Ue(n,s,m,h,p)),(n=o[3])&&t.push(new Ue(n,h,m,l,p))}e.push(i)}for(;i=e.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}f();function A4(r){return r[0]}function F4(r){return arguments.length?(this._x=r,this):this._x}f();function _4(r){return r[1]}function k4(r){return arguments.length?(this._y=r,this):this._y}function al(r,t,e){var i=new sy(t==null?A4:t,e==null?_4:e,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}function sy(r,t,e,i,o,n){this._x=r,this._y=t,this._x0=e,this._y0=i,this._x1=o,this._y1=n,this._root=void 0}function B4(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}var lt=al.prototype=sy.prototype;lt.copy=function(){var r=new sy(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,i;if(!t)return r;if(!t.length)return r._root=B4(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var o=0;o<4;++o)(i=t.source[o])&&(i.length?e.push({source:i,target:t.target[o]=new Array(4)}):t.target[o]=B4(i));return r};lt.add=b4;lt.addAll=S4;lt.cover=x4;lt.data=I4;lt.extent=M4;lt.find=P4;lt.remove=T4;lt.removeAll=w4;lt.root=E4;lt.size=D4;lt.visit=O4;lt.visitAfter=L4;lt.x=F4;lt.y=k4;var Lt,io,Wu=class{constructor(t){b(this,Lt,{});b(this,io,void 0);I(this,io,t)}getTreeByType(t,e,i){if(a(this,Lt)[t]||(a(this,Lt)[t]={}),a(this,Lt)[t][e]&&a(this,Lt)[t][e][i])return a(this,Lt)[t][e][i];a(this,Lt)[t][e]||(a(this,Lt)[t][e]={}),a(this,Lt)[t][e][i]||(a(this,Lt)[t][e][i]=al());let o=a(this,Lt)[t][e][i];o.x(s=>s.geometry.coordinates[1]),o.y(s=>s.geometry.coordinates[0]);let n=[];switch(t){case"node":n=a(this,io).mvfNodesByFloorId[i]||[];break;case"point-of-interest":n=a(this,io).mvfPoisByFloorId[i]||[];break;case"door":n=a(this,io).mvfEntrancesByFloorId[i]||[];break;case"annotation":n=a(this,io).mvfAnnotationsByFloorId[i]||[];break}return(n==null?void 0:n.length)>0&&o.addAll(n),o}};Lt=new WeakMap,io=new WeakMap;var p9=B.object({limit:B.enum(["same-floor","same-elevation"]).optional(),radius:B.number().optional(),types:B.array(B.enum(["node","point-of-interest"])).min(1)}),Ar,ll,sl=class{constructor(t){b(this,Ar,void 0);b(this,ll,void 0);I(this,Ar,t),I(this,ll,new Wu(a(this,Ar)))}nearest(t,e){try{p9.parse(e)}catch(s){O.error(s);return}let i=ni(t);if(!i)return;let o=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let s of a(this,Ar).getByType("floor-stack")){let c=s.defaultFloor;c&&o.push(c.id)}else if(e.limit==="same-elevation"){let s=a(this,Ar).floorsById[i.floorId];if(s){let c=s==null?void 0:s.elevation;c&&(o=a(this,Ar).getByType("floor-stack").map(l=>{var p;return(p=l.floors.find(h=>h.elevation===c))==null?void 0:p.id}).filter(Boolean))}}let n=[];for(let s of m4(e.types))for(let c of o){let l=a(this,ll).getTreeByType(s,a(this,Ar).mapName,c).find(i.latitude,i.longitude,e.radius);if(l){let p=a(this,Ar).getById(s,l==null?void 0:l.properties.id);p&&n.push({distance:nr([i.longitude,i.latitude],l.geometry.coordinates),feature:p})}}return n.sort((s,c)=>s.distance-c.distance)}};Ar=new WeakMap,ll=new WeakMap;var W,ca,pa=class extends Z{constructor(e,i){var c,l,p,h;super();u(this,"Analytics");b(this,W,{});u(this,"Query");u(this,"mvf");u(this,"outdoorViewToken");u(this,"spaceIdsByDestinationNodeId");u(this,"objectEntranceNodeIdsByObstructionId");u(this,"obstructionIdByEntranceId");u(this,"venue");u(this,"sasToken");u(this,"directions");u(this,"enterpriseMode",!1);u(this,"nodesById");u(this,"spacesById");u(this,"floorsById");u(this,"floorStacksById");u(this,"facadesById");u(this,"facadesBySpaceId");u(this,"connectionsById");u(this,"objectsById");u(this,"doorsById");u(this,"pointsOfInterestById");u(this,"annotationsById");u(this,"areasById");u(this,"locationsById");u(this,"categoriesById");u(this,"doorsByNodeId");u(this,"mvfLocationsBySpaceId");u(this,"locationIdsByNodeId");u(this,"mvfAnnotationsById");u(this,"mvfConnectionsById");u(this,"mvfConnectionsByNodeId");u(this,"mvfEntrancesById");u(this,"mvfNodesById");u(this,"mvfObstructionById");u(this,"mvfSpacesById");u(this,"mvfFloorsById");u(this,"mvfFloorStacksById");u(this,"mvfAreasById");u(this,"spacesByExternalId");u(this,"nodesByExternalId");u(this,"objectsByExternalId");u(this,"poisByExternalId");u(this,"floorsByExternalId");u(this,"floorStacksByExternalId");u(this,"doorsByExternalId");u(this,"areasByExternalId");u(this,"connectionsByExternalId");u(this,"locationsByExternalId");u(this,"categoriesByExternalId");u(this,"mvfNodesByFloorId");u(this,"mvfSpacesByFloorId");u(this,"mvfPoisByFloorId");u(this,"mvfEntrancesByFloorId");u(this,"mvfAnnotationsByFloorId");u(this,"localePacksUrls");u(this,"currentLanguage");u(this,"languagePacks",{});u(this,"binaryBundle");u(this,"envControl");b(this,ca,void 0);u(this,"getDirectionsMultiDestination",(e,i,o)=>this.getDirections(e,i,{...o,multiDestination:!0}));u(this,"getDirections",(e,i,o)=>{let{accessible:n=!1,smoothing:s=!0,multiDestination:c=!1}=o||{},l=typeof s=="object"?s.enabled:s,p=typeof s=="object"?s.radius:void 0,h=(o==null?void 0:o.zones)||[],m={accessible:n,zones:h,smoothing:{enabled:l!=null?l:!0,radius:p!=null?p:.75},excludedConnections:(o==null?void 0:o.excludedConnections)||[]};if(c&&Array.isArray(i)){let y=Array.isArray(e)?e:[e],g=[];for(let S of i){let M=Array.isArray(S)?S:[S],v=this.directions.getDirections(y,M,m,this);if(!v){O.error("getDirections failed due to missing directions for one of the segments");return}y=M,g.push(v)}return g}else{let y=Array.isArray(e)?e:[e],g=Array.isArray(i)?i:[i];if(Array.isArray(g[0])){O.error("getDirections does not support multi-destination without multisegment option");return}return y[0].id&&g[0].id&&this.Analytics.sendGetDirectionsEvent(y[0].id,g[0].id),this.directions.getDirections(y,g,m,this)}});let o=(c=i==null?void 0:i.env)!=null?c:Do();this.envControl=o,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new Rn,this.localePacksUrls=(l=i==null?void 0:i.localePacksUrls)!=null?l:{},this.mvf=e,this.outdoorViewToken=i==null?void 0:i.outdoorViewToken,this.enterpriseMode=(p=i==null?void 0:i.enterprise)!=null?p:!1,this.sasToken=i==null?void 0:i.sasToken;let n=Q3(e,this);this.nodesById=n.nodesById,this.spacesById=n.spacesById,this.floorsById=n.floorsById,this.floorStacksById=n.floorStacksById,this.facadesById=n.facadesById,this.facadesBySpaceId=n.facadesBySpaceId,this.connectionsById=n.connectionsById,this.objectsById=n.objectsById,this.doorsById=n.doorsById,this.pointsOfInterestById=n.poisById,this.annotationsById=n.annotationsById,this.areasById=n.areasById,this.spacesByExternalId=n.spacesByExternalId,this.nodesByExternalId=n.nodesByExternalId,this.objectsByExternalId=n.objectsByExternalId,this.floorsByExternalId=n.floorsByExternalId,this.floorStacksByExternalId=n.floorStacksByExternalId,this.poisByExternalId=n.poisByExternalId,this.doorsByExternalId=n.doorsByExternalId,this.areasByExternalId=n.areasByExternalId,this.mvfAnnotationsById=n.mvfAnnotationsById,this.mvfConnectionsById=n.mvfConnectionsById,this.mvfConnectionsByNodeId=n.mvfConnectionsByNodeId,this.mvfEntrancesById=n.mvfEntrancesById,this.mvfNodesById=n.mvfNodesById,this.mvfObstructionById=n.mvfObstructionById,this.mvfSpacesById=n.mvfSpacesById,this.mvfFloorsById=n.mvfFloorsById,this.mvfFloorStacksById=n.mvfFloorStacksById,this.mvfNodesByFloorId=n.mvfNodesByFloorId,this.mvfSpacesByFloorId=n.mvfSpacesByFloorId,this.mvfPoisByFloorId=n.mvfPoisByFloorId,this.mvfEntrancesByFloorId=n.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=n.mvfAnnotationsByFloorId,this.mvfAreasById=n.mvfAreasById,this.doorsByNodeId=n.doorsByNodeId,this.spaceIdsByDestinationNodeId=n.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=n.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=n.obstructionIdByEntranceId;let s=J3(e,this);if(this.locationsById=s.locationsById,this.categoriesById=s.categoriesById,this.mvfLocationsBySpaceId=s.mvfLocationsBySpaceId,this.locationIdsByNodeId=s.locationIdsByNodeId,this.connectionsByExternalId=s.connectionsByExternalId,this.locationsByExternalId=s.locationsByExternalId,this.categoriesByExternalId=s.categoriesByExternalId,s.venue.name!=null){this.venue=new Jm(this,{mvfData:s.venue});let m={};for(let y in s.mvfLocationsById)m[y]=s.mvfLocationsById[y];for(let y in s.locationInstancesById)m[y]=s.locationInstancesById[y];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:m,categories:s.mvfCategoriesById}},(h=i==null?void 0:i.languagePacks)==null||h.forEach(({language:y,localePack:g})=>{this.languagePacks[y.code]=Qm(g)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new sl(this),this.directions=new Hu({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map"})}getEnv(){let e=this;return{get baseUri(){var i;return e.envControl.getBaseUri((i=e.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return new Q(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return a(this,W).spaces==null&&(a(this,W).spaces=globalThis.Object.values(this.spacesById)),a(this,W).spaces}get objects(){return a(this,W).objects==null&&(a(this,W).objects=globalThis.Object.values(this.objectsById)),a(this,W).objects}get connections(){return a(this,W).connections==null&&(a(this,W).connections=globalThis.Object.values(this.connectionsById)),a(this,W).connections}get floors(){return a(this,W).floors==null&&(a(this,W).floors=globalThis.Object.values(this.floorsById)),a(this,W).floors}get floorStacks(){return a(this,W).floorStacks==null&&(a(this,W).floorStacks=globalThis.Object.values(this.floorStacksById)),a(this,W).floorStacks}get facades(){return a(this,W).facades==null&&(a(this,W).facades=globalThis.Object.values(this.facadesById)),a(this,W).facades}get doors(){return a(this,W).doors==null&&(a(this,W).doors=globalThis.Object.values(this.doorsById)),a(this,W).doors}get pointsOfInterest(){return a(this,W).pointsOfInterest==null&&(a(this,W).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),a(this,W).pointsOfInterest}get annotations(){return a(this,W).annotations==null&&(a(this,W).annotations=globalThis.Object.values(this.annotationsById)),a(this,W).annotations}get areas(){return a(this,W).areas==null&&(a(this,W).areas=globalThis.Object.values(this.areasById)),a(this,W).areas}get nodes(){return a(this,W).nodes==null&&(a(this,W).nodes=globalThis.Object.values(this.nodesById)),a(this,W).nodes}get locations(){return a(this,W).locations==null&&(a(this,W).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return a(this,W).categories==null&&(a(this,W).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get mvfFloors(){return a(this,W).mvfFloors==null&&(a(this,W).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),a(this,W).mvfFloors}get mvfFloorStacks(){return a(this,W).mvfFloorStacks==null&&(a(this,W).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),a(this,W).mvfFloorStacks}getByType(e){switch(e){case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(e,i){switch(e){case"space":return this.spacesById[i];case"floor":return this.floorsById[i];case"floor-stack":return this.floorStacksById[i];case"facade":return this.facadesById[i];case"node":return this.nodesById[i];case"door":return this.doorsById[i];case"connection":return this.connectionsById[i];case"object":return this.objectsById[i];case"point-of-interest":return this.pointsOfInterestById[i];case"annotation":return this.annotationsById[i];case"area":return this.areasById[i];case"enterprise-location":return this.locationsById[i];case"enterprise-category":return this.categoriesById[i];default:return}}getByExternalId(e,i){var o,n,s,c,l,p,h,m,y,g,S;switch(e){case"space":return(o=this.spacesByExternalId[i])!=null?o:[];case"floor":return(n=this.floorsByExternalId[i])!=null?n:[];case"floor-stack":return(s=this.floorStacksByExternalId[i])!=null?s:[];case"node":return(c=this.nodesByExternalId[i])!=null?c:[];case"door":return(l=this.doorsByExternalId[i])!=null?l:[];case"connection":return(p=this.connectionsByExternalId[i])!=null?p:[];case"object":return(h=this.objectsByExternalId[i])!=null?h:[];case"point-of-interest":return(m=this.poisByExternalId[i])!=null?m:[];case"area":return(y=this.areasByExternalId[i])!=null?y:[];case"enterprise-location":return(g=this.locationsByExternalId[i])!=null?g:[];case"enterprise-category":return(S=this.categoriesByExternalId[i])!=null?S:[];default:return[]}}getMapDataById(e){var i,o,n,s,c,l,p,h,m,y;return(y=(m=(h=(p=(l=(c=(s=(n=(o=(i=this.spacesById[e])!=null?i:this.floorsById[e])!=null?o:this.floorStacksById[e])!=null?n:this.facadesById[e])!=null?s:this.nodesById[e])!=null?c:this.doorsById[e])!=null?l:this.connectionsById[e])!=null?p:this.objectsById[e])!=null?h:this.pointsOfInterestById[e])!=null?m:this.annotationsById[e])!=null?y:this.areasById[e]}getMVFFeatureById(e,i){switch(e){case"space":return this.mvfSpacesById[i];case"node":return this.mvfNodesById[i];case"obstruction":return this.mvfObstructionById[i];case"floor":return this.mvfFloorsById[i];case"floor-stack":return this.mvfFloorStacksById[i];case"connection":return this.mvfConnectionsById[i];case"entrance":return this.mvfEntrancesById[i];case"annotation":return this.mvfAnnotationsById[i];case"area":return this.mvfAreasById[i];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,i){switch(e){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,i,o,n){var p,h;if(!this.currentLanguage)return n;let{code:s}=this.currentLanguage,c=e==="enterprise-category"?"categories":e==="enterprise-location"?"locations":void 0;if(!c)return n;let l=(h=(p=this.languagePacks[s])==null?void 0:p.optimized)==null?void 0:h[c];if(l){let m=l[o];if(m!=null&&m[i]!==void 0)return m[i]}return n}async changeLanguage(e){var c;let i=e.toLowerCase();if(!i){O.error("language code must be defined");return}if(!this.currentLanguage){O.error("languageCode feature is not supported");return}let o=this.currentLanguage.code,n=(c=this.venue)==null?void 0:c.languages.find(({code:l})=>l.toLowerCase()===i.toLowerCase());if(!n){O.warn("language not found");return}if(o===n.code)return;let s=this.languagePacks[n.code];if(!s){let l=this.localePacksUrls[n.code];if(!l){O.error("locale packs url not found for ".concat(n.code));return}a(this,ca)&&a(this,ca).abort();let p=new AbortController;I(this,ca,p);let h;try{h=await F1(l,{signal:p.signal})}catch(m){O.error("failed downloading language pack",m);return}if(!h||p.signal.aborted)return;s=Qm(h),this.languagePacks[n.code]=s}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=n,this.publish("language-change",this.currentLanguage)}getDistance(e,i){let o=ni(e),n=ni(i);return nr([o.longitude,o.latitude],[n.longitude,n.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var o;let i=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let c=await Bh(this.localePacksUrls[s.code],{signal:n.signal}),l=await Nn(c);l&&i.push({language:{code:s.code,name:s.name},localePack:l})}}catch(c){O.warn("failed downloading language pack",c)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var o;if(!this.binaryBundle){O.error("binary bundle not found");return}let i=[];if(e&&this.enterpriseMode){let n=new AbortController;for(let s of((o=this.venue)==null?void 0:o.languages)||[])try{if(this.localePacksUrls[s.code]){let c=await Bh(this.localePacksUrls[s.code],{signal:n.signal});c&&i.push({language:{code:s.code,name:s.name},localePack:c})}}catch(c){O.warn("failed downloading language pack",c)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(a(this,W)))a(this,W)[e]=null}};W=new WeakMap,ca=new WeakMap;f();f();f();f();f();f();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();f();f();var R4=!1;function N4(){R4=!0}function G4(){return R4}var Yu=class{constructor(t,e=2){u(this,"backgroundAlpha",1);u(this,"backgroundColor",new ze);u(this,"width",0);u(this,"height",0);u(this,"options",{});u(this,"renderer");var i,o;try{this.options=t;let n={canvas:t.canvas,alpha:t.alpha||!1,stencil:!1,antialias:typeof t.antialias=="boolean"?t.antialias:!0,outputColorSpace:Dn,powerPreference:"high-performance",preserveDrawingBuffer:!0};G4()?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new ze,autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),setRenderTarget:()=>{},setClearColor:()=>{},clear:()=>{},render:()=>{},domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=e===2?new fg(n):new mg(n),this.backgroundColor=new ze((i=t.backgroundColor)!=null?i:"#ffffff"),this.backgroundAlpha=(o=t.backgroundAlpha)!=null?o:1}catch(n){O.error(n),t.onWebGLRendererError&&t.onWebGLRendererError(n)}}destroy(){var t,e;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t))}render(t,e){this.renderer&&(this.renderer.state.reset(),e.layers.enable(0),e.layers.enable(1),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,e),this.renderer.state.reset())}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,e){x.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=e,this.renderer.setSize(t,e,!1))}setBackgroundColor(t,e){this.backgroundColor=t,this.backgroundAlpha=e}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};f();f();var V4='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>(J(n,typeof e!="symbol"?e+"":e,t),t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';f();f();f();f();f();function j4(r,t){return t.x+t.w<r.x+r.w&&t.x>r.x&&t.y>r.y&&t.y+t.h<r.y+r.h}f();function H4(r,t){let[e,i]=t;return e>=r.x&&e<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}f();function U4(r,t){let e=t.x,i=t.y,o=t.x+t.w,n=t.y+t.h,s=r.x,c=r.y,l=r.x+r.w,p=r.y+r.h;return e<l&&s<o&&i<p&&c<n}f();function di(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}f();var Ge=class{constructor(t,e,i,o,n){u(this,"x");u(this,"y");u(this,"w");u(this,"h");u(this,"userData");this.userData=typeof n>"u"?null:n,this.x=t,this.y=e,this.w=i,this.h=o}contains(t){return t===this?!1:j4(this,t)}intersects(t){return U4(this,t)}intersectsPoint(t){return H4(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};var Fr=class r{constructor(t,e){u(this,"topLeft");u(this,"topRight");u(this,"bottomLeft");u(this,"bottomRight");u(this,"divided",!1);u(this,"boundary");u(this,"capacity",16);u(this,"objects",[]);u(this,"parent");this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:i,h:o}=this.boundary;this.topLeft=new r(new Ge(t,e,i/2,o/2),this),this.topRight=new r(new Ge(t+i/2,e,i/2,o/2),this),this.bottomLeft=new r(new Ge(t,e+o/2,i/2,o/2),this),this.bottomRight=new r(new Ge(t+i/2,e+o/2,i/2,o/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(di(e,this.topLeft.queryRect(t)),di(e,this.topRight.queryRect(t)),di(e,this.bottomLeft.queryRect(t)),di(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(di(e,this.topLeft.queryPoint(t)),di(e,this.topRight.queryPoint(t)),di(e,this.bottomLeft.queryPoint(t)),di(e,this.bottomRight.queryPoint(t))),e}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(e=>e.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};f();function W4(r,t,e){let i,o,n,s=null,c=0;e||(e={});let l=function(){c=e.leading===!1?0:Date.now(),s=null,n=r.apply(i,o),s||(i=o=null)};return function(){let p=Date.now();!c&&e.leading===!1&&(c=p);let h=t-(p-c);return i=globalThis,o=arguments,h<=0||h>t?(s&&(clearTimeout(s),s=null),c=p,n=r.apply(i,o),s||(i=o=null)):!s&&e.trailing!==!1&&(s=setTimeout(l,h)),n}}var Jo=!1,u9=150,Zu=class extends Z{constructor(e,i,o=new Worker(URL.createObjectURL(new Blob([V4],{type:"text/javascript"})))){super();u(this,"worker");u(this,"debugContext");u(this,"debugCanvas");u(this,"collidersDirty",!0);u(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);u(this,"visibleCollidersQTree",new Fr(new Ge(0,0,0,0)));u(this,"interactiveCollidersQTree",new Fr(new Ge(0,0,0,0)));u(this,"coreState");u(this,"postMessage");u(this,"showCollisionBoxes",()=>{Jo=!0,this.debugCanvas.style.display="block"});u(this,"hideCollisionBoxes",()=>{Jo=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"});u(this,"currentMsgId","");u(this,"working",!1);u(this,"_postMessage",()=>{this.worker.postMessage(this.packedMessage)});u(this,"componentArray",[]);u(this,"update",(e,i,o="bottom-left",n=!0)=>{let s=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let l of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(l);p&&(c=p.components[0],this.componentArray.push(c))}this.resize(e,i,o),this.collidersDirty=!1,s=!0}else s=this.componentArray.some(c=>c.collisionDirty===!0);s&&this.componentArray.sort((c,l)=>l.rank-c.rank);for(let c=0;c<this.componentArray.length;c++)if(this.packedMessage){let l=this.componentArray[c].toPackedMessage(!n&&!s);this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=l.bboxes,this.packedMessage[0][c][1]=l.enabled&&this.componentArray[c].visible?1:0,this.packedMessage[0][c][2]=l.rank===5?1:0,this.packedMessage[0][c][3]=l.x,this.packedMessage[0][c][4]=l.y,this.packedMessage[0][c][5]=l.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=l.lockedToStrategyIndex}this.working||this.postMessage()});u(this,"resolve",e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let i=e.data.colliders,o=-1,n,s,c;Jo&&(this.visibleCollidersQTree=new Fr(new Ge(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Fr(new Ge(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let l=0;l<this.componentArray.length;l++){let p=this.componentArray[l];i[l]!=null&&(o=i[l][0],n=i[l][2],p.offscreen=i[l][1]===1,o!==-1&&n!=null?(c=new Ge(n.x,n.y,n.w,n.h,{entityId:p.id}),Jo&&this.visibleCollidersQTree.insert(c),s=this.coreState.geometry2DMap.get(p.id),(s==null?void 0:s.components[1])!=null&&this.interactiveCollidersQTree.insert(new Ge(n.x,n.y,n.w,n.h,{entityId:p.id})),(p.canShow===!1||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="show"),o!==-1&&o!==p.currentStrategyIndex&&(p.activeBoundingBox=c,p.onStrategySelected(o))):((p.canShow===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),o!==-1&&o!==p.currentStrategyIndex&&p.onStrategySelected(o)))}Jo&&this.drawDebug(),this.publish("visibility-changed")});u(this,"drawDebug",()=>{Jo&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))});u(this,"destroy",()=>{this.worker.terminate()});this.coreState=i,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker=o,this.worker.onmessage=n=>this.resolve(n),this.postMessage=W4(this._postMessage,u9,!1),Jo?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(e,i,o){this.packedMessage[6]=o,this.packedMessage[5]=i,this.packedMessage[4]=e,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};f();f();f();f();var zu=class{constructor(t){u(this,"type");u(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}},qu=class{constructor(){u(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};f();function Z4(r){let t=new Set;for(let e of r){let i=e.object;for(;i.parent&&!t.has(i.parent);)i=i.parent,i instanceof Ee&&i.type==="group-container"&&i.visible&&i.components[1]&&t.add(i)}return Array.from(t)}function z4(r,t){if(r==null||t==null)return r===t;if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}var ua,cl=class extends Z{constructor(e,i,o,n,s){super();u(this,"raycaster",new Sr);u(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,containerOffset:[0,0],interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});u(this,"coreState");u(this,"camera");u(this,"cameraPlane");u(this,"_quadtree",new Fr(new Ge(0,0,0,0)));u(this,"_container");u(this,"lastPointerEvent");u(this,"cursor","grab");u(this,"touchesCount",0);u(this,"isUserInteracting");u(this,"hasTouched",!1);b(this,ua,void 0);u(this,"onPointerMoveRaf",e=>{this.lastPointerEvent=e,a(this,ua)&&cancelAnimationFrame(a(this,ua)),I(this,ua,requestAnimationFrame(()=>{this.onPointerMove(e)}))});u(this,"onPointerMove",e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()});u(this,"tapsControl",new qu);u(this,"onPointerDown",e=>{e.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:e.timeStamp,clientX:e.clientX,clientY:e.clientY},this.lastPointerEvent=e,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),e.pointerType==="touch"&&(this.tapsControl.add(new zu(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))});u(this,"clickTimeout");u(this,"onPointerUp",e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:i}=this.state.interaction;!i||this.state.interaction.distanceFromMouseDown==null||(Date.now()<i.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())});u(this,"dirty3D",!0);u(this,"cachedHitBoxes",{entities:[],groups:[]});u(this,"ndcPoint",new J);u(this,"debugPanel");u(this,"resize",()=>{let{top:e,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[e,i]});this.isUserInteracting=s,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=o,this._container=e,this.coreState=i,this.cameraPlane=n,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive"),this.resize()}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let i=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:o,entity2D:n,position:s,groupContainers:c}=this.intersect(i);(this.detect3DEntityHover(o)||this.detect2DEntityHover(n)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=o,this.state.lastHover=o,this.state.hovered2DEntity=n,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:s,groupContainers:c})),this.handleCursor()}handleCursor(){let e=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,o=this.state.interaction.isPanning,n=f9(e,o,i);this.cursor!==n&&(this.cursor=n,n==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let i=this.intersect(e);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let e;for(let i of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(i),((e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path")&&e.components[2]?e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh):(e==null?void 0:e.type)==="group-container"&&e.components[1]&&!this.cachedHitBoxes.groups.includes(e)&&this.cachedHitBoxes.groups.push(e);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var S,M;let i=[e.offsetX,e.offsetY],o=this._quadtree.queryPoint(i),[n]=o.filter(v=>v.intersectsPoint(i)),s=this.state.containerOffset[0],c=this.state.containerOffset[1];this.ndcPoint.x=(e.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-s)/this._container.clientHeight)*2+1,this.raycaster.setFromCamera(this.ndcPoint,this.camera),this.raycaster.layers.enable(0);let[l]=this.getMouseRayIntersects(),p=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(v=>v.object.visible),[h]=p,m=(S=h==null?void 0:h.instanceId)!=null?S:h==null?void 0:h.batchId,y=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(v=>v.object.visible),g;return y!=null&&y.length>0&&(g=Z4(y)),{entity2D:((M=n==null?void 0:n.userData)==null?void 0:M.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(n==null?void 0:n.userData.entityId),entity3D:m!=null?this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entities[m]):this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entityId),position:Array.isArray(y)&&(y==null?void 0:y.length)>0?y[0].point:l==null?void 0:l.point,groupContainers:g}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&$4(this.state.lastHover,!1,this.coreState),e&&$4(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!z4(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.cameraPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",i=>{var o,n,s;this.queueDebugMessage("CLICK \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var o,n,s;this.queueDebugMessage("HOVER \n3D: ".concat((o=i.entity3D)==null?void 0:o.id," \n2D: ").concat((n=i.entity2D)==null?void 0:n.id," \nPos: ").concat((s=i.position)==null?void 0:s.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,i){var n;let o=document.createElement("pre");o.style.maxWidth="300px",o.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",o.style.backgroundColor=i,o.textContent=e,(n=this.debugPanel)==null||n.prepend(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>{o.remove()},500)},2500)}getCursor(){return this.cursor}};ua=new WeakMap;function $4(r,t,e){var s;let i=r.components[2];i&&i.hover!==!0&&(i.hover=t?"user-interaction":!1,i.dirty=!0);let o=(s=r.components[0].textMesh)==null?void 0:s.userData.entityId;if(!o)return;let n=e.geometry3DMap.get(o);(n==null?void 0:n.type)==="text3d"&&(n.components[1].hoverByPolygon=t,n.components[1].dirty=!0)}function f9(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}f();f();var Ko,_r,$u,Ju,J4,ul,Qu,Ku,Q4,ed,K4,dl,td,hl,fl,rd,pl=class{constructor(t){b(this,Ju);b(this,Ku);b(this,ed);b(this,Ko,null);b(this,_r,void 0);u(this,"getCurrentSceneGLTF",async t=>{let e={onlyVisible:!0,binary:!0,light:!0,scale:1,...t},i=await j(this,Ju,J4).call(this),o=a(this,$u).call(this,e),n=await i.parseAsync(o,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),s;if(n instanceof ArrayBuffer)s=new Blob([n],{type:"application/octet-stream"});else{let c=JSON.stringify(n,null,2);s=new Blob([c],{type:"text/plain"})}return s});b(this,$u,t=>{let{scale:e,light:i,onlyVisible:o}=t,n=new An,s=new zr().setFromObject(a(this,_r).entityScene);if(a(this,ul).call(this,a(this,_r).entityScene,n,o),i){let c=new hp(16777215,.3*Math.PI);c.position.set(0,Math.max(s.max.x,s.max.y)*e*.5,s.max.y*e*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),n.add(c)}return n});b(this,ul,(t,e,i)=>{t.material&&(t instanceof up?j(this,Ku,Q4).call(this,t).forEach(o=>e.add(o)):t instanceof Ch&&e.add(j(this,ed,K4).call(this,t))),t.children.forEach(o=>{(!i||o.visible)&&a(this,ul).call(this,o,e,i)})});b(this,Qu,(t,e,i)=>{let o=new Cg({color:new ze(t),metalness:0});return o.opacity=e,o.transparent=i,o});b(this,dl,t=>{let{geometry:e,material:i,position:o,rotation:n,quaternion:s,scale:c}=t;if(!(e!=null&&e.isBufferGeometry))return t;let l=e.attributes.position,p=e.attributes.normal,h=e.attributes.uv;return a(this,td).call(this,l,p),a(this,fl).call(this,o,c,n,s),h&&a(this,rd).call(this,h),i!=null&&i.map&&e.type==="PlaneGeometry"&&(t.side=To),t});b(this,td,(t,e)=>{let i=new z,o=new z;for(let n=0;n<t.count;n++)i.fromBufferAttribute(t,n),a(this,hl).call(this,i),t.setXYZ(n,i.x,i.y,i.z),e&&(o.fromBufferAttribute(e,n),a(this,hl).call(this,o),e.setXYZ(n,o.x,o.y,o.z))});b(this,hl,t=>{let e=t.y;t.y=t.z,t.z=-e});b(this,fl,(t,e,i,o)=>{let n=t.y;t.y=t.z,t.z=-n;let s=e.y;if(e.y=e.z,e.z=s,i instanceof Ln)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let c=o.y;o.set(o.x,o.z,-c,o.w)}});b(this,rd,t=>{for(let e=0;e<t.count;e++){let i=t.getX(e),o=t.getY(e);t.setXY(e,i,o)}});I(this,_r,t),a(this,_r).entityScene=t.entityScene,a(this,_r).geometry3DMap=t.geometry3DMap}destroy(){I(this,Ko,null)}};Ko=new WeakMap,_r=new WeakMap,$u=new WeakMap,Ju=new WeakSet,J4=async function(){if(!a(this,Ko)){let{GLTFExporter:t}=await import("./GLTFExporter-Y7BSZVBH.js");I(this,Ko,new t)}return a(this,Ko)},ul=new WeakMap,Qu=new WeakMap,Ku=new WeakSet,Q4=function(t){var s,c;let e=[],o=((s=t.userData)!=null&&s.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(l=>a(this,_r).geometry3DMap.get(l)),n=new Map;return o.forEach(l=>{var g;if(!l||!(l instanceof Ie))return;let p=l.components[1],h=l.components[2];if(!p.visible||p instanceof Wt&&p.opacity===0||p instanceof gp)return;let m=h!=null&&h.hover?p.hoverColor||a(this,_r).hoverColor:p.color,y="".concat(m,"-").concat(p.opacity,"-").concat(Number(p.visible));n.has(y)||n.set(y,[]),(g=n.get(y))==null||g.push(l)}),n.forEach((l,p)=>{let[h,m,y]=p.split("-"),g=l.reduce((C,w)=>{if(w.type==="custom-geometry")return C;let P=w.components[0];return"geometry"in P&&P.geometry instanceof ug&&C.push(P.geometry),C},[]),S=a(this,Qu).call(this,h,Number(m),t.material.transparent),M=Ri(g,!0),v=new me(M,S);v.position.copy(t.position),v.rotation.copy(t.rotation),v.scale.copy(t.scale),v.visible=!!y,a(this,fl).call(this,v.position,v.scale,v.rotation,v.quaternion),e.push(a(this,dl).call(this,v))}),e},ed=new WeakSet,K4=function(t){let e=t.geometry.clone(),i=t.material,o=new Xt({color:i.color,side:To});o.opacity=i.opacity,o.transparent=i.transparent;let n=new Ch(e,o);return n.position.copy(t.position),n.rotation.copy(t.rotation),n.scale.copy(t.scale),n.visible=t.visible,a(this,dl).call(this,n)},dl=new WeakMap,td=new WeakMap,hl=new WeakMap,fl=new WeakMap,rd=new WeakMap;f();f();f();f();var ml={top:0,bottom:0,left:0,right:0,type:"pixel"};f();f();var m9="gray",y9=.1;function e5(r,t,e){let{color:i=m9,opacity:o=1,altitude:n=0,height:s=y9}=e||{};Array.isArray(o)&&(o=1);let c={min:{x:1/0,y:1/0,z:n},max:{x:-1/0,y:-1/0,z:s+n},center:{x:0,y:0,z:(s+n)/2}},l=new br,p=r.geometry.coordinates[0].map(g=>{let S=t(g[1],g[0]);return c.min.x=Math.min(c.min.x,S.x),c.min.y=Math.min(c.min.y,S.y),c.max.x=Math.max(c.max.x,S.x),c.max.y=Math.max(c.max.y,S.y),S});l.moveTo(p[0].x,p[0].y),p.slice(1).forEach(g=>l.lineTo(g.x,g.y)),l.lineTo(p[0].x,p[0].y);let h=r.geometry.coordinates.slice(1);l.holes=h.map(g=>{let S=g.map(v=>t(v[1],v[0])),M=new Li;return M.moveTo(S[0].x,S[0].y),S.slice(1).forEach(v=>M.lineTo(v.x,v.y)),M.lineTo(S[0].x,S[0].y),M});let m={bevelEnabled:!1,depth:s},y=new Cr(l,m);return y.translate(0,0,n||0),y.userData={style:{color:i,opacity:o}},y}f();var g9="gray",v9=.1;function t5(r,t,e){let{color:i=g9,opacity:o=1,altitude:n=0,height:s=v9}=e||{};Array.isArray(o)&&(o=1);let c={min:{x:1/0,y:1/0,z:n},max:{x:-1/0,y:-1/0,z:s+n}},l={bevelEnabled:!1,depth:s},p=[];r.geometry.coordinates.forEach(m=>{let y=new br,g=m[0].map(v=>{let C=t(v[1],v[0]);return c.min.x=Math.min(c.min.x,C.x),c.min.y=Math.min(c.min.y,C.y),c.max.x=Math.max(c.max.x,C.x),c.max.y=Math.max(c.max.y,C.y),C});y.moveTo(g[0].x,g[0].y),g.slice(1).forEach(v=>y.lineTo(v.x,v.y)),y.lineTo(g[0].x,g[0].y);let S=m.slice(1);y.holes=S.map(v=>{let C=v.map(P=>t(P[1],P[0])),w=new Li;return w.moveTo(C[0].x,C[0].y),C.slice(1).forEach(P=>w.lineTo(P.x,P.y)),w.lineTo(C[0].x,C[0].y),w});let M=new Cr(y,l);p.push(M)});let h=Ri(p);return h.translate(0,0,n||0),h.userData={style:{color:i,opacity:o}},h}f();f();var dy=rp(u5());function d5(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}d5.prototype=Error.prototype;dy.default.Error=function(r){throw new d5(r)};var bt=dy.default;var uM="gray",hy=new bt.ClipperOffset,pt=100;function h5(r,t,e){let{color:i=uM,opacity:o=1,width:n=1,join:s="round",cap:c="round",height:l=.01,altitude:p=0}=e||{};Array.isArray(o)&&(o=0);let h=[];for(let M=0;M<r.geometry.coordinates.length-1;M++){let v=t(r.geometry.coordinates[M][1],r.geometry.coordinates[M][0]),C=t(r.geometry.coordinates[M+1][1],r.geometry.coordinates[M+1][0]);h.push([v,C])}hy.AddPaths(h.map(M=>M.map(v=>({X:v.x*pt,Y:v.y*pt}))),s==="round"?bt.JoinType.jsRound:s==="miter"?bt.JoinType.jsMiter:bt.JoinType.jsSquare,c==="round"?bt.EndType.etOpenRound:c==="butt"?bt.EndType.etOpenButt:bt.EndType.etOpenSquare);let m=new bt.PolyTree;hy.Execute(m,n/2*pt);let y=[],g={bevelEnabled:!1,depth:l};for(let M of m.m_AllPolys){let v=new br;if(M.IsHole())continue;let C=M.m_polygon;v.moveTo(C[0].X/pt,C[0].Y/pt),C.slice(1).forEach(w=>v.lineTo(w.X/pt,w.Y/pt)),v.lineTo(C[0].X/pt,C[0].Y/pt),v.holes=M.m_Childs.map(w=>{let P=new Li,T=w.m_polygon;return P.moveTo(T[0].X/pt,T[0].Y/pt),T.slice(1).forEach(E=>P.lineTo(E.X/pt,E.Y/pt)),P.lineTo(T[0].X/pt,T[0].Y/pt),P}),y.push(new Cr(v,g))}let S=Ri(y);return S.translate(0,0,p||0),S.userData={style:{color:i,opacity:o}},hy.Clear(),S}f();var ut=100,dM=.22,hM=.01;function f5(r,t,e={}){let{width:i=dM,height:o=hM,color:n="gray",opacity:s=1,altitude:c=0}=e,l={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+o}},p={bevelEnabled:!1,depth:o},h=new bt.ClipperOffset,m=r.geometry.coordinates.map(M=>M.map(v=>t(v[1],v[0])));h.AddPaths(m.map(M=>M.map(v=>({X:v.x*ut,Y:v.y*ut}))),bt.JoinType.jsMiter,bt.EndType.etOpenRound);let y=new bt.PolyTree;h.Execute(y,i/2*ut);let g=[];for(let M of y.m_AllPolys){let v=new br;if(M.IsHole())continue;l.min.x=Math.min(l.min.x,M.m_polygon[0].X),l.min.y=Math.min(l.min.y,M.m_polygon[0].Y),l.max.x=Math.max(l.max.x,M.m_polygon[0].X),l.max.y=Math.max(l.max.y,M.m_polygon[0].Y);let C=M.m_polygon;v.moveTo(C[0].X/ut,C[0].Y/ut),C.slice(1).forEach(w=>v.lineTo(w.X/ut,w.Y/ut)),v.lineTo(C[0].X/ut,C[0].Y/ut),v.holes=M.m_Childs.map(w=>{let P=new Li,T=w.m_polygon;return P.moveTo(T[0].X/ut,T[0].Y/ut),T.slice(1).forEach(E=>P.lineTo(E.X/ut,E.Y/ut)),P.lineTo(T[0].X/ut,T[0].Y/ut),P}),g.push(new Cr(v,p))}let S=Ri(g);return S.translate(0,0,c||0),S.userData={style:{color:n,opacity:s}},h.Clear(),S}f();f();var fa=B.object({type:B.enum(["Point"]),coordinates:B.array(B.number()).length(2)});var fM=B.object({rotation:B.array(B.number()).length(3).optional(),altitude:B.number().optional(),scale:B.array(B.number()).length(3).optional(),interactive:B.boolean().optional(),id:B.union([B.number(),B.string()]).optional()}),mM=B.object({type:B.enum(["Feature"]),geometry:fa,properties:fM}),yM=B.object({type:B.enum(["FeatureCollection"]),features:B.array(mM)}),gM=B.object({url:B.string(),color:B.string().optional(),opacity:B.number().optional()});function m5(r,t,e){B.union([B.number(),B.string()]).parse(r),yM.parse(t),gM.parse(e)}var vl,bl,ao=class{constructor(t){u(this,"mesh");u(this,"type","model");u(this,"outline");u(this,"geometry");u(this,"material");u(this,"feature");u(this,"instanceIndex",-1);u(this,"visible",!0);u(this,"color",new ze);u(this,"position",new z);b(this,vl,0);b(this,bl,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return a(this,vl)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,vl,t))}get opacity(){return a(this,bl)}set opacity(t){var e,i;if(this.mesh){for(let o of this.mesh.children)if(o instanceof pp){((e=o.userData)==null?void 0:e.originalOpacity)===void 0&&(o.userData.originalOpacity=o.material.opacity);let n=ki(t,0,(i=o.userData)==null?void 0:i.originalOpacity,0,1);o.material.opacity=n,o.material.transparent=n<1,o.material.needsUpdate=!0}}I(this,bl,t)}};vl=new WeakMap,bl=new WeakMap;function vM(r){let{color:t,opacity:e,topColor:i,texture:o,topTexture:n}=r;return"".concat(t).concat(e).concat(i||"").concat(o||"").concat(n||"")}var bM=1e4,sd=class extends Z{constructor(e,i){super();u(this,"state");u(this,"convertTo3DMapPosition");u(this,"loader");this.state=e,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return;let{GLTFLoader:e}=await import("./GLTFLoader-K67N4RFF.js");this.loader=new e}createEntityFromFeature(e,i,o){let n=new Tt(i),s=new Ie(n,new Wt(o));return s.id=e,s}createModelFromFeature(e,i,o){let n=new ao(i),s=new Ie(n,new Wt(o));return s.id=e,s}populateEntityMesh(e,i){let o=e.components[0];o.geometry=i,o.currentHeight=e.components[1].height,o.dirty=!1}async populateModelGroup(e,i,o){let n=new On,s=new Ln,c=new cg,l=new z,p=new _i;return this.loader||await this.getGLTFLoader(),this.loader.load(i,h=>{var g,S,M,v,C,w;h.scene.traverse(P=>{let T=P;if("isMesh"in T&&T.isMesh===!0){let E=new pp(T.geometry,T.material,e.size);E.userData={entities:{}},p.add(E),o.add(p)}});let m=0,y;for(let P of e.values()){if(y=this.state.geometry3DMap.get(P),!y||(y==null?void 0:y.type)!=="model")continue;let T=y.components[0],E=y.components[0].feature;T.mesh=p,T.instanceIndex=m;let{x:A,y:k,z:N}=this.convertTo3DMapPosition(E.geometry.coordinates[1],E.geometry.coordinates[0],0);T.position.set(A,k,N),s.set(((g=E.properties.rotation)==null?void 0:g[0])||0,((S=E.properties.rotation)==null?void 0:S[1])||0,((M=E.properties.rotation)==null?void 0:M[2])||0),l.set(((v=E.properties.scale)==null?void 0:v[0])||1,((C=E.properties.scale)==null?void 0:C[1])||1,((w=E.properties.scale)==null?void 0:w[2])||1),c.setFromEuler(s),n.compose(T.position,c,l),p.children.forEach(F=>{if(!y||(y==null?void 0:y.type)!=="model")return;let V=F;V.setMatrixAt(m,n),V.userData.entities[m]=y.id}),m++}this.publish("model-loaded")}),p}populateEntityGroup(e){let i,o,n,s;for(let c of e.values())s=this.state.geometry3DMap.get(c),s.components[0]instanceof Tt&&(o=s.components[0].feature,n=s.components[1],o.geometry.type==="Polygon"?(i=e5(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="MultiPolygon"?(i=t5(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="LineString"?(i=h5(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)):o.geometry.type==="MultiLineString"&&(i=f5(o,this.convertTo3DMapPosition,n),this.populateEntityMesh(s,i)));return e}optimize(e){var i;if(e.visible&&(e instanceof Yt||e instanceof Ee)){for(let s of e.children)this.optimize(s);if(e instanceof Ee||e.userData.dirty===!1)return;let o={};if(!e.userData.modelURL&&e.userData.dirty)try{this.populateEntityGroup(e.userData.entities3D)}catch(s){O.warn(s)}else e.userData.modelURL&&e.userData.dirty&&(this.populateModelGroup(e.userData.entities3D,e.userData.modelURL,e),e.userData.dirty=!1);let n=0;if(e.userData.dirty){let s=0,c;for(let l of e.userData.entities3D.values()){c=this.state.geometry3DMap.get(l);let p=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let h=c.components[1];s++,s>=bM&&(s=0,n++);let m=vM(h)+n;o[m]===void 0&&(o[m]={style:h,entities:[]}),o[m].entities.push(c)}else p&&"mesh"in p&&p.mesh&&((i=p.mesh)==null?void 0:i.parent)!==e&&e.add(p.mesh)}for(let l in o){let p=u1(o[l].entities,o[l].style);e.add(p),e.userData.outlineDirty=!0,e.userData.dirty=!1}for(let l of e.userData.entities3D.values())if(c=this.state.geometry3DMap.get(l),c!=null&&c.entities2D.size>0)for(let p of c.entities2D.values())p&&c.addEntity(p)}}}update(){this.optimize(this.state.entityScene)}};f();var ld=class{constructor(t,e){u(this,"state");u(this,"dirty",!0);u(this,"domTree");this.state=t,this.domTree=e}update(){if(this.dirty){let t;for(let e of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(e.userData.entityId),t){let i=t.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(e.userData.entityId))&&this.domTree.removeChild(e)}else this.domTree.removeChild(e);for(let e of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(e),t){let i=t.components[0];i instanceof Fi&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:t.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};f();var cd=class{constructor(t,e){u(this,"state");u(this,"project");this.state=t,this.project=e}update(){let t,e=0,i=0,o=!0,n,s;for(let c of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(c),t){let l=this.state.geometry3DMap.get(t.object3d.userData.parentEntityId);l instanceof Ie&&(n=l.components[1],n.dirty&&(e=n.height,i=n.opacity,o=n.visible,s=t.components[0],(i===0||o===!1)&&s.visible===!0?t.components[0].visible=!1:s.visible===!1&&(t.components[0].visible=!0),t.setAltitude(e))),this.project(t.components[0].projection,t.position)}}};f();f();var CM=function(){let t,e;return i=>{if((!e||!e)&&(t=document.createElement("canvas"),t.width=500*i,t.height=500*i,t.style.width="500px",t.style.height="500px",e=t.getContext("2d")),!e)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:e}}}(),y5=({text:r,size:t,maxWidth:e,pixelRatio:i,maxLines:o=2,lineHeight:n=1.2,options:s={strokeText:!0}})=>{let c="bold ".concat(t*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=CM(i);l.font=c;let p=[],h=r.split(" "),m=0,y=0,g=0;for(;y<h.length;){let C=h[y];if(m===o&&m>0){p[m-1]+="...";break}if(p[m]==null&&(p[m]=C,y++),h.length===1){p[m]=C;break}if(h[y]==null)break;let{width:w}=l.measureText(p[m]+" "+h[y]);w<=e*i?(p[m]+=" "+h[y],y++):m++}p.forEach(C=>{let{width:w}=l.measureText(C);g=Math.max(w,g)});let S=t*i*n,M=p.length*S;return{maxWidth:g,maxHeight:M,lines:p.length,draw:(C,w,P)=>{p.length===1?(s.strokeText&&C.strokeText(p[0],w,P),C.fillText(p[0],w,P)):(s.strokeText&&(C.strokeText(p[0],w,P-S/2),C.strokeText(p[1],w,P+S/2)),C.fillText(p[0],w,P-S/2),C.fillText(p[1],w,P+S/2))}}};f();function g5(r){let t=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}var SM=3.5,xM=2.5,IM=2,MM=5,Cl=2.5;var pd=class{constructor(t,e){u(this,"dirty",!1);u(this,"state");u(this,"colliderContext");u(this,"colliderCanvas");u(this,"pinCache",{});u(this,"imagePromiseCache",{});u(this,"imageDimensionsCache",{});u(this,"textCache",{});u(this,"update",(t,e,i)=>{let o=(t-e)/(i-e),n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let s,c,l,p,h,m;for(let y of this.state.geometry2DIdsInScene)if(m=this.state.geometry2DMap.get(y),m!=null&&(h=m.components[0],h instanceof Bi&&!m.disposed)){if(c=h.appearance.marker.foregroundColor,l=h.appearance.marker.backgroundColor,p=h.markerSize,s="".concat(c.active,"-").concat(c.inactive,"-").concat(l.active,"-").concat(l.inactive,"-").concat(p),this.pinCache[s]||this.prepare(h,s,this.colliderContext),h.appearance.marker.icon&&(!h.imageHash||h.dirty)&&this.cacheImage(h),this.textCache[h.id]==null||h.dirty||this.dirty){h.dirty=!1,h.collisionDirty=!0,this.textCache[h.id]={};let{textDrawFn:g,width:S,height:M}=this.processText(h.text,h.appearance.text.size,h.appearance.text.maxWidth,h.appearance.text.numLines,h.appearance.text.lineHeight);["left","center","right"].forEach(C=>{this.textCache[h.id][C]=this.textToCanvas(g,h.appearance.text.size,C,S,M,h.appearance.text.foregroundColor,h.appearance.text.backgroundColor)}),h.dimensions={width:Math.ceil(S/n),height:Math.ceil(M/n)},h.currentStrategyIndex===-1&&(h.currentStrategyIndex=0);let v=h.strategies[h.currentStrategyIndex];if(v){v.onStrategySelected(h);let C=h.style;h.style=h.newStyle,h.newStyle=C}}h.canShow&&h.visible&&(h.enabled||h.visibilityNeedsUpdate!==!1)&&(h.zoomProportion=o,this.draw(h,s,this.colliderContext))}this.dirty=!1});u(this,"processText",(t,e,i,o,n)=>{let s=this.state.pixelRatio,{draw:c,maxWidth:l,maxHeight:p}=y5({text:t,size:e,pixelRatio:s,maxWidth:i,maxLines:o,lineHeight:n});return{textDrawFn:c,width:l+Cl*s*2,height:p+Cl*s*2}});u(this,"textToCanvas",(t,e,i,o,n,s,c)=>{let l=this.state.pixelRatio,p,h=o,m=n;window.OffscreenCanvas!=null&&!Og()?p=new OffscreenCanvas(h,m):(p=document.createElement("canvas"),p.width=h,p.height=m,p.style.width=h+"px",p.style.height=m+"px");let y=p.getContext("2d",{willReadFrequently:!0});if(!y)return;y.textAlign=i,y.font="bold ".concat(e*l,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),y.textBaseline="middle",y.lineJoin="miter",y.miterLimit=2,y.strokeStyle="white",y.lineWidth=Cl*l,y.fillStyle=s,y.strokeStyle=c;let g=i==="left"?0:i==="center"?h/2:h-Cl*l/2;return t(y,g,(m+Cl*l/2)/2),p});u(this,"cacheImage",t=>{if(!t.appearance.marker.icon)return;let e=kg(t.appearance.marker.icon);if(t.imageHash=e,!this.imagePromiseCache[e]){let i=g5(t.appearance.marker.icon);i.onload=()=>{this.imagePromiseCache[e]=i}}});u(this,"createPinCanvas",(t,e,i,o)=>{let n,s=this.state.pixelRatio,c=t.totalMarkerSize*2*s;window.OffscreenCanvas!=null?n=new OffscreenCanvas(c,c):(n=document.createElement("canvas"),n.width=c,n.height=c,n.style.width=c/s+"px",n.style.height=c/s+"px");let l=n.getContext("2d");return l.shadowColor="rgba(0,0,0,0.3)",l.shadowOffsetY=IM*s,l.shadowBlur=MM*s,l.beginPath(),l.arc(c/2,c/2,e/2+xM*s/2,0,2*Math.PI),l.fillStyle=i,l.fill(),l.beginPath(),l.arc(c/2,c/2,e/2,0,2*Math.PI),l.shadowColor="transparent",l.fillStyle=o,l.fill(),n});u(this,"prepare",(t,e,i)=>{let o=this.state.pixelRatio;i.lineWidth=4*o;let n=this.createPinCanvas(t,t.markerSize,t.appearance.marker.backgroundColor.active,t.appearance.marker.foregroundColor.active),s=this.createPinCanvas(t,t.iconVisible?t.markerSize:SM*o,t.appearance.marker.backgroundColor.inactive,t.appearance.marker.foregroundColor.inactive);this.pinCache[e]=[n,s]});this.state=t,this.colliderCanvas=e,this.colliderContext=e.getContext("2d")}draw(t,e,i){if(!t.canShow||!t.visible)return;i.save(),i.globalAlpha=t.opacity;let o=this.state.pixelRatio,n=t.projection.x*o,s=t.projection.y*o,c=t.style.pinVisibility===1?this.pinCache[e][0]:this.pinCache[e][1];if(i.drawImage(c,n-t.totalMarkerSize*o,s-t.totalMarkerSize*o),t.appearance.marker.icon&&t.iconVisible&&t.imageHash&&t.appearance.marker.iconSize&&this.imagePromiseCache[t.imageHash]){let l=this.imagePromiseCache[t.imageHash],p=(t.appearance.marker.iconSize-t.appearance.marker.iconPadding)*o,h=t.appearance.marker.iconFit,m=p,y=p,g="".concat(t.imageHash,"_").concat(h);if(this.imageDimensionsCache[g])m=this.imageDimensionsCache[g].width,y=this.imageDimensionsCache[g].height;else{let S=l.width*o,M=l.height*o;if(h==="contain"){let v=Math.sqrt(S**2+M**2),C=p/v;m=S*C,y=M*C}if(h==="cover"){let v=p/S,C=p/M,w=Math.max(v,C);m=S*w,y=M*w}}i.save(),i.beginPath(),i.arc(n,s,p/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(l,n-m/2,s-y/2,m,y),i.restore()}t.style.textLabelVisible&&t.style.textAlign!=null&&t.style.left&&t.style.top&&i.drawImage(this.textCache[t.id][t.style.textAlign],n+t.style.left*o,s+t.style.top*o),i.restore()}};f();f();var on=class on{constructor(){u(this,"loader");this.loader=new Fn}static getInstance(){return on.instance||(on.instance=new on),on.instance}getLoader(){return this.loader}};u(on,"instance");var fy=on,ma=fy.getInstance();function TM(r,t){let e=r.components[2],i=r.components[1];return e!=null&&e.hover?[i.hoverColor||t,i.hoverColor||t]:[i.color,i.topColor||i.color]}var Sl,my,ud=class extends Z{constructor(e){super();b(this,Sl);u(this,"state");u(this,"textureLoadingCache",new Map);this.state=e}setShading(e,i){e.material&&e.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(e,i,o){i.texture!==e.texture&&i.texture!==""&&j(this,Sl,my).call(this,i.texture,e,"texture"),i.topTexture!==e.topTexture&&i.topTexture!==""&&j(this,Sl,my).call(this,i.topTexture,e,"topTexture"),(e.texture!=null||e.topTexture!=null)&&(o!=null&&o.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),i.texture===""&&e.removeSideTexture(),i.topTexture===""&&e.removeTopTexture())}update(){var s,c,l,p,h,m,y,g,S;let e,i,o,n;for(let M of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(M),n instanceof Yt&&n.type==="geometry-group"){if(i=n.components[0],n.userData.shadingDirty){let v=n.userData.entities3D.values().next().value;if(v==null)continue;let C=this.state.geometry3DMap.get(v);C instanceof Ie&&(C.type==="geometry"||C.type==="custom-geometry")&&(e=C.components[0],n.userData.shadingDirty&&i.shading&&this.setShading(e,i.shading));let w,P;for(let T of n.userData.entities3D.values())w=this.state.geometry3DMap.get(T),P=w.components[0],w.type==="geometry"&&P.detached&&n.userData.shadingDirty&&i.shading&&this.setShading(P,i.shading);n.userData.shadingDirty=!1}if(i.dirty){let v=Tg(n);v&&v.material instanceof yg&&(v.material.color.set(d1(i.color)),v.material.needsUpdate=!0);let C=n.getfirstChildEntityId();if(C){let w=this.state.geometry3DMap.get(C),P=w==null?void 0:w.components[0];P instanceof Tt&&this.processTextures(P,i)}i.dirty=!1}}else if(n instanceof Ie&&(n.type==="geometry"||n.type==="custom-geometry")&&((s=n.components[1])!=null&&s.dirty||(c=n.components[2])!=null&&c.dirty)){e=n.components[0],i=n.components[1],o=n.components[2];let v=TM(n,this.state.hoverColor);if(e.setColor(v[0],v[1]),i.visible!==e.visible&&(e.visible=i.visible,e.textMesh)){let C=this.state.geometry3DMap.get(e.textMesh.userData.entityId);(C==null?void 0:C.type)==="text3d"&&(C.components[0].visible=i.visible)}i.altitude!==e.altitude&&(e.altitude=i.altitude),i.opacity!==e.opacity&&(e.opacity=i.opacity),i.renderOrder!==e.renderOrder&&(e.renderOrder=i.renderOrder),i.dirty=!1,this.processTextures(e,i,o),n.components[2]&&(n.components[2].dirty=!1)}else if((n==null?void 0:n.type)==="model"&&((l=n.components[1])!=null&&l.dirty))e=n.components[0],i=n.components[1],i.opacity!==e.opacity&&(e.opacity=i.opacity),i.dirty=!1;else if((n==null?void 0:n.type)==="image"&&((p=n.components[1])!=null&&p.dirty))e=n.components[0],i=n.components[1],i.visible!==e.visible&&(e.visible=i.visible),i.dirty=!1;else if((n==null?void 0:n.type)==="text3d"&&((h=n.components[1])!=null&&h.dirty)){e=n.components[0],i=n.components[1],i.visible!=null&&i.visible!==e.visible&&(e.visible=i.visible);let{textMesh:v}=e;if(v){Object.assign(v,i.getState());let C=(m=i.hoverColor)!=null?m:this.state.text3dHoverColor;v.color=i.hoverByPolygon?C:(y=i.color)!=null?y:kn.color,v.outlineColor=i.hoverByPolygon?C:(g=i.outlineColor)!=null?g:kn.outlineColor,v.strokeColor=i.hoverByPolygon?C:(S=i.strokeColor)!=null?S:kn.strokeColor}i.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};Sl=new WeakSet,my=async function(e,i,o){if(!(!e||!i.showTextures))if(this.textureLoadingCache.has(e)){o==="topTexture"?i.topTexture=await this.textureLoadingCache.get(e):i.texture=await this.textureLoadingCache.get(e),i.showTextures();return}else{let n=new Promise((s,c)=>{ma.getLoader().load(e,l=>{o==="topTexture"?i.topTexture=l:i.texture=l,i.showTextures(),this.publish("texture-loaded"),s(l)},void 0,()=>{O.error("Failed to load texture: ".concat(e)),c("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,n)}};f();var dd=class extends Z{constructor(e){super();u(this,"state");u(this,"animating",new Map);u(this,"isAnimating",!1);u(this,"startTime",-1);u(this,"showDuration",300);u(this,"hideDuration",250);u(this,"update",()=>{this.animating.clear();let e,i;for(let o of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(o),e&&(i=e.components[0],i instanceof Bi&&(i.visibilityNeedsUpdate==="show"?(i.canShow=!0,this.animating.set(i,[i.opacity,1])):i.visibilityNeedsUpdate==="hide"&&this.animating.set(i,[i.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")});u(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[i,[o,n]]of this.animating.entries()){let s=n===1?this.showDuration:this.hideDuration,c=(e-this.startTime)/s;i.opacity=ki(c,0,1,o,n,n===0?Bg:Rg),e-this.startTime>=s&&(n===1?i.canShow=!0:n===0&&(i.canShow=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};f();var hd=class extends Z{constructor(e,i,o,n,s,c,l){super();u(this,"state");u(this,"renderer");u(this,"mode");u(this,"scene");u(this,"cameraObject");u(this,"viewCamera");u(this,"systems");u(this,"twoDdirty",!0);u(this,"threeDdirty",!0);u(this,"frameId",null);u(this,"twoDFrameId",null);u(this,"animationFrameId",null);u(this,"nextFrame",null);u(this,"update",(e=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)==null)return Promise.resolve();if(e){let o=this.commitRenderState();return this.paint(),o}else return this.frameId?Promise.resolve():new Promise((o,n)=>{this.frameId=requestAnimationFrame(()=>{var s;return((s=this.renderer)==null?void 0:s.renderer)==null?o():this.mode==="standalone"?this.commitRenderState().then(()=>{this.paint(),o()}).catch(c=>{O.error("render loop error:",c),n(c)}):o()})})});u(this,"animate2D",()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})});u(this,"drawEntities2D",()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))});u(this,"updateEntities2D",()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})});u(this,"commitRenderState",()=>{let e=[];return this.frameId=null,this.systems.preRenderSystem.update(),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.scene.updateMatrixWorld(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),Fg(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),Ag(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0),this.systems.meshOptimizationSystem.update(),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update(),this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,this.systems.cameraSystem.rotationDirty)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,Promise.all(e)});this.renderer=e,this.state=i,this.mode=o,this.scene=n,this.cameraObject=s,this.viewCamera=c,this.systems=l,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"?(this.renderer.clear(),this.renderer.render(this.scene,this.cameraObject)):this.renderer.render(this.scene,this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};f();var wM=B.object({interactive:B.boolean().optional(),id:B.string().optional(),nearRadius:B.number().optional(),farRadius:B.number().optional(),accentColor:B.string().optional(),displayArrowsOnPath:B.boolean().optional(),animateArrowsOnPath:B.boolean().optional()}),EM=B.object({type:B.enum(["Feature"]),geometry:fa,properties:B.object({parentId:B.any().optional()})});function v5(r,t){B.object({features:B.array(EM)}).parse(r),wM.parse(t)}var xl,so=class{constructor(t,e){u(this,"type","path");u(this,"mesh",new _i);u(this,"material");u(this,"geometry");u(this,"outline");u(this,"feature");u(this,"options");u(this,"nearRadius",.2);u(this,"farRadius",.4);u(this,"accentColor","blue");u(this,"completeFraction",1);u(this,"altitudeAdjustment",1);u(this,"displayArrowsOnPath",!1);u(this,"animateArrowsOnPath",!1);u(this,"isVertical",!1);u(this,"dirty",!0);u(this,"materialDirty",!0);u(this,"position",new z);b(this,xl,0);var i,o,n,s,c;this.feature=t,this.options=e||{},this.accentColor=(i=e==null?void 0:e.accentColor)!=null?i:this.accentColor,this.nearRadius=(o=e==null?void 0:e.nearRadius)!=null?o:this.nearRadius,this.farRadius=(n=e==null?void 0:e.farRadius)!=null?n:this.farRadius,this.displayArrowsOnPath=(s=e==null?void 0:e.displayArrowsOnPath)!=null?s:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=e==null?void 0:e.animateArrowsOnPath)!=null?c:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return a(this,xl)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,xl,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};xl=new WeakMap;f();var fd=class{constructor(t){u(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Ee&&t.components[0]){let i=t.components[0];if(i.dirty){for(let o of t.children)(o instanceof Yt||o instanceof Ee)&&(o.userData.entityId!==t.components[0].activeId?o.setVisible(!1):o.setVisible(!0));i.dirty=!1}}}};f();f();f();var Pe=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)}}),Bounce:Object.freeze({In:function(r){return 1-Pe.Bounce.Out(1-r)},Out:function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},InOut:function(r){return r<.5?Pe.Bounce.In(r*2)*.5:Pe.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),Il=function(){return performance.now()},gy=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var o=0,n=e;o<n.length;o++){var s=n[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,o=t;i<o.length;i++){var n=o[i];n._group=void 0,delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=Il()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var n=this._tweens[i[o]],s=!e;n&&n.update(t,s)===!1&&!e&&this.remove(n)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),ya={Linear:function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=ya.Utils.Linear;return t<0?n(r[0],r[1],i):t>1?n(r[e],r[e-1],e-i):n(r[o],r[o+1>e?e:o+1],i-o)},Bezier:function(r,t){for(var e=0,i=r.length-1,o=Math.pow,n=ya.Utils.Bernstein,s=0;s<=i;s++)e+=o(1-t,i-s)*o(t,s)*r[s]*n(i,s);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,o=Math.floor(i),n=ya.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(o=Math.floor(i=e*(1+t))),n(r[(o-1+e)%e],r[o],r[(o+1)%e],r[(o+2)%e],i-o)):t<0?r[0]-(n(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(n(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):n(r[o?o-1:0],r[o],r[e<o+1?e:o+1],r[e<o+2?e:o+2],i-o)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=ya.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,o){var n=(e-r)*.5,s=(i-t)*.5,c=o*o,l=o*c;return(2*t-2*e+n+s)*l+(-3*t+3*e-2*n-s)*c+n*o+t}}},b5=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),yy=new gy,Ct=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Pe.Linear.None,this._interpolationFunction=ya.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=b5.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=yy,yy.add(this))}return r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=Il()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var n in this._valuesEnd)o[n]=this._valuesEnd[n];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,o,n){for(var s in i){var c=t[s],l=Array.isArray(c),p=l?"array":typeof c,h=!l&&Array.isArray(i[s]);if(!(p==="undefined"||p==="function")){if(h){var m=i[s];if(m.length===0)continue;for(var y=[c],g=0,S=m.length;g<S;g+=1){var M=this._handleRelativeValue(c,m[g]);if(isNaN(M)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}y.push(M)}h&&(i[s]=y)}if((p==="object"||l)&&c&&!h){e[s]=l?[]:{};var v=c;for(var C in v)e[s][C]=v[C];o[s]=l?[]:{};var m=i[s];if(!this._isDynamic){var w={};for(var C in m)w[C]=m[C];i[s]=m=w}this._setupProperties(v,e[s],m,o[s],n)}else(typeof e[s]>"u"||n)&&(e[s]=c),l||(e[s]*=1),h?o[s]=i[s].slice().reverse():o[s]=e[s]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=Il()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=Il()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=Pe.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=ya.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,o;if(t===void 0&&(t=Il()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var n;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,c=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*c,p=function(){if(i._duration===0||s>l)return 1;var M=Math.trunc(s/c),v=s-M*c,C=Math.min(v/i._duration,1);return C===0&&s===i._duration?1:C},h=p(),m=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||s>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((s-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,S=this._chainedTweens.length;g<S;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,o){for(var n in i)if(e[n]!==void 0){var s=e[n]||0,c=i[n],l=Array.isArray(t[n]),p=Array.isArray(c),h=!l&&p;h?t[n]=this._interpolationFunction(c,o):typeof c=="object"&&c?this._updateProperties(t[n],s,c,o):(c=this._handleRelativeValue(s,c),typeof c=="number"&&(t[n]=s+(c-s)*o))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}();var kG=b5.nextId,kr=yy,BG=kr.getAll.bind(kr),RG=kr.removeAll.bind(kr),NG=kr.add.bind(kr),GG=kr.remove.bind(kr),VG=kr.update.bind(kr);f();f();f();var C5=(r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,S5=(r,t)=>new J(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),vy=(r,t)=>Math.atan2(t.y-r.y,t.x-r.x),Ml=(r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),by=(r,t)=>new J((r.x+t.x)/2,(r.y+t.y)/2),Cy=r=>{let t=0,{wheelDelta:e,detail:i}=r;return e!==void 0?t=e:i!==void 0&&(t=-i),t};var md=class{constructor(t,e){u(this,"input1");u(this,"input2");u(this,"lastAngle");u(this,"lastDistance");u(this,"totalDistance");u(this,"first");u(this,"second");this.input1=t,this.input2=e,this.lastAngle=vy(t,e),this.lastDistance=Ml(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let i=Ml(t,e);this.input1=t,this.input2=e;let o=vy(t,e);this.lastAngle=o,this.lastDistance=i,this.totalDistance+=(Ml(this.first,t)+Ml(this.second,e))/2,this.first=by(this.first,t),this.second=by(this.second,e)}};f();var Pl=class{constructor(t,e,i){u(this,"touch");u(this,"camera");u(this,"cameraPlane");u(this,"viewCoordinate");u(this,"snapHolderMatrix");u(this,"snapCamera");u(this,"cameraPosition");u(this,"raycaster");u(this,"worldCoordinate");u(this,"snapshotted",!1);this.touch=t,this.camera=e,this.cameraPlane=i,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new J(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Sr,this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=e&&e.length>0?e[0].point:null,this.snapshotted=!0}updateAnchorState(t,e){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(e),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var i,o;let t=new J(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(t,this.snapCamera);let e=(o=this.raycaster)==null?void 0:o.intersectObject(this.cameraPlane,!0)[0];return e?e.point:void 0}};var sr={};V7(sr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>OM,CLIPPING_RADIUS:()=>Tl,CONTROL_OPTIONS:()=>DM,DEFAULT_BEARING:()=>kM,DEFAULT_MAX_ZOOM_LEVEL:()=>FM,DEFAULT_MIN_ZOOM_LEVEL:()=>Py,DEFAULT_PITCH:()=>_M,DEFAULT_ZOOM_LEVEL:()=>AM,EVENTS:()=>bd,MAPLIBRE_TILE_SIZE:()=>yd,MAX_LAT:()=>xy,MAX_MERCATOR_ZOOM_LEVEL:()=>vd,MIN_LAT:()=>Sy,MIN_MERCATOR_ZOOM_LEVEL:()=>gd,ROOM_MERCATOR_ZOOM_LEVEL:()=>LM,TWO_PI:()=>Iy,WHEEL_ZOOM_MULTIPLIER:()=>My,ZRANGE:()=>ga});f();var yd=512,Sy=-85.051129,xy=85.051129,Tl=1e4,DM={chain:"chain",cancel:"cancel"},Iy=Math.PI*2,ga=100,My=1e4,gd=0,vd=24,OM=17,LM=20,bd=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],AM=18,Py=12,FM=22,_M=0,kM=0;var Cd=!1,BM=!1;var Sd,nn=class extends Z{constructor(e,i,o,n,s){super();u(this,"dirty",!1);u(this,"zoomDirty",!1);u(this,"rotationDirty",!1);b(this,Sd,Py);u(this,"zoomSpeed",5);u(this,"rotateSpeed",100);u(this,"enabled",!0);u(this,"enableZoom",!0);u(this,"enablePan",!0);u(this,"enablePedestal",!1);u(this,"maxPedestal",1/0);u(this,"minPedestal",0);u(this,"enableRotate",!0);u(this,"minZoomAltitude",0);u(this,"maxZoomAltitude",1/0);u(this,"ignoreZoomLimits",!1);u(this,"zoomFactor",1);u(this,"panBounds",{min:new z(1/0,1/0),max:new z(-1/0,-1/0),center:new z(0,0,0),radius:1/0});u(this,"minTilt",0);u(this,"maxTilt",1.2);u(this,"MOUSE_BUTTONS",{ORBIT:lp.RIGHT,ZOOM:lp.MIDDLE,PAN:lp.LEFT});u(this,"camera");u(this,"scene");u(this,"renderer");u(this,"elevation");u(this,"orbit");u(this,"cameraPlane");u(this,"raycaster",new Sr);u(this,"rendererState");u(this,"options");u(this,"state",-1);u(this,"intersection");u(this,"viewState",null);u(this,"tweens",new Map);u(this,"clock",new xg(!0));u(this,"coords",{mouse:new J,rotateStart:new J,rotateEnd:new J,rotateDelta:new J,panStart:new z,panCameraStart:new z,panEnd:new z,panDelta:new z,initialShiftPos:new J,initialPedestal:0,floorAnchor:new z});u(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});u(this,"scrollTimer",null);u(this,"lastWheelTime",0);u(this,"resetZoom",!1);u(this,"zoomStart");u(this,"pedestalScaleFactor",1);u(this,"isUserZooming",!1);u(this,"stayInsideBounds",!0);u(this,"userInteracting",!1);u(this,"raycastToFloor",e=>{this.raycaster.setFromCamera(e,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new z});u(this,"isUserInteracting",()=>this.userInteracting);u(this,"getPosition",()=>new z(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z));u(this,"getPedestal",()=>this.orbit.position.z);u(this,"pan",(e,i)=>{isNaN(e)||isNaN(i)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+i),this.publish("position-updated"))});u(this,"postRender",()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))});u(this,"isCameraMoving",()=>this.state!==-1);u(this,"setPosition",(e,i)=>{e===void 0||i===void 0||isNaN(e)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)});u(this,"updateCameraPosition",(e,i)=>{let o=e-this.panBounds.center.x,n=i-this.panBounds.center.y,s=Math.sqrt(o*o+n*n);if(this.stayInsideBounds&&s>this.panBounds.radius){let c=Math.atan2(n,o),l={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=e,this.orbit.position.y=i});u(this,"tilt",e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")});u(this,"zoomIn",(e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n/1.5},e,i,o)});u(this,"zoomOut",(e,i,o)=>{let n=this.getZoomAltitude();this.animateCamera({zoom:n*1.5},e,i,o)});u(this,"getRotation",()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2));u(this,"cancelAnimation",()=>{let e=Array.from(this.tweens.keys()),i=e[e.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)});u(this,"animateCamera",(e,i,o,n,s,c)=>{let l={interruptible:!0,...c},p={},h={},m=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(p.x=m.x,h.x=e.position.x),e.position.y!==void 0&&(p.y=m.y,h.y=e.position.y),e.position.z!==void 0&&(p.z=m.z,h.z=e.position.z)),e.zoom!==void 0&&(p.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?h.zoom=e.zoom:h.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:P,end:T}=np(this.getRotation(),e.rotation);p.rotation=P,h.rotation=T}e.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?h.tilt=e.tilt:h.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let y=p.zoom!==h.zoom,g=p.rotation!==h.rotation,S=p.tilt!==h.tilt,M=new Ct(p).to(h,x.env.TESTING?0:i).onUpdate(P=>{this.setMulti({x:P.x,y:P.y,z:P.z},P.zoom,P.rotation,P.tilt)}).onComplete(()=>{this.completeTween(M),this.publish("multi-end",{zooming:y,rotating:g,tilting:S}),n&&n()}).onStart(()=>{this.state!==7&&(this.state=7,M.state=7,this.publish("multi-start",{zooming:y,rotating:g,tilting:S})),this.publish("change")});this.rendererState.tweenGroup.add(M);let v=Array.from(this.tweens.entries()),C=v[v.length-1],w=!1;return C!=null&&(C[1].interruptible?(typeof C[1].cancelledCallback=="function"&&C[1].cancelledCallback(),this.completeTween(C[0])):(w=!0,C[0].chain(M))),this.tweens.set(M,{cancelledCallback:s,interruptible:l.interruptible}),o?M.easing(o):M.easing(Pe.Quadratic.In),!e.doNotAutoStart&&!w&&(M.start(),this.publish("change")),M.cameraAnimation=!0,M});u(this,"setMulti",(e,i,o,n,s=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),c=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0),c=!0)),c&&this.publish("position-updated");let l={zooming:!1,tilting:!!i,rotating:!1};if(i!==void 0&&!isNaN(i)){let p=this.stayInsideBounds?Math.min(Math.max(i,this.getZoomScaledMin()),this.getZoomScaledMax()):i;p!==this.camera.position.z&&(l.zooming=!0,this.camera.position.z=p,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?i>Tl&&(this.camera.near=i-Tl,this.camera.far=i+Tl):(this.camera.near=i/ga,this.camera.far=i*ga),this.camera.updateProjectionMatrix())}if(o!==void 0&&!isNaN(o)&&o!==this.getRotation()&&(l.rotating=!0,this.orbit.rotation.z=-o,this.publish("rotation-updated")),n!==void 0&&!isNaN(n)){let p=this.stayInsideBounds?Math.max(Math.min(n,this.maxTilt),this.minTilt):n;p!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}s&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)});u(this,"getZoomScaledMin",()=>this.minZoomAltitude*this.zoomFactor);u(this,"getZoomScaledMax",()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)});u(this,"setRotation",(e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let o=-(e%Iy);o!==this.orbit.rotation.z&&(this.orbit.rotation.z=o,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0});u(this,"setZoomAltitude",e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(e,this.getZoomScaledMin()),this.getZoomScaledMax()):e;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/ga,this.camera.far=i*ga,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0});u(this,"setZoomLevel",e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))});u(this,"getZoomAltitude",()=>this.camera.position.z);u(this,"getZoomLevel",()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()));u(this,"setTilt",(e,i)=>{if(isNaN(e))return;this.state===-1&&!i&&this.publish("rotate-start");let o=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;o!==this.elevation.rotation.x&&(this.elevation.rotation.x=o,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0});u(this,"getTilt",()=>this.elevation.rotation.x);u(this,"setCameraPlaneElevation",e=>{this.cameraPlane.position.z=e});u(this,"zoom",e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(i,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):i,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")});u(this,"getProjectionScaleFactor",(e,i,o)=>Ph(e,i,o));u(this,"update",()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())});u(this,"setPedestal",(e,i=!1)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,i&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0)});u(this,"dispose",()=>{for(let e of bd)e.endsWith("start")?this.off(e,this.setUserInteracting):e.endsWith("end")&&this.off(e,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)});u(this,"createCameraPlane",()=>{let e=Cd?2e3:1e10,i=Cd?100:1,o=new qr(e,e,i,i),n=new Xt({color:0,wireframe:Cd,visible:Cd}),s=new me(o,n);return this.scene.add(s),s});u(this,"addEventListeners",()=>{let{domElement:e}=this.renderer;for(let i of bd)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)});u(this,"addMouseEventListeners",()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)});u(this,"addMouseMoveEventListeners",()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeMouseMoveEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)});u(this,"removeEventListeners",()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});u(this,"removeMouseUpEventListeners",()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)});u(this,"onContextMenu",e=>{e.preventDefault()});u(this,"onMouseUp",()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1}});u(this,"onMouseMove",e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)});u(this,"onTouchStart",e=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(e),e.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(e),this.state=9):this.enablePan&&(this.handleTouchStartPan(e),this.state=6);break;case 2:this.touch.inputs=new md(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}});u(this,"onTouchMove",e=>{if(this.enabled!==!1)switch(this.touchToScene(e),e.touches.length){case 2:e.preventDefault(),e.stopPropagation();let i={...this.touch.inputs.first},o={...this.touch.inputs.second},n=new J(this.touch.touches[0].x,this.touch.touches[0].y),s=new J(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(e);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let c=i.y<n.y&&o.y<s.y,l=i.y>n.y&&o.y>s.y;this.enableRotate&&this.state!==4&&(l||c)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}});u(this,"onTouchEnd",e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}});u(this,"handleTouchMovePan",e=>{let i=Object.hasOwn(e,"x")?new J(e.x,e.y):this.touch.touches[0],o=this.raycastToFloor(i);this.coords.panEnd.set(o.x,o.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")});u(this,"handleTouchStartDolly",()=>{let e=this.touch.touches[0].x-this.touch.touches[1].x,i=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let o=new J(this.touch.touches[0].x-e/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(o),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Pl(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Pl(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")});u(this,"handleMouseMovePan",()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change")});u(this,"handleTouchStartTilt",e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")});u(this,"handleTouchMovePedestal",e=>{this.handleMouseMovePedestal(e.touches[0])});u(this,"handleTouchMoveTilt",e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)});u(this,"handleTouchMoveDolly",()=>{let e=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:e.x,y:e.y},this.touch.anchor2.viewCoordinate={x:i.x,y:i.y};let o=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);o&&this.setCameraFromTransformMatrix(o),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,i)});u(this,"handleTouchEnd",()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")});u(this,"handleTouchStartPan",e=>{let i=Object.hasOwn(e,"x")?new J(e.x,e.y):this.touch.touches[0],o=this.raycastToFloor(i);this.coords.panStart.set(o.x,o.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")});u(this,"handleTouchStartPedestal",e=>{this.handleMouseDownPedestal(e.touches[0])});u(this,"onMouseDown",e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}});u(this,"onMouseWheel",e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))});u(this,"handleMouseWheel",e=>{if(this.publish("zoom-start"),!this.canScrollZoom(e)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),o=i-Cy(e)*i/My*this.zoomSpeed;if(this.setZoomAltitude(o),this.enablePan){let n=o/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-n),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")});u(this,"setCameraFromTransformMatrix",e=>{this.orbit.updateMatrixWorld();let i=new Ln;i.setFromRotationMatrix(e,"ZYX");let o=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),n=i.z,s=new z(0,0,1);s.applyEuler(i),s.setLength(o);let c=new z;c.setFromMatrixPosition(e),c.sub(s),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(o),this.enableRotate&&this.setRotation(-n)});u(this,"makeTransformFromTouchAnchors",(e,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let o=this.camera.projectionMatrix.clone(),n=e.worldCoordinate,s=i.worldCoordinate,c=e.reUnproject(),l=i.reUnproject();if(!c||!l||!n||!s)return null;let p=e.viewCoordinate,h=i.viewCoordinate,m=s.x-n.x,y=s.y-n.y,g=Math.atan2(y,m),S=l.x-c.x,M=l.y-c.y,v=Math.atan2(M,S),C=C5(g,v),w=new On;w.makeRotationZ(-C);let P=w.clone();P.multiply(e.snapHolderMatrix);let T=(R7,N7,G7)=>R7.elements[(N7-1)*4+G7-1],E=T(o,1,1)*T(P,1,1)-p.x*T(o,3,4)*T(P,3,1),A=T(o,1,1)*T(P,1,2)-p.x*T(o,3,4)*T(P,3,2),k=T(o,1,1)*T(P,1,3)-p.x*T(o,3,4)*T(P,3,3),N=n.x*E+n.y*A+n.z*k,F=T(o,2,2)*T(P,2,1)-p.y*T(o,3,4)*T(P,3,1),V=T(o,2,2)*T(P,2,2)-p.y*T(o,3,4)*T(P,3,2),R=T(o,2,2)*T(P,2,3)-p.y*T(o,3,4)*T(P,3,3),q=n.x*F+n.y*V+n.z*R,$=T(o,1,1)*T(P,1,1)-h.x*T(o,3,4)*T(P,3,1),pe=T(o,1,1)*T(P,1,2)-h.x*T(o,3,4)*T(P,3,2),ve=T(o,1,1)*T(P,1,3)-h.x*T(o,3,4)*T(P,3,3),Be=s.x*$+s.y*pe+s.z*ve,Pt=T(o,2,2)*T(P,2,1)-h.y*T(o,3,4)*T(P,3,1),de=T(o,2,2)*T(P,2,2)-h.y*T(o,3,4)*T(P,3,2),Oe=T(o,2,2)*T(P,2,3)-h.y*T(o,3,4)*T(P,3,3),be=s.x*Pt+s.y*de+s.z*Oe,et=Math.abs($-E),Ut=Math.abs(pe-A),Ze=Math.abs(ve-k),tt=Math.abs($-F),Yr=Math.abs(pe-V),Tn=Math.abs(ve-R),re=Math.abs(Pt-E),se=Math.abs(de-A),Ce=Math.abs(Oe-k),Bt=Math.abs(Pt-F),wn=Math.abs(de-V),$a=Math.abs(Oe-R),yr=Math.min(et+Ut+Ze,tt+Yr+Tn),Oi=Math.min(re+se+Ce,Bt+wn+$a);yr<Oi&&($=Pt,pe=de,ve=Oe,Be=be);let Ja=F*k-E*R,hh=V*k-A*R,$y=q*k-N*R,fh=$*R-F*ve,mh=pe*R-V*ve,Jy=Be*R-q*ve,A7=(Jy*hh-$y*mh)/(fh*hh-Ja*mh),F7=(Jy*Ja-$y*fh)/(mh*Ja-hh*fh),Qy=V*E-A*F,_7=R*E-k*F,k7=q*E-N*F,Ky=pe*F-V*$,B7=ve*F-R*$,eg=((Be*F-q*$)*Qy-k7*Ky)/(B7*Qy-_7*Ky),tp=P.clone();return tp.elements[12]=A7,tp.elements[13]=F7,tp.elements[14]=eg,eg>0?tp:null});u(this,"updateTouchOrigin",()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top});u(this,"touchToScene",e=>{this.touch.touches=[];for(let i=0,o=e.touches.length;i<o;i++){let n=e.touches[i],s=S5(n,this.touch.origin);this.touch.touches.push(new J(s.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(s.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]});u(this,"canScrollZoom",e=>{let i=Cy(e),o=this.getZoomAltitude();return!(i<0&&o===this.getZoomScaledMax()||i>0&&o===this.getZoomScaledMin())});u(this,"mouseToScene",e=>{let i=this.getMousePos(e);return this.coords.mouse.x=i.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(i.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse});u(this,"getMousePos",e=>({x:e.offsetX,y:e.offsetY}));u(this,"handleMouseDownRotate",e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")});u(this,"handleMouseDownPan",()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")});u(this,"handleMouseDownPedestal",e=>{let i=new J(e.clientX,e.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=Ph(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")});u(this,"handleMouseMovePedestal",e=>{let i={x:e.clientX,y:e.clientY},o=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(o<this.minPedestal?o=Math.max(o,this.minPedestal):o>this.maxPedestal&&(o=Math.min(o,this.maxPedestal))),o!==this.getPedestal()&&this.setPedestal(o,!0)});u(this,"handleMouseMoveRotate",e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")});u(this,"publishUserZoomDebounced",wo(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));u(this,"publishUserZoomEvent",()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())});u(this,"setUserInteracting",()=>{this.userInteracting=!0});u(this,"unsetUserInteracting",()=>{this.userInteracting=!1});u(this,"publishPedestalChangeEvent",e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})});u(this,"convertAltitudeToZoomLevel",e=>{let[,i]=this.center,n=e*2*Math.tan(ae.degToRad(this.camera.fov)/2)/this.options.canvasHeight,s=Math.cos(ae.degToRad(i))*2*Math.PI*yh/n;return ae.clamp(Math.log2(s/512),gd,vd)});u(this,"convertZoomLevelToAltitude",e=>{let[,i]=this.center,o=ae.clamp(e,gd,vd),n=Math.pow(2,o),s=ae.clamp(i,Sy,xy),c=n*512;return Math.cos(ae.degToRad(s))*Math.PI*2*yh/c*this.options.canvasHeight/2/Math.tan(ae.degToRad(this.camera.fov)/2)});u(this,"completeTween",e=>{e.isPlaying()&&e.stop(),this.rendererState.tweenGroup.remove(e),this.tweens.delete(e)});u(this,"debugContainer",new es);this.camera=e,this.renderer=o,this.rendererState=n,this.scene=i,this.options=s,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,s.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e)}get defaultMinZoomLevel(){return a(this,Sd)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e)}get scrollPercent(){let e=this.minPedestal,i=this.maxPedestal,o=this.getPedestal();return o=Math.min(o,i),o=Math.max(o,e),(o-e)/(i-e)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var n,s,c,l;let e=this.getPosition(),{lat:i,lon:o}=fp((s=(n=this.rendererState.center)==null?void 0:n[1])!=null?s:0,(l=(c=this.rendererState.center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[o,i]}setCenter(e,i){var s,c,l,p;let{x:o,y:n}=mp((c=(s=this.rendererState.center)==null?void 0:s[1])!=null?c:0,(p=(l=this.rendererState.center)==null?void 0:l[0])!=null?p:0,i,e);this.setPosition(o,n)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(e=>e.cameraAnimation)}focusOn(e,i){BM&&(this.debugContainer&&je(this.debugContainer),e.forEach(v=>{let C=new me(new cp(2,2,2),new Xt({color:65280}));C.position.copy(v),this.debugContainer.add(C),this.scene.add(this.debugContainer)}));let o=i.curve,n=i.callback,s=i.cancelledCallback,c=i.minZoom!==void 0?i.minZoom:this.minZoomAltitude,l=i.maxZoom!==void 0?i.maxZoom:this.maxZoomAltitude,p=this.options.canvasWidth,h=this.options.canvasHeight,m;i.duration!==void 0?m=i.duration:x.env.TESTING==="true"?m=0:m=200;let y=i.padding,g=this.getRotation(),S=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let M=RM(e,{canvasHeight:h,paddingOption:y,canvasWidth:p,minZoom:c,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition()});this.setRotation(g),this.setTilt(S),this.animateCamera({position:M.position,tilt:i.tilt,rotation:i.rotation,zoom:M.zoom},m,o,n,s,i)}resize(e,i){this.options.canvasWidth=e,this.options.canvasHeight=i}};Sd=new WeakMap,u(nn,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);function RM(r,{canvasWidth:t,orbit:e,paddingOption:i,canvasHeight:o,minZoom:n,maxZoom:s,camera:c,position:l}){let p={zoom:n,position:l};if(r.length===0)return p;for(let Oi of nn.CAMERA_FRAME_PADDING_SIDES)typeof i[Oi]!="number"&&(i[Oi]=0);let h=i.type==="portion"?{top:i.top*o,bottom:i.bottom*o,left:i.left*t,right:i.right*t,type:"pixel"}:i;if(h.left+h.right>=t||h.top+h.bottom>=o)return p;e.updateMatrixWorld();let m=c.matrixWorldInverse,y=c.fov*(Math.PI/180)/2,g=y,M=Math.atan(Math.tan(y)*(t/o)),v=new z(1/0,1/0,1/0),C=new z(-1/0,-1/0,-1/0),w=new zr().setFromPoints(r),P;for(let Oi=0,Ja=r.length;Oi<Ja;Oi++)P=r[Oi].clone(),P.applyMatrix4(m),v.min(P),C.max(P);let T=C.x-v.x,E=C.y-v.y,A=t-h.left-h.right,k=o-h.top-h.bottom,N=(C.x+v.x)/2,F=(C.y+v.y)/2,V=T/A,R=E/k,q=n,$=s,pe=q*Math.tan(M)*2,ve=$*Math.tan(M)*2,Be=pe/t,Pt=ve/t,de=Math.max(V,R);de=ae.clamp(de,Be,Pt);let Oe=A*de,be=k*de,et={min:{x:N-Oe/2-h.left*de,y:F-be/2-h.bottom*de},max:{x:N+Oe/2+h.right*de,y:F+be/2+h.top*de}},Ut=(et.min.x+et.max.x)/2,Ze=(et.min.y+et.max.y)/2,tt=w.getCenter(new z),Yr=Math.abs(Ut-et.min.x),Tn=Math.abs(Ze-et.min.y),re=Yr/Math.tan(M),se=Tn/Math.tan(g),Ce=new z;Ce.set(Ut,Ze,C.z+Math.max(re,se)),Ce.applyMatrix4(c.matrixWorld);let Bt=new z;Bt.set(Ut,Ze,C.z),Bt.applyMatrix4(c.matrixWorld);let wn=new z().subVectors(Bt,Ce),$a=(tt.z-Ce.z)/wn.z,yr=new z().copy(Ce).add(wn.clone().multiplyScalar($a));return Bt.set(yr.x,yr.y,yr.z),Ce.sub(Bt),{position:yr,zoom:Ce.length()}}f();var NM=300,wl,El,xd=class{constructor(t){u(this,"state");b(this,wl,new z);b(this,El,new z);this.state=t}update(t){var o;let e,i;this.state.cameraObject.getWorldPosition(a(this,El));for(let n of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(n),e&&(i=e.components[0],i&&"containerEl"in i&&i.containerEl!=null)){if((i.canShow===!0&&i.visible===!0||((o=i.animation)==null?void 0:o.pending)===!0)&&!i.offscreen)if(i.options.zIndex!=null)i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(i.options.zIndex,"px)");else{e.object3d.getWorldPosition(a(this,wl));let s=a(this,El).distanceTo(a(this,wl));i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-s,"px)")}if(i.canShow===!0&&i.visible===!0?i.containerEl.style.pointerEvents=t?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.currentStrategyIndex===-1&&i.visible&&i.visibilityNeedsUpdate==="show")continue;i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.animation&&i.animation.cancel(),i.visibilityNeedsUpdate==="show"?(i.containerEl.style.opacity="0",i.canShow=!0):i.canShow=!1,i.animation=i.containerEl.animate([{opacity:i.canShow&&i.visible?"1":"0"}],{duration:NM,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};wl=new WeakMap,El=new WeakMap;f();var Id=class{constructor(){u(this,"percentExpanded",0);u(this,"activeId","");u(this,"gap",20);u(this,"dirty",!0)}};f();var Md=class extends Z{constructor(e,i){super();u(this,"state");u(this,"dirty",!0);u(this,"domTree");u(this,"observers",new Map);u(this,"updateDimensions",e=>{e.forEach(i=>{let o=i.target,n=o.getAttribute("data-marker-id");if(n){let s=this.state.geometry2DMap.get(n);s&&s.components[0]instanceof Fi&&o.firstElementChild&&(s.components[0].updateDimensions(),s.components[0].collisionDirty=!0)}}),this.publish("dimensions-update")});this.state=e,this.domTree=i}setupObserver(){var i;if(this.observers){for(let o of this.observers.values())o.disconnect();this.observers.clear()}let e;for(let o of this.domTree.children){let n=o.getAttribute("data-marker-id");if(n!=null&&(e=this.state.geometry2DMap.get(n),(i=e.components[0].options)!=null&&i.dynamicResize)){let s=new ResizeObserver(this.updateDimensions);s.observe(o),this.observers.set(o.userData.entityId,s)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};f();var GM=0,VM=90;function hi(r,t,e,i){return(r<t||r>e)&&O.warn(i),Math.min(e,Math.max(t,r))}var va={linear:Pe.Linear.None,"ease-in":Pe.Quadratic.In,"ease-out":Pe.Quadratic.Out,"ease-in-out":Pe.Quadratic.InOut},H,Y,ba,Dl,Ol,Pd=class{constructor(t,e,i,o){b(this,H,void 0);b(this,Y,void 0);b(this,ba,void 0);b(this,Dl,void 0);b(this,Ol,void 0);I(this,H,t),I(this,Y,e),I(this,ba,i),I(this,Dl,o),a(this,Y).cameraSystem.on("pedestal-change",({pedestal:n})=>{a(this,H).map&&(a(this,H).map.transform.elevation=n,a(this,H).map.transform.minElevationForCurrentTile=n,a(this,H).map.triggerRepaint()),a(this,Y).cameraSystem.setCameraPlaneElevation(n),a(this,Dl).position.z=n})}get center(){return a(this,H).mode==="outdoors-overlay"&&a(this,H).map?a(this,H).map.getCenter().toArray():a(this,Y).cameraSystem.center}setCenter(t){var e;if(a(this,H).mode==="outdoors-overlay"&&a(this,H).map){(e=a(this,H).map)==null||e.setCenter(t),a(this,Y).interactionSystem.handleHover();return}a(this,Y).cameraSystem.setCenter(t[0],t[1]),a(this,Y).interactionSystem.handleHover()}get zoomLevel(){var t;return a(this,H).mode==="outdoors-overlay"&&a(this,H).map?(t=a(this,H).map)==null?void 0:t.getZoom():a(this,Y).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;a(this,H).mode==="outdoors-overlay"&&a(this,H).map&&((e=a(this,H).map)==null||e.setZoom(t)),a(this,Y).cameraSystem.setZoomLevel(hi(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return a(this,Y).cameraSystem.isAnimating}cancelAnimation(){a(this,Y).cameraSystem.cancelAnimation()}get maxZoomLevel(){return a(this,Y).cameraSystem.maxZoomLevel}get minZoomLevel(){return a(this,Y).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){a(this,Y).panBoundsSystem.autoMinZoomLevel=t,t&&(a(this,Y).panBoundsSystem.dirty=!0,a(this,Y).panBoundsSystem.update())}get autoMinZoomLevel(){return a(this,Y).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var o;e&&this.setAutoMinZoomLevel(!1);let i=hi(t,sr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(sr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));a(this,Y).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(o=a(this,H).map)==null||o.setMinZoom(i)}setMaxZoomLevel(t){var i;let e=hi(t,this.minZoomLevel,sr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(sr.MAX_MERCATOR_ZOOM_LEVEL,"."));a(this,Y).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(i=a(this,H).map)==null||i.setMaxZoom(e)}get maxPitch(){var t;return a(this,H).mode==="outdoors-overlay"&&a(this,H).map?(t=a(this,H).map)==null?void 0:t.getMaxPitch():ae.radToDeg(a(this,Y).cameraSystem.maxTilt)}get minPitch(){var t;return a(this,H).mode==="outdoors-overlay"&&a(this,H).map?(t=a(this,H).map)==null?void 0:t.getMinPitch():ae.radToDeg(a(this,Y).cameraSystem.minTilt)}setMinPitch(t){var i;let e=Math.max(GM,t);(i=a(this,H).map)==null||i.setMinPitch(e),a(this,Y).cameraSystem.minTilt=ae.degToRad(e)}setMaxPitch(t){var i;let e=Math.min(VM,t);(i=a(this,H).map)==null||i.setMaxPitch(e),a(this,Y).cameraSystem.maxTilt=ae.degToRad(e)}get bearing(){var t;return a(this,H).mode==="outdoors-overlay"&&a(this,H).map?(t=a(this,H).map)==null?void 0:t.getBearing():ae.radToDeg(a(this,Y).cameraSystem.getRotation())}setBearing(t){var e;if(a(this,H).mode==="outdoors-overlay"&&a(this,H).map){(e=a(this,H).map)==null||e.setBearing(t);return}a(this,Y).cameraSystem.setRotation(ae.degToRad(t))}get pitch(){var t;return a(this,H).mode==="outdoors-overlay"&&a(this,H).map?(t=a(this,H).map)==null?void 0:t.getPitch():ae.radToDeg(a(this,Y).cameraSystem.getTilt())}setPitch(t){var e;if(a(this,H).mode==="outdoors-overlay"&&a(this,H).map){(e=a(this,H).map)==null||e.setPitch(t);return}a(this,Y).cameraSystem.setTilt(ae.degToRad(hi(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return a(this,Y).cameraSystem.getPedestal()}setElevation(t){a(this,Y).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return a(this,Ol)&&a(this,Ol).stop(),new Promise(i=>{let o=a(this,Y).cameraSystem.getPosition();o.z=t,a(this,Y).cameraSystem.animateCamera({position:o},(e==null?void 0:e.duration)||300,va[(e==null?void 0:e.easing)||"ease-in-out"],i,i,{interruptible:e==null?void 0:e.interruptible})})}get insetsPadding(){return a(this,ba).insetsPadding}get panMode(){return a(this,Y).cameraSystem.enablePan===!1&&a(this,Y).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(a(this,Y).cameraSystem.enablePan=!0,a(this,Y).cameraSystem.enablePedestal=!1):(a(this,Y).cameraSystem.enablePan=!1,a(this,Y).cameraSystem.enablePedestal=!0))}setInsetPadding(t){a(this,ba).insetsPadding=Object.assign({},ml,t)}animateTo(t){var s,c,l,p,h,m;if(a(this,H).mode==="outdoors-overlay"&&a(this,H).map)return(m=a(this,H).map)==null||m.flyTo({center:(s=t.center)!=null?s:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(l=t.bearing)!=null?l:this.bearing,pitch:(p=t.pitch)!=null?p:this.pitch,duration:(h=t.duration)!=null?h:600}),Promise.resolve();let e=t.center?a(this,H).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,i=t.zoomLevel!==void 0?a(this,Y).cameraSystem.convertZoomLevelToAltitude(hi(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,o=t.bearing!==void 0?ae.degToRad(t.bearing):void 0,n=t.pitch!==void 0?ae.degToRad(hi(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(y=>{a(this,Y).cameraSystem.animateCamera({position:e,zoom:i,rotation:o,tilt:n},t.duration||0,va[t.easing||"ease-in-out"],()=>{a(this,Y).interactionSystem.handleHover(),y()},y,{interruptible:t==null?void 0:t.interruptible})})}focusOn(t,e){var i,o;return t==null||!Array.isArray(t)||t.length<=0?(O.error("focusOn coordinates are invalid:",t),Promise.resolve()):a(this,H).mode==="outdoors-overlay"&&a(this,H).map?(t.length===1?(i=a(this,H).map)==null||i.flyTo({center:t[0],duration:(e==null?void 0:e.duration)||a(this,H).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?a(this,H).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,H).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||a(this,H).map.getMaxZoom()}):(o=a(this,H).map)==null||o.fitBounds(t,{duration:e==null?void 0:e.duration,animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?a(this,H).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?a(this,H).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||a(this,H).map.getMaxZoom()}),a(this,Y).interactionSystem.handleHover(),Promise.resolve()):new Promise(n=>{a(this,Y).cameraSystem.focusOn(t.map(s=>a(this,H).convertTo3DMapPosition(s[1],s[0],s[2]||0)),{minZoom:(e==null?void 0:e.maxZoomLevel)===void 0?void 0:a(this,Y).cameraSystem.convertZoomLevelToAltitude(hi(e.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(e==null?void 0:e.minZoomLevel)===void 0?void 0:a(this,Y).cameraSystem.convertZoomLevelToAltitude(hi(e.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:e!=null&&e.padding?Object.assign({},ml,e==null?void 0:e.padding):this.insetsPadding,curve:va[(e==null?void 0:e.easing)||"ease-in-out"],rotation:(e==null?void 0:e.bearing)===void 0?void 0:ae.degToRad(e.bearing),tilt:(e==null?void 0:e.pitch)!==void 0?ae.degToRad(hi(e.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:e==null?void 0:e.duration,callback:()=>{a(this,Y).interactionSystem.handleHover(),n()},cancelledCallback:n,interruptible:e==null?void 0:e.interruptible})})}};H=new WeakMap,Y=new WeakMap,ba=new WeakMap,Dl=new WeakMap,Ol=new WeakMap;f();var x5="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";var I5="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";f();var M5=4.291666666666667,P5=15,T5=25,w5=43/60;f();var E5=["horizontal","icon"],UM=new Map([[E5[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[E5[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),XM=/<svg([^>]*)>/g;function D5(r,t,e,i){let o=UM.get(r);return o?o.replace(XM,'<svg$1 width="'.concat(e,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}var O5=!1,ue,fi,Ca,Qe,dt,an,lr,Br,Td=class extends Z{constructor(e,i,o){super();b(this,ue,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});b(this,fi,void 0);b(this,Ca,void 0);b(this,Qe,void 0);b(this,dt,void 0);b(this,an,void 0);b(this,lr,0);b(this,Br,0);u(this,"dirty",!0);u(this,"getPositionAlignedCanvasCoordinates",(e,i)=>({"top-left":{x:0,y:0},"top-right":{x:e,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:e,y:i},center:{x:e/2,y:i/2},top:{x:e/2,y:0},bottom:{x:e/2,y:i},left:{x:0,y:i/2},right:{x:e,y:i/2}})[a(this,ue).position]);u(this,"getPositionAlignedPadding",()=>{var o,n,s,c;let e=a(this,ue).padding;if(typeof e=="number")return{"top-left":{x:e,y:e},"top-right":{x:-e,y:e},"bottom-left":{x:e,y:-e},"bottom-right":{x:-e,y:-e},center:{x:0,y:0},top:{x:0,y:e},bottom:{x:0,y:-e},left:{x:e,y:0},right:{x:-e,y:0}}[a(this,ue).position];let i={top:(o=e.top)!=null?o:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(c=e.left)!=null?c:0};return{x:i.left-i.right,y:i.top-i.bottom}});I(this,ue,Object.assign({},a(this,ue),o)),I(this,Ca,e),I(this,fi,i)}get color(){return a(this,ue).color==="light"?"white":"#293136"}get iconName(){return a(this,ue).iconOnly?"icon":"horizontal"}get minWidth(){return a(this,ue).iconOnly?P5:75}get defaultWidth(){return a(this,ue).iconOnly?T5:150}get aspectRatio(){return a(this,ue).iconOnly?w5:M5}get options(){return{...a(this,ue)}}set options(e){I(this,ue,{padding:e.padding||a(this,ue).padding,position:e.position||a(this,ue).position,iconOnly:e.iconOnly||a(this,ue).iconOnly,color:e.color||a(this,ue).color,scale:e.scale||a(this,ue).scale,onClick:a(this,ue).onClick,visible:e.visible||a(this,ue).visible})}get icon(){return D5(this.iconName,this.color,a(this,lr)*a(this,fi).pixelRatio,a(this,Br)*a(this,fi).pixelRatio)}setSize(e,i){a(this,dt)&&(a(this,dt).uniforms.uSize.value.x=e,a(this,dt).uniforms.uSize.value.y=i)}setXY(e,i){a(this,dt)&&(a(this,dt).uniforms.uSize.value.w=e,a(this,dt).uniforms.uSize.value.z=i)}get width(){return a(this,lr)}get height(){return a(this,Br)}getPositionAlignedOffset(e,i){return{"top-left":{x:0,y:0},"top-right":{x:-e,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-e,y:-i},center:{x:-(e/2),y:-(i/2)},top:{x:-(e/2),y:0},bottom:{x:-(e/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-e,y:-(i/2)}}[a(this,ue).position]}insertIntoQuadTree(e){a(this,an)!=null&&typeof a(this,ue).onClick=="function"&&e.insert(a(this,an))}resize(e,i){if(a(this,ue).visible!==!0)return;let o=this.getPositionAlignedCanvasCoordinates(e,i),n=this.getPositionAlignedPadding(),s=this.getPositionAlignedOffset(a(this,lr),a(this,Br)),c=Math.min(e-a(this,lr),Math.max(0,o.x+n.x+s.x)),l=Math.min(i-a(this,Br),Math.max(0,o.y+n.y+s.y));this.setSize(a(this,lr)/e,a(this,Br)/i),this.setXY(c/e,l/i),I(this,an,new Ge(c,l,a(this,lr),a(this,Br),{entityId:"watermark"}))}update(){this.dirty&&a(this,ue).visible===!0&&(I(this,lr,Math.min(a(this,fi).canvasWidth,Math.max(this.minWidth,this.defaultWidth*a(this,ue).scale))),I(this,Br,a(this,lr)/this.aspectRatio),ma.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(I(this,dt,new rs({uniforms:{uTexture:{value:e},uSize:{value:new lg(0,0,0,0)},uOpacity:{value:.7}},vertexShader:x5,fragmentShader:I5,depthWrite:!1,depthTest:!1,defines:{debug:O5},wireframe:O5,transparent:!0,visible:!0})),a(this,Qe))a(this,Qe).material=a(this,dt),a(this,Qe).material.needsUpdate=!0;else{let i=new qr(2,2,1,1);I(this,Qe,new me(i,a(this,dt))),a(this,Qe).position.set(0,0,-1),a(this,Qe).frustumCulled=!1,a(this,Qe).renderOrder=999;let o=new cp(1,1,1),n=new me(o,new Xt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));n.frustumCulled=!1,n.layers.set(1),a(this,Qe).add(n),a(this,Ca).add(a(this,Qe))}this.resize(a(this,fi).canvasWidth,a(this,fi).canvasHeight),this.publish("texture-loaded")})),this.dirty=!1}destroy(){a(this,Qe)&&(a(this,Ca).remove(a(this,Qe)),je(a(this,Qe))),I(this,Qe,void 0),a(this,dt)&&a(this,dt).dispose(),I(this,dt,void 0),I(this,an,void 0)}};ue=new WeakMap,fi=new WeakMap,Ca=new WeakMap,Qe=new WeakMap,dt=new WeakMap,an=new WeakMap,lr=new WeakMap,Br=new WeakMap;f();var Ty=100,ZM=!1,wd=class extends Z{constructor(e,i){super();u(this,"currentTotalBoundingBox");u(this,"state");u(this,"cameraSystem");u(this,"debugMesh",null);u(this,"dirty",!1);u(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new zr,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new z(0,0,0),new z(Ty*2,Ty*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(Ty))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let e of this.state.geometry2DMap.values())e.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(e.position),e.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new z),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new pg).radius},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,ZM&&this.state.entityScene.parent instanceof An&&(this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new me(new vg(this.cameraSystem.panBounds.radius),new Xt({color:16711680,transparent:!0,opacity:.5})),this.state.entityScene.parent.add(this.debugMesh))}}};f();var L5="\xA9 Mappedin",zM="https://info.mappedin.com/feedback",Ey=["top-left","top-right","bottom-left","bottom-right"],qM=640,$M=()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>",wy={custom:[],position:"bottom-right",feedback:!0},Ed=class{constructor(t){u(this,"controlContainerEl");u(this,"controlPositions");u(this,"compact");u(this,"attribContainerEl");u(this,"attribInnerEl");u(this,"attribButtonEl");u(this,"feedbackLinkEl");u(this,"attribHTML",L5);u(this,"customAttributions",[]);u(this,"toggleAttribution",t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))});this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=Ey.reduce((e,i)=>{let o=document.createElement("div");return o.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(o),e[i]=o,e},{})}addAttributionControl(t=wy){var o;let e=t.position&&Ey.includes(t.position)?t.position:wy.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(e)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[e].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=$M(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((o=t.feedback)!=null?o:wy.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=zM,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let e=[L5],i=t.style.sourceCaches;for(let o in i){let n=i[o];if(n.used||n.usedForTerrain){let s=n.getSource();s.attribution&&e.indexOf(s.attribution)<0&&e.push(s.attribution)}}e=e.filter(o=>String(o).trim()),e=e.filter((o,n)=>{for(let s=n+1;s<e.length;s++)if(e[s].indexOf(o)>=0)return!1;return!0}),this.attribHTML=e.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=qM||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};f();var Ll,Sa=class{constructor(t,e){u(this,"mesh");u(this,"type","custom-geometry");u(this,"dirty",!0);u(this,"feature");u(this,"builder");u(this,"outline");u(this,"color",new ze);b(this,Ll,0);this.mesh=new _i,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}setOpacity(){}setColor(){}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return a(this,Ll)}set altitude(t){this.mesh&&(this.mesh.position.z=t,I(this,Ll,t))}};Ll=new WeakMap;f();var Dd=class{constructor(t,e){u(this,"state");u(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let i of this.state.geometry3DIdsInScene){let o=this.state.geometry3DMap.get(i);(o==null?void 0:o.type)==="custom-geometry"&&(t=o.components[0],e=o.components[1],t.dirty&&e.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(n=>{n.userData={entityId:i,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};f();f();var Od=class extends me{constructor(){super(...arguments);u(this,"userData",{entityId:""})}},JM=B.object({flipImageToFaceCamera:B.boolean().optional(),url:B.string()}),QM=B.object({type:B.enum(["Feature"]),properties:B.object({width:B.number(),height:B.number(),rotation:B.number().min(0).max(360).optional(),verticalOffset:B.number().optional()}),geometry:fa});function A5(r,t,e){B.union([B.number(),B.string()]).parse(r),QM.parse(t),JM.parse(e)}var Ld=class{constructor(t){u(this,"mesh",new _i);u(this,"imageMesh");u(this,"outline");u(this,"type","image");u(this,"instanceIndex",-1);u(this,"geometry");u(this,"material");u(this,"feature");u(this,"position",new z);this.feature=t}get visible(){var t,e;return(e=(t=this.mesh)==null?void 0:t.visible)!=null?e:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};var F5=Math.PI*2,_5=Math.PI/2,k5=Math.PI*1.5,KM=.01,eP=!1,Ad=class extends Z{constructor(e,i){super();u(this,"rendererState");u(this,"convertTo3DMapPosition");u(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=i}createImageMesh(e,i,o,n=0,s){var m,y;let c=new Ai({transparent:!0,depthWrite:!1,side:To}),l=new qr(o.width,o.height),p=new Od(l);p.visible=!1,(m=this.getOrDownloadImage(i))==null||m.then(g=>{c.map=g,c.needsUpdate=!0,c.map.colorSpace=Dn,p.visible=!0,this.publish("image-loaded")}),p.userData.entityId=e,p.material=c;let h=this.convertTo3DMapPosition(s);if(eP){let g=new me(new qr(o.width,o.height),new Ai({color:"gray"}));p.add(g);let S=new Ig;p.add(S),S.scale.set(10,10,10)}return p.renderOrder=1,p.position.set(h.x,h.y,n+KM),p.rotation.z=-ae.degToRad((y=o.rotation)!=null?y:0),p}getOrDownloadImage(e){if(this.imageLoadingCache.has(e))return this.imageLoadingCache.get(e);{let i=new Promise(o=>{ma.getLoader().load(e,n=>{o(n)})});return this.imageLoadingCache.set(e,i),i}}flipIfNeeded(e,i){let n=(e.imageMesh.rotation.z-i+F5)%F5;(n>_5&&n<k5||n<-_5&&n>-k5)&&(e.imageMesh.rotation.z=e.imageMesh.rotation.z-Math.PI)}update(e){var s,c,l,p,h;let i,o,n;for(let m of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(m),(i==null?void 0:i.type)==="image")o=i.components[0],n=i.components[1],n.url&&o.imageMesh==null&&(o.imageMesh=this.createImageMesh(i.id,n.url,o.feature.properties,o.feature.properties.verticalOffset,o.feature.geometry.coordinates),o.mesh.add(o.imageMesh),o.position.copy(o.imageMesh.position)),o.imageMesh&&n.flipImageToFaceCamera&&this.flipIfNeeded(o,e);else if((i==null?void 0:i.type)==="geometry"){if(o=i.components[0],n=i.components[1],n.showImage&&((s=o.feature.properties)!=null&&s.image)&&o.imageMesh==null&&o.visible&&o.mesh!=null&&o.mesh.parent!=null&&((c=o.feature.properties)==null?void 0:c.image.position)!=null){let y=this.createImageMesh(m,(l=o.feature.properties)==null?void 0:l.image.path,(p=o.feature.properties)==null?void 0:p.image,n.height,(h=o.feature.properties)==null?void 0:h.image.position);o.mesh.parent.add(y),o.imageMesh=y}o.imageMesh&&(o.visible?n.showImage&&!o.imageMesh.visible?o.imageMesh.visible=!0:!n.showImage&&o.imageMesh.visible&&(o.imageMesh.visible=!1):o.imageMesh.visible=!1,n.flipImageToFaceCamera&&this.flipIfNeeded(o,e))}}};f();var lo,Fd=class extends Z{constructor(e,i){super();u(this,"cameraDirty",!0);u(this,"focusablesDirty",!0);u(this,"state");u(this,"camera");u(this,"debugEl",null);u(this,"raycasters",[]);u(this,"collisions",new Map);u(this,"focusableEntities",new Set);u(this,"debugRaycasters",!1);b(this,lo,void 0);u(this,"update",(e=!1)=>{e||(a(this,lo)&&cancelAnimationFrame(a(this,lo)),I(this,lo,requestAnimationFrame(()=>{this.updateRaf()})))});this.state=e,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new J(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new J(e.x/1.2,e.y/1.2),o=new J(e.x+(e.x-i.x),i.y),n=new J(i.x,e.y+(e.y-i.y)),s=new J(o.x,n.y),c=new J(e.x,e.y/1.5),l=new J(e.x,e.y+(e.y-c.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[e,c,l,i,o,n,s].map((p,h)=>{if(this.debugRaycasters){let M=document.createElement("div");M.style.position="absolute",M.style.top=p.y+"px",M.style.left=p.x+"px",M.style.width="10px",M.style.height="10px",M.style.backgroundColor="red",this.debugEl.append(M)}let m=p.x/this.state.canvasWidth*2-1,y=-(p.y/this.state.canvasHeight)*2+1,g=new J(m,y),S=new Sr;return S.setFromCamera(g,this.camera),[S,g,h===0?10:h<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,i;for(let o of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(o),i!=null&&(e=i.components[0],e instanceof Tt&&e.focusable&&e.geometry!=null)){if(e.focusMesh==null){let n=new me(e.geometry);n.userData={entityId:i.id},e.focusMesh=n}this.focusableEntities.add(e.focusMesh)}this.focusablesDirty=!1}updateRaf(){if(!this.cameraDirty)return;if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.collisions.clear();for(let[i,o]of this.raycasters)i.setFromCamera(o,this.camera);for(let[i,o,n]of this.raycasters)i.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var l;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let p=c.object.userData.entityId,h=(l=this.collisions.get(p))!=null?l:0;this.collisions.set(p,h+n)}});let e=Array.from(this.collisions,([i,o])=>({entityId:i,weight:o})).sort((i,o)=>o.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",e),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){a(this,lo)&&cancelAnimationFrame(a(this,lo)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};lo=new WeakMap;f();f();f();f();function _d(r,t){t===void 0&&(t={});var e=Gn(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return tP(e,t);case"MultiPolygon":return rP(e,t);default:throw new Error("invalid poly")}}function tP(r,t){t===void 0&&(t={});var e=Gn(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{};return B5(i,o)}function rP(r,t){t===void 0&&(t={});var e=Gn(r),i=e.coordinates,o=t.properties?t.properties:r.type==="Feature"?r.properties:{},n=[];return i.forEach(function(s){n.push(B5(s,o))}),Po(n)}function B5(r,t){return r.length>1?ig(r,t):Zr(r[0],t)}function iP(r,t){var e=!0;return vr(r,function(i){vr(t,function(o){if(e===!1)return!1;e=oP(i.geometry,o.geometry)})}),e}function oP(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!lP(r.coordinates,t.coordinates);case"LineString":return!R5(t,r);case"Polygon":return!ci(r,t)}break;case"LineString":switch(t.type){case"Point":return!R5(r,t);case"LineString":return!nP(r,t);case"Polygon":return!N5(t,r)}break;case"Polygon":switch(t.type){case"Point":return!ci(t,r);case"LineString":return!N5(r,t);case"Polygon":return!aP(t,r)}}return!1}function R5(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(sP(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}function nP(r,t){var e=Jn(r,t);return e.features.length>0}function N5(r,t){for(var e=0,i=t.coordinates;e<i.length;e++){var o=i[e];if(ci(o,r))return!0}var n=Jn(t,_d(r));return n.features.length>0}function aP(r,t){for(var e=0,i=r.coordinates[0];e<i.length;e++){var o=i[e];if(ci(o,t))return!0}for(var n=0,s=t.coordinates[0];n<s.length;n++){var c=s[n];if(ci(c,r))return!0}var l=Jn(_d(r),_d(t));return l.features.length>0}function sP(r,t,e){var i=e[0]-r[0],o=e[1]-r[1],n=t[0]-r[0],s=t[1]-r[1],c=i*s-o*n;return c!==0?!1:Math.abs(n)>=Math.abs(s)?n>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:s>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}function lP(r,t){return r[0]===t[0]&&r[1]===t[1]}var G5=iP;function Dy(r,t){var e=!1;return vr(r,function(i){vr(t,function(o){if(e===!0)return!0;e=!G5(i.geometry,o.geometry)})}),e}var kd=class{constructor(t){u(this,"dirty",!0);u(this,"map");u(this,"stylesheetId","");u(this,"userHiddenLayers",new Set);u(this,"hiddenLayersInStyle",new Set);u(this,"centerPoint");u(this,"bbox");u(this,"polygons");u(this,"handleRender",async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let t=[];if(this.centerPoint){let i=this.map.project(this.centerPoint),o=this.map.queryRenderedFeatures(i,{layers:Array.from(this.hiddenLayersInStyle)});for(var e of o)t.push(["!=",["id"],e.id])}else if(this.bbox&&this.polygons){let i=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(i.length>0){for(let o of i)if(o.geometry!=null&&"coordinates"in o.geometry){let n=ap(o.geometry.coordinates);for(let s of this.polygons)if(Dy(s,n)){t.push(["!=",["id"],o.id]);break}}}}t.length>0&&(this.hiddenLayersInStyle.forEach(i=>{this.map.setFilter(i,["all",...t])}),this.dirty=!1)});u(this,"handleStyleChange",t=>{var e,i;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let o=(i=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:i.id;(!o||o!==this.stylesheetId)&&(this.stylesheetId=o,this.filterStylesInMap(),this.dirty=!0)}});t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){this.centerPoint=t;for(let i of e)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,e,i){this.bbox=t,this.polygons=e.reduce((o,n)=>(n.geometry.type==="Polygon"?o.push(ap(n.geometry.coordinates)):n.geometry.type==="MultiPolygon"&&o.push(...n.geometry.coordinates.map(s=>ap(s))),o),[]);for(let o of i)this.userHiddenLayers.add(o);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};f();f();f();var Oy="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // `nearRadius` to `farRadius` when the camera is at `farZoom`.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";var Ly='#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of `pathRadius`. Since we\'ve\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered "long", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered "short", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path\'s length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the `complete` value as it varies from 0.0 to 1.0.\n // Fragments that are at the `complete` value or past it will be fully\n // transparent, while fragments that are at `complete - completeLength`\n // or before it will be fully opaque. However, we adjust the `complete`\n // value here so that it overshoots by one full `completeLength`, so that\n // the entire path will be opaque when the `complete` value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at `arrowMargin` instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // "zooming off" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as `arrowAnimationTimer` goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a "looping sawtooth" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the "looping" design is preferred is because\n // it takes advantage of WebGL\'s `GL_REPEAT` texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from `pulse`\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the `pulse` value and whether it\'s covered by an arrow -- but if it\'s\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like "holes" when they\'re overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}';var V5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==";var dP=new Fn;function j5(r,t,e){let{nearRadius:i,farRadius:o,accentColor:n,completeFraction:s,isVertical:c}=t,{color:l}=e,p=!0,h=0,m=1/0,y=t.displayArrowsOnPath,g=!c,S=!0,M=y,v=i/2+hP,C=0;r[0].z+=v;for(let re=1;re<r.length;++re){r[re].z+=v;let se=r[re].x-r[re-1].x,Ce=r[re].z-r[re-1].z;if(c)C+=Math.sqrt(se*se+Ce*Ce);else{let Bt=r[re].y-r[re-1].y;C+=Math.sqrt(se*se+Bt*Bt+Ce*Ce)}}if(!c){let re=v-.01;r.push(r[r.length-1].clone().setZ(re)),r.unshift(r[0].clone().setZ(re))}let w=new sg;M&&(w=dP.load(V5),w.colorSpace=Dn);let P=new ze(l),T=new ze(n),E={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new J(1,1)},cameraParameters:{type:"v2",value:new J(h,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:P},pathLength:{type:"f",value:C},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:o},nearZoom:{type:"f",value:h},farZoom:{type:"f",value:m},pulseColor:{type:"c",value:T},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:w},displayArrowsOnPath:{type:"b",value:y},flattenFactor:{type:"f",value:g?.05:1},showPulse:{type:"b",value:S},opacityMultiplier:{type:"f",value:1}},A=new gg(r);A.curveType="catmullrom",A.tension=0;let k=30,N=8,F=k*r.length,V=new bg(A,F,i,N,!1),R=new Float32Array(V.attributes.position.count);for(let re=r.length;re<R.length;re++)R[re]=re;V.setAttribute("vertexIndex",new ts(R,1));let q=new Float32Array(V.attributes.position.count),$=new ts(q,1);for(let re=0;re<=F;re++)for(let se=0;se<=N;++se)$.setX(re*(N+1)+se,re/F);V.setAttribute("pathDistance",$);let pe=new Float32Array(V.attributes.normal.count*3),ve=new ts(pe,3);for(let re=0;re<F;re++){let se=V.tangents[re];for(let Ce=0;Ce<=N;++Ce)ve.setXYZ(re*(N+1)+Ce,se.x,se.y,se.z)}V.setAttribute("pathTangent",ve);let Be=new Float32Array(V.attributes.normal.count*3),Pt=new ts(Be,3);for(let re=0;re<F;re++){let se=V.tangents[re];var de,Oe,be;c?(de=se.x*se.y,Oe=-1+se.y*se.y,be=se.z*se.y):(de=-se.x*se.z,Oe=-se.y*se.z,be=1-se.z*se.z);let Ce=Math.sqrt(de*de+Oe*Oe+be*be);Ce===0&&(Ce=1);let Bt=de/Ce,wn=Oe/Ce,$a=be/Ce;for(let yr=0;yr<=N;++yr)Pt.setXYZ(re*(N+1)+yr,Bt,wn,$a)}V.setAttribute("pathNormal",Pt);let et=new rs({uniforms:E,vertexShader:Oy,fragmentShader:Ly});et.transparent=!0,et.alphaTest=.5,E.resolution.value.x=1,E.resolution.value.y=1,E.vertexes.value=R.length,E.arrowTexture.value.wrapS=Ka,E.arrowTexture.value.wrapT=Ka,E.arrowTexture.value.anisotropy=16,E.complete.value=s;let Ut=new me(V,et),Ze=Ut.clone(),tt={...E,opacityMultiplier:{type:"f",value:.25}};tt.complete.value=1,Ze.material=new rs({uniforms:tt,vertexShader:Oy,fragmentShader:Ly}),Ze.material.transparent=!0,Ze.material.alphaTest=.5,Ze.material.depthWrite=!1,Ze.material.depthTest=!1,Ze.renderOrder=1,tt.resolution.value.x=1,tt.resolution.value.y=1,tt.vertexes.value=R.length,tt.arrowTexture.value.wrapS=Ka,tt.arrowTexture.value.wrapT=Ka,tt.arrowTexture.value.anisotropy=16,tt.complete.value=s,Ut.userData=Ze.userData=t.mesh.userData;let Yr=t.mesh;Yr.add(Ut),Yr.add(Ze),V.computeBoundingBox();let Tn=new z;return V.boundingBox.getCenter(Tn),{mesh:Yr,material:et,center:Tn}}var hP=.15;var Al=class extends Z{constructor(e,i,o){super();u(this,"rendererState");u(this,"altitudeDirty",!0);u(this,"convertTo3DMapPosition");u(this,"getParentContainer");this.rendererState=e,this.convertTo3DMapPosition=i,this.getParentContainer=o}update(e,i,o){let n,s=!1;for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="path"&&n.components[0].type==="path"){let l=n.components[0],p=n.components[1],h=l.isVertical&&this.altitudeDirty;if(!(l instanceof so))continue;if(l.dirty||h){if(l.mesh.parent!=null)for(let y=l.mesh.children.length-1;y>=0;y--)je(l.mesh.children[0]);let m=[];if(l.feature.features.forEach(y=>{let g=y.geometry.coordinates[2]||0,S;if(y.properties.parentId&&(S=this.getParentContainer(y.properties.parentId,!0),S!=null&&S.altitude!=null&&(g+=S.altitude,l.isVertical=!0)),!y.properties.parentId||S!=null&&S.visible){let M=this.convertTo3DMapPosition(y.geometry.coordinates[1],y.geometry.coordinates[0],g);m.push(M)}}),m.length>1){let{mesh:y,material:g,center:S}=j5(m,l,{color:p.color});l.mesh=y,l.material=g,l.position=S}l.dirty=!1}p.dirty&&(l.mesh.children.forEach(m=>{m.material.uniforms.color.value.set(p.color),m.material.needsUpdate=!0}),l.mesh.position.z=p.altitude,p.dirty=!1),l.material&&(l.mesh.children.forEach(m=>{let y=m.material.uniforms;y.nearZoom.value=e,y.farZoom.value=i,y.cameraParameters.value.x=o,l.materialDirty&&(y.nearRadius.value=l.nearRadius,y.displayArrowsOnPath.value=l.displayArrowsOnPath,y.farRadius.value=l.farRadius,y.pulseColor.value.set(l.accentColor),y.complete.value=l.completeFraction),m.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(m=>{m.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,m.material.needsUpdate=!0}),s=!0),l.materialDirty=!1)}this.altitudeDirty=!1,s&&this.publish("animate:path")}};f();var _e,xa,cr,Bd=class{constructor(t){u(this,"rendererState");u(this,"dirty",!1);b(this,_e,void 0);b(this,xa,void 0);b(this,cr,void 0);this.rendererState=t}updateOne(t){var e;if(t instanceof Ie&&t.components[0]instanceof Tt&&t.components[1]instanceof Wt&&t.parentObject3D instanceof Yt&&(I(this,_e,t.components[0]),I(this,cr,t.components[1]),a(this,_e).detached&&a(this,_e).dirty&&a(this,_e).geometry!=null&&a(this,_e).material!=null)){I(this,xa,t.parentObject3D),(e=a(this,_e).mesh)==null||e.setVisibleAt(a(this,_e).instanceIndex,!1);let i=new ze(a(this,cr).color),o=new p1({color:i,side:To,opacity:a(this,cr).opacity||1,transparent:a(this,cr).opacity!==void 0?a(this,cr).opacity<1:!1},1,a(this,_e).material.repeatYFactor),n=new Pg(1,a(this,_e).geometry.attributes.position.count||0,0,o);n.addGeometry(a(this,_e).geometry),n.userData={entities:{0:t.id},detached:!0},a(this,_e).instanceIndex=0,a(this,_e).material.setColor(a(this,_e).instanceIndex,i,a(this,cr).topColor?new ze(a(this,cr).topColor):i),a(this,_e).mesh=n,a(this,_e).material=o,a(this,xa).add(n),a(this,_e).dirty=!1}}update(){if(!this.dirty)return;let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){I(this,_e,void 0),I(this,xa,void 0),I(this,cr,void 0)}};_e=new WeakMap,xa=new WeakMap,cr=new WeakMap;f();f();function H5(r,t,e){var i;if(r.geometry!=null){let o=t||1e-4,n=o/r.currentHeight,s=o/e;r.geometry.scale(1,1,n),r.material&&(r.material.repeatYFactor=s),(i=r.mesh)==null||i.setGeometryAt(r.instanceIndex,r.geometry),r.currentHeight=o}}var sn,co,Rd=class{constructor(t){u(this,"rendererState");u(this,"dirty",!1);b(this,sn,void 0);b(this,co,void 0);this.rendererState=t}updateOne(t){var e;t instanceof Ie&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(I(this,sn,t.components[0]),I(this,co,t.components[1]),t.type==="geometry"&&a(this,co).height!==a(this,sn).currentHeight&&H5(a(this,sn),a(this,co).height,a(this,co).initialHeight))}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){I(this,sn,void 0),I(this,co,void 0)}};sn=new WeakMap,co=new WeakMap;f();var Fl,Nd=class{constructor(t){b(this,Fl,void 0);I(this,Fl,t)}update(){var t;(t=a(this,Fl)._subscribers["pre-render"])==null||t.forEach(e=>e())}};Fl=new WeakMap;f();var fP={showPolygonLabelTextAreaMesh:!1},Gd=class{constructor(t){u(this,"state",fP);u(this,"core");this.core=t}update(t){let e={};for(let[i,o]of Object.entries(t))i in this.state&&this.state[i]!==t[i]&&(this.state[i]=o,e[i]=o);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh())}};var U5=new Sr;var{DEFAULT_PITCH:ky,DEFAULT_BEARING:By,DEFAULT_ZOOM_LEVEL:Ry,DEFAULT_MIN_ZOOM_LEVEL:mP,DEFAULT_MAX_ZOOM_LEVEL:yP}=sr,gP=ae.radToDeg(.6435011087932844),St,De,_l,Ia,po,ln,Ma,kl,Fy,L,ce,pr,Te,Rr,xt,D,Bl,ke,ye,Vd,X5,jd,W5,Hd,Y5,uo,Rl,Nl,Pa,Ud,Gl,Vl,jl,Ta,Hl,_y,cn,Ul,ht,ft,wa,Xl,Ay=class extends Z{constructor(e,i={}){var y,g,S,M,v,C,w,P,T,E;super();b(this,kl);b(this,Vd);b(this,jd);b(this,Hd);b(this,Hl);u(this,"options");u(this,"container");u(this,"Debug");b(this,St,void 0);b(this,De,void 0);b(this,_l,void 0);b(this,Ia,void 0);b(this,po,void 0);b(this,ln,void 0);b(this,Ma,void 0);u(this,"rendererDomElement");b(this,L,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Ee("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:ml,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new gy,cameraObject:new bh});u(this,"camera");b(this,ce,void 0);b(this,pr,void 0);b(this,Te,void 0);b(this,Rr,void 0);b(this,xt,void 0);b(this,D,{});b(this,Bl,window.matchMedia("screen and (min-resolution: 2dppx)"));u(this,"map");b(this,ke,()=>{a(this,D).renderSystem.twoDdirty=!0});b(this,ye,()=>{a(this,D).renderSystem.threeDdirty=!0});b(this,uo,"standalone");b(this,Rl,e=>Math.trunc(e*10)/10);b(this,Nl,()=>{a(this,D).twoDDrawSystem.dirty=!0,j(this,kl,Fy).call(this,_n()),a(this,D).watermarkSystem.dirty=!0,this.render()});b(this,Pa,()=>{a(this,L).canvasWidth=this.rendererDomElement.clientWidth,a(this,L).canvasHeight=this.rendererDomElement.clientHeight,j(this,kl,Fy).call(this,_n()),a(this,Ta).call(this),j(this,Hd,Y5).call(this),a(this,D).cameraSystem.resize(this.canvasWidth,this.canvasHeight),a(this,D).cameraSystem.dirty=!0,a(this,D).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),a(this,D).htmlControlsSystem.resize(this.canvasWidth),a(this,D).geometryInFocusSystem.resize(),a(this,D).interactionSystem.resize(),this.render()});b(this,Ud,()=>{this.renderSync()});b(this,Gl,new z);b(this,Vl,(e,i)=>{let o=this.mode==="standalone"?a(this,De):this.viewCamera;if(a(this,De).position.z+this.camera.elevation>i.z){a(this,Gl).copy(i);let n=a(this,Gl).project(o),s=(n.x+1)/2*this.canvasWidth-0/2,c=(-n.y+1)/2*this.canvasHeight-0/2,l=a(this,Rl).call(this,s),p=a(this,Rl).call(this,c);e.x=l,e.y=p}else e.x=-1e3,e.y=-1e3});b(this,jl,(e,i)=>{a(this,xt).setBufferSize(e,i),a(this,De).aspect=e/i,a(this,De).updateProjectionMatrix(),a(this,De).updateMatrixWorld(!0),a(this,Ia).x=e,a(this,Ia).y=i});b(this,Ta,()=>{var s;let e=a(this,L).canvasWidth=this.rendererDomElement.clientWidth,i=a(this,L).canvasHeight=this.rendererDomElement.clientHeight,o=Math.floor(e*this.resolutionScale),n=Math.floor(i*this.resolutionScale);a(this,jl).call(this,o,n),(s=this.map)==null||s.resize(),a(this,L).shouldMeasureCanvas=!1});u(this,"getParentContainer",(e,i=!0)=>{if(!e)return i?a(this,L).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let o=a(this,L).geometry3DMap.get(e);return o instanceof Ee?o:(O.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),i?a(this,L).entityScene:void 0)}else if(e.type==="group-container"){let o=a(this,L).geometry3DMap.get(e.id);if(o instanceof Ee)return o}return i?a(this,L).entityScene:void 0});u(this,"showCollisionBoxes",()=>{a(this,D).collisionSystem.showCollisionBoxes(),this.render()});u(this,"hideCollisionBoxes",()=>{a(this,D).collisionSystem.hideCollisionBoxes(),this.render()});u(this,"projectScreenXYToCoordinate",(e,i)=>{var l;let o=e/this.canvasWidth*2-1,n=-(i/this.canvasHeight)*2+1,s=new J(o,n);U5.setFromCamera(s,a(this,De).clone());let c=(l=U5.intersectObject(a(this,po),!1)[0])==null?void 0:l.point;return c!=null?this.convert3DMapPositionToCoordinate(c):void 0});u(this,"projectCoordinateToScreenXY",e=>{let i=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),o=new J;return a(this,Vl).call(this,o,i),{x:o.x,y:o.y}});u(this,"convert3DMapPositionToCoordinate",e=>{var n,s,c,l;let{lat:i,lon:o}=fp((s=(n=a(this,L).center)==null?void 0:n[1])!=null?s:0,(l=(c=a(this,L).center)==null?void 0:c[0])!=null?l:0,e.x,e.y);return[o,i,e.z]});u(this,"setBackgroundColor",(e,i)=>{a(this,xt).setBackgroundColor(e,i)});u(this,"getMetresPerPixel",()=>{let e=this.container.clientWidth,i=this.container.clientHeight/2,o=this.projectScreenXYToCoordinate(0,i),n=this.projectScreenXYToCoordinate(e,i);return o==null||n==null?void 0:op(o,n)/e});u(this,"hideOutdoorLayersUnderPoint",(e,i)=>{!this.map||(i==null?void 0:i.length)===0||(a(this,D).outdoorLayersSystem.hideLayersUnderPoint(e,i),this.render())});u(this,"hideOutdoorLayersIntersectingPolygons",(e,i,o)=>{a(this,D).outdoorLayersSystem.hideLayersIntersectingPolygons(e,i,o),this.render()});b(this,cn,new hg);b(this,Ul,new On);u(this,"render",()=>{if(a(this,D).renderSystem!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return a(this,D).renderSystem.update()});u(this,"renderSync",()=>a(this,D).renderSystem.update(!0));b(this,ht,wo(()=>{this.publish("user-interaction-start",void 0)},0,!0));b(this,ft,wo(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));u(this,"on",(e,i)=>{super.on(e,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&x.env.NODE_ENV!=="test"&&(O.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))});u(this,"off",(e,i)=>{super.off(e,i)});u(this,"getCursor",()=>a(this,D).interactionSystem.getCursor());u(this,"destroy",()=>{a(this,D)&&(a(this,D).cameraSystem.off("user-dolly-start",a(this,ht)),a(this,D).cameraSystem.off("user-pan-start",a(this,ht)),a(this,D).cameraSystem.off("user-rotate-start",a(this,ht)),a(this,D).cameraSystem.off("user-zoom-start",a(this,ht)),a(this,D).cameraSystem.off("user-tilt-start",a(this,ht)),a(this,D).cameraSystem.off("user-pedestal-start",a(this,ht)),a(this,D).cameraSystem.off("user-dolly-end",a(this,ft)),a(this,D).cameraSystem.off("user-pan-end",a(this,ft)),a(this,D).cameraSystem.off("user-rotate-end",a(this,ft)),a(this,D).cameraSystem.off("user-zoom-end",a(this,ft)),a(this,D).cameraSystem.off("user-tilt-end",a(this,ft)),a(this,D).cameraSystem.off("user-pedestal-end",a(this,ft)),a(this,D).renderSystem.off("measure-canvas",a(this,Ta)),this.remove("__scene"),a(this,ke).call(this),a(this,ye).call(this),this.renderSync(),a(this,D).renderSystem.destroy(),a(this,D).cameraSystem.off("change",this.render),a(this,D).pathSystem.off("animate:path",this.render),a(this,D).cameraSystem.dispose(),a(this,D).exporterSystem.destroy(),a(this,D).outdoorLayersSystem.destroy(),a(this,D).drawSystem.destroy(),window.removeEventListener("resize",a(this,Pa),!1),a(this,Bl).removeEventListener("change",a(this,Nl)),a(this,ln)&&a(this,ln).disconnect(),this._subscribers={},a(this,xt).destroy(),a(this,St).traverse(e=>{je(e),"dispose"in e&&typeof e.dispose=="function"&&e.dispose()}),I(this,St,void 0),a(this,D).htmlControlsSystem.destroy(),a(this,D).collisionSystem.destroy(),a(this,D).interactionSystem.destroy(),a(this,D).domMutationSystem.destroy(),a(this,D).geometryInFocusSystem.destroy(),I(this,D,void 0),a(this,uo)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(a(this,Rr)),this.container.removeChild(a(this,ce)),I(this,xt,void 0))});b(this,wa,new z);b(this,Xl,new z);if(this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!e.clientWidth||!e.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(i.mode==="outdoors-interleaved"||i.mode==="outdoors-overlay")&&i.map&&(I(this,uo,i.mode),this.map=i.map),a(this,L).entityScene.addEventListener("childadded",()=>{a(this,ye).call(this),a(this,ke).call(this)}),a(this,L).entityScene.addEventListener("childremoved",()=>{a(this,ye).call(this),a(this,ke).call(this)}),a(this,L).geometry3DMap.set(a(this,L).entityScene.userData.entityId,a(this,L).entityScene),i.center&&(a(this,L).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=e,j(this,Vd,X5).call(this),j(this,jd,W5).call(this),a(this,D).htmlControlsSystem=new Ed(this.container),a(this,uo)!=="outdoors-overlay"&&a(this,D).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),x.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),I(this,xt,new Yu({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(y=i.gl)==null?void 0:y.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:()=>{typeof i.onWebGLContextLost=="function"&&i.onWebGLContextLost()},onWebGLContextRestored:()=>{i.onWebGLContextRestored&&i.onWebGLContextRestored(),a(this,ke).call(this),a(this,ye).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(g=i.backgroundAlpha)!=null?g:1})),I(this,St,new An),a(this,St).add(a(this,L).entityScene);let o=window.__THREE_DEVTOOLS__;x.env.NODE_ENV==="dev"&&typeof o<"u"&&(o.dispatchEvent(new CustomEvent("observe",{detail:a(this,St)})),o.dispatchEvent(new CustomEvent("observe",{detail:a(this,xt)}))),I(this,De,new bh(gP,this.aspect,50,1e5)),a(this,L).cameraObject=a(this,De),I(this,_l,new dg),a(this,De).renderOrder=999;let n=new es;n.add(a(this,De)),I(this,Ma,new es),a(this,Ma).add(n),a(this,St).add(a(this,Ma)),a(this,De).updateProjectionMatrix(),a(this,De).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:()=>0,georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=a(this,xt).domElement(),I(this,Ia,new J);let s=new qr(1e6,1e6),c=new Xt({color:0,visible:!1});I(this,po,new me(s,c)),a(this,St).add(a(this,po)),(S=i.gl)!=null&&S.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",a(this,Pa),!1),a(this,Bl).addEventListener("change",a(this,Nl)),typeof ResizeObserver=="function"&&((M=x.env)==null?void 0:M.NODE_ENV)!=="test"&&(I(this,ln,new ResizeObserver(wo(()=>{a(this,Pa).call(this)},0))),(v=a(this,ln))==null||v.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(C=globalThis.MappedinDebug)!=null&&C.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(w=globalThis.MappedinDebug)!=null&&w.TEST_IOS?"1920px":"100%",x.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),a(this,L).canvasWidth=this.rendererDomElement.clientWidth,a(this,L).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,p=this.canvasHeight;a(this,D).watermarkSystem=new Td(a(this,De),a(this,L),i==null?void 0:i.watermark),a(this,D).watermarkSystem.on("texture-loaded",this.render),a(this,L).shouldMeasureCanvas=!0,a(this,L).pixelRatio=this.resolutionScale,a(this,jl).call(this,Math.floor(l*this.resolutionScale),Math.floor(p*this.resolutionScale));let h=new hp(16777215,.3*Math.PI);h.position.set(-150,-150,350),a(this,St).add(h);let m=new Sg(16777215,.741*Math.PI);a(this,St).add(m),a(this,D).cameraSystem=new nn(a(this,De),a(this,St),a(this,xt).renderer,a(this,L),{mode:this.mode,canvasHeight:p,canvasWidth:l}),a(this,D).cameraSystem.on("user-dolly-start",a(this,ht)),a(this,D).cameraSystem.on("user-pan-start",a(this,ht)),a(this,D).cameraSystem.on("user-rotate-start",a(this,ht)),a(this,D).cameraSystem.on("user-zoom-start",a(this,ht)),a(this,D).cameraSystem.on("user-tilt-start",a(this,ht)),a(this,D).cameraSystem.on("user-pedestal-start",a(this,ht)),a(this,D).cameraSystem.on("user-dolly-end",a(this,ft)),a(this,D).cameraSystem.on("user-pan-end",a(this,ft)),a(this,D).cameraSystem.on("user-rotate-end",a(this,ft)),a(this,D).cameraSystem.on("user-zoom-end",a(this,ft)),a(this,D).cameraSystem.on("user-tilt-end",a(this,ft)),a(this,D).cameraSystem.on("user-pedestal-end",a(this,ft)),a(this,D).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),a(this,D).geometryInFocusSystem&&(a(this,D).geometryInFocusSystem.cameraDirty=!0),this.render()}),a(this,D).pathSystem=new Al(a(this,L),this.convertTo3DMapPosition,this.getParentContainer),a(this,D).pathSystem.on("animate:path",this.render),a(this,D).panBoundsSystem=new wd(a(this,L),a(this,D).cameraSystem),a(this,D).panBoundsSystem.on("update",()=>{let{panBounds:A,fov:k,convertAltitudeToZoomLevel:N}=a(this,D).cameraSystem;if(a(this,D).panBoundsSystem.autoMinZoomLevel){let F=k*Math.PI/180,V=Math.tan(F/2);if(A.radius<=0)return;let R=N(A.radius/V);this.camera.setMinZoomLevel(R)}}),this.camera=new Pd(this,a(this,D),a(this,L),a(this,po)),this.camera.setZoomLevel((P=i.zoomLevel)!=null?P:Ry),this.camera.setBearing((T=i.bearing)!=null?T:By),this.camera.setPitch((E=i.pitch)!=null?E:ky),this.camera.setMaxZoomLevel(yP),this.camera.setMinZoomLevel(mP),a(this,D).domVisiblitySystem=new ld(a(this,L),a(this,Rr)),a(this,D).domMutationSystem=new Md(a(this,L),a(this,Rr)),a(this,D).domMutationSystem.on("dimensions-update",()=>{a(this,D).collisionSystem.collidersDirty=!0,this.render()}),a(this,D).domDrawSystem=new xd(a(this,L)),a(this,D).collisionSystem=new Zu(a(this,pr),a(this,L)),a(this,D).twoDDrawSystem=new pd(a(this,L),a(this,Te)),a(this,D).interactionSystem=new cl(this.rendererDomElement,a(this,L),a(this,De),a(this,po),a(this,D).cameraSystem.isUserInteracting),a(this,D).interactionSystem.on("hover",this.render),a(this,D).interactionSystem.on("click",A=>{var k,N,F,V,R,q;if(((k=A.entity2D)==null?void 0:k.id)==="watermark"&&typeof a(this,D).watermarkSystem.options.onClick=="function"){a(this,D).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(A.position),geometry:A.entity3D?[(N=A.entity3D)==null?void 0:N.id]:[],paths:((F=A.entity3D)==null?void 0:F.components[0])instanceof so?[A.entity3D.id]:[],markers:((V=A.entity2D)==null?void 0:V.components[0])instanceof Fi?[A.entity2D.id]:[],models:((R=A.entity3D)==null?void 0:R.components[0])instanceof ao?[A.entity3D.id]:[],labels:((q=A.entity2D)==null?void 0:q.components[0])instanceof Bi?[A.entity2D.id]:[],containers:Array.isArray(A.groupContainers)?A.groupContainers.map($=>$.userData.entityId):[],pointerEvent:A.pointerEvent})}),a(this,D).interactionSystem.on("hover",A=>{var k,N,F,V,R,q;A.position&&((k=A.entity2D)==null?void 0:k.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(A.position),geometry:A.entity3D?[(N=A.entity3D)==null?void 0:N.id]:[],paths:((F=A.entity3D)==null?void 0:F.components[0])instanceof so?[A.entity3D.id]:[],markers:((V=A.entity2D)==null?void 0:V.components[0])instanceof Fi?[A.entity2D.id]:[],models:((R=A.entity3D)==null?void 0:R.components[0])instanceof ao?[A.entity3D.id]:[],labels:((q=A.entity2D)==null?void 0:q.components[0])instanceof Bi?[A.entity2D.id]:[],containers:Array.isArray(A.groupContainers)?A.groupContainers.map($=>$.userData.entityId):[]})}),a(this,D).geometryInFocusSystem=new Fd(a(this,L),a(this,De)),a(this,D).geometryInFocusSystem.on("geometry-in-focus",A=>{this.publish("geometry-in-focus",A)}),a(this,D).twoDVisiblitySystem=new dd(a(this,L)),a(this,D).drawSystem=new ud(a(this,L)),a(this,D).drawSystem.on("texture-loaded",this.render),a(this,D).stackSystem=new fd(a(this,L)),a(this,D).twoDProjectionSystem=new cd(a(this,L),a(this,Vl)),a(this,D).exporterSystem=new pl(a(this,L)),a(this,D).meshOptimizationSystem=new sd(a(this,L),this.convertTo3DMapPosition),a(this,D).meshOptimizationSystem.on("model-loaded",this.render),a(this,D).meshDetachmentSystem=new Bd(a(this,L)),a(this,D).meshModificationSystem=new Rd(a(this,L)),a(this,D).customGeometrySystem=new Dd(a(this,L),this.convertTo3DMapPosition),a(this,D).outlineInterpolationSystem=new h1(a(this,L)),a(this,D).renderSystem=new hd(a(this,xt),a(this,L),this.mode,a(this,St),a(this,De),this.viewCamera,a(this,D)),a(this,D).preRenderSystem=new Nd(this),a(this,D).imageSystem=new Ad(a(this,L),this.convertTo3DMapPosition),a(this,D).text3DSystem=new Hg(a(this,L),this.convertTo3DMapPosition),a(this,D).text3DSystem.on("render",this.render),a(this,D).imageSystem.on("image-loaded",this.render),a(this,D).renderSystem.on("measure-canvas",a(this,Ta)),a(this,D).outdoorLayersSystem=new kd(this.map),this.Debug=new Gd(this),a(this,Ud).call(this)}get viewCamera(){return a(this,_l)}get canvasWidth(){return a(this,L).canvasWidth}get canvasHeight(){return a(this,L).canvasHeight}get resolutionScale(){var e,i;return(i=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:_n()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return a(this,uo)}addGroupContainer(e,i,o){if(!a(this,L).geometry3DMap.has(e)&&!a(this,L).geometry2DMap.has(e)){let n=new Ee(e);n.addEventListener("childadded",()=>{a(this,ye).call(this),a(this,ke).call(this)}),n.addEventListener("childremoved",()=>{a(this,ye).call(this),a(this,ke).call(this)}),(i==null?void 0:i.visible)!==void 0&&(n.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&n.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&xr(n,i.interactive,a(this,L)),a(this,L).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Ee&&s.addEntity(n),a(this,ye).call(this),this.render()}else O.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,i,o){if(a(this,L).geometry3DMap.has(e))O.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let n=new Ee(e);n.addEventListener("childadded",()=>{a(this,ye).call(this),a(this,ke).call(this)}),n.addEventListener("childremoved",()=>{a(this,ye).call(this),a(this,ke).call(this)}),n.components[0]=new Id,(i==null?void 0:i.visible)!==void 0&&(n.visible=i.visible),a(this,L).geometry3DMap.set(e,n);let s=this.getParentContainer(o);s instanceof Ee&&s.addEntity(n)}return{id:e,type:"stack-container"}}addCustomGeometry(e,i,o,n,s){if(a(this,L).geometry3DMap.has(e))O.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let c=new Sa(i,o),l=new Ie(c,new Wt(n));l.id=e,c.mesh.userData={entityId:e,type:"custom-geometry"},a(this,L).geometry3DMap.set(l.id,l);let p=this.getParentContainer(s);p instanceof Ee&&p.addEntity(l),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,i,o,n){var s,c;if(!a(this,L).geometry3DMap.has(e)&&!a(this,L).geometry2DMap.has(e)){let l=new Yt(e,new Sh(o));l.addEventListener("childadded",()=>{a(this,ye).call(this),a(this,ke).call(this)}),l.addEventListener("childremoved",()=>{a(this,ye).call(this),a(this,ke).call(this)}),l.userData.dirty=!0,a(this,L).geometry3DMap.set(e,l);for(let h of i.features){if(h.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(h.geometry.type))continue;let m=(h==null?void 0:h.id)||((s=h==null?void 0:h.properties)==null?void 0:s.id)||he(),{visible:y,...g}=o||{color:Mg},S=a(this,D).meshOptimizationSystem.createEntityFromFeature(m,h,g);a(this,L).geometry3DMap.set(m,S),l.userData.entities3D.add(m)}l.setVisible((c=o==null?void 0:o.visible)!=null?c:!0),(o==null?void 0:o.altitude)!=null&&l.setAltitude(o.altitude);let p=this.getParentContainer(n);p instanceof Ee&&p.addEntity(l),a(this,ye).call(this),this.render()}else O.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return a(this,D).outlineInterpolationSystem.dirty=!0,{id:e,type:"geometry-group"}}addImage(e,i,o,n){try{A5(e,i,o)}catch(s){O.error(s);return}if(!a(this,L).geometry3DMap.has(e)&&!a(this,L).geometry2DMap.has(e)){let s=new Ld(i),c=new Ie(s,new Wt(o));c.id=e||he(),s.mesh.userData={entityId:c.id,type:"path"},a(this,L).geometry3DMap.set(c.id,c);let l=this.getParentContainer(n);l instanceof Ee&&l.addEntity(c),a(this,ye).call(this),this.render()}else O.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,i,o,n){try{m5(e,i,o)}catch(s){O.error(s);return}if(!a(this,L).geometry3DMap.has(e)&&!a(this,L).geometry2DMap.has(e)){let s=new Yt(e,new Sh(o));s.addEventListener("childadded",()=>{a(this,ye).call(this),a(this,ke).call(this)}),s.addEventListener("childremoved",()=>{a(this,ye).call(this),a(this,ke).call(this)}),a(this,L).geometry3DMap.set(e,s),s.userData.dirty=!0,s.userData.modelURL=o.url;for(let l of i.features){let p=l.id||l.properties.id||he(),h=a(this,D).meshOptimizationSystem.createModelFromFeature(p,l,o);l.properties.interactive!==void 0&&xr(h,l.properties.interactive,a(this,L)),a(this,L).geometry3DMap.set(p,h),s.userData.entities3D.add(p)}let c=this.getParentContainer(n);c instanceof Ee&&c.addEntity(s),a(this,ye).call(this),this.render()}else O.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,i,o,n){var c;let s=o==null?void 0:o.id;try{wg(e,i,o||{})}catch(l){O.error(l);return}if(s===void 0||!a(this,L).geometry2DMap.has(s)&&!a(this,L).geometry3DMap.has(s)){let l=j(this,Hl,_y).call(this,e,new Fi(i,o));l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&o.interactive!=="pointer-events-auto"&&xr(l,o==null?void 0:o.interactive,a(this,L)),(c=this.getParentContainer(n))==null||c.addEntity(l),this.render()}else O.error("Marker2D with ID '".concat(s,"' already exists. The marker cannot be added."));return{id:s,type:"marker"}}labelText3D(e,i,o={}){var p,h;try{if(!i||!e)throw new Error("content and meshGeometryId are required");Ug.parse(o)}catch(m){O.error(m);return}let n=a(this,L).geometry3DMap.get(e);if((n==null?void 0:n.type)!=="geometry"){O.error(".labelText3D failed: target incorrect");return}let s=n==null?void 0:n.components[0];if(!s.feature.properties.textArea)return;if(s.textEntityId){let m=a(this,L).geometry3DMap.get(s.textEntityId);if((m==null?void 0:m.type)!=="text3d"){O.error(".labelText3D failed: existing text3d not found");return}return{id:m.id,type:m.type}}let c=new Xg({type:"Feature",geometry:{coordinates:(p=s.feature.properties.textArea)==null?void 0:p.position,type:"Point"},properties:{textArea:s.feature.properties.textArea,content:i,id:he()}});c.polygonEntityId=e;let l=new Ie(c,new gp(o==null?void 0:o.appearance));return s.textEntityId=l.id.toString(),c.mesh.userData.entityId=l.id.toString(),c.mesh.userData.type="text3d",a(this,L).geometry3DMap.set(l.id.toString(),l),o.parentId&&((h=this.getParentContainer(o.parentId))==null||h.addEntity(l)),this.render(),{id:l.id,type:"text3d"}}addLabel2D(e,i,o,n){var c;let s=o==null?void 0:o.id;try{jg(e,i,o||{})}catch(l){O.error(l);return}if(s===void 0||!a(this,L).geometry2DMap.has(s)&&!a(this,L).geometry3DMap.has(s)){let l=j(this,Hl,_y).call(this,e,new Bi(i,o||{},a(this,L)));l.id=s||String(l.id),s=l.id,(o==null?void 0:o.interactive)!=null&&xr(l,o==null?void 0:o.interactive,a(this,L));let p=typeof n=="string"||typeof n=="number"?a(this,L).geometry3DMap.get(n):void 0;p instanceof Ie?p.addEntity(l):(c=this.getParentContainer(n))==null||c.addEntity(l),a(this,ke).call(this),this.render()}else O.error("Label2D with ID '".concat(s,"' already exists. The label cannot be added."));return{id:s,type:"label"}}addPath(e,i={},o){var l;try{v5(e,i||{})}catch(p){O.error(p);return}let n=new so(e,s1(i)),s=new Ie(n,new Wt({color:(l=i==null?void 0:i.color)!=null?l:"#ff834c"}));s.id=(i==null?void 0:i.id)||he(),n.mesh.userData={entityId:s.id,type:"path"},a(this,L).geometry3DMap.set(s.id,s),(i==null?void 0:i.interactive)!=null&&xr(s,i==null?void 0:i.interactive,a(this,L));let c=this.getParentContainer(o);return c instanceof Ee&&c.addEntity(s),a(this,ye).call(this),this.render(),{id:s.id,type:"path"}}updateWatermark(e){a(this,D).watermarkSystem.options=e,a(this,D).watermarkSystem.dirty=!0,a(this,D).collisionSystem.collidersDirty=!0,this.render()}remove(e){var o,n;let i;if(typeof e=="string"||typeof e=="number"?(i=a(this,L).geometry2DMap.get(e),i==null&&(i=a(this,L).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(i=a(this,L).geometry2DMap.get(e.id),i==null&&(i=a(this,L).geometry3DMap.get(e.id))):i=e,i!=null){if(i.type==="custom-geometry")a(this,L).geometry3DMap.delete(i.id),i.object3d&&je(i.object3d);else if(i.type==="group-container"){a(this,L).geometry3DMap.delete(i.userData.entityId);for(let s of i.childrenIds.values())this.remove(s),i.userData.entities2D.delete(s);je(i)}else if(i.type==="geometry-group"){a(this,L).geometry3DMap.delete(i.userData.entityId);for(let s of i.userData.entities3D.values())this.remove(s),i.userData.entities3D.delete(s);je(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let s=i.components[0];if(i.entities2D.size>0){for(let c of i.entities2D.values())this.remove(c);i.removeAllEntities()}i.object3d&&(((o=i.parentObject3D)==null?void 0:o.type)==="geometry-group"&&i.parentObject3D.userData.entities3D.delete(i.id),je(i.object3d)),"outline"in s&&s.outline&&je(s.outline),"focusMesh"in s&&s.focusMesh!=null&&je(s.focusMesh),"textMesh"in s&&s.textMesh!=null&&this.remove(s.textMesh.userData.entityId),a(this,L).geometry3DMap.delete(i.id)}else if(i.type==="marker"||i.type==="label"){if(((n=i.parentObject3D)==null?void 0:n.type)==="geometry-group"){let s=i.object3d.userData.parentEntityId;if(s){let c=a(this,L).geometry3DMap.get(s);c instanceof Ie&&c.removeEntity(i)}}i.object3d&&je(i.object3d),i.type==="label"&&delete a(this,D).twoDDrawSystem.textCache[i.id],a(this,L).geometry2DMap.delete(i.id)}else if(i.type==="image")i.object3d&&je(i.object3d),a(this,L).geometry3DMap.delete(i.id);else if(i.type==="text3d"){je(i.object3d);let{batchedText:s,textMesh:c,polygonEntityId:l}=i.components[0];if(c&&(s&&s.removeText(c),je(c)),l){a(this,D).text3DSystem.remove(l);let p=a(this,L).geometry3DMap.get(l);(p==null?void 0:p.type)==="geometry"&&(p.components[0].textMesh=void 0,p.components[0].textEntityId=void 0)}a(this,L).geometry3DMap.delete(i.id)}a(this,ye).call(this),a(this,ke).call(this),this.render()}}getScene(){return this.getState("__scene")}getCurrentSceneGLTF(e){return a(this,D).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(a(this,D).renderSystem.threeDdirty||a(this,D).renderSystem.twoDdirty)&&this.renderSync();let i=new zr;if(e==null)i.setFromObject(a(this,L).entityScene);else{let o=os(a(this,L),e);if((o==null?void 0:o.type)==="geometry"&&(o==null?void 0:o.object3d)!=null){let n=o.components[0],s=n instanceof Tt?n.geometry:void 0;n.mesh instanceof up&&s?(s.computeBoundingBox(),s.boundingBox&&i.union(s.boundingBox)):i.setFromObject(o.object3d)}else((o==null?void 0:o.type)==="geometry-group"||(o==null?void 0:o.type)==="group-container")&&(o==null?void 0:o.userData.entityId)!=null&&i.setFromObject(o)}if(Gg(i))return Dg(i).map(this.convert3DMapPositionToCoordinate)}getState(e){var o,n,s,c,l;if(e==null)return{type:"map-view",hoverColor:a(this,L).hoverColor,text3dHoverColor:a(this,L).text3dHoverColor};let i=os(a(this,L),e);if((i==null?void 0:i.type)==="custom-geometry"){let p=i.components[0],h=i.components[1];return{id:i.id,type:"custom-geometry",visible:h.visible,altitude:h.altitude,parent:(o=i.parentObject3D)==null?void 0:o.userData.entityId,position:this.convert3DMapPositionToCoordinate(p.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let p=[];for(let m of i.userData.entities3D.values()){let y=this.getState(m);((y==null?void 0:y.type)==="geometry"||(y==null?void 0:y.type)==="model")&&p.push(y)}let h=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:h.opacity,color:h.color,height:h.height,altitude:i.altitude,topColor:h.topColor,outline:h.outline,shading:h.shading,texture:h.texture,topTexture:h.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(m=>a(this,L).geometry3DMap.get(m)).every(m=>m&&m.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(m=>this.getState(m)).filter(Boolean)}}else{if((i==null?void 0:i.type)==="group-container")return{id:i.userData.entityId,type:"group-container",visible:i.visible,altitude:i.altitude,interactive:!!i.components[1],children:Array.from(i.childrenIds.values()).map(p=>this.getState(p)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let p=i.components[0],h=i.object3d.parent,m=h==null?void 0:h.userData.entityId;return{id:i.id,type:"label",text:p.text||"",parent:{id:m,type:h==null?void 0:h.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:p.enabled,visible:p.visible,initialRank:is(p.initialRank),options:{rank:is(p.rank),appearance:p.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let p=i.components[0],h=i.object3d.parent,m=h==null?void 0:h.userData.entityId;return{id:i.id,type:"marker",enabled:p.enabled,visible:p.visible,anchor:p.options.anchor,dynamicResize:p.options.dynamicResize,parent:{id:m,type:h==null?void 0:h.type},position:this.convert3DMapPositionToCoordinate(i.position),element:p.containerEl,initialRank:is(p.initialRank),options:{rank:is(p.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:p,hoverColor:h,initialColor:m,topColor:y}=i.components[1],g=i.components[0],S=i.components[1],M=i.components[2];return{id:i.id,type:"geometry",opacity:S.opacity,color:p,focusable:g.focusable,topColor:y,initialColor:m,hoverColor:h,hovered:!!(M!=null&&M.hover),height:S.height,visible:S.visible,outline:S.outline,showImage:S.showImage,texture:S.texture,topTexture:S.topTexture,flipImageToFaceCamera:S.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(g.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let p=i.components[0],h=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(p.position),interactive:h!=null}}else if((i==null?void 0:i.type)==="path"){let p=i.components[0],h=i.components[2],m=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(p.position),visible:m.visible,interactive:h!=null,completeFraction:p.completeFraction,color:m.color,accentColor:p.accentColor,nearRadius:p.nearRadius,farRadius:p.farRadius,animateArrowsOnPath:p.animateArrowsOnPath,displayArrowsOnPath:p.displayArrowsOnPath}}else if((i==null?void 0:i.type)==="image"){let p=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(p.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else if((i==null?void 0:i.type)==="text3d"){l1(i);let p=i.components[0],h=i.components[1],{textMesh:m}=p,y=(n=p.mesh)==null?void 0:n.parent;y instanceof Ee&&((s=y.children.find(M=>M.type==="batchedtext"))==null||s.getWorldPosition(a(this,Xl))),a(this,wa).set(0,0,0);let g=m?m.getWorldPosition(a(this,wa)):a(this,wa);return Object.assign({},kn,h.getState(),{id:i.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(g.add(a(this,Xl))),visible:(c=p.visible)!=null?c:!1,content:(l=p.feature.properties.content)!=null?l:""})}else return}}setState(e,i){var n,s;if(typeof e=="object"&&i==null){"hoverColor"in e&&(a(this,L).hoverColor=(n=e.hoverColor)!=null?n:a(this,L).hoverColor),"text3dHoverColor"in e&&(a(this,L).text3dHoverColor=(s=e.text3dHoverColor)!=null?s:a(this,L).text3dHoverColor);return}let o=os(a(this,L),e);if(o!=null){if(o.type==="custom-geometry"){let c=a(this,L).geometry3DMap.get(o.id);if(c instanceof Ie&&c.components[0]instanceof Sa){let l=i;Eo(o,l.visible),vp(o,l.altitude),wh(o,l.position,this.convertTo3DMapPosition),Eh(o,this.getParentContainer(l.parent,!1))}}else if(o.type==="model"||o.type==="path"){let c=i;xr(o,c.interactive,a(this,L))&&a(this,ye).call(this),o.type==="path"&&(vp(o,c.altitude),a1(o,c))}else if(o.type==="group-container"){let c=i;Eo(o,c.visible)&&(a(this,D).outlineInterpolationSystem.dirty=!0,a(this,D).pathSystem.altitudeDirty=!0),vp(o,c.altitude)&&(a(this,D).pathSystem.altitudeDirty=!0),xr(o,c.interactive,a(this,L))&&a(this,ye).call(this)}else if(o.type==="geometry-group"){let c=i;Eo(o,c.visible)&&(a(this,D).outlineInterpolationSystem.dirty=!0),Wg(o,a(this,L),c)&&(a(this,D).outlineInterpolationSystem.dirty=!0),Oh(o,c.outline)&&(a(this,D).outlineInterpolationSystem.geometries3DDirty=!0),c.height!=null&&(Th(o,a(this,L),c.height),a(this,D).outlineInterpolationSystem.geometries3DDirty=!0),c.altitude!=null&&(o.setAltitude(c.altitude),o.userData.outlineDirty=!0),t1(o,c),Yg(o,c.shading),e1(o,a(this,L),c.opacity)&&(o.userData.outlineDirty=!0,a(this,D).outlineInterpolationSystem.geometries3DDirty=!0),xr(o,c.interactive,a(this,L))&&(a(this,ye).call(this),a(this,ke).call(this))}else if(o.type==="geometry"){if(o.components[0]instanceof Tt){let c=i;Eo(o,c.visible)&&(a(this,D).outlineInterpolationSystem.geometries3DDirty=!0),Oh(o,c.outline)&&(a(this,D).outlineInterpolationSystem.geometries3DDirty=!0),Zg(o,c),o1(o,c.focusable)&&(a(this,D).geometryInFocusSystem.focusablesDirty=!0),n1(o,c.renderOrder)&&(a(this,D).meshDetachmentSystem.dirty=!0),i1(o,c.opacity)&&(a(this,D).meshDetachmentSystem.dirty=!0,a(this,D).outlineInterpolationSystem.geometries3DDirty=!0),Dh(o,c.flipImageToFaceCamera),c.height!=null&&(Th(o,a(this,L),c.height),a(this,D).outlineInterpolationSystem.geometries3DDirty=!0),r1(o,c)&&(a(this,D).meshDetachmentSystem.dirty=!0),zg(o,c),Qg(o,c.hoverColor),xr(o,c.interactive,a(this,L)),Kg(o,c.hovered)}a(this,ye).call(this)}else if(o.type==="label"||o.type==="marker"){let c=i;Jg(o,i,a(this,L)),$g(o,i,a(this,L))&&(a(this,ke).call(this),a(this,D).domMutationSystem.dirty=!0),wh(o,c.position,this.convertTo3DMapPosition),Eh(o,this.getParentContainer(c.parent,!1))&&(a(this,ke).call(this),a(this,D).panBoundsSystem.dirty=!0),qg(o,c.enabled),Eo(o,c.visible)}else if(o.type==="image"){let c=i;Eo(o,c.visible),Dh(o,c.flipImageToFaceCamera)}else o.type==="text3d"&&c1(o,i);this.render()}}convertTo3DMapPosition(e,i,o=0,n){var l,p,h,m,y;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(l=e[2])!=null?l:o,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:s,y:c}=mp((h=(p=a(this,L).center)==null?void 0:p[1])!=null?h:0,(y=(m=a(this,L).center)==null?void 0:m[0])!=null?y:0,e,i);return n?(n.set(s,c,o),n):new z(s,c,o)}get backgroundColor(){return a(this,xt).backgroundColor}getThreeRenderer(){return a(this,xt)}getCenter(e){let i=Array.isArray(e)?e:this.getBoundingArea(e);return i?Ng(i):void 0}isInView(e){let i=os(a(this,L),e);if(a(this,Ul).identity().multiply(a(this,De).projectionMatrix).multiply(a(this,De).matrixWorldInverse),a(this,cn).setFromProjectionMatrix(a(this,Ul)),i instanceof xh)return a(this,cn).containsPoint(i.position);if(i instanceof Ie){let o=i==null?void 0:i.components[0];if(o instanceof Sa||o instanceof ao)return a(this,cn).containsPoint(this.convertTo3DMapPosition(o.feature.geometry.coordinates));if(o instanceof Tt){let n=new zr(this.convertTo3DMapPosition(o.featureBbox[1],o.featureBbox[0],0),this.convertTo3DMapPosition(o.featureBbox[3],o.featureBbox[2],0));return a(this,cn).intersectsBox(n)}}return!1}getSystems(){return a(this,D)}getInternalState(){return a(this,L)}getTweenGroup(){return a(this,L).tweenGroup}};St=new WeakMap,De=new WeakMap,_l=new WeakMap,Ia=new WeakMap,po=new WeakMap,ln=new WeakMap,Ma=new WeakMap,kl=new WeakSet,Fy=function(e){var i;a(this,uo)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(e)),a(this,L).pixelRatio=this.resolutionScale},L=new WeakMap,ce=new WeakMap,pr=new WeakMap,Te=new WeakMap,Rr=new WeakMap,xt=new WeakMap,D=new WeakMap,Bl=new WeakMap,ke=new WeakMap,ye=new WeakMap,Vd=new WeakSet,X5=function(){I(this,ce,document.createElement("div")),a(this,ce).classList.add("mappedin__smart-collision-engine__container"),I(this,pr,document.createElement("canvas")),a(this,pr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(a(this,ce)),I(this,Te,document.createElement("canvas")),a(this,Te).classList.add("mappedin__smart-collision-engine__container"),a(this,Te).width=a(this,ce).clientWidth*this.resolutionScale,a(this,Te).height=a(this,ce).clientHeight*this.resolutionScale,a(this,Te).style.width=a(this,ce).clientWidth+"px",a(this,Te).style.height=a(this,ce).clientHeight+"px",a(this,ce).appendChild(a(this,pr)),a(this,ce).appendChild(a(this,Te)),a(this,pr).width=a(this,ce).clientWidth,a(this,pr).height=a(this,ce).clientHeight,a(this,Te).width=a(this,ce).clientWidth*this.resolutionScale,a(this,Te).height=a(this,ce).clientHeight*this.resolutionScale,a(this,Te).style.width=a(this,ce).clientWidth+"px",a(this,Te).style.height=a(this,ce).clientHeight+"px"},jd=new WeakSet,W5=function(){I(this,Rr,document.createElement("div")),a(this,Rr).classList.add("mappedin-2d-entities"),Object.assign(a(this,Rr).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(a(this,Rr))},Hd=new WeakSet,Y5=function(){a(this,Te).width=a(this,ce).clientWidth*this.resolutionScale,a(this,Te).height=a(this,ce).clientHeight*this.resolutionScale,a(this,Te).style.width=a(this,ce).clientWidth+"px",a(this,Te).style.height=a(this,ce).clientHeight+"px",a(this,pr).width=a(this,ce).clientWidth,a(this,pr).height=a(this,ce).clientHeight,a(this,Te).width=a(this,ce).clientWidth*this.resolutionScale,a(this,Te).height=a(this,ce).clientHeight*this.resolutionScale,a(this,Te).style.width=a(this,ce).clientWidth+"px",a(this,Te).style.height=a(this,ce).clientHeight+"px",a(this,D).collisionSystem.collidersDirty=!0},uo=new WeakMap,Rl=new WeakMap,Nl=new WeakMap,Pa=new WeakMap,Ud=new WeakMap,Gl=new WeakMap,Vl=new WeakMap,jl=new WeakMap,Ta=new WeakMap,Hl=new WeakSet,_y=function(e,i,o){let n=new xh(i,this.convertTo3DMapPosition(e[1],e[0],e[2]||o||0));return a(this,L).geometry2DMap.set(n.id,n),n},cn=new WeakMap,Ul=new WeakMap,ht=new WeakMap,ft=new WeakMap,wa=new WeakMap,Xl=new WeakMap;var Wl=Ay;f();function vP(r,t){bP(r,t)(r.getScene(),t),CP(r,t),t.addFolder("Export").add({export:async()=>{let s=await r.getCurrentSceneGLTF({binary:!0}),c=new Blob([s],{type:"application/octet-stream"});var l=document.createElement("a");document.body.appendChild(l),l.style.display="none";let p=window.URL.createObjectURL(c);l.href=p,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(p)}},"export");let o=t.addFolder("Camera"),n={get bearing(){return r.camera.bearing},set bearing(s){r.camera.setBearing(s)},get pitch(){return r.camera.pitch},set pitch(s){r.camera.setPitch(s)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(s){r.camera.setZoomLevel(s)}};o.add(n,"bearing",-359,359,1),o.add(n,"pitch",r.camera.minPitch,r.camera.maxPitch,1),o.add(n,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}function bP(r,t){let e=t;return function i(o,n){let s=n.addFolder("".concat([o.type]," ").concat(o.id.slice(0,16)));if(n.close(),o.type==="geometry"||o.type==="model"||o.type==="path"||o.type==="image"){let c={get height(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry"&&r.setState(o,{height:l})},set flipImageToFaceCamera(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="image"&&r.setState(o,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){let p=r.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image")&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?l.visible:!1},set outline(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry"&&r.setState(o,{outline:l})},get outline(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get opacity(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"?l.opacity:1},set opacity(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{opacity:l})},get color(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"&&l.color?Vg(l.color).toHexString():"#ffffff"},set color(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{color:l})},set interactive(l){let p=r.getState(o.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"?l.interactive:!1},get completeFraction(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="path"&&r.setState(p,{completeFraction:l})},focus:()=>{}};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="model"||(l==null?void 0:l.type)==="path"||(l==null?void 0:l.type)==="image"?r.camera.focusOn([l.position]):(l==null?void 0:l.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(l))}),s.add(c,"visible"),o.type==="image"?s.add(c,"flipImageToFaceCamera"):(s.add(c,"interactive"),o.type==="path"&&s.add(c,"completeFraction",0,1,.1),o.type!=="model"&&(s.addColor(c,"color"),s.add(c,"outline"))),o.type==="geometry"&&(s.add(c,"height"),s.add(c,"opacity",0,1,.1))}else if(o.type==="marker"){let c={get interactive(){var p;let l=r.getState(o.id);return(l==null?void 0:l.type)==="marker"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="marker"&&(r.setState(p,{options:{interactive:l}}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},focus:()=>{}};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="marker"&&r.camera.focusOn([l.position])}),s.add(c,"interactive")}else if(o.type==="label"){let c={get interactive(){var p;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(p=l.options)==null?void 0:p.interactive:!1},set interactive(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&(r.setState(p,{options:{interactive:l}}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get text(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l})},get"Text Color"(){var p,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(h=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:h.foregroundColor:"#000000"},set"Text Color"(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(o.id,{text:c.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var p,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(h=(p=l.options.appearance)==null?void 0:p.text)==null?void 0:h.size:10},set"Text Size"(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var p,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.iconSize:10},set"Icon Size"(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var p,h,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.foregroundColor)==null?void 0:m.active:"#000000"},set"Active Foreground Color"(l){var h,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(m=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:m.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var p,h,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.foregroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Foreground Color"(l){var h,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{foregroundColor:{...(m=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:m.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var p,h,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.backgroundColor)==null?void 0:m.active:"#000000"},set"Active Background Color"(l){var h,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(m=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:m.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var p,h,m;let l=r.getState(o.id);return(l==null?void 0:l.type)==="label"?(m=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.backgroundColor)==null?void 0:m.inactive:"#000000"},set"Inactive Background Color"(l){var h,m;let p=r.getState(o.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:c.text,options:{appearance:{marker:{backgroundColor:{...(m=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:m.backgroundColor,inactive:l}}}}})},focus:()=>{}};s.add(c,"focus").onChange(()=>{let l=r.getState(o.id);(l==null?void 0:l.type)==="label"&&r.camera.focusOn([l.position])}),s.add(c,"interactive"),s.add(c,"text"),s.add(c,"Text Size",10,50),s.add(c,"Icon Size",10,50),s.addColor(c,"Text Color"),s.addColor(c,"Active Background Color"),s.addColor(c,"Inactive Background Color"),s.addColor(c,"Active Foreground Color"),s.addColor(c,"Inactive Foreground Color")}else if(o.type==="geometry-group"){let c={get opacity(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(o,{opacity:l})},set visible(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(o,{outline:l})},get outline(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&(r.setState(o,{interactive:l}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var p,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(h=(p=l.shading)==null?void 0:p.start)!=null?h:0},set shadingStart(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{start:l}})},get shadingEnd(){var p,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(h=(p=l.shading)==null?void 0:p.end)!=null?h:0},set shadingEnd(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{end:l}})},get shadingIntensity(){var p,h;let l=r.getState(o.id);return(l==null?void 0:l.type)==="geometry-group"&&(h=(p=l.shading)==null?void 0:p.intensity)!=null?h:0},set shadingIntensity(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{intensity:l}})}};s.add(c,"visible"),s.add(c,"opacity",0,1,.1),s.add(c,"interactive"),s.add(c,"outline"),s.add(c,"shadingStart",0,1,.1),s.add(c,"shadingEnd",0,1,.1),s.add(c,"shadingIntensity",0,1,.1)}else if(o.type==="group-container"){let c={set visible(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="group-container"&&r.setState(o,{visible:l})},get visible(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let p=r.getState(o.id);(p==null?void 0:p.type)==="group-container"&&(r.setState(p,{interactive:l}),e.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(o.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};s.add(c,"visible"),s.add(c,"interactive")}if(s.close(),o.children)for(let c of o.children.values())i(c,s)}}function CP(r,t){let e=t.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};e.add(i,"padding",0,100,1),e.add(i,"scale",.5,1.5,.1),e.add(i,"color",["dark","light"]),e.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),e.add(i,"iconOnly"),e.onChange(()=>{r.updateWatermark(i)})}var Z5="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",xP="https://auth.mappedin.com/oauth2/token";async function z5(r,t){var e,i,o,n,s;if((e=t==null?void 0:t.outdoorView)!=null&&e.enabled&&((i=t==null?void 0:t.outdoorView)!=null&&i.headers)){let{Map:c,MercatorCoordinate:l}=await import("./outdoor-context-v4-XK734ARV.js"),p=t.outdoorView.headers;p==null&&(p=await _g(xP));let h=t.center||[0,0],m=new c({container:r,style:t.outdoorView.style||Z5,center:h,attributionControl:!1,zoom:(o=t.zoomLevel)!=null?o:Ry,pitch:(n=t.pitch)!=null?n:ky,bearing:(s=t.bearing)!=null?s:By,transformRequest:Lg(p),trackResize:!1,pixelRatio:_n(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),y=m.painter.context.gl,g=new Wl(r,{center:h,zoomLevel:m.getZoom(),pitch:m.getPitch(),bearing:m.getBearing(),gl:y,map:m,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias}),S={center:m.getCenter().toArray(),zoom:m.getZoom(),bearing:m.getBearing(),pitch:m.getPitch()};m.setMinZoom(g.camera.minZoomLevel),m.setMaxZoom(g.camera.maxZoomLevel),g.on("camera-change",T=>{S.center=T.center,S.zoom=T.zoomLevel,S.bearing=T.bearing,S.pitch=T.pitch,m.jumpTo(S)});let M=l.fromLngLat(h,0),v=yp(M,g.viewCamera,g.camera,()=>{g.renderSync()});m.on("style.load",async()=>{m&&(m.addLayer(v),g.renderSync())});let C=!1,w=!1;m.on("idle",()=>{m&&(C||(g.publish("outdoor-view-loaded"),C=!0),w||(w=!0,g.publish("outdoor-style-loaded")))});let P=T=>{T&&(T.sourceDataType==="metadata"||T.sourceDataType==="visibility"||T.dataType==="style"||T.type==="terrain")&&g.getSystems().htmlControlsSystem.updateData(m)};return m.on("styledata",T=>{m&&T&&T.dataType==="style"&&T.type==="styledata"&&(w=!1),P(T)}),m.on("sourcedata",P),m.on("terrain",P),m.on("error",T=>{var E;if(((E=T.error)==null?void 0:E.url)===Z5){O.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}O.warn(T)}),g}else return new Wl(r,t)}f();var Gu=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(Gu||{}),Vu=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(Vu||{});f();f();var Yl=class Yl{constructor(t,e,i){u(this,"id");u(this,"text");u(this,"target");u(this,"__type",Yl.__type);this.id=t,this.text=e,this.target=i}static is(t){return t.__type===Yl.__type}get focusTarget(){return this.target.anchorTarget}};u(Yl,"__type","Label");var ho=Yl;f();var Ea,Zl=class Zl{constructor(t,e,i){u(this,"id");b(this,Ea,void 0);u(this,"__type",Zl.__type);u(this,"contentEl");this.id=t,this.contentEl=e,I(this,Ea,i)}get target(){return a(this,Ea)}static is(t){return t.__type===Zl.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){I(this,Ea,t)}};Ea=new WeakMap,u(Zl,"__type","Marker");var mi=Zl;f();var $l,Jl,zl=class zl{constructor(t,e,i){b(this,$l,void 0);b(this,Jl,void 0);u(this,"target");u(this,"__type",zl.__type);I(this,$l,t),I(this,Jl,e),this.target=i}static is(t){return t.__type===zl.__type}get id(){return a(this,$l)}get url(){return a(this,Jl)}};$l=new WeakMap,Jl=new WeakMap,u(zl,"__type","Image");var ql=zl;f();var Ql=class Ql{constructor(t,e){u(this,"id");u(this,"groupId");u(this,"__type",Ql.__type);this.id=t,this.groupId=e}static is(t){return t.__type===Ql.__type}};u(Ql,"__type","Model");var Kl=Ql;f();var pn=class{constructor(t,e,i){u(this,"id");u(this,"animation");u(this,"coordinates");u(this,"__type");this.id=t,this.__type="Path",this.animation=e,this.coordinates=i}get focusTarget(){return this.coordinates}};f();var fo,ec=class{constructor(t){b(this,fo,void 0);I(this,fo,t)}get center(){return a(this,fo).center}get bearing(){return a(this,fo).bearing}get pitch(){return a(this,fo).pitch}get zoomLevel(){return a(this,fo).zoomLevel}};fo=new WeakMap;f();var tc=class tc{constructor(t){u(this,"id");u(this,"__type",tc.__type);this.id=t}static is(t){return t.__type===tc.__type}get focusTarget(){return this}};u(tc,"__type","Shape");var mo=tc;f();var Xd=class Xd{constructor(t,e){u(this,"id");u(this,"target");u(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===Xd.__type}};u(Xd,"__type","Text3D");var yo=Xd;f();f();f();var IP=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),MP=/<svg([^>]*)>/g;function q5(r,t,e){let i=IP.get(r);return i?i.replace(MP,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var PP=r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(r,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),TP=r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(r,'"\n />\n </svg>\n '),Ny="#722ED1",Gy="#1890FF",$5=({type:r="departure",color:t=Gy})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?PP(t):TP(t),"\n </div>"),wP=r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},J5=({type:r="stairs",color:t=Ny,direction:e="up"})=>{let i=wP("default"),o=i/2+2,n=e&&e!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(q5("connection-"+r+"-16x16","white",o)||"","\n </div>\n ").concat(n?'<div style="margin-left: -'.concat(i*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(i,"px; height: ").concat(i,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(o,"px; height: ").concat(o,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")};f();var Q5=async r=>new Promise(t=>setTimeout(t,r));var Da={setMapOnConnectionClick:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:{drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},inactivePathOptions:{drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},markerOptions:{departureColor:Gy,destinationColor:Ny}},yi,gi,go,ge,ic,vi,Xe,Nr,Ht,bi,un,Zd,K5,Oa,Wd,La,Yd,zd,e7,oc,rc=class{constructor(t,e,i){b(this,Zd);b(this,Oa);b(this,La);b(this,zd);b(this,yi,new Map);b(this,gi,void 0);b(this,go,void 0);b(this,ge,Da);b(this,ic,void 0);b(this,vi,void 0);b(this,Xe,[]);b(this,Nr,void 0);b(this,Ht,new Map);b(this,bi,new Map);b(this,un,new Map);b(this,oc,t=>{var e;if((e=a(this,ge).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:i}=a(this,yi).get(t.markers[0]);i!=null&&i.action.toFloor&&(a(this,ge).setMapOnConnectionClick&&this.currentMap.setFloor(i.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:i,fromFloor:i.action.fromFloor,toFloor:i.action.toFloor}))}});I(this,gi,t),I(this,ic,i),I(this,go,e)}get currentMap(){return a(this,ic).call(this)}get isMultiFloor(){if(!a(this,Xe).length)return!1;let t=new Set;for(let e of a(this,Xe))for(let i of e.coordinates)if(i.floorId&&(t.add(i.floorId),t.size>1))return!0;return!1}getPathById(t){return a(this,Ht).get(t)}getMarkerById(t){return a(this,yi).get(t)}get paths(){let t=[];return a(this,Ht).forEach(({path:e})=>t.push(e)),t}get activeDirections(){return a(this,un).get(a(this,Nr))}get activePath(){var t;if(a(this,Nr))return(t=a(this,Ht).get(a(this,Nr).id))==null?void 0:t.path}get floorStacks(){let t=a(this,go).getMapData();if(!a(this,Xe).length||!t)return[];let e=new Set;for(let i of a(this,Xe))for(let o of i.coordinates)if(o.floorId){let n=t.getById("floor",o.floorId);n&&e.add(n.floorStack)}return Array.from(e)}get floors(){let t=a(this,go).getMapData();if(!a(this,Xe).length||!t)return[];let e=new Set;for(let i of a(this,Xe))for(let o of i.coordinates)if(o.floorId){let n=t.getById("floor",o.floorId);n&&e.add(n)}return Array.from(e)}setActivePathByIndex(t){let e=a(this,Xe)[t];if(!a(this,Xe).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,Xe)[t]){O.warn("Direction #".concat(t," does not exist"));return}let i=a(this,bi).get(e);if(!i){O.warn("The direction is not a part of muli-direcional path");return}j(this,Oa,Wd).call(this,i)}setActivePath(t){if(!a(this,Xe).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!a(this,un).get(t)){O.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}j(this,Oa,Wd).call(this,t)}setActivePathByDirections(t){if(!a(this,Xe).length){O.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=a(this,bi).get(t);if(!e){O.warn("The direction is not a part of muli-direcional path");return}j(this,Oa,Wd).call(this,e)}async draw(t,e={}){var l;let i=Array.isArray(t)?t:[t],o=i[0],n=i[i.length-1],s=o.coordinates[0];I(this,Xe,i),s.floorId&&this.currentMap.setFloor(s.floorId),a(this,vi)&&this.clear(),I(this,ge,{setMapOnConnectionClick:(l=e.setMapOnConnectionClick)!=null?l:Da.setMapOnConnectionClick,pathOptions:{...Da.pathOptions,...e.pathOptions},inactivePathOptions:{...Da.inactivePathOptions,...e.inactivePathOptions},createMarkers:{...Da.createMarkers,...e.createMarkers},markerOptions:{...Da.markerOptions,...e.markerOptions}});let c=!1;return I(this,vi,{promise:new Promise(async p=>{var h,m,y;if(x.env.NODE_ENV!=="test"&&await Q5(500),c||!i.length){p();return}(h=a(this,ge).createMarkers)!=null&&h.departure&&j(this,La,Yd).call(this,o.coordinates[0],"departure",o.instructions[0]);for(let g=0;g<i.length;g++){let S=i[g],M=g?{...a(this,ge).inactivePathOptions}:{...a(this,ge).pathOptions};if(S.coordinates.length<2){O.warn("Directions must have at least 2 coordinates"),p();return}let v=this.currentMap.Paths.add(S.coordinates,M),C=v.paths.map(P=>P.id.toString()),w=new pn(he(),v.animation,S.coordinates);for(let P of C){a(this,Ht).set(P,{path:w,entityIds:C});let T=g?{...a(this,ge).inactivePathOptions,altitude:0}:{...a(this,ge).pathOptions,altitude:.05};a(this,gi).setState(P,T)}if(a(this,Ht).set(w.id,{path:w,entityIds:C}),a(this,bi).set(S,w),a(this,un).set(w,S),x.env.NODE_ENV!=="test"&&await v.animation,c){p();return}(m=a(this,ge).createMarkers)!=null&&m.connection&&j(this,zd,e7).call(this,S.instructions,"connection"),g===0&&(I(this,Nr,a(this,bi).get(a(this,Xe)[0])),a(this,gi).on("click",a(this,oc)))}if((y=a(this,ge).createMarkers)!=null&&y.destination&&j(this,La,Yd).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),c){p();return}a(this,go).mapObjects.forEach(g=>{g.processFloorChange(g.currentFloorId)}),p()}),cancel:()=>{c=!0}}),a(this,vi).promise}clear(){a(this,yi).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),a(this,yi).clear(),a(this,Ht).forEach(({path:t,entityIds:e})=>{a(this,Ht).delete(t.id),e.forEach(i=>a(this,Ht).delete(i)),this.currentMap.Paths.remove(e)}),a(this,vi)&&(a(this,vi).cancel(),I(this,vi,void 0)),I(this,Xe,[]),a(this,bi).clear(),a(this,un).clear(),I(this,Nr,void 0),a(this,gi).off("click",a(this,oc)),a(this,go).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};yi=new WeakMap,gi=new WeakMap,go=new WeakMap,ge=new WeakMap,ic=new WeakMap,vi=new WeakMap,Xe=new WeakMap,Nr=new WeakMap,Ht=new WeakMap,bi=new WeakMap,un=new WeakMap,Zd=new WeakSet,K5=function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},Oa=new WeakSet,Wd=function(t){I(this,Nr,t),a(this,Xe).forEach(e=>{let i=a(this,bi).get(e);if(i){let o=a(this,Ht).get(i.id),n=o.path.id===a(this,Nr).id?{...a(this,ge).pathOptions,altitude:.05}:{...a(this,ge).inactivePathOptions,altitude:0};o.entityIds.forEach(s=>{a(this,gi).setState(s,n)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},La=new WeakSet,Yd=function(t,e,i){var o,n,s,c,l;if(e==="connection"&&i){let p=i.action.type==="ExitConnection"?a(this,ge).markerOptions.departureColor:a(this,ge).markerOptions.destinationColor,h;if(typeof((o=a(this,ge).createMarkers)==null?void 0:o.connection)=="function"){let y=a(this,ge).createMarkers.connection(i);a(this,gi).setState(y.id.toString(),{options:{interactive:!0}}),h={id:y.id,type:"marker"}}else h=this.currentMap.Markers.add(i.coordinate,J5({type:(s=(n=i.action.connection)==null?void 0:n.type)!=null?s:i.action.connectionType,color:p,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let m=this.currentMap.Markers.getContentEl(h.id.toString());if(!m)throw new Error("marker component should exist");a(this,yi).set(h.id,{instruction:i,marker:new mi(h.id.toString(),m,i.coordinate)})}else{let p=e==="departure"?a(this,ge).markerOptions.departureColor:a(this,ge).markerOptions.destinationColor,h;typeof((c=a(this,ge).createMarkers)==null?void 0:c.departure)=="function"&&e==="departure"?h={id:a(this,ge).createMarkers.departure(i).id,type:"marker"}:typeof((l=a(this,ge).createMarkers)==null?void 0:l.destination)=="function"&&e==="destination"?h={id:a(this,ge).createMarkers.destination(i).id,type:"marker"}:h=this.currentMap.Markers.add(t,$5({type:e,color:p}),{anchor:"top",rank:"always-visible"}),a(this,yi).set(h.id,void 0)}},zd=new WeakSet,e7=function(t,e){t.filter(o=>j(this,Zd,K5).call(this,o.action)).forEach(o=>{j(this,La,Yd).call(this,o.coordinate,e,o)})},oc=new WeakMap;f();f();f();var EP=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),DP=/<svg([^>]*)>/g;function t7(r,t,e){let i=EP.get(r);return i?i.replace(DP,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}var dn,Aa,nc,Vy,$d,r7,Jd,i7,ac,jy,Qd,o7,qd=class{constructor(t,e){b(this,nc);b(this,$d);b(this,Jd);b(this,ac);b(this,Qd);b(this,dn,void 0);b(this,Aa,void 0);u(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});I(this,dn,t),I(this,Aa,e)}auto(){let t=a(this,Aa)[Object.keys(a(this,Aa))[0]];[...t.getByType("connection"),...t.getByType("point-of-interest"),...t.getByType("space")].forEach(e=>{if(e.__type==="connection")e.coordinates.forEach(i=>{let o=e.name||e.externalId;o&&a(this,dn).Labels.add(i,o,j(this,nc,Vy).call(this,e))});else{e.__type==="space"&&e.name!==""&&a(this,dn).updateState(e,{interactive:!0,hoverColor:"#F0F0F0"});let i=e.name||e.externalId;i&&a(this,dn).Labels.add(e,i,j(this,nc,Vy).call(this,e))}})}};dn=new WeakMap,Aa=new WeakMap,nc=new WeakSet,Vy=function(t){let e=t7(j(this,$d,r7).call(this,t),"white",12);return{appearance:{text:{foregroundColor:j(this,ac,jy).call(this,t)},marker:{foregroundColor:{active:j(this,ac,jy).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:j(this,Qd,o7).call(this,t)}},$d=new WeakSet,r7=function(t){return t.__type==="connection"?j(this,Jd,i7).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},Jd=new WeakSet,i7=function(t){let e="";switch(t){case"elevator":e="connection-elevator-12x12";break;case"escalator":e="connection-escalator-12x12";break;case"stairs":e="connection-stairs-12x12";break}return e},ac=new WeakSet,jy=function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},Qd=new WeakSet,o7=function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")};var Kd=class{constructor(t,e){u(this,"Labels");u(this,"auto",()=>{this.Labels.auto()});this.Labels=new qd(t,e)}};f();var te,eh,n7,sc=class{constructor(t){b(this,eh);b(this,te,void 0);u(this,"setMinPitch",t=>{a(this,te).camera.setMinPitch(t)});u(this,"setMaxPitch",t=>{a(this,te).camera.setMaxPitch(t)});u(this,"setMinZoomLevel",t=>{a(this,te).camera.setMinZoomLevel(t,!0)});u(this,"setMaxZoomLevel",t=>{a(this,te).camera.setMaxZoomLevel(t)});I(this,te,t)}setScreenOffsets(t){a(this,te).camera.setInsetPadding(t)}get screenOffsets(){return a(this,te).camera.insetsPadding}get panMode(){return a(this,te).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&a(this,te).camera.setPanMode(t)}focusOn(t,e){var s,c,l;let i=[],n=(Array.isArray(t)?t:[t]).flatMap(p=>{var h;return(h=p==null?void 0:p.focusTarget)!=null?h:[p]});for(let p of n)if(p!=null)if(Q.is(p)){let h=p.floorId!=null?a(this,te).getBoundingArea(p.floorId):void 0;h?i.push([p.longitude,p.latitude,(s=h[0][2])!=null?s:a(this,te).camera.elevation]):i.push([p.longitude,p.latitude,a(this,te).camera.elevation])}else if((p==null?void 0:p.id)!=null){let h=a(this,te).getBoundingArea(p.id);if(h){let m="floor"in p?a(this,te).getBoundingArea((c=p.floor)==null?void 0:c.id):void 0;m?i.push(...h.map(y=>{var g;return[y[0],y[1],(g=m[0][2])!=null?g:a(this,te).camera.elevation]})):i.push(...h)}}else Y3(p)&&i.push(p);return((l=e==null?void 0:e.axisAlignedPadding)==null?void 0:l.vertical)!==void 0&&(i=j(this,eh,n7).call(this,i,e.axisAlignedPadding)),a(this,te).camera.focusOn(i,{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:e==null?void 0:e.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing})}animateTo(t,e){var l;let{center:i,zoomLevel:o,bearing:n,pitch:s}=t,c=i!=null?i:this.center;return a(this,te).camera.animateTo({center:i!=null?[c.longitude,c.latitude,this.elevation]:void 0,zoomLevel:o,bearing:n,pitch:s,duration:(l=e==null?void 0:e.duration)!=null?l:600,easing:e==null?void 0:e.easing})}set(t){let{center:e=this.center,zoomLevel:i=this.zoomLevel,bearing:o=this.bearing,pitch:n=this.pitch}=t,s=[e.longitude,e.latitude];a(this,te).camera.setCenter(s),a(this,te).camera.setZoomLevel(i),a(this,te).camera.setBearing(o),a(this,te).camera.setPitch(n)}get center(){let t=a(this,te).camera.center;return new Q(t[1],t[0],void 0)}setAutoMinZoomLevel(t){a(this,te).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return a(this,te).camera.autoMinZoomLevel}get zoomLevel(){return a(this,te).camera.zoomLevel}get pitch(){return a(this,te).camera.pitch}get minPitch(){return a(this,te).camera.minPitch}get maxPitch(){return a(this,te).camera.maxPitch}get bearing(){let t=a(this,te).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return a(this,te).camera.minZoomLevel}get maxZoomLevel(){return a(this,te).camera.maxZoomLevel}setElevation(t){a(this,te).camera.setElevation(t)}get elevation(){return a(this,te).camera.elevation}animateElevation(t,e){return a(this,te).camera.animateElevation(t,e)}};te=new WeakMap,eh=new WeakSet,n7=function(t,e){var n;let i=(n=e==null?void 0:e.vertical)!=null?n:0;return[t.map(s=>{var c;return[s[0],s[1],((c=s[2])!=null?c:0)-i]}),t.map(s=>{var c;return[s[0],s[1],(c=s[2])!=null?c:0]}),t.map(s=>{var c;return[s[0],s[1],((c=s[2])!=null?c:0)+i]})].flat()};f();var Fa,lc=class{constructor({currentMapGetter:t}){b(this,Fa,void 0);I(this,Fa,t)}get currentMap(){return a(this,Fa).call(this)}async getCurrentSceneGLTF(t){let e=a(this,Fa).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(O.error("There is no map to export. Please load a map first."),new Blob)}};Fa=new WeakMap;f();var Gr,pc,cc=class{constructor({currentMapGetter:t}){b(this,Gr,new Map);b(this,pc,void 0);I(this,pc,t)}get currentMap(){return a(this,pc).call(this)}getById(t){return a(this,Gr).get(t)}add(t,e,i){let o=t.anchorTarget,n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Labels.add(Lr(o),e,{...i,spaceId:Fe.is(t)?t.id:void 0,floorId:o.floorId,rank:(i==null?void 0:i.rank)==null||(i==null?void 0:i.rank)==="initial"?"medium":i.rank}),c=new ho(s.id.toString(),e,t);return a(this,Gr).set(c.id,{label:c,entityId:c.id}),c}all(){var e;let t=[];return(e=this.currentMap)==null||e.Labels.all({onCreate:(i,o,n)=>{let s=new ho(i.toString(),o,n);a(this,Gr).set(s.id,{label:s,entityId:s.id}),t.push(s)}}),t}remove(t){var i;let e=a(this,Gr).get(t.id);e&&((i=this.currentMap)==null||i.Labels.remove(e),a(this,Gr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Gr).forEach(({label:e})=>{this.remove(e),t.push(e),a(this,Gr).delete(e.id.toString())}),t}};Gr=new WeakMap,pc=new WeakMap;f();f();var a7={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},s7={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},l7=.5,hn=class{constructor(t,e,i=new Map){u(this,"containerId");u(this,"labelIds",new Set);u(this,"layers");u(this,"renderer");this.containerId=e,this.layers=i,this.renderer=t}show(){this.renderer.setState(this.containerId,{visible:!0});for(let t of this.labelIds)this.renderer.setState(t,{visible:!0})}hide(){this.renderer.setState(this.containerId,{visible:!1});for(let t of this.labelIds)this.renderer.setState(t,{visible:!1})}},uc=class{constructor(t,e,i,o,n,s,c){u(this,"id");u(this,"name");u(this,"elevation");u(this,"containerId");u(this,"externalId");u(this,"metadata");u(this,"shortName");u(this,"subtitle");u(this,"loaded",!1);u(this,"styleMap",{});u(this,"obstructions");u(this,"entrances");u(this,"spaces");u(this,"floorImages");u(this,"renderer");u(this,"options");u(this,"layers",new Map);u(this,"footprint");u(this,"floorStackId");u(this,"multiFloorView");u(this,"load",()=>{var o,n,s,c;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(si,"-").concat(this.id),{},this.id);this.layers.set(si,new hn(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(Er,"-").concat(this.id),{},this.id);this.layers.set(Er,new hn(this.renderer,e.id.toString()));let i=this.renderer.addGroupContainer("".concat(Se,"-").concat(this.id),{},this.id);if(this.layers.set(Se,new hn(this.renderer,i.id.toString())),this.spaces!=null&&this.spaces.features.length>0){let l=this.spaces.features.filter(y=>{var g;return y.geometry.type==="Polygon"&&((g=y.properties.kind)==null?void 0:g.toLowerCase())!=="void"}),p=ny(l,this.styleMap),h=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),m=0;for(let[y,g]of p){let S=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(m),{features:g},nl(y,this.options),h);m++;let M=h.id.toString();this.layers.get(Se).layers.set(y.id||M,S.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let l=this.obstructions.features.filter(C=>C.geometry.type==="Polygon"&&C.properties.kind==="object"),p=ny(l,this.styleMap),h=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),m=0;for(let[C,w]of p){let P=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(m),{features:w},nl(C,this.options),h);m++;let T=h.id.toString();this.layers.get(Se).layers.set(C.id||T,P.id.toString())}let y=this.obstructions.features.filter(C=>C.geometry.type==="LineString"&&C.properties.kind==="Wall"&&C.properties.footprintComponent===!1),g=this.obstructions.features.filter(C=>C.geometry.type==="LineString"&&C.properties.kind==="Wall"&&C.properties.footprintComponent===!0),S=this.entrances,M=a7,v=a7;if(y!=null&&y.length>0){let C=this.styleMap[(o=y[0].properties)==null?void 0:o.id];C!=null&&(M={...C}),v=M;let{walls:w,entrances:P}=ry(y,(S==null?void 0:S.features)||[]),T=Math.max(M.height-.11,l7),E={...s7,height:T},A=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),P,E,i);this.layers.get(Se).layers.set(ta,A.id.toString());let k=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[w]},nl(M,this.options),i);this.layers.get(Se).layers.set(Ji,k.id.toString())}if(g!=null&&g.length>0){let C=this.styleMap[(n=g[0].properties)==null?void 0:n.id];C!=null&&(v={...C,id:wr});let{walls:w,entrances:P}=ry(g,(S==null?void 0:S.features)||[]),T=Math.max(v.height-.11,l7),E={...s7,height:T},A=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),P,E,i);this.layers.get(Se).layers.set(ra,A.id.toString());let k=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[w]},nl(v,this.options),i);this.layers.get(Se).layers.set(wr,k.id.toString())}}if(this.floorImages!=null){let l=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let p of this.floorImages.features||[])"anchorId"in p.properties||"anchorId"in p.properties&&((s=p.properties)==null?void 0:s.anchorId)==null||this.renderer.addImage(he(),p,{url:p.properties.path,flipImageToFaceCamera:!0},l);this.layers.set(z3,new hn(this.renderer,l.id.toString()))}return(c=this.multiFloorView)!=null&&c.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this});var p,h,m;this.id=e.id,this.options=n;let l=i.addGroupContainer(this.id,{visible:!1,interactive:!0},t);if(this.containerId=l.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.elevation=e.elevation,s!=null&&c!=null&&(this.styleMap=c,this.spaces=s.space[this.id],this.entrances=s.entrance[this.id],this.obstructions=s.obstruction[this.id],this.floorImages=(p=s.floorImages)==null?void 0:p[this.id],this.footprint=(h=s["floor.geojson"])==null?void 0:h.features.find(y=>y.properties.id===e.id)),this.renderer=i,this.floorStackId=t,this.multiFloorView=o,this.footprint&&(o!=null&&o.enabled)&&this.obstructions!=null&&this.obstructions.features.length>0){let y=this.obstructions.features.filter(g=>g.geometry.type==="LineString"&&g.properties.kind==="Wall"&&g.properties.footprintComponent===!0);if(y!=null&&y.length>0){let g=this.styleMap[(m=y[0].properties)==null?void 0:m.id],S=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...g,height:-o.floorHeight,altitude:o.floorHeight/2,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":g.color},this.id);this.layers.set(ia,new hn(this.renderer,S.id.toString()))}}}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};f();var c7=50,OP=1e3,we,ur,_a,Vr,dr,mt,hc,ka,fn,fc,Hy,mn,mc,yc,gc,vc,Ci,th,p7,bc,vo,Cc,Uy,dc=class extends Z{constructor({currentMapGetter:e}){super();b(this,fc);b(this,th);b(this,Cc);b(this,we,void 0);b(this,ur,c7);b(this,_a,0);b(this,Vr,void 0);b(this,dr,!1);b(this,mt,[]);b(this,hc,0);b(this,ka,!1);b(this,fn,"collapsed");u(this,"expandedFactor",0);b(this,mn,"all-floors");b(this,mc,()=>{let e=a(this,we).call(this);if(a(this,hc)===this.expandedFactor||e==null||!a(this,dr))return;I(this,hc,this.expandedFactor);let i=ki(this.expandedFactor,0,1,0,a(this,ur)),n=ki(this.expandedFactor,0,.1,0,1)===0;a(this,mt).forEach((s,c)=>{e.renderer.setState(s.containerId,{visible:n?s.id===e.currentFloorId:!0,altitude:i*c})}),this.expandedFactor===0?(I(this,dr,!1),e.renderer.camera.setPanMode("default"),a(this,vo)&&a(this,vo).call(this)):this.expandedFactor===1&&(I(this,dr,!1),a(this,vo)&&a(this,vo).call(this))});b(this,yc,()=>{var e,i,o;this.expanded&&I(this,_a,(i=(e=a(this,we).call(this))==null?void 0:e.renderer.camera.elevation)!=null?i:0),(o=a(this,we).call(this))==null||o.renderer.on("user-interaction-end",a(this,vc))});b(this,gc,()=>{var i;let e=a(this,we).call(this);if(e!=null&&this.expanded&&a(this,ka)&&!a(this,dr)){let o=[1/0,e.currentFloorId];for(let n=0;n<a(this,mt).length;n++){let s=a(this,mt)[n],c=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-n*a(this,ur));c<a(this,ur)/3&&(o[0]=c,o[1]=s.id)}o[1]!==e.currentFloorId&&(e.currentFloorId=o[1],a(this,mt).forEach(n=>{e.renderer.setState(n.containerId,{visible:a(this,mn)==="all-floors"?!0:e.currentFloor.id===n.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId}))}});b(this,vc,()=>{var i,o;let e=a(this,we).call(this);if(this.expanded&&e&&a(this,_a)!==((i=e.renderer.camera.elevation)!=null?i:0)){let n=[1/0,e.currentFloorId,0];for(let s=0;s<a(this,mt).length;s++){let c=a(this,mt)[s],l=Math.abs(((o=e.renderer.camera.elevation)!=null?o:0)-s*a(this,ur));l<n[0]&&(n[0]=l,n[1]=c.id,n[2]=s*a(this,ur))}a(this,ka)&&j(this,th,p7).call(this,n[2]),I(this,_a,0),e.renderer.off("user-interaction-end",a(this,vc))}});b(this,Ci,null);b(this,bc,null);b(this,vo,void 0);I(this,we,e);let i=a(this,we).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",a(this,yc)),i.renderer.on("camera-change",a(this,gc)),i.renderer.on("pre-render",a(this,mc)))}get state(){return a(this,fn)}get expanded(){return a(this,fn)!=="collapsed"}get gapBelowFloors(){return a(this,ur)}get includedFloors(){var e;return(e=a(this,fc,Hy))!=null&&e.api.mapData?a(this,mt).map(i=>{var o,n;return(n=(o=a(this,fc,Hy))==null?void 0:o.api.mapData)==null?void 0:n.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return a(this,mn)}setFloorVisiblityMode(e){I(this,mn,e);let i=a(this,we).call(this);i!=null&&a(this,mt).forEach(o=>{i.renderer.setState(o.containerId,{visible:a(this,mn)==="all-floors"?!0:i.currentFloor.id===o.id})})}changeFloorOnElevationChanges(e){I(this,ka,e)}async expand(e){var o,n,s;let i=a(this,we).call(this);if(i!=null)return I(this,ur,(o=e==null?void 0:e.distanceBetweenFloors)!=null?o:c7),I(this,mt,(e==null?void 0:e.includedFloors)!=null&&(e==null?void 0:e.includedFloors.length)>0?e==null?void 0:e.includedFloors.map(c=>i.floorsById.get(c.id)).filter(Boolean):i.currentFloorStack.floorObjects),a(this,mt).sort((c,l)=>c.elevation-l.elevation),a(this,mt).length<=1||this.expanded===!0?Promise.resolve():(I(this,dr,!0),i.api.Camera.setPanMode((n=e==null?void 0:e.cameraPanMode)!=null?n:"elevation"),this.changeFloorOnElevationChanges((s=e==null?void 0:e.changeFloorOnElevationChanges)!=null?s:!0),j(this,Cc,Uy).call(this,"expand",e).then(()=>{I(this,fn,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{I(this,dr,!1)}))}async collapse(e){let i=a(this,we).call(this);if(i!=null)return this.expanded===!0?(I(this,dr,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),j(this,Cc,Uy).call(this,"collapse",e).then(()=>{I(this,fn,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{I(this,dr,!1)})):Promise.resolve()}destroy(){let e=a(this,we).call(this);e!=null&&(e.renderer.off("user-interaction-start",a(this,yc)),e.renderer.off("camera-change",a(this,gc)),e.renderer.off("pre-render",a(this,mc)))}};we=new WeakMap,ur=new WeakMap,_a=new WeakMap,Vr=new WeakMap,dr=new WeakMap,mt=new WeakMap,hc=new WeakMap,ka=new WeakMap,fn=new WeakMap,fc=new WeakSet,Hy=function(){return a(this,we).call(this)},mn=new WeakMap,mc=new WeakMap,yc=new WeakMap,gc=new WeakMap,vc=new WeakMap,Ci=new WeakMap,th=new WeakSet,p7=function(e){var o,n,s;a(this,Ci)&&a(this,Ci).stop();let i=a(this,we).call(this);i!=null&&(I(this,Ci,new Ct({elevation:(o=i.renderer.camera.elevation)!=null?o:0}).to({elevation:e},150).easing(Pe.Quadratic.Out).onComplete(()=>{var c;a(this,Ci)&&((c=a(this,we).call(this))==null||c.renderer.getTweenGroup().remove(a(this,Ci)))}).onUpdate(({elevation:c})=>{i.renderer.camera.setElevation(c)}).start()),(n=a(this,we).call(this))==null||n.renderer.getTweenGroup().add(a(this,Ci)),(s=a(this,we).call(this))==null||s.renderer.render())},bc=new WeakMap,vo=new WeakMap,Cc=new WeakSet,Uy=function(e,i){var c,l,p,h;a(this,Vr)&&a(this,Vr).stop();let o=a(this,we).call(this);if(o==null)return Promise.reject(new Error("No current map"));let n=a(this,mt).indexOf(o.currentFloor)*a(this,ur),s=(c=o.renderer.camera.elevation)!=null?c:0;return I(this,bc,new Promise(m=>{I(this,vo,m)})),I(this,Vr,new Ct({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(l=i==null?void 0:i.duration)!=null?l:OP).easing(va[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:m})=>{this.expandedFactor=m,o.renderer.camera.setElevation(e==="expand"?n*m:s*m)}).onComplete(()=>{var m;a(this,Vr)&&((m=a(this,we).call(this))==null||m.renderer.getTweenGroup().remove(a(this,Vr)))}).start()),a(this,Vr).cameraAnimation=!0,(p=a(this,we).call(this))==null||p.renderer.getTweenGroup().add(a(this,Vr)),(h=a(this,we).call(this))==null||h.renderer.render(),a(this,bc)};f();var Ba,Sc=class{constructor(t,e,i,o){u(this,"id");u(this,"externalId");u(this,"name");u(this,"type");u(this,"floorIds");u(this,"defaultFloorId");u(this,"floorObjects",[]);u(this,"floorObjectsByElevation",new Map);u(this,"metadata");u(this,"containerId");u(this,"facade");u(this,"renderer");b(this,Ba,void 0);var s;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(s=t.floors)!=null?s:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=i;let n=i.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=n.id.toString(),this.facade=o}get defaultFloor(){if(a(this,Ba)==null){this.floorObjects.length===0&&O.throw("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,i)=>Math.abs(i.elevation)<Math.abs(e.elevation)?i:e)),I(this,Ba,t)}return a(this,Ba)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){O.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var e,i;(i=(e=this.facade)==null?void 0:e.spaces)==null||i.forEach(o=>{this.renderer.setState(o.spaceId,{visible:t})})}};Ba=new WeakMap;f();function u7(r,t,e){let i=[];for(let o of r){let n={floor:o,visible:!1,visibleLayers:[],expandFootprint:!1};o.id===t.id?(n.visible=!0,n.visibleLayers=[Er,Se,si],o.elevation<0&&(n.expandFootprint=!0,n.visibleLayers.push(ia))):e.includes(o.id)&&o.elevation<t.elevation?(n.visible=!0,n.visibleLayers=[ia,Er,Se],o.elevation<0&&(n.expandFootprint=!0)):t.elevation>0&&o.elevation<t.elevation&&o.elevation>=0&&(n.visible=!0,n.visibleLayers=[ia]),i.push(n)}return i}f();f();f();f();var Ra,yn,Ye,Ic,Na,Mc,Pc,Ga,It,xc=class{constructor(t,e,i){u(this,"id");b(this,Ra,void 0);b(this,yn,void 0);b(this,Ye,void 0);b(this,Ic,void 0);b(this,Na,[]);b(this,Mc,!1);b(this,Pc,1);b(this,Ga,new Map);b(this,It,void 0);this.id=t.id,I(this,Ra,t),I(this,yn,e),I(this,Ye,i),this.setDefaultFloor(this.defaultFloor)}get floorStack(){return a(this,yn)}get defaultFloor(){var t;return(t=a(this,Ic))!=null?t:a(this,yn).defaultFloor}setDefaultFloor(t){I(this,Ic,t),this.updateChildGeometryIds(t)}updateChildGeometryIds(t){I(this,Na,[]);let e=a(this,Ye).getState(t.layers.get(Se).containerId);for(let i of e.children){let o=a(this,Ye).getState(i);for(let n of o.children){let s=a(this,Ye).getState(n);s&&a(this,Na).push(s.id.toString())}}}set focusable(t){I(this,Mc,t),a(this,Ra).spaces.forEach(e=>{let i=a(this,Ye).getState(e.id);i&&a(this,Ye).setState(i,{focusable:t,renderOrder:t?2:0})})}get focusable(){return a(this,Mc)}set opacity(t){I(this,Pc,t),a(this,Ra).spaces.forEach(e=>{let i=a(this,Ye).getState(e.id);i&&(a(this,Ga).has(e.id)||a(this,Ga).set(e.id,i.opacity),a(this,Ye).setState(i,{opacity:Math.min(a(this,Ga).get(e.id),t)}))})}get opacity(){return a(this,Pc)}animateOpacity(t,e=300){a(this,It)&&a(this,It).stop(),t<1&&this.defaultFloor.setVisible(!0),I(this,It,new Ct({opacity:this.opacity}).easing(Pe.Quadratic.In).to({opacity:t},e).onUpdate(({opacity:i})=>{this.opacity=i,a(this,Na).forEach(o=>{a(this,Ye).setState(a(this,Ye).getState(o),{opacity:1-i})}),a(this,Ye).render()}).onStop(()=>{a(this,It)&&(a(this,Ye).getTweenGroup().remove(a(this,It)),I(this,It,void 0))}).onComplete(()=>{a(this,It)&&(a(this,Ye).getTweenGroup().remove(a(this,It)),I(this,It,void 0)),this.opacity===1&&a(this,yn).floorObjects.forEach(i=>{i.setVisible(!1)})})),a(this,It).start(),a(this,Ye).getTweenGroup().add(a(this,It))}};Ra=new WeakMap,yn=new WeakMap,Ye=new WeakMap,Ic=new WeakMap,Na=new WeakMap,Mc=new WeakMap,Pc=new WeakMap,Ga=new WeakMap,It=new WeakMap;var h7=!1,jr,gn,Va,bo,Tc,ja,fr,At,hr,ih,f7,wc,Xy,Ha,rh,Co,Ec,Dc,Wy,Oc,Ua=class extends Z{constructor(e,i,{currentMapGetter:o}){super();b(this,At);b(this,ih);b(this,wc);b(this,Ha);b(this,Dc);b(this,jr,void 0);b(this,gn,!1);b(this,Va,17);b(this,bo,!1);b(this,Tc,void 0);b(this,ja,void 0);b(this,fr,new Map);b(this,Co,new Set);b(this,Ec,e=>{if(!a(this,gn)||e.length===0||!a(this,bo))return;let i=-1/0,o,n=!1,s=new Set,c=new Map;e.forEach((l,p)=>{var g;let h=j(this,wc,Xy).call(this,l);if(!h)return;let m=1-p/e.length,y=((g=c.get(h.id))!=null?g:0)+m;c.set(h.id,y),y>i&&(i=y,o=h),a(this,Co).has(h.id)||(j(this,Ha,rh).call(this,h.id,0),n=!0),s.add(h.id)}),h7&&O.log("likelyInFocus:",[o==null?void 0:o.floorStack.name,i],"Weights:",e.flatMap(l=>{let p=j(this,wc,Xy).call(this,l);return p?[p.floorStack.name,c.get(p.id)]:[]}));for(let l of a(this,Co))s.has(l)||(j(this,Ha,rh).call(this,l,1),n=!0);o&&a(this,At,hr).currentFloorStackId!==o.floorStack.id&&(j(this,ih,f7).call(this,o.id),n=!0),I(this,Co,s),n&&this.publish("focus-change",{facades:Array.from(a(this,Co)),spaces:e})});b(this,Oc,e=>{if(e.zoomLevel>=a(this,Va)&&!a(this,bo))I(this,bo,!0);else if(e.zoomLevel<a(this,Va)&&a(this,bo)){I(this,bo,!1);for(let i of a(this,fr).values())i.opacity<1&&j(this,Ha,rh).call(this,i.id,1);a(this,Co).clear(),a(this,At,hr).outdoorFloorStacks.size>0&&!a(this,At,hr).outdoorFloorStacks.has(a(this,At,hr).currentFloorStackId)&&(a(this,At,hr).setFloorStack(a(this,At,hr).outdoorFloorStacks.values().next().value),this.publish("focus-change",{facades:[],spaces:[]}))}});I(this,jr,e),I(this,Tc,o),I(this,ja,i)}enable(e){var i;I(this,Va,(i=e==null?void 0:e.minZoomLevel)!=null?i:17),this.enabled||(a(this,jr).on("geometry-in-focus",a(this,Ec)),a(this,jr).on("camera-change",a(this,Oc)),j(this,Dc,Wy).call(this,!0),I(this,gn,!0)),h7&&a(this,jr).getSystems().geometryInFocusSystem.showRaycasters()}disable(){I(this,gn,!1),a(this,jr).off("geometry-in-focus",a(this,Ec)),a(this,jr).off("camera-change",a(this,Oc)),j(this,Dc,Wy).call(this,!1)}get enabled(){return a(this,gn)}setDefaultFloorForStack(e,i){a(this,At,hr)==null&&O.throw("Current map does not exist.");let o=a(this,At,hr).floorsById.get(i.id);if(o==null){O.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(o.floorStackId!==e.id){O.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(e.id,"). Default floor will not be set."));return}let n=e.facade&&a(this,fr).get(e.facade.id);n&&n.setDefaultFloor(o)}resetDefaultFloorForStack(e){let i=e.facade&&a(this,fr).get(e.facade.id);i&&i.setDefaultFloor(i.floorStack.defaultFloor)}};jr=new WeakMap,gn=new WeakMap,Va=new WeakMap,bo=new WeakMap,Tc=new WeakMap,ja=new WeakMap,fr=new WeakMap,At=new WeakSet,hr=function(){return a(this,Tc).call(this)},ih=new WeakSet,f7=function(e){let i=a(this,fr).get(e);i&&a(this,At,hr).setFloor(i.defaultFloor.id)},wc=new WeakSet,Xy=function(e){var o;let i=(o=a(this,ja).getMapDataInternal())==null?void 0:o.facadesBySpaceId[e];return a(this,fr).get(i.id)},Ha=new WeakSet,rh=function(e,i){let o=a(this,fr).get(e);o&&o.animateOpacity(i)},Co=new WeakMap,Ec=new WeakMap,Dc=new WeakSet,Wy=function(e){var i;(i=a(this,ja).getMapDataInternal())==null||i.facades.forEach(o=>{let n=a(this,fr).get(o.id);n==null&&(n=new xc(o,a(this,At,hr).floorStacksById.get(o.floorStack.id),a(this,jr)),a(this,fr).set(o.id,n)),n.focusable=e})},Oc=new WeakMap;var AP=5,FP={linear:Pe.Linear.None,easeIn:Pe.Quadratic.In,easeOut:Pe.Quadratic.Out,easeInOut:Pe.Quadratic.InOut},Ft,Lc=class extends Z{constructor(e,i,o,n){var p,h,m,y;super();u(this,"floorStacksById",new Map);u(this,"floorsById",new Map);u(this,"currentFloorId","");u(this,"currentFloorStackId","");u(this,"outdoorFloorStacks",new Set);u(this,"id");u(this,"renderer");u(this,"api");u(this,"mvf");u(this,"options",{});u(this,"styleMap");u(this,"StackedMaps");u(this,"DynamicFocus");u(this,"animations",new Map);u(this,"Models",{add:(e,i,o)=>{let{floorId:n,...s}=o,c=n?this.floorsById.get(n):this.currentFloor,l=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:i.map(p=>{var h;return{type:"Feature",properties:{id:he(),rotation:(h=p.rotation)==null?void 0:h.map(m=>m*(Math.PI/180)),scale:p.scale,interactive:p.interactive},geometry:{type:"Point",coordinates:Lr(p.target)}}})},{url:s.url},c.id);if(l==null)throw new Error("error creating model");return this.renderer.getState(l).children},remove:(e,i)=>{this.renderer.remove(e),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});u(this,"Images",{add:(e,i,o)=>{let{floorId:n,flipImageToFaceCamera:s,...c}=o,l=n?this.floorsById.get(n):this.currentFloor,p={type:"Feature",properties:c,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(he(),p,{url:i,flipImageToFaceCamera:s!=null?s:!1},l.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}});u(this,"Markers",{add:(e,i,o)=>{var c;let n=e.floorId?this.floorsById.get(e.floorId):this.currentFloor,s=o;return o.rank==="initial"&&(s.rank="medium"),this.renderer.addMarker2D(Lr(e),i,s,(c=n==null?void 0:n.layers.get(Er))==null?void 0:c.containerId)},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let i=this.renderer.getState(e);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(e,i,o)=>{var c;let n=this.renderer.getState(e),s=o?this.floorsById.get(o):this.currentFloor;if(!n){O.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(n.type!=="marker"){O.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(n,{position:i,parent:(c=s==null?void 0:s.layers.get(Er))==null?void 0:c.containerId})},animateTo:(e,i,o,n)=>{let s=this.renderer.getState(e),c=o?this.floorsById.get(o):this.currentFloor;if(!s)return O.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(s.type!=="marker")return O.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let l={duration:1e3,easing:"ease-in-out",...n};this.cancelAnimation(e);let p=new Ct({lon:s.position[0],lat:s.position[1]}).to({lon:i[0],lat:i[1]},l.duration).easing(FP[l.easing]).onUpdate(({lon:h,lat:m})=>{var g;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let S=(g=c==null?void 0:c.layers.get(Er))==null?void 0:g.containerId;S&&this.Markers.setPosition(e,[h,m],S)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(e,p),ay(p).then(()=>{this.animations.delete(e)})}});u(this,"Exporter",{getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)});u(this,"Shapes",{add:(e,i,o)=>{let n=o!=null&&o.floorId?this.floorsById.get(o==null?void 0:o.floorId):this.currentFloor,s=he();return this.renderer.addGeometryGroup(s,e,i,n.id),s},remove:e=>(this.renderer.remove(e.id),e.id)});u(this,"Text3D",{label:(e,i,o)=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode)){O.warn("Enterprise mode is not enabled, skipping label creation");return}let n=m7(this.renderer,e,i,o);if(n)return{textInfo:n,target:e}},labelAll:(e={})=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode))return O.warn("Enterprise mode is not enabled, skipping label creation"),[];let i=this.api.getMapData();if(!i)return[];let o=[];return i.getByType("space").forEach(s=>{var c,l;if(s.locations[0]){let p=m7(this.renderer,s,(l=(c=s.locations[0])==null?void 0:c.name)!=null?l:s.name,e);p&&o.push({textInfo:p,target:s})}}),o},remove:e=>{var i;if(!((i=this.api.getMapDataInternal())!=null&&i.enterpriseMode)){O.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e}});u(this,"Labels",{all:({onCreate:e})=>{for(let i of Object.entries(this.mvf.space)){let[o,n]=i;n&&n.features.forEach(s=>{var g,S,M;let c=(g=this.api.getMapData())==null?void 0:g.getById("space",s.properties.id);if(!c)return;let l=(S=this.styleMap[s.properties.id])==null?void 0:S.showImage,p=(M=s.properties.details)==null?void 0:M.images,h={};l&&p&&p.length>0&&(h={marker:{icon:p[0].url}});let y=(o?this.floorsById.get(o):this.currentFloor).layers.get(si);if(s.properties.center&&s.properties.externalId!==""){let v=this.renderer.addLabel2D(s.properties.center,s.properties.externalId,{id:s.properties.id+"-label",appearance:h},Fe.is(c)?c.id:y==null?void 0:y.containerId);v&&(Fe.is(c)&&y&&y.labelIds.add(v.id.toString()),e(v.id,s.properties.externalId,c))}})}},add:(e,i,o={})=>{let{floorId:n,...s}=o,l=(n?this.floorsById.get(n):this.currentFloor).layers.get(si),p=this.renderer.addLabel2D(e,i,s,(o==null?void 0:o.spaceId)||(l==null?void 0:l.containerId));if(!p)throw new Error("label creating failed");return o!=null&&o.spaceId&&l.labelIds.add(p.id.toString()),p},remove:({label:e,entityId:i})=>{var o;if(Fe.is(e.target)){let n=this.floorsById.get(e.target.floor.id);n&&((o=n.layers.get(si))==null||o.labelIds.delete(e.id.toString()))}this.renderer.remove(i)},removeAll:()=>{}});u(this,"Paths",{add:(e,i)=>{var p;let o=[],n=e[0].floorId||"root",s=0;for(let h of e){let{floorId:m="root",latitude:y,longitude:g}=h;m!==n&&(s++,n=m),o[s]==null&&o.push({floorId:m,coordinates:[]}),o[s].coordinates.push([g,y])}let c=o.reduce((h,{floorId:m,coordinates:y},g)=>{if(g!==0){let M=o[g-1],v=y[0],C=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:M.floorId},geometry:{type:"Point",coordinates:M.coordinates[M.coordinates.length-1]}},{type:"Feature",properties:{parentId:m},geometry:{type:"Point",coordinates:v}}]},i,this.id);C&&h.push(C)}let S=this.renderer.addPath({type:"FeatureCollection",features:y.map(M=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:M}}))},i,m);return S&&h.push(S),h},[]),l=new Ct({fraction:0}).to({fraction:1},(p=i==null?void 0:i.drawDuration)!=null?p:1e3).onUpdate(({fraction:h})=>{c.forEach(m=>{this.renderer.setState(m.id,{completeFraction:h})})}).start();return this.renderer.getTweenGroup().add(l),this.renderer.render(),this.animations.set(c[0].id.toString(),l),{paths:c,animation:ay(l).then(()=>{this.animations.delete(c[0].id.toString())})}},remove:e=>{e.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});b(this,Ft,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=n.core,this.api=n,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=o!=null?o:{},this.StackedMaps=new dc({currentMapGetter:()=>this}),this.DynamicFocus=new Ua(this.renderer,this.api,{currentMapGetter:()=>this}),this.mvf=(p=i==null?void 0:i.mvf)!=null?p:{};let s=u4(this.mvf["styles.json"]||{});if(this.styleMap=s,I(this,Ft,{enabled:!1,floorHeight:AP,updateCameraElevationOnFloorChange:!0,...o==null?void 0:o.multiFloorView}),!i){this.id!=="outdoors-container"&&O.warn("Map (".concat(this.id,") created with no data."));let g=new Sc({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(g.id,g),this.currentFloorStackId=g.id;let S=new uc(g.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,a(this,Ft),o!=null?o:{});g.addFloor(S),this.floorsById.set(S.id,S),this.setFloor(S.id);return}let c=i.getMVFFeatureByType("floor-stack");(c==null||c.length===0)&&O.throw("MVF does not contain any Floor Stacks.");for(let g of c){let S=new Sc(g,this.id,this.renderer,(h=this.mvf.facade)==null?void 0:h[g.id]);if(S.floorIds.length!==0){for(let M of S.floorIds){let v=i.getMVFFeatureById("floor",M);if(v!=null){let C=this.mvf.space[v.id],w=this.mvf.obstruction[v.id];if((C==null||C.features.length===0)&&(w==null||w.features.length===0))continue;let P=new uc(S.id,v,this.renderer,a(this,Ft),o!=null?o:{},this.mvf,s);S.addFloor(P),this.floorsById.set(P.id,P)}}this.floorStacksById.set(g.id,S),this.currentFloorStackId||(this.currentFloorStackId=g.id)}}for(let[g]of Object.entries(i.facadesBySpaceId)){let S=i.getById("space",g);S&&(this.outdoorFloorStacks.add(S.floor.floorStack.id),(m=this.floorsById.get(S.floor.id))==null||m.setVisible(!0))}let l=(y=this.mvf.enterprise)==null?void 0:y.venue.defaultMap;if(o!=null&&o.initialFloor){let g=Gs(o.initialFloor);g&&this.floorsById.has(g)?l=g:O.error("Invalid initial floor specified (".concat(o.initialFloor,"), using default behavior instead"))}l||(l=this.currentFloorStack.defaultFloor.id),this.setFloor(l)}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);return e||O.throw('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found')),e}setFloorStack(e){if(this.currentFloorStackId===e)return;let i=this.floorStacksById.get(e);if(i==null){O.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){O.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(i.defaultFloor.id)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);return e||O.throw('Floor with id "'.concat(this.currentFloorId,'" not found')),e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var n,s,c;let i=this.floorsById.get(e),o=this.floorStacksById.get(this.currentFloorStackId);i&&o&&(!((n=a(this,Ft))!=null&&n.enabled)||i.floorStackId!==(o==null?void 0:o.id)?(!this.options.keepOutdoorGeometryVisible||!this.outdoorFloorStacks.has(o.id))&&(o==null||o.floorObjects.forEach(l=>{l.id!==e&&l.setVisible(!1)})):(u7(this.currentFloorStack.floorObjects,i,((c=(s=this.api.Navigation)==null?void 0:s.floors)==null?void 0:c.map(p=>p.id))||[]).forEach(p=>{var h,m,y,g;p.floor.setVisible(p.visible);for(let[S,M]of p.floor.layers)p.visibleLayers.includes(S)?M.show():M.hide();p.expandFootprint?(this.renderer.setState("Footprint-".concat(p.floor.id),{height:Math.abs(p.floor.elevation)*a(this,Ft).floorHeight,altitude:-a(this,Ft).floorHeight/2}),(m=(h=this.api)==null?void 0:h.Outdoor)==null||m.setOpacity(.2)):(this.renderer.setState("Footprint-".concat(p.floor.id),{height:-a(this,Ft).floorHeight,altitude:a(this,Ft).floorHeight/2}),i.elevation>=0&&((g=(y=this.api)==null?void 0:y.Outdoor)==null||g.setOpacity("initial")))}),a(this,Ft).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*a(this,Ft).floorHeight)))}setFloor(e,i){if(this.currentFloorId!==e){if(!this.floorsById.has(e)){O.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}if(this.publish("floor-change-start",{floorId:e}),this.DynamicFocus.enabled){let o=this.floorsById.get(e);if(!this.outdoorFloorStacks.has(this.currentFloorStack.id)&&(o==null?void 0:o.floorStackId)===this.currentFloorStack.id){let n=this.floorsById.get(this.currentFloorId);n==null||n.setVisible(!1)}}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(e));this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.DynamicFocus.enabled||this.currentFloorStack.setFacadeVisible(!1),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(e){let i=this.animations.get(e);i&&(i.stop(),this.animations.delete(e),this.renderer.getTweenGroup().remove(i))}};Ft=new WeakMap;function m7(r,t,e,i){return r.labelText3D(t.id,e!=null?e:t.name,{...i,parentId:t.floor.id})}f();var mr,Fc,Ac=class{constructor({currentMapGetter:t}){b(this,mr,new Map);b(this,Fc,void 0);I(this,Fc,t)}get currentMap(){return a(this,Fc).call(this)}getById(t){return a(this,mr).get(t)}add(t,e,i){let o=t.anchorTarget;if(!o)throw new Error("get coordinate failed");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Markers.add(o,e,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1});if(s==null)throw new Error("error creating marker");let c=n.Markers.getContentEl(s.id.toString());if(!c)throw new Error("marker component should exist");let l=new mi(s.id.toString(),c,t);return a(this,mr).set(l.id,{marker:l,entityId:s.id.toString()}),l}remove(t){var i;let e=a(this,mr).get(t.id);e&&((i=this.currentMap)==null||i.Markers.remove(e.entityId),a(this,mr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,mr).forEach(({marker:e})=>{this.remove(e),t.push(e),a(this,mr).delete(e.id.toString())}),t}setPosition(t,e){var s;let i=e.anchorTarget;if(!i){O.error("Cannot determine coordinate from target.");return}let o=this.currentMap;if(!o){O.error("Cannot determine the current map.");return}let n=a(this,mr).get(t.id);if(!n){O.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}o.Markers.setPosition(n.entityId,Lr(i),(s=i.floorId)!=null?s:o.currentFloorId),n.marker.updateTarget(e)}animateTo(t,e,i){var c;let o=e.anchorTarget;if(!o)return O.error("Cannot determine coordinate from target."),Promise.resolve();let n=this.currentMap;if(!n)return O.error("Cannot determine the current map."),Promise.resolve();let s=a(this,mr).get(t.id);return s?(s.marker.updateTarget(e),n.Markers.animateTo(s.entityId,Lr(o),(c=o.floorId)!=null?c:n.currentFloorId,i)):(O.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};mr=new WeakMap,Fc=new WeakMap;f();var Si,kc,_c=class{constructor({currentMapGetter:t}){b(this,Si,new Map);b(this,kc,void 0);I(this,kc,t)}get currentMap(){return a(this,kc).call(this)}getById(t){return a(this,Si).get(t)}add(t,e,i){let o=ni(t);if(!o)throw new Error("get coordinate failed");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=n.Images.add(Lr(o),e,{...i,floorId:o.floorId});if(!s)throw new Error("image component should exist");let c=new ql(s.id.toString(),e,t);return a(this,Si).set(c.id,{image:c,entityId:s.id.toString()}),c}remove(t){var i;let e=a(this,Si).get(t.id);e&&((i=this.currentMap)==null||i.Images.remove(e.entityId),a(this,Si).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Si).forEach(({image:e})=>{this.remove(e),t.push(e),a(this,Si).delete(e.id.toString())}),t}};Si=new WeakMap,kc=new WeakMap;f();var Hr,Rc,Bc=class{constructor({currentMapGetter:t}){b(this,Hr,new Map);b(this,Rc,void 0);I(this,Rc,t)}get currentMap(){return a(this,Rc).call(this)}getById(t){return a(this,Hr).get(t)}add(t,e){let i=Array.isArray(t)?t:[t],o=i.reduce((c,l)=>{var h;let p=ni(l.target);return p?(c.has(p.floorId)||c.set(p.floorId,[]),(h=c.get(p.floorId))==null||h.push({...l,target:p}),c):(O.error("Cannot determine coordinate from options."),c)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let s=[];return o.forEach((c,l)=>{let p=he();n.Models.add(p,c,{...e,floorId:l}).forEach(({id:m})=>{let y=new Kl(m.toString(),p);a(this,Hr).set(y.id,{model:y,entityId:m.toString(),groupId:p}),s.push(y)})}),s}remove(t){var i;let e=a(this,Hr).get(t.id);e&&((i=this.currentMap)==null||i.Models.remove(e.entityId,e.groupId),a(this,Hr).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Hr).forEach(({model:e})=>{var o;let i=a(this,Hr).get(e.id);i&&(t.push(e),(o=this.currentMap)==null||o.Models.remove(i.entityId,i.groupId),a(this,Hr).delete(e.id.toString()))}),t}};Hr=new WeakMap,Rc=new WeakMap;f();var Ur,Gc,Nc=class{constructor({currentMapGetter:t}){b(this,Ur,new Map);b(this,Gc,void 0);I(this,Gc,t)}get currentMap(){return a(this,Gc).call(this)}getById(t){return a(this,Ur).get(t)}add(t,e){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let o=i.Paths.add(t,e),n=o.paths.map(c=>c.id.toString()),s=new pn(he(),o.animation,t);for(let c of n)a(this,Ur).set(c,{path:s,entityIds:n});return a(this,Ur).set(s.id,{path:s,entityIds:n}),s}remove(t){var i;let e=a(this,Ur).get(t.id);e&&((i=this.currentMap)==null||i.Paths.remove(e.entityIds),a(this,Ur).delete(t.id),e.entityIds.forEach(o=>a(this,Ur).delete(o)))}removeAll(){let t=[];return a(this,Ur).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};Ur=new WeakMap,Gc=new WeakMap;f();var w7=rp(j7(),1);f();var Yy="#2266ff",_P="#808080",y7="#f5f5f5";var g7={radius:10,color:Yy,inactiveColor:_P,heading:{color:Yy,opacity:.7},accuracyRing:{color:Yy,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};f();var v7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";f();var b7=(r,t,e=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=e/Math.tan(r/2),o=e/Math.sin(r/2),n=o+t,s=10,c=new br;c.moveTo(-o*Math.sin(r/2),o*Math.cos(r/2)-i);for(let l=0;l<s;l++)c.lineTo(-(n*Math.sin(r/2-r/s*l)),n*Math.cos(r/2-r/s*l)-i);for(let l=0;l<s;l++)c.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/s*l)),e*Math.cos(Math.PI/-2+Math.PI/s*l));return new Cr(c,{depth:.1,bevelEnabled:!1,UVGenerator:BP(t)})},Zy=(r,t,e)=>{let o=Math.sqrt(Math.pow(r,2)+Math.pow(t,2))/e;return o>1?o=1:o<0&&(o=0),new J(0,o)},BP=r=>({generateTopUV:(t,e,i,o,n)=>{let s=e[i*3],c=e[i*3+1],l=e[o*3],p=e[o*3+1],h=e[n*3],m=e[n*3+1];return[Zy(s,c,r),Zy(l,p,r),Zy(h,m,r)]},generateSideWallUV:()=>[new J(0,1),new J(0,1),new J(0,1),new J(0,1)]});function C7(r,t){if(t==null)return r;let e={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in t&&(e.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?r==null?void 0:r.latitude:t.latitude),"longitude"in t&&(e.longitude=t.longitude==null||t.longitude==="device"?r==null?void 0:r.longitude:t.longitude),"accuracy"in t&&(e.accuracy=t.accuracy==="device"?r==null?void 0:r.accuracy:t.accuracy),"floor"in t&&(e.floor=t.floor==="device"?r==null?void 0:r.floor:t.floor),"heading"in t&&(e.heading=t.heading==="device"?r==null?void 0:r.heading:t.heading),e}function RP([r,t],[e,i],[o,n]){let s=e-r,c=i-t,l=s**2+c**2;if(l===0)return;let p=((o-r)*s+(n-t)*c)/l,h;p<=0?h=[r,t]:p>=1?h=[e,i]:h=[r+p*s,t+p*c];let m=op([o,n],h);return{proportion:Math.max(0,Math.min(1,p)),intersection:h,distance:m}}function S7(r,t){if(r==null||r.length<2)return;let e=Number.MAX_SAFE_INTEGER,i,o=0,n=0;for(let s=0;s<r.length-1;s++){let c=r[s],l=r[s+1],p=RP(c,l,t);p!=null&&p.distance<e&&(e=p.distance,i=p.intersection,o=s,n=p.proportion)}if(i)return{intersection:i,distance:e,segmentIndex:o,proportion:n}}function x7(r,t){let e=new Ai({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,o=.35*4,n=b7(Math.PI/6,o,i);new Fn().load(v7,c=>{e.alphaMap=c,e.needsUpdate=!0});let s=new me(n,e);return s.position.z=-.05,s.renderOrder=0,s}function I7(r,t){let e=new dp(1,1,.05,32),i=new Ai({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),o=new me(e,i);return o.scale.set(0,0,.05),o.renderOrder=1,o.rotation.x=Math.PI/2,o}function M7(r){let t=new dp(.35,.35,.07,32),e=new Ai({transparent:!0,color:y7,depthTest:!1,depthWrite:!1}),i=new me(t,e);i.renderOrder=2;let o=new dp(.35*.8,.35*.8,.01,32),n=new Ai({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),s=new me(o,n);return s.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,s.rotation.x=Math.PI/2,s.position.z=.07,{outerMesh:i,innerMesh:s}}var E7=rp(P7(),1);var vn,xi,_t,kt,Ii,bn,Cn,Sn,Le,Mt,Vc,Mi,jc,Hc,Uc,Xc,nh,Xr,Pi,ah,xn,Wc,Wr,Wa=class extends Z{constructor(e,i){super();this.core=e;this.geoJSONApi=i;b(this,vn,null);u(this,"geometry");b(this,xi,void 0);b(this,_t,void 0);b(this,kt,void 0);b(this,Ii,void 0);b(this,bn,void 0);b(this,Cn,void 0);b(this,Sn,void 0);b(this,Le,g7);b(this,Mt,1);b(this,Vc,void 0);b(this,Mi,void 0);u(this,"state","disabled");u(this,"following",!1);b(this,jc,e=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",e)});b(this,Hc,e=>{var o;let i;if(e!=null){let n=(o=this.geoJSONApi.currentMap)==null?void 0:o.currentFloorStack.floorObjectsByElevation.get(e);i=n?a(this,jc).call(this,n.id):void 0}return i});b(this,Uc,e=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,o,n,s]=e.children;if(a(this,nh).call(this),o.scale.set(a(this,Mt),a(this,Mt),a(this,Mt)),o.position.z=.07/2*a(this,Mt),n.scale.set(a(this,Mt),a(this,Mt),a(this,Mt)),n.position.z=.07*a(this,Mt),this.state==="active"){n.material.color.set(a(this,Le).color);let c=this.accuracy;c!=null?(i.visible=!0,a(this,Cn)&&a(this,Cn).stop(),I(this,Cn,new Ct({scale:i.scale.x}).to({scale:c/2},150).onUpdate(({scale:p})=>{i.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(a(this,Cn))):i.visible=!1;let l=this.heading;if(l!=null){s.visible=!0,a(this,Sn)&&a(this,Sn).stop();let{start:p,end:h}=np(s.rotation.z,-ae.degToRad(l));I(this,Sn,new Ct({rotation:p}).to({rotation:h},150).onUpdate(({rotation:m})=>{s.rotation.z=m}).start()),this.core.getTweenGroup().add(a(this,Sn)),s.scale.set(a(this,Mt),a(this,Mt),1)}else s.visible=!1}else this.state==="inactive"&&(n.material.color.set(a(this,Le).inactiveColor),s.visible=!1,i.visible=!1)});b(this,Xc,e=>{var s,c;let i;try{i=HP.parse(C7(e,a(this,_t)))}catch(l){a(this,Xr).call(this,"error"),O.error("BlueDot: Position parse failed",l instanceof B.ZodError?l.message:String(l)),this.publish("error");return}a(this,Le).debug&&O.log("BlueDot: Parsed position",i),I(this,kt,i),a(this,Xr).call(this,"position-update"),a(this,Ii)&&clearTimeout(a(this,Ii)),typeof a(this,Le).timeout=="number"&&a(this,Le).timeout<1/0&&I(this,Ii,setTimeout(()=>{a(this,Le).debug&&O.log("BlueDot: Position timed out after ".concat(a(this,Le).timeout,"ms")),a(this,Xr).call(this,"timeout"),this.core.render()},a(this,Le).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(s=i.floor)==null?void 0:s.elevation,accuracy:i.accuracy}});let o=i.floor!=null?i.floor.id:"outdoors-container",n=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:n}},{setup:l=>{let p=I7(a(this,Le).accuracyRing.color,a(this,Le).accuracyRing.opacity),{outerMesh:h,innerMesh:m}=M7(a(this,Le).color),y=x7(a(this,Le).heading.color,a(this,Le).heading.opacity);l.add(p),p.visible=!1,l.add(h),l.add(m),l.add(y),y.visible=!1,a(this,Uc).call(this,l)},update:a(this,Uc)},{visible:!0},o);else{let l=this.core.getState(this.geometry);n=[l.position[0],l.position[1]]}a(this,bn)&&a(this,bn).stop(),I(this,bn,new Ct(n).to([i.longitude,i.latitude],1e3).easing(Pe.Cubic.Out).onUpdate(l=>{if(this.geometry){let p={position:[l[0],l[1]]};p.parent=o,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(a(this,bn)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()});u(this,"onPositionUpdate",e=>{var i,o,n,s,c;if(this.state!=="disabled"){try{jP.parse(e)}catch(l){a(this,Xr).call(this,"error"),O.error("BlueDot: Browser sent invalid position",l instanceof B.ZodError?l.message:String(l)),this.publish("error");return}I(this,xi,{latitude:(i=e.coords)==null?void 0:i.latitude,longitude:(o=e.coords)==null?void 0:o.longitude,accuracy:(n=e.coords)==null?void 0:n.accuracy,heading:(s=e.coords)==null?void 0:s.heading,floor:a(this,Hc).call(this,(c=e.coords)==null?void 0:c.floorLevel)}),a(this,Xc).call(this,a(this,xi))}});u(this,"onPositionError",e=>{var i;switch(a(this,Xr).call(this,"error"),e.code){case e.PERMISSION_DENIED:O.error("Geolocation permission denied by the user.",e),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case e.POSITION_UNAVAILABLE:O.error("Geolocation position unavailable.",e);break;case e.TIMEOUT:O.error("Geolocation request timed out.",e);break;default:O.error("An unknown geolocation error occurred.",e);break}this.publish("error",e)});b(this,nh,()=>{var i;let e=Math.round(this.core.camera.zoomLevel*1e5);if(e!==a(this,Vc)){I(this,Vc,e);let o=(i=this.core.getMetresPerPixel())!=null?i:1;I(this,Mt,Math.max(a(this,Le).radius/(.35/o),1))}});b(this,Xr,e=>{let i=VP[this.state].actions[e];if(i){switch(a(this,Le).debug&&O.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(e)),i){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==i&&(this.publish("state-change",{state:i,action:e}),this.state=i)}else O.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(e))});b(this,Pi,void 0);b(this,ah,()=>{if(a(this,Pi)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(o=>o.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(o=>o.floorId===this.geoJSONApi.currentFloor.id);I(this,Pi,(0,E7.default)(i.map(o=>({x:o.longitude,y:o.latitude})),1e-5).map(o=>[o.x,o.y]))}return a(this,Pi)});b(this,xn,()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),a(this,Wr)&&(this.off("position-update",a(this,Wr)),I(this,Wr,void 0)),this.following=!1,I(this,Pi,void 0),this.core.off("user-interaction-start",a(this,xn)),this.geoJSONApi.currentMap.off("navigation-active-path-change",a(this,Wc)),this.publish("follow-change",{following:!1})});b(this,Wc,()=>{I(this,Pi,void 0)});b(this,Wr,void 0);u(this,"follow",(e,i)=>{var n,s,c,l;if(e===!1){a(this,xn).call(this);return}e!=="position-only"&&(i==null?void 0:i.bearing)!=null&&O.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(e,"'. To control the bearing manually, use mode 'position-only'."));let o={zoomLevel:(n=i==null?void 0:i.zoomLevel)!=null?n:21,bearing:e==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(s=i==null?void 0:i.pitch)!=null?s:45,duration:(c=i==null?void 0:i.duration)!=null?c:1e3,easing:(l=i==null?void 0:i.easing)!=null?l:"ease-in-out"};this.following?a(this,Wr)&&this.off("position-update",a(this,Wr)):(this.following=!0,this.core.on("user-interaction-start",a(this,xn)),this.geoJSONApi.currentMap.on("navigation-active-path-change",a(this,Wc))),I(this,Wr,p=>{let{coordinate:h,heading:m,floor:y}=p;if(o.center=[h.longitude,h.latitude],y!=null&&y.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(y.id),I(this,Pi,void 0)),e==="position-and-heading")o.bearing=m!=null?m:void 0;else if(e==="position-and-path-direction"){let g=a(this,ah).call(this);if(g!=null){let S=S7(g,[h.longitude,h.latitude]);if(S!=null){let M=g[S.segmentIndex],v=g[S.segmentIndex+1];o.bearing=tg(M,v)}}}this.core.camera.animateTo(o)}),this.on("position-update",a(this,Wr)),this.publish("follow-change",{following:!0,mode:e})})}get heading(){var e;return(e=a(this,kt))==null?void 0:e.heading}get accuracy(){var e;return(e=a(this,kt))==null?void 0:e.accuracy}get coordinate(){var e,i;if(a(this,kt)!=null)return(a(this,Mi)==null||((e=this.floor)==null?void 0:e.id)!==a(this,Mi).floorId||a(this,kt).latitude!==a(this,Mi).latitude||a(this,kt).longitude!==a(this,Mi).longitude)&&I(this,Mi,new Q(a(this,kt).latitude,a(this,kt).longitude,(i=this.floor)==null?void 0:i.id)),a(this,Mi)}get floor(){var e;return(e=a(this,kt))==null?void 0:e.floor}enable(e){I(this,Le,(0,w7.default)({},e,a(this,Le))),a(this,Xr).call(this,"enable"),this.watchDevicePosition(a(this,Le).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),a(this,Ii)&&(clearTimeout(a(this,Ii)),I(this,Ii,void 0)),this.following&&a(this,xn).call(this),this.watchDevicePosition(!1),I(this,kt,void 0),I(this,_t,void 0),a(this,Xr).call(this,"disable")}watchDevicePosition(e){if(a(this,vn)&&(navigator.geolocation.clearWatch(a(this,vn)),I(this,vn,null)),a(this,xi)&&I(this,xi,void 0),e){if(this.state==="disabled"){O.warn("BlueDot must be enabled before watching browser position.");return}I(this,vn,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(e){var o,n;e==null?I(this,_t,void 0):"coords"in e?I(this,_t,Object.assign({},a(this,_t),{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy,heading:e.coords.heading,floor:a(this,Hc).call(this,e.coords.floorLevel)})):(I(this,_t,Object.assign({},a(this,_t),e)),"floorOrFloorId"in e&&(a(this,_t).floor=typeof e.floorOrFloorId=="string"&&e.floorOrFloorId!=="device"?a(this,jc).call(this,e.floorOrFloorId):e.floorOrFloorId)),(((o=a(this,_t))==null?void 0:o.latitude)!=null&&((n=a(this,_t))==null?void 0:n.longitude)!=null||a(this,xi)!=null)&&a(this,Xc).call(this,a(this,xi))}};vn=new WeakMap,xi=new WeakMap,_t=new WeakMap,kt=new WeakMap,Ii=new WeakMap,bn=new WeakMap,Cn=new WeakMap,Sn=new WeakMap,Le=new WeakMap,Mt=new WeakMap,Vc=new WeakMap,Mi=new WeakMap,jc=new WeakMap,Hc=new WeakMap,Uc=new WeakMap,Xc=new WeakMap,nh=new WeakMap,Xr=new WeakMap,Pi=new WeakMap,ah=new WeakMap,xn=new WeakMap,Wc=new WeakMap,Wr=new WeakMap;var VP={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},jP=B.object({coords:B.object({latitude:B.number(),longitude:B.number(),accuracy:B.number(),altitude:B.number().optional().nullable(),altitudeAccuracy:B.number().optional().nullable(),heading:B.number().optional().nullable(),speed:B.number().optional().nullable(),floorLevel:B.number().optional().nullable()}),timestamp:B.number()}),HP=B.object({latitude:B.number(),longitude:B.number(),floor:B.custom().optional(),accuracy:B.number().optional(),heading:B.number().optional().nullable()});f();var Ti,Zc,Yc=class{constructor({currentMapGetter:t}){b(this,Ti,new Map);b(this,Zc,void 0);I(this,Zc,t)}get currentMap(){return a(this,Zc).call(this)}getById(t){return a(this,Ti).get(t)}add(t,e,i){let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let n=o.Shapes.add(t,e||{},{floorId:i==null?void 0:i.id}),s=new mo(n);return a(this,Ti).set(s.id,s),s}remove(t){var i;a(this,Ti).get(t.id)&&((i=this.currentMap)==null||i.Shapes.remove(t),a(this,Ti).delete(t.id.toString()))}removeAll(){let t=[];return a(this,Ti).forEach(e=>{this.remove(e),t.push(e.id),a(this,Ti).delete(e.id.toString())}),t}};Ti=new WeakMap,Zc=new WeakMap;f();var qc,zc=class{constructor({currentMapGetter:t}){b(this,qc,void 0);I(this,qc,t)}get currentMap(){return a(this,qc).call(this)}setFromStyleCollection(t){var e,i,o;for(let n in t)for(let s of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[n]==null||!s.layers.has(Se))continue;let c=s.layers.get(Se);if(c!=null&&c.layers.has(n)&&"color"in t[n]){let l=c.layers.get(n);(i=this.currentMap)==null||i.renderer.setState(l,{color:t[n].color})}if(c&&n===Ji&&!(wr in t)){let l=c.layers.get(wr);l&&"color"in t[n]&&((o=this.currentMap)==null||o.renderer.setState(l,{color:t[n].color}))}}}};qc=new WeakMap;f();var zy={opacity:1},Ke,$c,Jc,xo,wi,Qc,qy,sh,D7,Ya=class{constructor(t,e){b(this,Qc);b(this,sh);b(this,Ke,void 0);b(this,$c,[]);b(this,Jc,{opacity:"initial"});b(this,xo,{opacity:new Map});b(this,wi,new Set);I(this,Ke,t),I(this,$c,e||[]);let i=a(this,Ke).map;i&&i.on("idle",()=>{a(this,xo).opacity.size||j(this,Qc,qy).call(this,i)})}setStyle(t){var e,i;if(a(this,Ke).map){(e=a(this,Ke).map)==null||e.setStyle(t),a(this,wi).size&&(a(this,wi).clear(),this.hide()),j(this,sh,D7).call(this),j(this,Qc,qy).call(this,a(this,Ke).map),this.setOpacity(a(this,Jc).opacity),(i=a(this,Ke).map)==null||i.moveLayer(Ih);for(let[o,n,s]of a(this,$c)||[])a(this,Ke).hideOutdoorLayersIntersectingPolygons(o,n,s)}}get map(){return a(this,Ke).map}get enabled(){return!!a(this,Ke).map}get visible(){return a(this,wi).size===0}show(){let t=a(this,Ke).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(i=>{a(this,wi).has(i.id)&&t.setLayoutProperty(i.id,"visibility","visible")}),a(this,wi).clear())}hide(t=[]){let e=a(this,Ke).map;if(!e)return;let i=e.getStyle().layers;i&&i.forEach(o=>{let n=e.getLayoutProperty(o.id,"visibility");!t.includes(o.id)&&n!=="none"&&(e.setLayoutProperty(o.id,"visibility","none"),a(this,wi).add(o.id))})}setOpacity(t,e=[]){var n,s;let i=a(this,Ke).map;if(!i)return;let o=(s=(n=a(this,Ke).map)==null?void 0:n.getStyle())==null?void 0:s.layers;o&&i.once("idle",()=>{o.forEach(c=>{let l=i.getLayoutProperty(c.id,"visibility");if(!e.includes(c.id)&&l!=="none")try{let p=a(this,xo).opacity.get(c.id);p!==void 0&&(c.id==="background"||(c.type==="symbol"?(i.setPaintProperty(c.id,"icon-opacity",t==="initial"?p[0]:t),i.setPaintProperty(c.id,"text-opacity",t==="initial"?p[1]:t)):i.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?p[0]:t)),a(this,Jc).opacity=t)}catch(p){O.warn("Error setting opacity:",p)}})})}};Ke=new WeakMap,$c=new WeakMap,Jc=new WeakMap,xo=new WeakMap,wi=new WeakMap,Qc=new WeakSet,qy=function(t){let e=t.getStyle().layers;e&&e.forEach(i=>{var n,s,c;t.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?a(this,xo).opacity.set(i.id,[(n=t.getPaintProperty(i.id,"icon-opacity"))!=null?n:zy.opacity,(s=t.getPaintProperty(i.id,"text-opacity"))!=null?s:zy.opacity]):a(this,xo).opacity.set(i.id,[(c=t.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?c:zy.opacity,void 0])))})},sh=new WeakSet,D7=function(){Object.values(a(this,xo)).forEach(t=>t.clear())};f();var Ei,Di,Io,lh=class{constructor({currentMapGetter:t}){b(this,Ei,void 0);b(this,Di,new Map);b(this,Io,new Map);I(this,Ei,t)}labelAll(t={}){var o,n;let e=[],i=new Set;return(n=(o=a(this,Ei).call(this))==null?void 0:o.Text3D.labelAll(t))==null||n.forEach(({textInfo:s,target:c})=>{let l=s.id.toString(),p=a(this,Io).get(l);if(p){i.has(l)||e.push(p.text3DView),i.add(l);return}i.add(l);let h=new yo(l,c);a(this,Di).set(h.id,{targetId:c.id,text3d:l,text3DView:h}),a(this,Io).set(l,{text3DView:h}),e.push(h)}),e}label(t,e,i={}){var n;if(a(this,Ei).call(this))if(Fe.is(t)){let s=(n=a(this,Ei).call(this))==null?void 0:n.Text3D.label(t,e,i);if(!s)return;let c=s.textInfo.id.toString(),l=a(this,Io).get(c);if(l)return l.text3DView;let p=new yo(c,s.target);return a(this,Di).set(p.id,{targetId:s.target.id,text3d:c,text3DView:p}),a(this,Io).set(c,{text3DView:p}),p}else throw new Error("Non-space target is not supported")}remove(t){var o;let e=typeof t=="string"?t:t.id,i=a(this,Di).get(e);i&&((o=a(this,Ei).call(this))==null||o.Text3D.remove(i.text3d),a(this,Di).delete(e),a(this,Io).delete(i.text3d))}removeAll(){a(this,Di).forEach(t=>{var e;(e=a(this,Ei).call(this))==null||e.Text3D.remove(t.text3d)}),a(this,Di).clear()}};Ei=new WeakMap,Di=new WeakMap,Io=new WeakMap;var ch=.05,Kc=class{constructor(t,e){u(this,"core");u(this,"mapObjects",[]);u(this,"id");u(this,"mapDataExternal",{});u(this,"mapsByFloorId",{});u(this,"mapData");u(this,"currentMap");u(this,"hiddenOutdoorGeometries",[]);u(this,"lastFacadeIntersected");u(this,"mapView");u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"Outdoor");u(this,"BlueDot");u(this,"Shapes");u(this,"Style");u(this,"Images");u(this,"update",()=>{this.core.render()});this.core=t,this.mapView=e,this.Camera=new sc(this.core),this.id=this.core.addGroupContainer("root").id.toString();let i=new Lc("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i;let o=new ec(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",o)});let n=l=>p=>{var P,T,E,A;let h=[],m=[],y=[],g=[];p.labels.forEach(k=>{let N=this.Labels.getById(k.toString());N&&h.push(N.label)}),p.markers.forEach(k=>{let N=this.Markers.getById(k.toString())||this.Navigation.getMarkerById(k.toString());N&&m.push(N.marker)}),p.models.forEach(k=>{let N=this.Models.getById(k.toString());N&&y.push(N.model)}),p.paths.forEach(k=>{let N=this.Paths.getById(k.toString())||this.Navigation.getPathById(k.toString());N&&g.push(N.path)});let S=p.geometry[0],M;S&&(M=(P=this.getMapDataInternal())==null?void 0:P.getById("space",S)),M||(M=(T=this.getMapDataInternal())==null?void 0:T.getById("object",S));let v=p.containers.reduce((k,N)=>{var V;let F=(V=this.getMapDataInternal())==null?void 0:V.getById("floor",N);return F&&Vo.is(F)&&k.push(F),k},[]),C;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(k=>{this.core.setState(k.id,{hovered:!1})}),M&&Fe.is(M)&&(C=(E=this.getMapDataInternal())==null?void 0:E.facadesBySpaceId[S],C&&C.spaces.forEach(k=>{this.core.setState(k.id,{hovered:!0})})),this.lastFacadeIntersected=C;let w={coordinate:new Q(p.coordinate[1],p.coordinate[0],(A=v==null?void 0:v[0])==null?void 0:A.id),spaces:M&&Fe.is(M)?[M]:[],objects:M&&Qt.is(M)?[M]:[],markers:m,labels:h,models:y,paths:g,floors:v,facades:C?[C]:[]};"pointerEvent"in p&&(w.pointerEvent=p.pointerEvent),this.mapView.publish(l,w)};this.core.on("hover",n("hover")),this.core.on("click",n("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let s={currentMapGetter:()=>this.currentMap};this.Markers=new Ac(s),this.Models=new Bc(s),this.Labels=new cc(s),this.Text3D=new lh(s),this.Exporter=new lc(s),this.Paths=new Nc(s),this.Navigation=new rc(this.core,this,s.currentMapGetter),this.BlueDot=new Wa(this.core,this),this.BlueDot.on("position-update",l=>{this.mapView.publish("blue-dot-position-update",l)}),this.BlueDot.on("state-change",l=>{this.mapView.publish("blue-dot-state-change",l)}),this.BlueDot.on("error",l=>{this.mapView.publish("blue-dot-error",l)}),this.BlueDot.on("follow-change",l=>{this.mapView.publish("blue-dot-follow-change",l)}),this.Outdoor=new Ya(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new _c(s),this.Shapes=new Yc(s),this.Style=new zc(s);let c=new Kd(e,this.mapDataExternal);this.auto=c.auto}get DynamicFocus(){return this.currentMap.DynamicFocus}get StackedMaps(){return this.currentMap.StackedMaps}updateState(t,e){if(t==="interior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Se);if(n){let s=n.layers.get(Ji);s&&this.core.setState(s,iy(e,this.core.getState(s)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Se);if(n){let s=n.layers.get(wr);s&&this.core.setState(s,iy(e,this.core.getState(s)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Se);if(n){let s=n.layers.get(ta);s&&this.core.setState(s,Nu(e,this.core.getState(s)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(o=>{let n=o.layers.get(Se);if(n){let s=n.layers.get(ra);s&&this.core.setState(s,Nu(e,this.core.getState(s)))}});return}let i=typeof t=="string"?this.getMapDataObject(t):t;if(i){if(ho.is(i))return this.core.setState(i.id,s4({...e,type:"label"},this.core.getState(i.id)));if(mi.is(i))return this.core.setState(i.id,l4({...e,type:"marker"},this.core.getState(i.id)));if((Fe.is(i)||Qt.is(i))&&this.core.setState(i.id,oy({...e,type:"geometry"},this.core.getState(i.id))),Tr.is(i)&&this.core.setState(i.id,Nu({...e,type:"doors"},this.core.getState(i.id))),mo.is(i)&&this.core.setState(i.id,Mh(e,["altitude","color","opacity"])),Kt.is(i))for(let o of i.spaces)this.core.setState(o.id,oy({...e,type:"geometry"},this.core.getState(o.id)));yo.is(i)&&this.core.setState(i.id,Mh(e,Lh))}}getMapDataObject(t){var e;return(e=this.getMapDataInternal())==null?void 0:e.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return us(this.mapData)}getMapData(){return this.mapData}addMap(t,e){return new Promise(i=>{var m,y,g;let o;try{o=us(t)}catch(S){O.error("Error adding map",S),i(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:n}=o,s=n["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new Q(s[1],s[0])});let c=n["manifest.geojson"].features[0].properties.name,l=new Lc("mapObject-".concat(c),o,e,this),p=this.core.getBoundingArea(l.currentFloor.id);p==null&&O.error("Could not determine bounding box for map:",l.currentFloor.id);let h=(y=(m=e==null?void 0:e.outdoorView)==null?void 0:m.layersHiddenByGeometry)!=null?y:[];if(h.length>0){let S,M=[];for(let v of l.floorStacksById.values())if(v.defaultFloor.footprint&&v.defaultFloor.footprint.geometry!=null&&((g=v.defaultFloor.footprint.geometry)==null?void 0:g.coordinates.length)>0){let C=v.defaultFloor.footprint,w=h4(C);S==null?S=w:f4(S,w),M.push(C)}M.length>0&&S!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(S,M,h),this.hiddenOutdoorGeometries.push([S,M,h]))}this.mapObjects.push(l),o.getMVFFeatureByType("floor").forEach(S=>{this.mapsByFloorId[S.id]=l}),l.on("navigation-connection-click",S=>{this.mapView.publish("navigation-connection-click",S)}),l.on("navigation-active-path-change",S=>{this.mapView.publish("navigation-active-path-change",S)}),l.StackedMaps.on("stacked-maps-state-change",({state:S})=>{this.mapView.publish("stacked-maps-state-change",{state:S})}),l.on("floor-change-start",()=>{this.mapView.publish("floor-change-start",{floor:this.currentFloor})}),l.on("floor-change",S=>{this.mapView.publish("floor-change",{reason:S.reason,floor:this.currentFloor})}),this.currentMap=l,this.mapData=t,(e==null?void 0:e.zoomLevel)!=null?(this.core.camera.setZoomLevel(e.zoomLevel),i(t)):this.core.mode!=="outdoors-overlay"&&p?this.core.camera.focusOn(p,{duration:Z3,padding:{top:ch*this.core.canvasHeight,left:ch*this.core.canvasWidth,right:ch*this.core.canvasWidth,bottom:ch*this.core.canvasHeight}}).then(()=>{i(t)}):i(t)})}setFloor(t,e){return this.currentMap.setFloor(Gs(t),e)}setFloorStack(t){return this.currentMap.setFloorStack(Gs(t))}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var i;let t=this.currentMap.currentFloorStack.id;if(!t)throw O.throw("Missing currentFloorStack.");let e=(i=this.mapData)==null?void 0:i.getById("floor-stack",t);if(!e)throw O.throw("FloorStack was not found in map data.");return e}get currentFloor(){var i;let t=this.currentMap.currentFloor.id;if(!t)throw O.throw("Missing currentFloor object from GeoJsonApi");let e=(i=this.mapData)==null?void 0:i.getById("floor",t);if(!e)throw O.throw("Missing currentFloor");return e}getState(t){var o,n;if(typeof t=="object"&&Kt.is(t)){O.warn("Cannot get state of a Facade directly. Use getState() on individual spaces within Facade.spaces[] instead.");return}let e=d4(t,this),i=this.core.getState(e);if(i)if(["interior-walls","exterior-walls"].includes(t)){let{color:s,topColor:c,texture:l,topTexture:p,visible:h,height:m,opacity:y}=i;return{type:"walls",visible:h,color:s,topColor:c,texture:l?{url:l}:void 0,topTexture:p?{url:p}:void 0,height:m,opacity:y}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:s,topColor:c,texture:l,topTexture:p,visible:h,opacity:m}=i;return{type:"doors",visible:h,color:s,topColor:c,opacity:m,texture:l?{url:l}:void 0,topTexture:p?{url:p}:void 0}}else{if(i.type==="geometry")return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0};if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((o=i.options)==null?void 0:o.rank)!==void 0&&i.options.interactive!==void 0){let s=typeof i.parent=="object"?i.parent.id:i.parent,c=this.Markers.getById(i.id.toString()),l=c!=null&&c.marker.target?c==null?void 0:c.marker.target.anchorTarget:void 0;return l==null&&(l=new Q(i.position[1],i.position[0],s.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,anchor:i.anchor,zIndex:i.options.zIndex,dynamicResize:i.dynamicResize}}else{if(i.type==="model")return{type:"model"};if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&t&&typeof t!="string"&&mo.is(t)){let[s]=i.children;if(s.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(n=i.altitude)!=null?n:0,visible:i.visible,color:i.color,height:s.height,opacity:s.opacity}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinate(t,e,i){return new Q(t,e,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(t,e,i){let o=this.core.projectScreenXYToCoordinate(t,e);return o?new Q(o[1],o[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){this.Labels.all()}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};f();f();var ph=class{constructor(t){u(this,"state");u(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};f();var O7=B.object({text3d:B.object({hoverColor:B.string().optional()}).optional(),geometry:B.object({hoverColor:B.string().optional()}).optional()}).strict();var ep,X,In,Za=class extends Z{constructor(e){super();b(this,ep,{});b(this,X,void 0);b(this,In,void 0);u(this,"Camera");u(this,"Labels");u(this,"Text3D");u(this,"Markers");u(this,"Images");u(this,"Models");u(this,"Paths");u(this,"Exporter");u(this,"Navigation");u(this,"BlueDot");u(this,"Style");u(this,"Shapes");u(this,"Outdoor");u(this,"update",()=>{a(this,X).core.render()});u(this,"getDirections",(e,i,o)=>{var n;return(n=a(this,X).getMapData())==null?void 0:n.getDirections(e,i,o)});u(this,"getDirectionsMultiDestination",(e,i,o)=>{var n;return(n=a(this,X).getMapData())==null?void 0:n.getDirectionsMultiDestination(e,i,o)});u(this,"on",(e,i)=>{super.on(e,i)});u(this,"off",(e,i)=>{super.off(e,i)});u(this,"Debug");I(this,In,e);let i=new Kc(e,this);I(this,X,i),this.Camera=a(this,X).Camera,I(this,ep,a(this,X).mapDataExternal),this.Markers=a(this,X).Markers,this.Models=a(this,X).Models,this.Labels=a(this,X).Labels,this.Text3D=a(this,X).Text3D,this.Exporter=a(this,X).Exporter,this.Paths=a(this,X).Paths,this.Navigation=a(this,X).Navigation,this.BlueDot=a(this,X).BlueDot,this.Shapes=a(this,X).Shapes,this.Style=a(this,X).Style,this.auto=a(this,X).auto,this.Outdoor=a(this,X).Outdoor,this.Images=a(this,X).Images,a(this,In).container.dataset.version=x.env.npm_package_version,this.Debug=new ph(a(this,X).core)}get StackedMaps(){return a(this,X).currentMap.StackedMaps}get DynamicFocus(){return a(this,X).currentMap.DynamicFocus}updateState(e,i){return a(this,X).updateState(e,i)}updateGlobalState(e){var i,o;try{O7.parse(e)}catch(n){O.error("updateGlobalState",n);return}if(typeof e=="object"&&!("id"in e)){let n={};(i=e.text3d)!=null&&i.hoverColor&&(n.text3dHoverColor=e.text3d.hoverColor),(o=e.geometry)!=null&&o.hoverColor&&(n.hoverColor=e.geometry.hoverColor),a(this,X).core.setState(n)}}getGlobalState(){let e=a(this,X).core.getState();return{geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor}}}getMapData(){return a(this,ep)}getDimensions(){return{width:a(this,In).canvasWidth,height:a(this,In).canvasHeight}}expand(e){var i;return(i=a(this,X).currentMap)==null?void 0:i.StackedMaps.expand(e)}collapse(e){var i;return(i=a(this,X).currentMap)==null?void 0:i.StackedMaps.collapse(e)}addMap(e,i){return a(this,X).addMap(e,i)}setFloor(e){return a(this,X).setFloor(e)}setFloorStack(e){return a(this,X).setFloorStack(e)}get currentFloorStack(){return a(this,X).currentFloorStack}get currentFloor(){return a(this,X).currentFloor}updateWatermark(e){a(this,X).updateWatermark(e)}getState(e){return a(this,X).getState(e)}setHoverColor(e){a(this,X).setHoverColor(e)}getHoverColor(){return a(this,X).getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return a(this,X).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return a(this,X).core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return a(this,X).isInView(e)}getDistance(e,i){var o;return(o=a(this,X).getMapData())==null?void 0:o.getDistance(e,i)}createCoordinate(e,i,o){return a(this,X).createCoordinate(e,i,o)}createCoordinateFromScreenCoordinate(e,i,o){return a(this,X).createCoordinateFromScreenCoordinate(e,i,o)}auto(){this.Labels.all()}get __core(){if(x.env.INTERNAL==="true")return a(this,X).core;throw new Error("__core is not available.")}clear(){a(this,X).clear()}destroy(){a(this,X).destroy()}async enableDebug(e={}){let{Inspector:i}=await import("./inspector-JWG7GWP6.js");await new i(this,a(this,X)).enable(e)}};ep=new WeakMap,X=new WeakMap,In=new WeakMap;f();f();var uh=class extends Z{constructor(e){super();u(this,"gl");u(this,"el",document.createElement("div"));u(this,"core");u(this,"origin");u(this,"map");u(this,"layer");u(this,"handleStyleChange",()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))});u(this,"handleMove",()=>{if(!this.map)return;let[e,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(e,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(ae.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ae.degToRad(this.map.getPitch()))});u(this,"handleError",e=>{O.warn(e)});this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new Wl(e._container,{center:this.origin,zoomLevel:e.getZoom(),pitch:e.getPitch(),bearing:e.getBearing(),gl:this.gl,map:e,mode:"outdoors-overlay"}),this.map=e,this.core.camera.setMinZoomLevel(e.getMinZoom()),this.core.camera.setMaxZoomLevel(e.getMaxZoom()),this.core.camera.setMinPitch(e.getMinPitch()),this.core.camera.setMaxPitch(e.getMaxPitch()),this.map.on("error",this.handleError);let i=Eg.fromLngLat(this.origin,0);return this.layer=yp(i,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};var Mn,za,Mo,Pn,dh=class dh extends Z{constructor(e,i,o){super();b(this,Mn,void 0);b(this,za,void 0);b(this,Mo,void 0);b(this,Pn,void 0);u(this,"on",(e,i)=>{super.on(e,i)});u(this,"off",(e,i)=>{super.off(e,i)});I(this,Pn,new uh(e)),I(this,Mn,i),I(this,za,o)}onAdd(e){var n,s;let i=a(this,Pn).onAdd(e),o={...Vs,...(n=a(this,za))!=null?n:{},outdoorView:{token:a(this,Mn).outdoorViewToken,...(s=a(this,za))==null?void 0:s.outdoorView}};return I(this,Mo,new Za(a(this,Pn).core)),a(this,Mo).addMap(a(this,Mn),o).then(()=>{this.publish("loaded",{mapView:a(this,Mo),mapData:a(this,Mn)})}),i}onRemove(){a(this,Mo)&&a(this,Mo).clear(),dh.instance=null,a(this,Pn).onRemove()}};Mn=new WeakMap,za=new WeakMap,Mo=new WeakMap,Pn=new WeakMap,u(dh,"instance");var qa=dh;var $q=async(r,t)=>{let e,i=Do();t&&i.updateByUserOption(t);try{t&&(e=(await ds({...t,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(s){O.warn("Getting access token failed. Outdoor map disabled.",s)}let o=new pa(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:i});return new Cp(o)},L7=!1;function Jq(r){L7=r}var Qq=async(r,t)=>{var p,h,m,y;let e={...t||{}},i,o=Do();o.updateByUserOption(e);let n={};if("type"in r&&typeof r.type=="string"){if(n.enterprise=(p=r.options)==null?void 0:p.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let g=await xp(r.main);i=Sp(g),n.languagePacks=[];for(let S of(h=r.languagePacks)!=null?h:[])S.localePack instanceof Uint8Array&&n.languagePacks.push({language:S.language,localePack:await Nn(S.localePack)})}else if(r.type==="json")i=r.main,n.languagePacks=(m=r.languagePacks)!=null?m:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(n.binaryBundle=r.main)}else i=r,n.enterprise=i.enterprise!=null;let s;if("accessToken"in e)s=e.accessToken;else if("key"in e&&"secret"in e){e.baseAuthUri=o.getBaseAuthUri(n.enterprise);let g=await ds(e,n.enterprise);s=(g==null?void 0:g.accessToken)||""}if(n.outdoorViewToken=s,n.env=o,s&&!n.enterprise)try{n.sasToken=(await Ip(e,s)).token}catch(g){O.error("Failed to fetch SAS token.",g)}let c=new pa(i,n);s&&c.Analytics.init({accessToken:s,mapId:e.mapId,key:"key"in e?e.key:void 0,secret:"secret"in e?e.secret:void 0,...e.analytics,baseUri:o.getAnalyticsBaseUri(),context:(y=e.analytics)==null?void 0:y.context});let l=new Cp(c);if("language"in e)try{await l.changeLanguage(e.language)}catch{}return l},UP=async r=>{var M;let t=L7,e,i=Do();i.updateByUserOption(r);let o={...r};if("accessToken"in o){e=o.accessToken;let{aud:v,sub:C}=ip(e);(q3.some(w=>v.includes(w))||C&&C.startsWith("client"))&&(t=!0)}else if("key"in o&&"secret"in o)o.key.startsWith("mik_")||(t=!0),o.baseAuthUri=i.getBaseAuthUri(t),e=(await ds(o,t)).accessToken;else throw new Error("Missing key or secret.");o.baseUri=i.getBaseUri(t);let n=performance.now(),s,c;if(t){let v={...o,venue:o.mapId,clientId:o.key,clientSecret:o.secret,version:"1.0.0"},C=await Rh(v);s=C.compressed,c=C.localePacks}else s=await Nh(o,e);let l=performance.now(),p=await xp(s),h=Sp(p),m=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(h);let y;if(!t)try{y=(await Ip(o,e)).token}catch(v){O.error("Failed to fetch SAS token.",v)}let g=new pa(h,{env:i,outdoorViewToken:e,sasToken:y,enterprise:t,localePacksUrls:c,binaryBundle:s}),S=new Cp(g,{search:r.search});if(g.Analytics.init({accessToken:e,mapId:o.mapId,key:"key"in o?o.key:void 0,secret:"secret"in o?o.secret:void 0,...o.analytics,baseUri:i.getAnalyticsBaseUri(),context:(M=o.analytics)==null?void 0:M.context}),g.Analytics.sendGetMapDataEvent({parseDuration:m-l,downloadDuration:l-n,viewId:o.viewId}),"language"in o)try{await S.changeLanguage(o.language)}catch{}return S},Kq=UP,e$=(r,t)=>{qa.instance!=null&&O.warn("Only a single map venue is supported at this time.");let e=new qa([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return qa.instance=e,e},XP=async(r,t,e)=>{var p,h,m,y,g,S,M,v,C;let i=performance.now(),o=Vm(e,t);try{e&&Gm(e)}catch(w){if(w instanceof Error&&w.name==="MissingOutdoorViewToken")O.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw w}let n=$3((p=t.outdoorViewToken)!=null?p:""),s=us(t);(h=o.outdoorView)!=null&&h.style&&s.envControl.updateTileServerBaseUrl((m=o.outdoorView)==null?void 0:m.style);let c=await z5(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:o.bearing,pitch:o.pitch,zoomLevel:o.zoomLevel,backgroundAlpha:(y=o.style)==null?void 0:y.backgroundAlpha,backgroundColor:(g=o.style)==null?void 0:g.backgroundColor,outdoorView:(S=o.outdoorView)!=null&&S.token?{headers:{"x-mappedin-tiles-key":(M=o.outdoorView)==null?void 0:M.token},style:t.getEnv().tileServerUri,enabled:!!((v=o.outdoorView)!=null&&v.enabled)}:void 0,watermark:{...o.watermark,visible:!s.enterpriseMode&&!n.remove_watermark},attribution:o.attribution,antialias:typeof o.antialiasing=="boolean"?o.antialiasing:!!((C=o.antialiasing)!=null&&C.enabled),accessToken:t.outdoorViewToken}),l=new Za(c);return await l.addMap(t,o),s.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:l.getDimensions()}),l},t$=XP;export{Q as a,Zi as b,Mu as c,Tu as d,zi as e,Tr as f,Fe as g,Vo as h,jo as i,Qt as j,$i as k,ea as l,wu as m,Kt as n,ai as o,Eu as p,Jm as q,Sp as r,xp as s,N4 as t,vP as u,Gu as v,Vu as w,$q as x,Jq as y,Qq as z,UP as A,Kq as B,e$ as C,XP as D,t$ as E};