@mappedin/mappedin-js 6.0.1-beta.23 → 6.0.1-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-NAC5AOBR.js → GLTFExporter-V3JBMXKP.js} +1 -1
- package/lib/esm/{GLTFLoader-DS2TN3AV.js → GLTFLoader-JYDXWLFZ.js} +1 -1
- package/lib/esm/{browser-7PYC6B4T.js → browser-Q2RAR7TI.js} +1 -1
- package/lib/esm/chunk-5YXLRKWZ.js +1 -0
- package/lib/esm/{chunk-2ZAO5EG6.js → chunk-CJQTJCFY.js} +1 -1
- package/lib/esm/{chunk-FFK6S6NZ.js → chunk-CP4QYC2D.js} +1 -1
- package/lib/esm/{chunk-6JX55RII.js → chunk-MYZZLUDX.js} +1 -1
- package/lib/esm/{chunk-OCVOMAWQ.js → chunk-RANFBRDO.js} +1 -1
- package/lib/esm/index.d.ts +315 -226
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-655W6NEX.js → inspector-XDGCRPFV.js} +1 -1
- package/lib/esm/internal-ATY6WXPD.js +1 -0
- package/lib/esm/{outdoor-context-v4-5ZQPPV2K.js → outdoor-context-v4-B4BXJOPD.js} +1 -1
- package/package.json +3 -3
- package/lib/esm/chunk-3AOFVHL4.js +0 -1
- package/lib/esm/internal-GGT2QNUQ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as Bm,i as H2,j as od}from"./chunk-CJQTJCFY.js";import{a as ti}from"./chunk-MYZZLUDX.js";import{Aa as Qr,B as P2,C as I2,D as w2,E as q,F as Vi,G as E2,H as ji,I as Ya,Ia as qa,J as mt,K as Ee,La as id,M as Zt,Ma as G2,N as Wl,P as Te,Pa as V2,Q as Qp,R as Xl,S as _2,Sa as ei,T as Fm,Ta as j2,U as D2,Ua as nd,V as Mr,Y as O2,Z as L2,_ as Za,a as Kp,b as x2,c as S2,d as Ni,da as A2,e as $r,f as km,ga as ed,ha as za,ia as td,ka as Mo,n as M2,o as T2,qa as k2,ra as Dn,sa as rd,ta as F2,ua as Jr,v as Gi,va as Kr,wa as B2,x as ye,xa as R2,y as te,ya as N2}from"./chunk-RANFBRDO.js";import{a as c,b as N,c as R8,d as Ul,e as d,f as s,g as M,h as P,i as V,j as m,k as C}from"./chunk-CP4QYC2D.js";var T3=N((ry,iy)=>{m();(function(r,e){typeof ry=="object"&&typeof iy<"u"?iy.exports=e():typeof define=="function"&&define.amd?define(e):(r=r||self).RBush=e()})(ry,function(){"use strict";function r(b,x,I,E,w){c(function _(D,B,U,G,j){for(;G>U;){if(G-U>600){var Y=G-U+1,ce=B-U+1,ge=Math.log(Y),we=.5*Math.exp(2*ge/3),Le=.5*Math.sqrt(ge*we*(Y-we)/Y)*(ce-Y/2<0?-1:1),qe=Math.max(U,Math.floor(B-ce*we/Y+Le)),Wt=Math.min(G,Math.floor(B+(Y-ce)*we/Y+Le));_(D,B,qe,Wt,j)}var Ae=D[B],$e=U,je=G;for(e(D,U,B),j(D[G],Ae)>0&&e(D,U,G);$e<je;){for(e(D,$e,je),$e++,je--;j(D[$e],Ae)<0;)$e++;for(;j(D[je],Ae)>0;)je--}j(D[U],Ae)===0?e(D,U,je):e(D,++je,G),je<=B&&(U=je+1),B<=je&&(G=je-1)}},"t")(b,x,I||0,E||b.length-1,w||t)}c(r,"t");function e(b,x,I){var E=b[x];b[x]=b[I],b[I]=E}c(e,"i");function t(b,x){return b<x?-1:b>x?1:0}c(t,"n");var i=c(function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function n(b,x,I){if(!I)return x.indexOf(b);for(var E=0;E<x.length;E++)if(I(b,x[E]))return E;return-1}c(n,"e");function o(b,x){a(b,0,b.children.length,x,b)}c(o,"a");function a(b,x,I,E,w){w||(w=S(null)),w.minX=1/0,w.minY=1/0,w.maxX=-1/0,w.maxY=-1/0;for(var _=x;_<I;_++){var D=b.children[_];u(w,b.leaf?E(D):D)}return w}c(a,"h");function u(b,x){return b.minX=Math.min(b.minX,x.minX),b.minY=Math.min(b.minY,x.minY),b.maxX=Math.max(b.maxX,x.maxX),b.maxY=Math.max(b.maxY,x.maxY),b}c(u,"o");function l(b,x){return b.minX-x.minX}c(l,"s");function p(b,x){return b.minY-x.minY}c(p,"l");function h(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}c(h,"f");function y(b){return b.maxX-b.minX+(b.maxY-b.minY)}c(y,"u");function g(b,x){return b.minX<=x.minX&&b.minY<=x.minY&&x.maxX<=b.maxX&&x.maxY<=b.maxY}c(g,"m");function v(b,x){return x.minX<=b.maxX&&x.minY<=b.maxY&&x.maxX>=b.minX&&x.maxY>=b.minY}c(v,"c");function S(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}c(S,"p");function T(b,x,I,E,w){for(var _=[x,I];_.length;)if(!((I=_.pop())-(x=_.pop())<=E)){var D=x+Math.ceil((I-x)/E/2)*E;r(b,D,x,I,w),_.push(x,D,D,I)}}return c(T,"d"),i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var x=this.data,I=[];if(!v(b,x))return I;for(var E=this.toBBox,w=[];x;){for(var _=0;_<x.children.length;_++){var D=x.children[_],B=x.leaf?E(D):D;v(b,B)&&(x.leaf?I.push(D):g(b,B)?this._all(D,I):w.push(D))}x=w.pop()}return I},i.prototype.collides=function(b){var x=this.data;if(!v(b,x))return!1;for(var I=[];x;){for(var E=0;E<x.children.length;E++){var w=x.children[E],_=x.leaf?this.toBBox(w):w;if(v(b,_)){if(x.leaf||g(b,_))return!0;I.push(w)}}x=I.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var x=0;x<b.length;x++)this.insert(b[x]);return this}var I=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===I.height)this._splitRoot(this.data,I);else{if(this.data.height<I.height){var E=this.data;this.data=I,I=E}this._insert(I,this.data.height-I.height-1,!0)}else this.data=I;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=S([]),this},i.prototype.remove=function(b,x){if(!b)return this;for(var I,E,w,_=this.data,D=this.toBBox(b),B=[],U=[];_||B.length;){if(_||(_=B.pop(),E=B[B.length-1],I=U.pop(),w=!0),_.leaf){var G=n(b,_.children,x);if(G!==-1)return _.children.splice(G,1),B.push(_),this._condense(B),this}w||_.leaf||!g(_,D)?E?(I++,_=E.children[I],w=!1):_=null:(B.push(_),U.push(I),I=0,E=_,_=_.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,x){return b.minX-x.minX},i.prototype.compareMinY=function(b,x){return b.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,x){for(var I=[];b;)b.leaf?x.push.apply(x,b.children):I.push.apply(I,b.children),b=I.pop();return x},i.prototype._build=function(b,x,I,E){var w,_=I-x+1,D=this._maxEntries;if(_<=D)return o(w=S(b.slice(x,I+1)),this.toBBox),w;E||(E=Math.ceil(Math.log(_)/Math.log(D)),D=Math.ceil(_/Math.pow(D,E-1))),(w=S([])).leaf=!1,w.height=E;var B=Math.ceil(_/D),U=B*Math.ceil(Math.sqrt(D));T(b,x,I,U,this.compareMinX);for(var G=x;G<=I;G+=U){var j=Math.min(G+U-1,I);T(b,G,j,B,this.compareMinY);for(var Y=G;Y<=j;Y+=B){var ce=Math.min(Y+B-1,j);w.children.push(this._build(b,Y,ce,E-1))}}return o(w,this.toBBox),w},i.prototype._chooseSubtree=function(b,x,I,E){for(;E.push(x),!x.leaf&&E.length-1!==I;){for(var w=1/0,_=1/0,D=void 0,B=0;B<x.children.length;B++){var U=x.children[B],G=h(U),j=(Y=b,ce=U,(Math.max(ce.maxX,Y.maxX)-Math.min(ce.minX,Y.minX))*(Math.max(ce.maxY,Y.maxY)-Math.min(ce.minY,Y.minY))-G);j<_?(_=j,w=G<w?G:w,D=U):j===_&&G<w&&(w=G,D=U)}x=D||x.children[0]}var Y,ce;return x},i.prototype._insert=function(b,x,I){var E=I?b:this.toBBox(b),w=[],_=this._chooseSubtree(E,this.data,x,w);for(_.children.push(b),u(_,E);x>=0&&w[x].children.length>this._maxEntries;)this._split(w,x),x--;this._adjustParentBBoxes(E,w,x)},i.prototype._split=function(b,x){var I=b[x],E=I.children.length,w=this._minEntries;this._chooseSplitAxis(I,w,E);var _=this._chooseSplitIndex(I,w,E),D=S(I.children.splice(_,I.children.length-_));D.height=I.height,D.leaf=I.leaf,o(I,this.toBBox),o(D,this.toBBox),x?b[x-1].children.push(D):this._splitRoot(I,D)},i.prototype._splitRoot=function(b,x){this.data=S([b,x]),this.data.height=b.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,x,I){for(var E,w,_,D,B,U,G,j=1/0,Y=1/0,ce=x;ce<=I-x;ce++){var ge=a(b,0,ce,this.toBBox),we=a(b,ce,I,this.toBBox),Le=(w=ge,_=we,D=void 0,B=void 0,U=void 0,G=void 0,D=Math.max(w.minX,_.minX),B=Math.max(w.minY,_.minY),U=Math.min(w.maxX,_.maxX),G=Math.min(w.maxY,_.maxY),Math.max(0,U-D)*Math.max(0,G-B)),qe=h(ge)+h(we);Le<j?(j=Le,E=ce,Y=qe<Y?qe:Y):Le===j&&qe<Y&&(Y=qe,E=ce)}return E||I-x},i.prototype._chooseSplitAxis=function(b,x,I){var E=b.leaf?this.compareMinX:l,w=b.leaf?this.compareMinY:p;this._allDistMargin(b,x,I,E)<this._allDistMargin(b,x,I,w)&&b.children.sort(E)},i.prototype._allDistMargin=function(b,x,I,E){b.children.sort(E);for(var w=this.toBBox,_=a(b,0,x,w),D=a(b,I-x,I,w),B=y(_)+y(D),U=x;U<I-x;U++){var G=b.children[U];u(_,b.leaf?w(G):G),B+=y(_)}for(var j=I-x-1;j>=x;j--){var Y=b.children[j];u(D,b.leaf?w(Y):Y),B+=y(D)}return B},i.prototype._adjustParentBBoxes=function(b,x,I){for(var E=I;E>=0;E--)u(x[E],b)},i.prototype._condense=function(b){for(var x=b.length-1,I=void 0;x>=0;x--)b[x].children.length===0?x>0?(I=b[x-1].children).splice(I.indexOf(b[x]),1):this.clear():o(b[x],this.toBBox)},i})});var ly=N(J=>{"use strict";m();Object.defineProperty(J,"__esModule",{value:!0});J.earthRadius=63710088e-1;J.factors={centimeters:J.earthRadius*100,centimetres:J.earthRadius*100,degrees:J.earthRadius/111325,feet:J.earthRadius*3.28084,inches:J.earthRadius*39.37,kilometers:J.earthRadius/1e3,kilometres:J.earthRadius/1e3,meters:J.earthRadius,metres:J.earthRadius,miles:J.earthRadius/1609.344,millimeters:J.earthRadius*1e3,millimetres:J.earthRadius*1e3,nauticalmiles:J.earthRadius/1852,radians:1,yards:J.earthRadius*1.0936};J.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/J.earthRadius,yards:1.0936133};J.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 kn(r,e,t){t===void 0&&(t={});var i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}c(kn,"feature");J.feature=kn;function b9(r,e,t){switch(t===void 0&&(t={}),r){case"Point":return ny(e).geometry;case"LineString":return ay(e).geometry;case"Polygon":return oy(e).geometry;case"MultiPoint":return I3(e).geometry;case"MultiLineString":return P3(e).geometry;case"MultiPolygon":return w3(e).geometry;default:throw new Error(r+" is invalid")}}c(b9,"geometry");J.geometry=b9;function ny(r,e,t){if(t===void 0&&(t={}),!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(!bd(r[0])||!bd(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return kn(i,e,t)}c(ny,"point");J.point=ny;function C9(r,e,t){return t===void 0&&(t={}),Cd(r.map(function(i){return ny(i,e)}),t)}c(C9,"points");J.points=C9;function oy(r,e,t){t===void 0&&(t={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var u={type:"Polygon",coordinates:r};return kn(u,e,t)}c(oy,"polygon");J.polygon=oy;function x9(r,e,t){return t===void 0&&(t={}),Cd(r.map(function(i){return oy(i,e)}),t)}c(x9,"polygons");J.polygons=x9;function ay(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return kn(i,e,t)}c(ay,"lineString");J.lineString=ay;function S9(r,e,t){return t===void 0&&(t={}),Cd(r.map(function(i){return ay(i,e)}),t)}c(S9,"lineStrings");J.lineStrings=S9;function Cd(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}c(Cd,"featureCollection");J.featureCollection=Cd;function P3(r,e,t){t===void 0&&(t={});var i={type:"MultiLineString",coordinates:r};return kn(i,e,t)}c(P3,"multiLineString");J.multiLineString=P3;function I3(r,e,t){t===void 0&&(t={});var i={type:"MultiPoint",coordinates:r};return kn(i,e,t)}c(I3,"multiPoint");J.multiPoint=I3;function w3(r,e,t){t===void 0&&(t={});var i={type:"MultiPolygon",coordinates:r};return kn(i,e,t)}c(w3,"multiPolygon");J.multiPolygon=w3;function M9(r,e,t){t===void 0&&(t={});var i={type:"GeometryCollection",geometries:r};return kn(i,e,t)}c(M9,"geometryCollection");J.geometryCollection=M9;function T9(r,e){if(e===void 0&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(r*t)/t}c(T9,"round");J.round=T9;function E3(r,e){e===void 0&&(e="kilometers");var t=J.factors[e];if(!t)throw new Error(e+" units is invalid");return r*t}c(E3,"radiansToLength");J.radiansToLength=E3;function sy(r,e){e===void 0&&(e="kilometers");var t=J.factors[e];if(!t)throw new Error(e+" units is invalid");return r/t}c(sy,"lengthToRadians");J.lengthToRadians=sy;function P9(r,e){return _3(sy(r,e))}c(P9,"lengthToDegrees");J.lengthToDegrees=P9;function I9(r){var e=r%360;return e<0&&(e+=360),e}c(I9,"bearingToAzimuth");J.bearingToAzimuth=I9;function _3(r){var e=r%(2*Math.PI);return e*180/Math.PI}c(_3,"radiansToDegrees");J.radiansToDegrees=_3;function w9(r){var e=r%360;return e*Math.PI/180}c(w9,"degreesToRadians");J.degreesToRadians=w9;function E9(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return E3(sy(r,e),t)}c(E9,"convertLength");J.convertLength=E9;function _9(r,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("area must be a positive number");var i=J.areaFactors[e];if(!i)throw new Error("invalid original units");var n=J.areaFactors[t];if(!n)throw new Error("invalid final units");return r/i*n}c(_9,"convertArea");J.convertArea=_9;function bd(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}c(bd,"isNumber");J.isNumber=bd;function D9(r){return!!r&&r.constructor===Object}c(D9,"isObject");J.isObject=D9;function O9(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(e){if(!bd(e))throw new Error("bbox must only contain numbers")})}c(O9,"validateBBox");J.validateBBox=O9;function L9(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")}c(L9,"validateId");J.validateId=L9});var k3=N(Ke=>{"use strict";m();Object.defineProperty(Ke,"__esModule",{value:!0});var lt=ly();function ic(r,e,t){if(r!==null)for(var i,n,o,a,u,l,p,h=0,y=0,g,v=r.type,S=v==="FeatureCollection",T=v==="Feature",b=S?r.features.length:1,x=0;x<b;x++){p=S?r.features[x].geometry:T?r.geometry:r,g=p?p.type==="GeometryCollection":!1,u=g?p.geometries.length:1;for(var I=0;I<u;I++){var E=0,w=0;if(a=g?p.geometries[I]:p,a!==null){l=a.coordinates;var _=a.type;switch(h=t&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(e(l,y,x,E,w)===!1)return!1;y++,E++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(e(l[i],y,x,E,w)===!1)return!1;y++,_==="MultiPoint"&&E++}_==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-h;n++){if(e(l[i][n],y,x,E,w)===!1)return!1;y++}_==="MultiLineString"&&E++,_==="Polygon"&&w++}_==="Polygon"&&E++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-h;o++){if(e(l[i][n][o],y,x,E,w)===!1)return!1;y++}w++}E++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(ic(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}c(ic,"coordEach");function A9(r,e,t,i){var n=t;return ic(r,function(o,a,u,l,p){a===0&&t===void 0?n=o:n=e(n,o,a,u,l,p)},i),n}c(A9,"coordReduce");function D3(r,e){var t;switch(r.type){case"FeatureCollection":for(t=0;t<r.features.length&&e(r.features[t].properties,t)!==!1;t++);break;case"Feature":e(r.properties,0);break}}c(D3,"propEach");function k9(r,e,t){var i=t;return D3(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}c(k9,"propReduce");function O3(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}c(O3,"featureEach");function F9(r,e,t){var i=t;return O3(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}c(F9,"featureReduce");function B9(r){var e=[];return ic(r,function(t){e.push(t)}),e}c(B9,"coordAll");function cy(r,e){var t,i,n,o,a,u,l,p,h,y,g=0,v=r.type==="FeatureCollection",S=r.type==="Feature",T=v?r.features.length:1;for(t=0;t<T;t++){for(u=v?r.features[t].geometry:S?r.geometry:r,p=v?r.features[t].properties:S?r.properties:{},h=v?r.features[t].bbox:S?r.bbox:void 0,y=v?r.features[t].id:S?r.id:void 0,l=u?u.type==="GeometryCollection":!1,a=l?u.geometries.length:1,n=0;n<a;n++){if(o=l?u.geometries[n]:u,o===null){if(e(null,g,p,h,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,h,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,h,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}c(cy,"geomEach");function R9(r,e,t){var i=t;return cy(r,function(n,o,a,u,l){o===0&&t===void 0?i=n:i=e(i,n,o,a,u,l)}),i}c(R9,"geomReduce");function xd(r,e){cy(r,function(t,i,n,o,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(lt.feature(t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(u){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var h=t.coordinates[p],y={type:l,coordinates:h};if(e(lt.feature(y,n),i,p)===!1)return!1}})}c(xd,"flattenEach");function N9(r,e,t){var i=t;return xd(r,function(n,o,a){o===0&&a===0&&t===void 0?i=n:i=e(i,n,o,a)}),i}c(N9,"flattenReduce");function L3(r,e){xd(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,l=0,p=0,h=0;if(ic(t,function(y,g,v,S,T){if(u===void 0||i>l||S>p||T>h){u=y,l=i,p=S,h=T,o=0;return}var b=lt.lineString([u,y],t.properties);if(e(b,i,n,T,o)===!1)return!1;o++,u=y})===!1)return!1}}})}c(L3,"segmentEach");function G9(r,e,t){var i=t,n=!1;return L3(r,function(o,a,u,l,p){n===!1&&t===void 0?i=o:i=e(i,o,a,u,l,p),n=!0}),i}c(G9,"segmentReduce");function A3(r,e){if(!r)throw new Error("geojson is required");xd(r,function(t,i,n){if(t.geometry!==null){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(e(t,i,n,0,0)===!1)return!1;break;case"Polygon":for(var u=0;u<a.length;u++)if(e(lt.lineString(a[u],t.properties),i,n,u)===!1)return!1;break}}})}c(A3,"lineEach");function V9(r,e,t){var i=t;return A3(r,function(n,o,a,u){o===0&&t===void 0?i=n:i=e(i,n,o,a,u)}),i}c(V9,"lineReduce");function j9(r,e){if(e=e||{},!lt.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.segmentIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var l=u.coordinates;switch(u.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=l.length+o-1),lt.lineString([l[o],l[o+1]],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),lt.lineString([l[n][o],l[n][o+1]],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o-1),lt.lineString([l[i][o],l[i][o+1]],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o-1),lt.lineString([l[i][n][o],l[i][n][o+1]],a,e)}throw new Error("geojson is invalid")}c(j9,"findSegment");function H9(r,e){if(e=e||{},!lt.isObject(e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.coordIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var l=u.coordinates;switch(u.type){case"Point":return lt.point(l,a,e);case"MultiPoint":return i<0&&(i=l.length+i),lt.point(l[i],a,e);case"LineString":return o<0&&(o=l.length+o),lt.point(l[o],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),lt.point(l[n][o],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),lt.point(l[i][o],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o),lt.point(l[i][n][o],a,e)}throw new Error("geojson is invalid")}c(H9,"findPoint");Ke.coordAll=B9;Ke.coordEach=ic;Ke.coordReduce=A9;Ke.featureEach=O3;Ke.featureReduce=F9;Ke.findPoint=H9;Ke.findSegment=j9;Ke.flattenEach=xd;Ke.flattenReduce=N9;Ke.geomEach=cy;Ke.geomReduce=R9;Ke.lineEach=A3;Ke.lineReduce=V9;Ke.propEach=D3;Ke.propReduce=k9;Ke.segmentEach=L3;Ke.segmentReduce=G9});var uy=N((UR,B3)=>{"use strict";m();var F3=Object.prototype.toString;B3.exports=c(function(e){var t=F3.call(e),i=t==="[object Arguments]";return i||(i=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&F3.call(e.callee)==="[object Function]"),i},"isArguments")});var X3=N((YR,W3)=>{"use strict";m();var U3;Object.keys||(nc=Object.prototype.hasOwnProperty,py=Object.prototype.toString,R3=uy(),dy=Object.prototype.propertyIsEnumerable,N3=!dy.call({toString:null},"toString"),G3=dy.call(function(){},"prototype"),oc=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Sd=c(function(r){var e=r.constructor;return e&&e.prototype===r},"equalsConstructorPrototype"),V3={$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},j3=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!V3["$"+r]&&nc.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Sd(window[r])}catch{return!0}}catch{return!0}return!1}(),H3=c(function(r){if(typeof window>"u"||!j3)return Sd(r);try{return Sd(r)}catch{return!1}},"equalsConstructorPrototypeIfNotBuggy"),U3=c(function(e){var t=e!==null&&typeof e=="object",i=py.call(e)==="[object Function]",n=R3(e),o=t&&py.call(e)==="[object String]",a=[];if(!t&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var u=G3&&i;if(o&&e.length>0&&!nc.call(e,0))for(var l=0;l<e.length;++l)a.push(String(l));if(n&&e.length>0)for(var p=0;p<e.length;++p)a.push(String(p));else for(var h in e)!(u&&h==="prototype")&&nc.call(e,h)&&a.push(String(h));if(N3)for(var y=H3(e),g=0;g<oc.length;++g)!(y&&oc[g]==="constructor")&&nc.call(e,oc[g])&&a.push(oc[g]);return a},"keys"));var nc,py,R3,dy,N3,G3,oc,Sd,V3,j3,H3;W3.exports=U3});var Td=N((qR,z3)=>{"use strict";m();var U9=Array.prototype.slice,W9=uy(),Y3=Object.keys,Md=Y3?c(function(e){return Y3(e)},"keys"):X3(),Z3=Object.keys;Md.shim=c(function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=c(function(i){return W9(i)?Z3(U9.call(i)):Z3(i)},"keys"))}else Object.keys=Md;return Object.keys||Md},"shimObjectKeys");z3.exports=Md});var $3=N((KR,q3)=>{"use strict";m();q3.exports=Error});var K3=N((eN,J3)=>{"use strict";m();J3.exports=EvalError});var eC=N((rN,Q3)=>{"use strict";m();Q3.exports=RangeError});var rC=N((nN,tC)=>{"use strict";m();tC.exports=ReferenceError});var hy=N((aN,iC)=>{"use strict";m();iC.exports=SyntaxError});var Zi=N((lN,nC)=>{"use strict";m();nC.exports=TypeError});var aC=N((uN,oC)=>{"use strict";m();oC.exports=URIError});var ac=N((dN,sC)=>{"use strict";m();sC.exports=c(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==n||a.enumerable!==!0)return!1}return!0},"hasSymbols")});var Pd=N((mN,cC)=>{"use strict";m();var lC=typeof Symbol<"u"&&Symbol,X9=ac();cC.exports=c(function(){return typeof lC!="function"||typeof Symbol!="function"||typeof lC("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:X9()},"hasNativeSymbols")});var pC=N((vN,uC)=>{"use strict";m();var fy={__proto__:null,foo:{}},Y9=Object;uC.exports=c(function(){return{__proto__:fy}.foo===fy.foo&&!(fy instanceof Y9)},"hasProto")});var fC=N((xN,hC)=>{"use strict";m();var Z9="Function.prototype.bind called on incompatible ",z9=Object.prototype.toString,q9=Math.max,$9="[object Function]",dC=c(function(e,t){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<t.length;o+=1)i[o+e.length]=t[o];return i},"concatty"),J9=c(function(e,t){for(var i=[],n=t||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},"slicy"),K9=c(function(r,e){for(var t="",i=0;i<r.length;i+=1)t+=r[i],i+1<r.length&&(t+=e);return t},"joiny");hC.exports=c(function(e){var t=this;if(typeof t!="function"||z9.apply(t)!==$9)throw new TypeError(Z9+t);for(var i=J9(arguments,1),n,o=c(function(){if(this instanceof n){var h=t.apply(this,dC(i,arguments));return Object(h)===h?h:this}return t.apply(e,dC(i,arguments))},"binder"),a=q9(0,t.length-i.length),u=[],l=0;l<a;l++)u[l]="$"+l;if(n=Function("binder","return function ("+K9(u,",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var p=c(function(){},"Empty");p.prototype=t.prototype,n.prototype=new p,p.prototype=null}return n},"bind")});var Id=N((TN,mC)=>{"use strict";m();var Q9=fC();mC.exports=Function.prototype.bind||Q9});var my=N((IN,yC)=>{"use strict";m();var eT=Function.prototype.call,tT=Object.prototype.hasOwnProperty,rT=Id();yC.exports=rT.call(eT,tT)});var Er=N((EN,xC)=>{"use strict";m();var he,iT=$3(),nT=K3(),oT=eC(),aT=rC(),is=hy(),rs=Zi(),sT=aC(),CC=Function,yy=c(function(r){try{return CC('"use strict"; return ('+r+").constructor;")()}catch{}},"getEvalledConstructor"),Eo=Object.getOwnPropertyDescriptor;if(Eo)try{Eo({},"")}catch{Eo=null}var gy=c(function(){throw new rs},"throwTypeError"),lT=Eo?function(){try{return arguments.callee,gy}catch{try{return Eo(arguments,"callee").get}catch{return gy}}}():gy,es=Pd()(),cT=pC()(),ot=Object.getPrototypeOf||(cT?function(r){return r.__proto__}:null),ts={},uT=typeof Uint8Array>"u"||!ot?he:ot(Uint8Array),_o={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?he:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?he:ArrayBuffer,"%ArrayIteratorPrototype%":es&&ot?ot([][Symbol.iterator]()):he,"%AsyncFromSyncIteratorPrototype%":he,"%AsyncFunction%":ts,"%AsyncGenerator%":ts,"%AsyncGeneratorFunction%":ts,"%AsyncIteratorPrototype%":ts,"%Atomics%":typeof Atomics>"u"?he:Atomics,"%BigInt%":typeof BigInt>"u"?he:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?he:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?he:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?he:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":iT,"%eval%":eval,"%EvalError%":nT,"%Float32Array%":typeof Float32Array>"u"?he:Float32Array,"%Float64Array%":typeof Float64Array>"u"?he:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?he:FinalizationRegistry,"%Function%":CC,"%GeneratorFunction%":ts,"%Int8Array%":typeof Int8Array>"u"?he:Int8Array,"%Int16Array%":typeof Int16Array>"u"?he:Int16Array,"%Int32Array%":typeof Int32Array>"u"?he:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":es&&ot?ot(ot([][Symbol.iterator]())):he,"%JSON%":typeof JSON=="object"?JSON:he,"%Map%":typeof Map>"u"?he:Map,"%MapIteratorPrototype%":typeof Map>"u"||!es||!ot?he:ot(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?he:Promise,"%Proxy%":typeof Proxy>"u"?he:Proxy,"%RangeError%":oT,"%ReferenceError%":aT,"%Reflect%":typeof Reflect>"u"?he:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?he:Set,"%SetIteratorPrototype%":typeof Set>"u"||!es||!ot?he:ot(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?he:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":es&&ot?ot(""[Symbol.iterator]()):he,"%Symbol%":es?Symbol:he,"%SyntaxError%":is,"%ThrowTypeError%":lT,"%TypedArray%":uT,"%TypeError%":rs,"%Uint8Array%":typeof Uint8Array>"u"?he:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?he:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?he:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?he:Uint32Array,"%URIError%":sT,"%WeakMap%":typeof WeakMap>"u"?he:WeakMap,"%WeakRef%":typeof WeakRef>"u"?he:WeakRef,"%WeakSet%":typeof WeakSet>"u"?he:WeakSet};if(ot)try{null.error}catch(r){gC=ot(ot(r)),_o["%Error.prototype%"]=gC}var gC,pT=c(function r(e){var t;if(e==="%AsyncFunction%")t=yy("async function () {}");else if(e==="%GeneratorFunction%")t=yy("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=yy("async function* () {}");else if(e==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(t=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&ot&&(t=ot(n.prototype))}return _o[e]=t,t},"doEval"),vC={__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"]},sc=Id(),wd=my(),dT=sc.call(Function.call,Array.prototype.concat),hT=sc.call(Function.apply,Array.prototype.splice),bC=sc.call(Function.call,String.prototype.replace),Ed=sc.call(Function.call,String.prototype.slice),fT=sc.call(Function.call,RegExp.prototype.exec),mT=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,yT=/\\(\\)?/g,gT=c(function(e){var t=Ed(e,0,1),i=Ed(e,-1);if(t==="%"&&i!=="%")throw new is("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new is("invalid intrinsic syntax, expected opening `%`");var n=[];return bC(e,mT,function(o,a,u,l){n[n.length]=u?bC(l,yT,"$1"):a||o}),n},"stringToPath"),vT=c(function(e,t){var i=e,n;if(wd(vC,i)&&(n=vC[i],i="%"+n[0]+"%"),wd(_o,i)){var o=_o[i];if(o===ts&&(o=pT(i)),typeof o>"u"&&!t)throw new rs("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new is("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");xC.exports=c(function(e,t){if(typeof e!="string"||e.length===0)throw new rs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new rs('"allowMissing" argument must be a boolean');if(fT(/^%?[^%]*%?$/,e)===null)throw new is("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=gT(e),n=i.length>0?i[0]:"",o=vT("%"+n+"%",t),a=o.name,u=o.value,l=!1,p=o.alias;p&&(n=p[0],hT(i,dT([0,1],p)));for(var h=1,y=!0;h<i.length;h+=1){var g=i[h],v=Ed(g,0,1),S=Ed(g,-1);if((v==='"'||v==="'"||v==="`"||S==='"'||S==="'"||S==="`")&&v!==S)throw new is("property names with quotes must have matching quotes");if((g==="constructor"||!y)&&(l=!0),n+="."+g,a="%"+n+"%",wd(_o,a))u=_o[a];else if(u!=null){if(!(g in u)){if(!t)throw new rs("base intrinsic for "+e+" exists, but the property is not available.");return}if(Eo&&h+1>=i.length){var T=Eo(u,g);y=!!T,y&&"get"in T&&!("originalValue"in T.get)?u=T.get:u=u[g]}else y=wd(u,g),u=u[g];y&&!l&&(_o[a]=u)}}return u},"GetIntrinsic")});var Dd=N((ON,SC)=>{"use strict";m();var bT=Er(),_d=bT("%Object.defineProperty%",!0)||!1;if(_d)try{_d({},"a",{value:1})}catch{_d=!1}SC.exports=_d});var Ld=N((AN,MC)=>{"use strict";m();var CT=Er(),Od=CT("%Object.getOwnPropertyDescriptor%",!0);if(Od)try{Od([],"length")}catch{Od=null}MC.exports=Od});var Ad=N((FN,IC)=>{"use strict";m();var TC=Dd(),xT=hy(),ns=Zi(),PC=Ld();IC.exports=c(function(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new ns("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ns("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ns("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ns("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ns("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ns("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,l=!!PC&&PC(e,t);if(TC)TC(e,t,{configurable:a===null&&l?l.configurable:!a,enumerable:n===null&&l?l.enumerable:!n,value:i,writable:o===null&&l?l.writable:!o});else if(u||!n&&!o&&!a)e[t]=i;else throw new xT("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var kd=N((NN,EC)=>{"use strict";m();var vy=Dd(),wC=c(function(){return!!vy},"hasPropertyDescriptors");wC.hasArrayLengthDefineBug=c(function(){if(!vy)return null;try{return vy([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");EC.exports=wC});var Fn=N((jN,LC)=>{"use strict";m();var ST=Td(),MT=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",TT=Object.prototype.toString,PT=Array.prototype.concat,_C=Ad(),IT=c(function(r){return typeof r=="function"&&TT.call(r)==="[object Function]"},"isFunction"),DC=kd()(),wT=c(function(r,e,t,i){if(e in r){if(i===!0){if(r[e]===t)return}else if(!IT(i)||!i())return}DC?_C(r,e,t,!0):_C(r,e,t)},"defineProperty"),OC=c(function(r,e){var t=arguments.length>2?arguments[2]:{},i=ST(e);MT&&(i=PT.call(i,Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n+=1)wT(r,i[n],e[i[n]],t[i[n]])},"defineProperties");OC.supportsDescriptors=!!DC;LC.exports=OC});var RC=N((WN,BC)=>{"use strict";m();var ET=Er(),AC=Ad(),_T=kd()(),kC=Ld(),FC=Zi(),DT=ET("%Math.floor%");BC.exports=c(function(e,t){if(typeof e!="function")throw new FC("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||DT(t)!==t)throw new FC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in e&&kC){var a=kC(e,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(_T?AC(e,"length",t,!0,!0):AC(e,"length",t)),e},"setFunctionLength")});var Do=N((ZN,Fd)=>{"use strict";m();var by=Id(),Bd=Er(),OT=RC(),LT=Zi(),VC=Bd("%Function.prototype.apply%"),jC=Bd("%Function.prototype.call%"),HC=Bd("%Reflect.apply%",!0)||by.call(jC,VC),NC=Dd(),AT=Bd("%Math.max%");Fd.exports=c(function(e){if(typeof e!="function")throw new LT("a function is required");var t=HC(by,jC,arguments);return OT(t,1+AT(0,e.length-(arguments.length-1)),!0)},"callBind");var GC=c(function(){return HC(by,VC,arguments)},"applyBind");NC?NC(Fd.exports,"apply",{value:GC}):Fd.exports.apply=GC});var qt=N(($N,XC)=>{"use strict";m();var UC=Er(),WC=Do(),kT=WC(UC("String.prototype.indexOf"));XC.exports=c(function(e,t){var i=UC(e,!!t);return typeof i=="function"&&kT(e,".prototype.")>-1?WC(i):i},"callBoundIntrinsic")});var Cy=N((QN,$C)=>{"use strict";m();var FT=Td(),zC=ac()(),qC=qt(),YC=Object,BT=qC("Array.prototype.push"),ZC=qC("Object.prototype.propertyIsEnumerable"),RT=zC?Object.getOwnPropertySymbols:null;$C.exports=c(function(e,t){if(e==null)throw new TypeError("target must be an object");var i=YC(e);if(arguments.length===1)return i;for(var n=1;n<arguments.length;++n){var o=YC(arguments[n]),a=FT(o),u=zC&&(Object.getOwnPropertySymbols||RT);if(u)for(var l=u(o),p=0;p<l.length;++p){var h=l[p];ZC(o,h)&&BT(a,h)}for(var y=0;y<a.length;++y){var g=a[y];if(ZC(o,g)){var v=o[g];i[g]=v}}}return i},"assign")});var Sy=N((rG,JC)=>{"use strict";m();var xy=Cy(),NT=c(function(){if(!Object.assign)return!1;for(var r="abcdefghijklmnopqrst",e=r.split(""),t={},i=0;i<e.length;++i)t[e[i]]=e[i];var n=Object.assign({},t),o="";for(var a in n)o+=a;return r!==o},"lacksProperEnumerationOrder"),GT=c(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},"assignHasPendingExceptions");JC.exports=c(function(){return!Object.assign||NT()||GT()?xy:Object.assign},"getPolyfill")});var QC=N((oG,KC)=>{"use strict";m();var VT=Fn(),jT=Sy();KC.exports=c(function(){var e=jT();return VT(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e},"shimAssign")});var i4=N((lG,r4)=>{"use strict";m();var HT=Fn(),UT=Do(),WT=Cy(),e4=Sy(),XT=QC(),YT=UT.apply(e4()),t4=c(function(e,t){return YT(Object,arguments)},"assign");HT(t4,{getPolyfill:e4,implementation:WT,shim:XT});r4.exports=t4});var o4=N((pG,n4)=>{"use strict";m();var cc=c(function(){return typeof c(function(){},"f").name=="string"},"functionsHaveNames"),lc=Object.getOwnPropertyDescriptor;if(lc)try{lc([],"length")}catch{lc=null}cc.functionsHaveConfigurableNames=c(function(){if(!cc()||!lc)return!1;var e=lc(function(){},"name");return!!e&&!!e.configurable},"functionsHaveConfigurableNames");var ZT=Function.prototype.bind;cc.boundFunctionsHaveNames=c(function(){return cc()&&typeof ZT=="function"&&c(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");n4.exports=cc});var l4=N((fG,s4)=>{"use strict";m();var a4=Ad(),zT=kd()(),qT=o4().functionsHaveConfigurableNames(),$T=Zi();s4.exports=c(function(e,t){if(typeof e!="function")throw new $T("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||qT)&&(zT?a4(e,"name",t,!0,!0):a4(e,"name",t)),e},"setFunctionName")});var My=N((gG,c4)=>{"use strict";m();var JT=l4(),KT=Zi(),QT=Object;c4.exports=JT(c(function(){if(this==null||this!==QT(this))throw new KT("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"flags"),"get flags",!0)});var Ty=N((CG,u4)=>{"use strict";m();var eP=My(),tP=Fn().supportsDescriptors,rP=Object.getOwnPropertyDescriptor;u4.exports=c(function(){if(tP&&/a/mig.flags==="gim"){var e=rP(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var t="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(i,"sticky",{get:function(){t+="y"}}),t==="dy")return e.get}}return eP},"getPolyfill")});var h4=N((MG,d4)=>{"use strict";m();var iP=Fn().supportsDescriptors,nP=Ty(),oP=Object.getOwnPropertyDescriptor,aP=Object.defineProperty,sP=TypeError,p4=Object.getPrototypeOf,lP=/a/;d4.exports=c(function(){if(!iP||!p4)throw new sP("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=nP(),t=p4(lP),i=oP(t,"flags");return(!i||i.get!==e)&&aP(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},"shimFlags")});var g4=N((IG,y4)=>{"use strict";m();var cP=Fn(),uP=Do(),pP=My(),f4=Ty(),dP=h4(),m4=uP(f4());cP(m4,{getPolyfill:f4,implementation:pP,shim:dP});y4.exports=m4});var Bn=N((EG,v4)=>{"use strict";m();var hP=ac();v4.exports=c(function(){return hP()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Iy=N((OG,C4)=>{"use strict";m();var fP=Bn()(),mP=qt(),Py=mP("Object.prototype.toString"),Rd=c(function(e){return fP&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Py(e)==="[object Arguments]"},"isArguments"),b4=c(function(e){return Rd(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Py(e)!=="[object Array]"&&Py(e.callee)==="[object Function]"},"isArguments"),yP=function(){return Rd(arguments)}();Rd.isLegacyArguments=b4;C4.exports=yP?Rd:b4});var x4=N(()=>{m()});var j4=N((RG,V4)=>{m();var By=typeof Map=="function"&&Map.prototype,wy=Object.getOwnPropertyDescriptor&&By?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Gd=By&&wy&&typeof wy.get=="function"?wy.get:null,S4=By&&Map.prototype.forEach,Ry=typeof Set=="function"&&Set.prototype,Ey=Object.getOwnPropertyDescriptor&&Ry?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Vd=Ry&&Ey&&typeof Ey.get=="function"?Ey.get:null,M4=Ry&&Set.prototype.forEach,gP=typeof WeakMap=="function"&&WeakMap.prototype,pc=gP?WeakMap.prototype.has:null,vP=typeof WeakSet=="function"&&WeakSet.prototype,dc=vP?WeakSet.prototype.has:null,bP=typeof WeakRef=="function"&&WeakRef.prototype,T4=bP?WeakRef.prototype.deref:null,CP=Boolean.prototype.valueOf,xP=Object.prototype.toString,SP=Function.prototype.toString,MP=String.prototype.match,Ny=String.prototype.slice,Nn=String.prototype.replace,TP=String.prototype.toUpperCase,P4=String.prototype.toLowerCase,k4=RegExp.prototype.test,I4=Array.prototype.concat,ii=Array.prototype.join,PP=Array.prototype.slice,w4=Math.floor,Oy=typeof BigInt=="function"?BigInt.prototype.valueOf:null,_y=Object.getOwnPropertySymbols,Ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,os=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ct=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===os||!0)?Symbol.toStringTag:null,F4=Object.prototype.propertyIsEnumerable,E4=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function _4(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||k4.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-w4(-r):w4(r);if(i!==r){var n=String(i),o=Ny.call(e,n.length+1);return Nn.call(n,t,"$&_")+"."+Nn.call(Nn.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Nn.call(e,t,"$&_")}c(_4,"addNumericSeparator");var Ay=x4(),D4=Ay.custom,O4=R4(D4)?D4:null;V4.exports=c(function r(e,t,i,n){var o=t||{};if(Rn(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Rn(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Rn(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Rn(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Rn(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return G4(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return u?_4(e,l):l}if(typeof e=="bigint"){var p=String(e)+"n";return u?_4(e,p):p}var h=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=h&&h>0&&typeof e=="object")return ky(e)?"[Array]":"[Object]";var y=UP(o,i);if(typeof n>"u")n=[];else if(N4(n,e)>=0)return"[Circular]";function g(ge,we,Le){if(we&&(n=PP.call(n),n.push(we)),Le){var qe={depth:o.depth};return Rn(o,"quoteStyle")&&(qe.quoteStyle=o.quoteStyle),r(ge,qe,i+1,n)}return r(ge,o,i+1,n)}if(c(g,"inspect"),typeof e=="function"&&!L4(e)){var v=kP(e),S=Nd(e,g);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(S.length>0?" { "+ii.call(S,", ")+" }":"")}if(R4(e)){var T=os?Nn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ly.call(e);return typeof e=="object"&&!os?uc(T):T}if(VP(e)){for(var b="<"+P4.call(String(e.nodeName)),x=e.attributes||[],I=0;I<x.length;I++)b+=" "+x[I].name+"="+B4(IP(x[I].value),"double",o);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+P4.call(String(e.nodeName))+">",b}if(ky(e)){if(e.length===0)return"[]";var E=Nd(e,g);return y&&!HP(E)?"["+Fy(E,y)+"]":"[ "+ii.call(E,", ")+" ]"}if(EP(e)){var w=Nd(e,g);return!("cause"in Error.prototype)&&"cause"in e&&!F4.call(e,"cause")?"{ ["+String(e)+"] "+ii.call(I4.call("[cause]: "+g(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ii.call(w,", ")+" }"}if(typeof e=="object"&&a){if(O4&&typeof e[O4]=="function"&&Ay)return Ay(e,{depth:h-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(FP(e)){var _=[];return S4&&S4.call(e,function(ge,we){_.push(g(we,e,!0)+" => "+g(ge,e))}),A4("Map",Gd.call(e),_,y)}if(NP(e)){var D=[];return M4&&M4.call(e,function(ge){D.push(g(ge,e))}),A4("Set",Vd.call(e),D,y)}if(BP(e))return Dy("WeakMap");if(GP(e))return Dy("WeakSet");if(RP(e))return Dy("WeakRef");if(DP(e))return uc(g(Number(e)));if(LP(e))return uc(g(Oy.call(e)));if(OP(e))return uc(CP.call(e));if(_P(e))return uc(g(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===global)return"{ [object globalThis] }";if(!wP(e)&&!L4(e)){var B=Nd(e,g),U=E4?E4(e)===Object.prototype:e instanceof Object||e.constructor===Object,G=e instanceof Object?"":"null prototype",j=!U&&ct&&Object(e)===e&&ct in e?Ny.call(Gn(e),8,-1):G?"Object":"",Y=U||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",ce=Y+(j||G?"["+ii.call(I4.call([],j||[],G||[]),": ")+"] ":"");return B.length===0?ce+"{}":y?ce+"{"+Fy(B,y)+"}":ce+"{ "+ii.call(B,", ")+" }"}return String(e)},"inspect_");function B4(r,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+r+i}c(B4,"wrapQuotes");function IP(r){return Nn.call(String(r),/"/g,""")}c(IP,"quote");function ky(r){return Gn(r)==="[object Array]"&&(!ct||!(typeof r=="object"&&ct in r))}c(ky,"isArray");function wP(r){return Gn(r)==="[object Date]"&&(!ct||!(typeof r=="object"&&ct in r))}c(wP,"isDate");function L4(r){return Gn(r)==="[object RegExp]"&&(!ct||!(typeof r=="object"&&ct in r))}c(L4,"isRegExp");function EP(r){return Gn(r)==="[object Error]"&&(!ct||!(typeof r=="object"&&ct in r))}c(EP,"isError");function _P(r){return Gn(r)==="[object String]"&&(!ct||!(typeof r=="object"&&ct in r))}c(_P,"isString");function DP(r){return Gn(r)==="[object Number]"&&(!ct||!(typeof r=="object"&&ct in r))}c(DP,"isNumber");function OP(r){return Gn(r)==="[object Boolean]"&&(!ct||!(typeof r=="object"&&ct in r))}c(OP,"isBoolean");function R4(r){if(os)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Ly)return!1;try{return Ly.call(r),!0}catch{}return!1}c(R4,"isSymbol");function LP(r){if(!r||typeof r!="object"||!Oy)return!1;try{return Oy.call(r),!0}catch{}return!1}c(LP,"isBigInt");var AP=Object.prototype.hasOwnProperty||function(r){return r in this};function Rn(r,e){return AP.call(r,e)}c(Rn,"has");function Gn(r){return xP.call(r)}c(Gn,"toStr");function kP(r){if(r.name)return r.name;var e=MP.call(SP.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}c(kP,"nameOf");function N4(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t;return-1}c(N4,"indexOf");function FP(r){if(!Gd||!r||typeof r!="object")return!1;try{Gd.call(r);try{Vd.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}c(FP,"isMap");function BP(r){if(!pc||!r||typeof r!="object")return!1;try{pc.call(r,pc);try{dc.call(r,dc)}catch{return!0}return r instanceof WeakMap}catch{}return!1}c(BP,"isWeakMap");function RP(r){if(!T4||!r||typeof r!="object")return!1;try{return T4.call(r),!0}catch{}return!1}c(RP,"isWeakRef");function NP(r){if(!Vd||!r||typeof r!="object")return!1;try{Vd.call(r);try{Gd.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}c(NP,"isSet");function GP(r){if(!dc||!r||typeof r!="object")return!1;try{dc.call(r,dc);try{pc.call(r,pc)}catch{return!0}return r instanceof WeakSet}catch{}return!1}c(GP,"isWeakSet");function VP(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}c(VP,"isElement");function G4(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return G4(Ny.call(r,0,e.maxStringLength),e)+i}var n=Nn.call(Nn.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,jP);return B4(n,"single",e)}c(G4,"inspectString");function jP(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+TP.call(e.toString(16))}c(jP,"lowbyte");function uc(r){return"Object("+r+")"}c(uc,"markBoxed");function Dy(r){return r+" { ? }"}c(Dy,"weakCollectionOf");function A4(r,e,t,i){var n=i?Fy(t,i):ii.call(t,", ");return r+" ("+e+") {"+n+"}"}c(A4,"collectionOf");function HP(r){for(var e=0;e<r.length;e++)if(N4(r[e],"\n")>=0)return!1;return!0}c(HP,"singleLineValues");function UP(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=ii.call(Array(r.indent+1)," ");else return null;return{base:t,prev:ii.call(Array(e+1),t)}}c(UP,"getIndent");function Fy(r,e){if(r.length===0)return"";var t="\n"+e.prev+e.base;return t+ii.call(r,","+t)+"\n"+e.prev}c(Fy,"indentedJoin");function Nd(r,e){var t=ky(r),i=[];if(t){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=Rn(r,n)?e(r[n],r):""}var o=typeof _y=="function"?_y(r):[],a;if(os){a={};for(var u=0;u<o.length;u++)a["$"+o[u]]=o[u]}for(var l in r)Rn(r,l)&&(t&&String(Number(l))===l&&l<r.length||os&&a["$"+l]instanceof Symbol||(k4.call(/[^\w$]/,l)?i.push(e(l,r)+": "+e(r[l],r)):i.push(l+": "+e(r[l],r))));if(typeof _y=="function")for(var p=0;p<o.length;p++)F4.call(r,o[p])&&i.push("["+e(o[p])+"]: "+e(r[o[p]],r));return i}c(Nd,"arrObjKeys")});var Vy=N((VG,U4)=>{"use strict";m();var H4=Er(),as=qt(),WP=j4(),XP=Zi(),jd=H4("%WeakMap%",!0),Hd=H4("%Map%",!0),YP=as("WeakMap.prototype.get",!0),ZP=as("WeakMap.prototype.set",!0),zP=as("WeakMap.prototype.has",!0),qP=as("Map.prototype.get",!0),$P=as("Map.prototype.set",!0),JP=as("Map.prototype.has",!0),Gy=c(function(r,e){for(var t=r,i;(i=t.next)!==null;t=i)if(i.key===e)return t.next=i.next,i.next=r.next,r.next=i,i},"listGetNode"),KP=c(function(r,e){var t=Gy(r,e);return t&&t.value},"listGet"),QP=c(function(r,e,t){var i=Gy(r,e);i?i.value=t:r.next={key:e,next:r.next,value:t}},"listSet"),eI=c(function(r,e){return!!Gy(r,e)},"listHas");U4.exports=c(function(){var e,t,i,n={assert:function(o){if(!n.has(o))throw new XP("Side channel does not contain "+WP(o))},get:function(o){if(jd&&o&&(typeof o=="object"||typeof o=="function")){if(e)return YP(e,o)}else if(Hd){if(t)return qP(t,o)}else if(i)return KP(i,o)},has:function(o){if(jd&&o&&(typeof o=="object"||typeof o=="function")){if(e)return zP(e,o)}else if(Hd){if(t)return JP(t,o)}else if(i)return eI(i,o);return!1},set:function(o,a){jd&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new jd),ZP(e,o,a)):Hd?(t||(t=new Hd),$P(t,o,a)):(i||(i={key:{},next:null}),QP(i,o,a))}};return n},"getSideChannel")});var X4=N((UG,W4)=>{"use strict";m();var tI=my(),hc=Vy()(),zi=Zi(),jy={assert:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new zi("`O` is not an object");if(typeof e!="string")throw new zi("`slot` must be a string");if(hc.assert(r),!jy.has(r,e))throw new zi("`"+e+"` is not present on `O`")},get:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new zi("`O` is not an object");if(typeof e!="string")throw new zi("`slot` must be a string");var t=hc.get(r);return t&&t["$"+e]},has:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new zi("`O` is not an object");if(typeof e!="string")throw new zi("`slot` must be a string");var t=hc.get(r);return!!t&&tI(t,"$"+e)},set:function(r,e,t){if(!r||typeof r!="object"&&typeof r!="function")throw new zi("`O` is not an object");if(typeof e!="string")throw new zi("`slot` must be a string");var i=hc.get(r);i||(i={},hc.set(r,i)),i["$"+e]=t}};Object.freeze&&Object.freeze(jy);W4.exports=jy});var z4=N((XG,Z4)=>{"use strict";m();var fc=X4(),rI=SyntaxError,Y4=typeof StopIteration=="object"?StopIteration:null;Z4.exports=c(function(e){if(!Y4)throw new rI("this environment lacks StopIteration");fc.set(e,"[[Done]]",!1);var t={next:c(function(){var n=fc.get(this,"[[Iterator]]"),o=fc.get(n,"[[Done]]");try{return{done:o,value:o?void 0:n.next()}}catch(a){if(fc.set(n,"[[Done]]",!0),a!==Y4)throw a;return{done:!0,value:void 0}}},"next")};return fc.set(t,"[[Iterator]]",e),t},"getStopIterationIterator")});var Hy=N((zG,q4)=>{m();var iI={}.toString;q4.exports=Array.isArray||function(r){return iI.call(r)=="[object Array]"}});var Uy=N(($G,$4)=>{"use strict";m();var nI=String.prototype.valueOf,oI=c(function(e){try{return nI.call(e),!0}catch{return!1}},"tryStringObject"),aI=Object.prototype.toString,sI="[object String]",lI=Bn()();$4.exports=c(function(e){return typeof e=="string"?!0:typeof e!="object"?!1:lI?oI(e):aI.call(e)===sI},"isString")});var Xy=N((QG,Q4)=>{"use strict";m();var Wy=typeof Map=="function"&&Map.prototype?Map:null,cI=typeof Set=="function"&&Set.prototype?Set:null,Ud;Wy||(Ud=c(function(e){return!1},"isMap"));var K4=Wy?Map.prototype.has:null,J4=cI?Set.prototype.has:null;!Ud&&!K4&&(Ud=c(function(e){return!1},"isMap"));Q4.exports=Ud||c(function(e){if(!e||typeof e!="object")return!1;try{if(K4.call(e),J4)try{J4.call(e)}catch{return!0}return e instanceof Wy}catch{}return!1},"isMap")});var Zy=N((rV,r5)=>{"use strict";m();var uI=typeof Map=="function"&&Map.prototype?Map:null,Yy=typeof Set=="function"&&Set.prototype?Set:null,Wd;Yy||(Wd=c(function(e){return!1},"isSet"));var e5=uI?Map.prototype.has:null,t5=Yy?Set.prototype.has:null;!Wd&&!t5&&(Wd=c(function(e){return!1},"isSet"));r5.exports=Wd||c(function(e){if(!e||typeof e!="object")return!1;try{if(t5.call(e),e5)try{e5.call(e)}catch{return!0}return e instanceof Yy}catch{}return!1},"isSet")});var f5=N((oV,Zd)=>{"use strict";m();var i5=Iy(),n5=z4();Pd()()||ac()()?(Xd=Symbol.iterator,Zd.exports=c(function(e){if(e!=null&&typeof e[Xd]<"u")return e[Xd]();if(i5(e))return Array.prototype[Xd].call(e)},"getIterator")):(o5=Hy(),a5=Uy(),zy=Er(),s5=zy("%Map%",!0),l5=zy("%Set%",!0),hr=qt(),qy=hr("Array.prototype.push"),$y=hr("String.prototype.charCodeAt"),c5=hr("String.prototype.slice"),u5=c(function(e,t){var i=e.length;if(t+1>=i)return t+1;var n=$y(e,t);if(n<55296||n>56319)return t+1;var o=$y(e,t+1);return o<56320||o>57343?t+1:t+2},"advanceStringIndex"),Yd=c(function(e){var t=0;return{next:c(function(){var n=t>=e.length,o;return n||(o=e[t],t+=1),{done:n,value:o}},"next")}},"getArrayIterator"),Jy=c(function(e,t){if(o5(e)||i5(e))return Yd(e);if(a5(e)){var i=0;return{next:c(function(){var o=u5(e,i),a=c5(e,i,o);return i=o,{done:o>e.length,value:a}},"next")}}if(t&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()},"getNonCollectionIterator"),!s5&&!l5?Zd.exports=c(function(e){if(e!=null)return Jy(e,!0)},"getIterator"):(p5=Xy(),d5=Zy(),Ky=hr("Map.prototype.forEach",!0),Qy=hr("Set.prototype.forEach",!0),(typeof C>"u"||!C.versions||!C.versions.node)&&(eg=hr("Map.prototype.iterator",!0),tg=hr("Set.prototype.iterator",!0)),rg=hr("Map.prototype.@@iterator",!0)||hr("Map.prototype._es6-shim iterator_",!0),ig=hr("Set.prototype.@@iterator",!0)||hr("Set.prototype._es6-shim iterator_",!0),h5=c(function(e){if(p5(e)){if(eg)return n5(eg(e));if(rg)return rg(e);if(Ky){var t=[];return Ky(e,function(n,o){qy(t,[o,n])}),Yd(t)}}if(d5(e)){if(tg)return n5(tg(e));if(ig)return ig(e);if(Qy){var i=[];return Qy(e,function(n){qy(i,n)}),Yd(i)}}},"getCollectionIterator"),Zd.exports=c(function(e){return h5(e)||Jy(e)},"getIterator")));var Xd,o5,a5,zy,s5,l5,hr,qy,$y,c5,u5,Yd,Jy,p5,d5,Ky,Qy,eg,tg,rg,ig,h5});var ng=N((lV,y5)=>{"use strict";m();var m5=c(function(r){return r!==r},"numberIsNaN");y5.exports=c(function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||m5(e)&&m5(t))},"is")});var og=N((pV,g5)=>{"use strict";m();var pI=ng();g5.exports=c(function(){return typeof Object.is=="function"?Object.is:pI},"getPolyfill")});var b5=N((fV,v5)=>{"use strict";m();var dI=og(),hI=Fn();v5.exports=c(function(){var e=dI();return hI(Object,{is:e},{is:c(function(){return Object.is!==e},"testObjectIs")}),e},"shimObjectIs")});var M5=N((gV,S5)=>{"use strict";m();var fI=Fn(),mI=Do(),yI=ng(),C5=og(),gI=b5(),x5=mI(C5(),Object);fI(x5,{getPolyfill:C5,implementation:yI,shim:gI});S5.exports=x5});var sg=N((bV,w5)=>{"use strict";m();var vI=Do(),I5=qt(),bI=Er(),ag=bI("%ArrayBuffer%",!0),zd=I5("ArrayBuffer.prototype.byteLength",!0),CI=I5("Object.prototype.toString"),T5=!!ag&&!zd&&new ag(0).slice,P5=!!T5&&vI(T5);w5.exports=c(zd||P5?function(e){if(!e||typeof e!="object")return!1;try{return zd?zd(e):P5(e,0),!0}catch{return!1}}:ag?function(e){return CI(e)==="[object ArrayBuffer]"}:function(e){return!1},"isArrayBuffer")});var _5=N((SV,E5)=>{"use strict";m();var xI=Date.prototype.getDay,SI=c(function(e){try{return xI.call(e),!0}catch{return!1}},"tryDateGetDayCall"),MI=Object.prototype.toString,TI="[object Date]",PI=Bn()();E5.exports=c(function(e){return typeof e!="object"||e===null?!1:PI?SI(e):MI.call(e)===TI},"isDateObject")});var k5=N((PV,A5)=>{"use strict";m();var lg=qt(),D5=Bn()(),O5,L5,cg,ug;D5&&(O5=lg("Object.prototype.hasOwnProperty"),L5=lg("RegExp.prototype.exec"),cg={},qd=c(function(){throw cg},"throwRegexMarker"),ug={toString:qd,valueOf:qd},typeof Symbol.toPrimitive=="symbol"&&(ug[Symbol.toPrimitive]=qd));var qd,II=lg("Object.prototype.toString"),wI=Object.getOwnPropertyDescriptor,EI="[object RegExp]";A5.exports=c(D5?function(e){if(!e||typeof e!="object")return!1;var t=wI(e,"lastIndex"),i=t&&O5(t,"value");if(!i)return!1;try{L5(e,ug)}catch(n){return n===cg}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:II(e)===EI},"isRegex")});var R5=N((EV,B5)=>{"use strict";m();var _I=qt(),F5=_I("SharedArrayBuffer.prototype.byteLength",!0);B5.exports=c(F5?function(e){if(!e||typeof e!="object")return!1;try{return F5(e),!0}catch{return!1}}:function(e){return!1},"isSharedArrayBuffer")});var G5=N((OV,N5)=>{"use strict";m();var DI=Number.prototype.toString,OI=c(function(e){try{return DI.call(e),!0}catch{return!1}},"tryNumberObject"),LI=Object.prototype.toString,AI="[object Number]",kI=Bn()();N5.exports=c(function(e){return typeof e=="number"?!0:typeof e!="object"?!1:kI?OI(e):LI.call(e)===AI},"isNumberObject")});var H5=N((kV,j5)=>{"use strict";m();var V5=qt(),FI=V5("Boolean.prototype.toString"),BI=V5("Object.prototype.toString"),RI=c(function(e){try{return FI(e),!0}catch{return!1}},"booleanBrandCheck"),NI="[object Boolean]",GI=Bn()();j5.exports=c(function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:GI&&Symbol.toStringTag in e?RI(e):BI(e)===NI},"isBoolean")});var Y5=N((RV,pg)=>{"use strict";m();var VI=Object.prototype.toString,jI=Pd()();jI?(U5=Symbol.prototype.toString,W5=/^Symbol\(.*\)$/,X5=c(function(e){return typeof e.valueOf()!="symbol"?!1:W5.test(U5.call(e))},"isRealSymbolObject"),pg.exports=c(function(e){if(typeof e=="symbol")return!0;if(VI.call(e)!=="[object Symbol]")return!1;try{return X5(e)}catch{return!1}},"isSymbol")):pg.exports=c(function(e){return!1},"isSymbol");var U5,W5,X5});var q5=N((VV,z5)=>{"use strict";m();var Z5=typeof BigInt<"u"&&BigInt;z5.exports=c(function(){return typeof Z5=="function"&&typeof BigInt=="function"&&typeof Z5(42)=="bigint"&&typeof BigInt(42)=="bigint"},"hasNativeBigInts")});var K5=N((UV,dg)=>{"use strict";m();var HI=q5()();HI?($5=BigInt.prototype.valueOf,J5=c(function(e){try{return $5.call(e),!0}catch{}return!1},"tryBigIntObject"),dg.exports=c(function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:J5(e)},"isBigInt")):dg.exports=c(function(e){return!1},"isBigInt");var $5,J5});var ex=N((YV,Q5)=>{"use strict";m();var UI=Uy(),WI=G5(),XI=H5(),YI=Y5(),ZI=K5();Q5.exports=c(function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(UI(e))return"String";if(WI(e))return"Number";if(XI(e))return"Boolean";if(YI(e))return"Symbol";if(ZI(e))return"BigInt"},"whichBoxedPrimitive")});var ix=N((qV,rx)=>{"use strict";m();var $d=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,tx=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Jd;$d||(Jd=c(function(e){return!1},"isWeakMap"));var fg=$d?$d.prototype.has:null,hg=tx?tx.prototype.has:null;!Jd&&!fg&&(Jd=c(function(e){return!1},"isWeakMap"));rx.exports=Jd||c(function(e){if(!e||typeof e!="object")return!1;try{if(fg.call(e,fg),hg)try{hg.call(e,hg)}catch{return!0}return e instanceof $d}catch{}return!1},"isWeakMap")});var ox=N((KV,yg)=>{"use strict";m();var zI=Er(),nx=qt(),qI=zI("%WeakSet%",!0),mg=nx("WeakSet.prototype.has",!0);mg?(Kd=nx("WeakMap.prototype.has",!0),yg.exports=c(function(e){if(!e||typeof e!="object")return!1;try{if(mg(e,mg),Kd)try{Kd(e,Kd)}catch{return!0}return e instanceof qI}catch{}return!1},"isWeakSet")):yg.exports=c(function(e){return!1},"isWeakSet");var Kd});var sx=N((tj,ax)=>{"use strict";m();var $I=Xy(),JI=Zy(),KI=ix(),QI=ox();ax.exports=c(function(e){if(e&&typeof e=="object"){if($I(e))return"Map";if(JI(e))return"Set";if(KI(e))return"WeakMap";if(QI(e))return"WeakSet"}return!1},"whichCollection")});var px=N((nj,ux)=>{"use strict";m();var cx=Function.prototype.toString,ss=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,vg,Qd;if(typeof ss=="function"&&typeof Object.defineProperty=="function")try{vg=Object.defineProperty({},"length",{get:function(){throw Qd}}),Qd={},ss(function(){throw 42},null,vg)}catch(r){r!==Qd&&(ss=null)}else ss=null;var ew=/^\s*class\b/,bg=c(function(e){try{var t=cx.call(e);return ew.test(t)}catch{return!1}},"isES6ClassFunction"),gg=c(function(e){try{return bg(e)?!1:(cx.call(e),!0)}catch{return!1}},"tryFunctionToStr"),eh=Object.prototype.toString,tw="[object Object]",rw="[object Function]",iw="[object GeneratorFunction]",nw="[object HTMLAllCollection]",ow="[object HTML document.all class]",aw="[object HTMLCollection]",sw=typeof Symbol=="function"&&!!Symbol.toStringTag,lw=!(0 in[,]),Cg=c(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(lx=document.all,eh.call(lx)===eh.call(document.all)&&(Cg=c(function(e){if((lw||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=eh.call(e);return(t===nw||t===ow||t===aw||t===tw)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var lx;ux.exports=c(ss?function(e){if(Cg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{ss(e,null,vg)}catch(t){if(t!==Qd)return!1}return!bg(e)&&gg(e)}:function(e){if(Cg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(sw)return gg(e);if(bg(e))return!1;var t=eh.call(e);return t!==rw&&t!==iw&&!/^\[object HTML/.test(t)?!1:gg(e)},"isCallable")});var fx=N((sj,hx)=>{"use strict";m();var cw=px(),uw=Object.prototype.toString,dx=Object.prototype.hasOwnProperty,pw=c(function(e,t,i){for(var n=0,o=e.length;n<o;n++)dx.call(e,n)&&(i==null?t(e[n],n,e):t.call(i,e[n],n,e))},"forEachArray"),dw=c(function(e,t,i){for(var n=0,o=e.length;n<o;n++)i==null?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)},"forEachString"),hw=c(function(e,t,i){for(var n in e)dx.call(e,n)&&(i==null?t(e[n],n,e):t.call(i,e[n],n,e))},"forEachObject"),fw=c(function(e,t,i){if(!cw(t))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),uw.call(e)==="[object Array]"?pw(e,t,n):typeof e=="string"?dw(e,t,n):hw(e,t,n)},"forEach");hx.exports=fw});var yx=N((uj,mx)=>{"use strict";m();mx.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var vx=N((dj,gx)=>{"use strict";m();var xg=yx(),mw=typeof globalThis>"u"?global:globalThis;gx.exports=c(function(){for(var e=[],t=0;t<xg.length;t++)typeof mw[xg[t]]=="function"&&(e[e.length]=xg[t]);return e},"availableTypedArrays")});var Mx=N((mj,Sx)=>{"use strict";m();var rh=fx(),yw=vx(),bx=Do(),Tg=qt(),th=Ld(),gw=Tg("Object.prototype.toString"),xx=Bn()(),Cx=typeof globalThis>"u"?global:globalThis,Mg=yw(),Pg=Tg("String.prototype.slice"),Sg=Object.getPrototypeOf,vw=Tg("Array.prototype.indexOf",!0)||c(function(e,t){for(var i=0;i<e.length;i+=1)if(e[i]===t)return i;return-1},"indexOf"),ih={__proto__:null};xx&&th&&Sg?rh(Mg,function(r){var e=new Cx[r];if(Symbol.toStringTag in e){var t=Sg(e),i=th(t,Symbol.toStringTag);if(!i){var n=Sg(t);i=th(n,Symbol.toStringTag)}ih["$"+r]=bx(i.get)}}):rh(Mg,function(r){var e=new Cx[r],t=e.slice||e.set;t&&(ih["$"+r]=bx(t))});var bw=c(function(e){var t=!1;return rh(ih,function(i,n){if(!t)try{"$"+i(e)===n&&(t=Pg(n,1))}catch{}}),t},"tryAllTypedArrays"),Cw=c(function(e){var t=!1;return rh(ih,function(i,n){if(!t)try{i(e),t=Pg(n,1)}catch{}}),t},"tryAllSlices");Sx.exports=c(function(e){if(!e||typeof e!="object")return!1;if(!xx){var t=Pg(gw(e),8,-1);return vw(Mg,t)>-1?t:t!=="Object"?!1:Cw(e)}return th?bw(e):null},"whichTypedArray")});var Ix=N((vj,Px)=>{"use strict";m();var xw=qt(),Tx=xw("ArrayBuffer.prototype.byteLength",!0),Sw=sg();Px.exports=c(function(e){return Sw(e)?Tx?Tx(e):e.byteLength:NaN},"byteLength")});var Jx=N((xj,$x)=>{"use strict";m();var Zx=i4(),ni=qt(),wx=g4(),Mw=Er(),ls=f5(),Tw=Vy(),Ex=M5(),_x=Iy(),Dx=Hy(),Ox=sg(),Lx=_5(),Ax=k5(),kx=R5(),Fx=Td(),Bx=ex(),Rx=sx(),Nx=Mx(),Gx=Ix(),Vx=ni("SharedArrayBuffer.prototype.byteLength",!0),jx=ni("Date.prototype.getTime"),Ig=Object.getPrototypeOf,Hx=ni("Object.prototype.toString"),oh=Mw("%Set%",!0),wg=ni("Map.prototype.has",!0),ah=ni("Map.prototype.get",!0),Ux=ni("Map.prototype.size",!0),sh=ni("Set.prototype.add",!0),zx=ni("Set.prototype.delete",!0),lh=ni("Set.prototype.has",!0),nh=ni("Set.prototype.size",!0);function Wx(r,e,t,i){for(var n=ls(r),o;(o=n.next())&&!o.done;)if(_r(e,o.value,t,i))return zx(r,o.value),!0;return!1}c(Wx,"setHasEqualElement");function qx(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}c(qx,"findLooseMatchingPrimitives");function Pw(r,e,t,i,n,o){var a=qx(t);if(a!=null)return a;var u=ah(e,a),l=Zx({},n,{strict:!1});return typeof u>"u"&&!wg(e,a)||!_r(i,u,l,o)?!1:!wg(r,a)&&_r(i,u,l,o)}c(Pw,"mapMightHaveLoosePrim");function Iw(r,e,t){var i=qx(t);return i!=null?i:lh(e,i)&&!lh(r,i)}c(Iw,"setMightHaveLoosePrim");function Xx(r,e,t,i,n,o){for(var a=ls(r),u,l;(u=a.next())&&!u.done;)if(l=u.value,_r(t,l,n,o)&&_r(i,ah(e,l),n,o))return zx(r,l),!0;return!1}c(Xx,"mapHasEqualEntry");function _r(r,e,t,i){var n=t||{};if(n.strict?Ex(r,e):r===e)return!0;var o=Bx(r),a=Bx(e);if(o!==a)return!1;if(!r||!e||typeof r!="object"&&typeof e!="object")return n.strict?Ex(r,e):r==e;var u=i.has(r),l=i.has(e),p;if(u&&l){if(i.get(r)===i.get(e))return!0}else p={};return u||i.set(r,p),l||i.set(e,p),_w(r,e,n,i)}c(_r,"internalDeepEqual");function Yx(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))}c(Yx,"isBuffer");function ww(r,e,t,i){if(nh(r)!==nh(e))return!1;for(var n=ls(r),o=ls(e),a,u,l;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")l||(l=new oh),sh(l,a.value);else if(!lh(e,a.value)){if(t.strict||!Iw(r,e,a.value))return!1;l||(l=new oh),sh(l,a.value)}if(l){for(;(u=o.next())&&!u.done;)if(u.value&&typeof u.value=="object"){if(!Wx(l,u.value,t.strict,i))return!1}else if(!t.strict&&!lh(r,u.value)&&!Wx(l,u.value,t.strict,i))return!1;return nh(l)===0}return!0}c(ww,"setEquiv");function Ew(r,e,t,i){if(Ux(r)!==Ux(e))return!1;for(var n=ls(r),o=ls(e),a,u,l,p,h,y;(a=n.next())&&!a.done;)if(p=a.value[0],h=a.value[1],p&&typeof p=="object")l||(l=new oh),sh(l,p);else if(y=ah(e,p),typeof y>"u"&&!wg(e,p)||!_r(h,y,t,i)){if(t.strict||!Pw(r,e,p,h,t,i))return!1;l||(l=new oh),sh(l,p)}if(l){for(;(u=o.next())&&!u.done;)if(p=u.value[0],y=u.value[1],p&&typeof p=="object"){if(!Xx(l,r,p,y,t,i))return!1}else if(!t.strict&&(!r.has(p)||!_r(ah(r,p),y,t,i))&&!Xx(l,r,p,y,Zx({},t,{strict:!1}),i))return!1;return nh(l)===0}return!0}c(Ew,"mapEquiv");function _w(r,e,t,i){var n,o;if(typeof r!=typeof e||r==null||e==null||Hx(r)!==Hx(e)||_x(r)!==_x(e))return!1;var a=Dx(r),u=Dx(e);if(a!==u)return!1;var l=r instanceof Error,p=e instanceof Error;if(l!==p||(l||p)&&(r.name!==e.name||r.message!==e.message))return!1;var h=Ax(r),y=Ax(e);if(h!==y||(h||y)&&(r.source!==e.source||wx(r)!==wx(e)))return!1;var g=Lx(r),v=Lx(e);if(g!==v||(g||v)&&jx(r)!==jx(e)||t.strict&&Ig&&Ig(r)!==Ig(e))return!1;var S=Nx(r),T=Nx(e);if(S!==T)return!1;if(S||T){if(r.length!==e.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}var b=Yx(r),x=Yx(e);if(b!==x)return!1;if(b||x){if(r.length!==e.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==e[n])return!1;return!0}var I=Ox(r),E=Ox(e);if(I!==E)return!1;if(I||E)return Gx(r)!==Gx(e)?!1:typeof Uint8Array=="function"&&_r(new Uint8Array(r),new Uint8Array(e),t,i);var w=kx(r),_=kx(e);if(w!==_)return!1;if(w||_)return Vx(r)!==Vx(e)?!1:typeof Uint8Array=="function"&&_r(new Uint8Array(r),new Uint8Array(e),t,i);if(typeof r!=typeof e)return!1;var D=Fx(r),B=Fx(e);if(D.length!==B.length)return!1;for(D.sort(),B.sort(),n=D.length-1;n>=0;n--)if(D[n]!=B[n])return!1;for(n=D.length-1;n>=0;n--)if(o=D[n],!_r(r[o],e[o],t,i))return!1;var U=Rx(r),G=Rx(e);return U!==G?!1:U==="Set"||G==="Set"?ww(r,e,t,i):U==="Map"?Ew(r,e,t,i):!0}c(_w,"objEquiv");$x.exports=c(function(e,t,i){return _r(e,t,i,Tw())},"deepEqual")});var hS=N(ve=>{"use strict";m();Object.defineProperty(ve,"__esModule",{value:!0});function Dw(r){return r&&r.__esModule?r:{default:r}}c(Dw,"_interopRequireDefault");var Ow=Object.defineProperty,Ce=c((r,e)=>Ow(r,"name",{value:e,configurable:!0}),"__name"),Lw=Jx(),Aw=Dw(Lw),gc,Kx=(gc=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,i,n;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(i=e==null?void 0:e.direction)!=null?i:!1,this.compareProperties=(n=e==null?void 0:e.compareProperties)!=null?n:!0}compare(e,t){if(e.type!==t.type||!mc(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){let i=Eg(e),n=Eg(t);return i.every(o=>n.some(a=>this.compare(o,a)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((i,n)=>Math.abs(i-t[n])<this.precision)}compareLine(e,t,i=0,n=!1){if(!mc(e,t))return!1;let o=e,a=t;if(n&&!this.compareCoord(o[0],a[0])){let l=this.fixStartIndex(a,o);if(l)a=l;else return!1}let u=this.compareCoord(o[i],a[i]);return this.direction||u?this.comparePath(o,a):this.compareCoord(o[i],a[a.length-(1+i)])?this.comparePath(o.slice().reverse(),a):!1}fixStartIndex(e,t){let i,n=-1;for(let o=0;o<e.length;o++)if(this.compareCoord(e[o],t[0])){n=o;break}return n>=0&&(i=[].concat(e.slice(n,e.length),e.slice(1,n+1))),i}comparePath(e,t){return e.every((i,n)=>this.compareCoord(i,t[n]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){let i=e.coordinates.slice(1,e.coordinates.length),n=t.coordinates.slice(1,t.coordinates.length);return i.every(o=>n.some(a=>this.compareLine(o,a,1,!0)))}return!1}compareGeometryCollection(e,t){return mc(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((i,n)=>this.compare(i,t.geometries[n]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?Aw.default.call(void 0,e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return mc(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((i,n)=>this.compare(i,t.features[n]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}},c(gc,"_GeojsonEquality"),gc);Ce(Kx,"GeojsonEquality");var kw=Kx;function mc(r,e){return r.coordinates?r.coordinates.length===e.coordinates.length:r.length===e.length}c(mc,"sameLength");Ce(mc,"sameLength");function Eg(r){return r.coordinates.map(e=>({type:r.type.replace("Multi",""),coordinates:e}))}c(Eg,"explode");Ce(Eg,"explode");var Bt=63710088e-1,Dg={centimeters:Bt*100,centimetres:Bt*100,degrees:360/(2*Math.PI),feet:Bt*3.28084,inches:Bt*39.37,kilometers:Bt/1e3,kilometres:Bt/1e3,meters:Bt,metres:Bt,miles:Bt/1609.344,millimeters:Bt*1e3,millimetres:Bt*1e3,nauticalmiles:Bt/1852,radians:1,yards:Bt*1.0936},_g={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 qi(r,e,t={}){let i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}c(qi,"feature");Ce(qi,"feature");function Qx(r,e,t={}){switch(r){case"Point":return ch(e).geometry;case"LineString":return ph(e).geometry;case"Polygon":return uh(e).geometry;case"MultiPoint":return Lg(e).geometry;case"MultiLineString":return Og(e).geometry;case"MultiPolygon":return Ag(e).geometry;default:throw new Error(r+" is invalid")}}c(Qx,"geometry");Ce(Qx,"geometry");function ch(r,e,t={}){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(!yc(r[0])||!yc(r[1]))throw new Error("coordinates must contain numbers");return qi({type:"Point",coordinates:r},e,t)}c(ch,"point");Ce(ch,"point");function eS(r,e,t={}){return vc(r.map(i=>ch(i,e)),t)}c(eS,"points");Ce(eS,"points");function uh(r,e,t={}){for(let n of r){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<n[n.length-1].length;o++)if(n[n.length-1][o]!==n[0][o])throw new Error("First and last Position are not equivalent.")}return qi({type:"Polygon",coordinates:r},e,t)}c(uh,"polygon");Ce(uh,"polygon");function tS(r,e,t={}){return vc(r.map(i=>uh(i,e)),t)}c(tS,"polygons");Ce(tS,"polygons");function ph(r,e,t={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return qi({type:"LineString",coordinates:r},e,t)}c(ph,"lineString");Ce(ph,"lineString");function rS(r,e,t={}){return vc(r.map(i=>ph(i,e)),t)}c(rS,"lineStrings");Ce(rS,"lineStrings");function vc(r,e={}){let t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}c(vc,"featureCollection");Ce(vc,"featureCollection");function Og(r,e,t={}){return qi({type:"MultiLineString",coordinates:r},e,t)}c(Og,"multiLineString");Ce(Og,"multiLineString");function Lg(r,e,t={}){return qi({type:"MultiPoint",coordinates:r},e,t)}c(Lg,"multiPoint");Ce(Lg,"multiPoint");function Ag(r,e,t={}){return qi({type:"MultiPolygon",coordinates:r},e,t)}c(Ag,"multiPolygon");Ce(Ag,"multiPolygon");function iS(r,e,t={}){return qi({type:"GeometryCollection",geometries:r},e,t)}c(iS,"geometryCollection");Ce(iS,"geometryCollection");function nS(r,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");let t=Math.pow(10,e||0);return Math.round(r*t)/t}c(nS,"round");Ce(nS,"round");function kg(r,e="kilometers"){let t=Dg[e];if(!t)throw new Error(e+" units is invalid");return r*t}c(kg,"radiansToLength");Ce(kg,"radiansToLength");function dh(r,e="kilometers"){let t=Dg[e];if(!t)throw new Error(e+" units is invalid");return r/t}c(dh,"lengthToRadians");Ce(dh,"lengthToRadians");function oS(r,e){return Fg(dh(r,e))}c(oS,"lengthToDegrees");Ce(oS,"lengthToDegrees");function aS(r){let e=r%360;return e<0&&(e+=360),e}c(aS,"bearingToAzimuth");Ce(aS,"bearingToAzimuth");function Fg(r){return r%(2*Math.PI)*180/Math.PI}c(Fg,"radiansToDegrees");Ce(Fg,"radiansToDegrees");function sS(r){return r%360*Math.PI/180}c(sS,"degreesToRadians");Ce(sS,"degreesToRadians");function lS(r,e="kilometers",t="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return kg(dh(r,e),t)}c(lS,"convertLength");Ce(lS,"convertLength");function cS(r,e="meters",t="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");let i=_g[e];if(!i)throw new Error("invalid original units");let n=_g[t];if(!n)throw new Error("invalid final units");return r/i*n}c(cS,"convertArea");Ce(cS,"convertArea");function yc(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}c(yc,"isNumber");Ce(yc,"isNumber");function uS(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}c(uS,"isObject");Ce(uS,"isObject");function pS(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(e=>{if(!yc(e))throw new Error("bbox must only contain numbers")})}c(pS,"validateBBox");Ce(pS,"validateBBox");function dS(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")}c(dS,"validateId");Ce(dS,"validateId");ve.GeojsonEquality=kw;ve.areaFactors=_g;ve.bearingToAzimuth=aS;ve.convertArea=cS;ve.convertLength=lS;ve.degreesToRadians=sS;ve.earthRadius=Bt;ve.factors=Dg;ve.feature=qi;ve.featureCollection=vc;ve.geometry=Qx;ve.geometryCollection=iS;ve.isNumber=yc;ve.isObject=uS;ve.lengthToDegrees=oS;ve.lengthToRadians=dh;ve.lineString=ph;ve.lineStrings=rS;ve.multiLineString=Og;ve.multiPoint=Lg;ve.multiPolygon=Ag;ve.point=ch;ve.points=eS;ve.polygon=uh;ve.polygons=tS;ve.radiansToDegrees=Fg;ve.radiansToLength=kg;ve.round=nS;ve.validateBBox=pS;ve.validateId=dS});var TS=N(Qe=>{"use strict";m();Object.defineProperty(Qe,"__esModule",{value:!0});var Fw=Object.defineProperty,st=c((r,e)=>Fw(r,"name",{value:e,configurable:!0}),"__name"),ut=hS();function cs(r,e,t){if(r!==null)for(var i,n,o,a,u,l,p,h=0,y=0,g,v=r.type,S=v==="FeatureCollection",T=v==="Feature",b=S?r.features.length:1,x=0;x<b;x++){p=S?r.features[x].geometry:T?r.geometry:r,g=p?p.type==="GeometryCollection":!1,u=g?p.geometries.length:1;for(var I=0;I<u;I++){var E=0,w=0;if(a=g?p.geometries[I]:p,a!==null){l=a.coordinates;var _=a.type;switch(h=t&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(e(l,y,x,E,w)===!1)return!1;y++,E++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(e(l[i],y,x,E,w)===!1)return!1;y++,_==="MultiPoint"&&E++}_==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-h;n++){if(e(l[i][n],y,x,E,w)===!1)return!1;y++}_==="MultiLineString"&&E++,_==="Polygon"&&w++}_==="Polygon"&&E++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-h;o++){if(e(l[i][n][o],y,x,E,w)===!1)return!1;y++}w++}E++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(cs(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}c(cs,"coordEach");st(cs,"coordEach");function fS(r,e,t,i){var n=t;return cs(r,function(o,a,u,l,p){a===0&&t===void 0?n=o:n=e(n,o,a,u,l,p)},i),n}c(fS,"coordReduce");st(fS,"coordReduce");function Bg(r,e){var t;switch(r.type){case"FeatureCollection":for(t=0;t<r.features.length&&e(r.features[t].properties,t)!==!1;t++);break;case"Feature":e(r.properties,0);break}}c(Bg,"propEach");st(Bg,"propEach");function mS(r,e,t){var i=t;return Bg(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}c(mS,"propReduce");st(mS,"propReduce");function Rg(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}c(Rg,"featureEach");st(Rg,"featureEach");function yS(r,e,t){var i=t;return Rg(r,function(n,o){o===0&&t===void 0?i=n:i=e(i,n,o)}),i}c(yS,"featureReduce");st(yS,"featureReduce");function gS(r){var e=[];return cs(r,function(t){e.push(t)}),e}c(gS,"coordAll");st(gS,"coordAll");function hh(r,e){var t,i,n,o,a,u,l,p,h,y,g=0,v=r.type==="FeatureCollection",S=r.type==="Feature",T=v?r.features.length:1;for(t=0;t<T;t++){for(u=v?r.features[t].geometry:S?r.geometry:r,p=v?r.features[t].properties:S?r.properties:{},h=v?r.features[t].bbox:S?r.bbox:void 0,y=v?r.features[t].id:S?r.id:void 0,l=u?u.type==="GeometryCollection":!1,a=l?u.geometries.length:1,n=0;n<a;n++){if(o=l?u.geometries[n]:u,o===null){if(e(null,g,p,h,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,h,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,h,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}c(hh,"geomEach");st(hh,"geomEach");function vS(r,e,t){var i=t;return hh(r,function(n,o,a,u,l){o===0&&t===void 0?i=n:i=e(i,n,o,a,u,l)}),i}c(vS,"geomReduce");st(vS,"geomReduce");function bc(r,e){hh(r,function(t,i,n,o,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(ut.feature.call(void 0,t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(u){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var h=t.coordinates[p],y={type:l,coordinates:h};if(e(ut.feature.call(void 0,y,n),i,p)===!1)return!1}})}c(bc,"flattenEach");st(bc,"flattenEach");function bS(r,e,t){var i=t;return bc(r,function(n,o,a){o===0&&a===0&&t===void 0?i=n:i=e(i,n,o,a)}),i}c(bS,"flattenReduce");st(bS,"flattenReduce");function Ng(r,e){bc(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,l=0,p=0,h=0;if(cs(t,function(y,g,v,S,T){if(u===void 0||i>l||S>p||T>h){u=y,l=i,p=S,h=T,o=0;return}var b=ut.lineString.call(void 0,[u,y],t.properties);if(e(b,i,n,T,o)===!1)return!1;o++,u=y})===!1)return!1}}})}c(Ng,"segmentEach");st(Ng,"segmentEach");function CS(r,e,t){var i=t,n=!1;return Ng(r,function(o,a,u,l,p){n===!1&&t===void 0?i=o:i=e(i,o,a,u,l,p),n=!0}),i}c(CS,"segmentReduce");st(CS,"segmentReduce");function Gg(r,e){if(!r)throw new Error("geojson is required");bc(r,function(t,i,n){if(t.geometry!==null){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(e(t,i,n,0,0)===!1)return!1;break;case"Polygon":for(var u=0;u<a.length;u++)if(e(ut.lineString.call(void 0,a[u],t.properties),i,n,u)===!1)return!1;break}}})}c(Gg,"lineEach");st(Gg,"lineEach");function xS(r,e,t){var i=t;return Gg(r,function(n,o,a,u){o===0&&t===void 0?i=n:i=e(i,n,o,a,u)}),i}c(xS,"lineReduce");st(xS,"lineReduce");function SS(r,e){if(e=e||{},!ut.isObject.call(void 0,e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.segmentIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var l=u.coordinates;switch(u.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=l.length+o-1),ut.lineString.call(void 0,[l[o],l[o+1]],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),ut.lineString.call(void 0,[l[n][o],l[n][o+1]],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o-1),ut.lineString.call(void 0,[l[i][o],l[i][o+1]],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o-1),ut.lineString.call(void 0,[l[i][n][o],l[i][n][o+1]],a,e)}throw new Error("geojson is invalid")}c(SS,"findSegment");st(SS,"findSegment");function MS(r,e){if(e=e||{},!ut.isObject.call(void 0,e))throw new Error("options is invalid");var t=e.featureIndex||0,i=e.multiFeatureIndex||0,n=e.geometryIndex||0,o=e.coordIndex||0,a=e.properties,u;switch(r.type){case"FeatureCollection":t<0&&(t=r.features.length+t),a=a||r.features[t].properties,u=r.features[t].geometry;break;case"Feature":a=a||r.properties,u=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":u=r;break;default:throw new Error("geojson is invalid")}if(u===null)return null;var l=u.coordinates;switch(u.type){case"Point":return ut.point.call(void 0,l,a,e);case"MultiPoint":return i<0&&(i=l.length+i),ut.point.call(void 0,l[i],a,e);case"LineString":return o<0&&(o=l.length+o),ut.point.call(void 0,l[o],a,e);case"Polygon":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),ut.point.call(void 0,l[n][o],a,e);case"MultiLineString":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),ut.point.call(void 0,l[i][o],a,e);case"MultiPolygon":return i<0&&(i=l.length+i),n<0&&(n=l[i].length+n),o<0&&(o=l[i][n].length-o),ut.point.call(void 0,l[i][n][o],a,e)}throw new Error("geojson is invalid")}c(MS,"findPoint");st(MS,"findPoint");Qe.coordAll=gS;Qe.coordEach=cs;Qe.coordReduce=fS;Qe.featureEach=Rg;Qe.featureReduce=yS;Qe.findPoint=MS;Qe.findSegment=SS;Qe.flattenEach=bc;Qe.flattenReduce=bS;Qe.geomEach=hh;Qe.geomReduce=vS;Qe.lineEach=Gg;Qe.lineReduce=xS;Qe.propEach=Bg;Qe.propReduce=mS;Qe.segmentEach=Ng;Qe.segmentReduce=CS});var PS=N(fh=>{"use strict";m();Object.defineProperty(fh,"__esModule",{value:!0});var Bw=Object.defineProperty,Rw=c((r,e)=>Bw(r,"name",{value:e,configurable:!0}),"__name"),Nw=TS();function Vg(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;let t=[1/0,1/0,-1/0,-1/0];return Nw.coordEach.call(void 0,r,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}c(Vg,"bbox");Rw(Vg,"bbox");var Gw=Vg;fh.bbox=Vg;fh.default=Gw});var DS=N((Fj,jg)=>{m();var oi=T3(),wS=ly(),ES=k3(),us=PS().default,Vw=ES.featureEach,Aj=ES.coordEach,kj=wS.polygon,IS=wS.featureCollection;function _S(r){var e=new oi(r);return e.insert=function(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:us(t),oi.prototype.insert.call(this,t)},e.load=function(t){var i=[];return Array.isArray(t)?t.forEach(function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:us(n),i.push(n)}):Vw(t,function(n){if(n.type!=="Feature")throw new Error("invalid features");n.bbox=n.bbox?n.bbox:us(n),i.push(n)}),oi.prototype.load.call(this,i)},e.remove=function(t,i){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:us(t),oi.prototype.remove.call(this,t,i)},e.clear=function(){return oi.prototype.clear.call(this)},e.search=function(t){var i=oi.prototype.search.call(this,this.toBBox(t));return IS(i)},e.collides=function(t){return oi.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=oi.prototype.all.call(this);return IS(t)},e.toJSON=function(){return oi.prototype.toJSON.call(this)},e.fromJSON=function(t){return oi.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var i;if(t.bbox)i=t.bbox;else if(Array.isArray(t)&&t.length===4)i=t;else if(Array.isArray(t)&&t.length===6)i=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")i=us(t);else if(t.type==="FeatureCollection")i=us(t);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},e}c(_S,"geojsonRbush");jg.exports=_S;jg.exports.default=_S});var hv=N((xu,ul)=>{m();var Q_=200,d6="__lodash_hash_undefined__",eD=800,tD=16,h6=9007199254740991,f6="[object Arguments]",rD="[object Array]",iD="[object AsyncFunction]",nD="[object Boolean]",oD="[object Date]",aD="[object Error]",m6="[object Function]",sD="[object GeneratorFunction]",lD="[object Map]",cD="[object Number]",uD="[object Null]",y6="[object Object]",pD="[object Proxy]",dD="[object RegExp]",hD="[object Set]",fD="[object String]",mD="[object Undefined]",yD="[object WeakMap]",gD="[object ArrayBuffer]",vD="[object DataView]",bD="[object Float32Array]",CD="[object Float64Array]",xD="[object Int8Array]",SD="[object Int16Array]",MD="[object Int32Array]",TD="[object Uint8Array]",PD="[object Uint8ClampedArray]",ID="[object Uint16Array]",wD="[object Uint32Array]",ED=/[\\^$.*+?()[\]{}|]/g,_D=/^\[object .+?Constructor\]$/,DD=/^(?:0|[1-9]\d*)$/,De={};De[bD]=De[CD]=De[xD]=De[SD]=De[MD]=De[TD]=De[PD]=De[ID]=De[wD]=!0;De[f6]=De[rD]=De[gD]=De[nD]=De[vD]=De[oD]=De[aD]=De[m6]=De[lD]=De[cD]=De[y6]=De[dD]=De[hD]=De[fD]=De[yD]=!1;var g6=typeof global=="object"&&global&&global.Object===Object&&global,OD=typeof self=="object"&&self&&self.Object===Object&&self,Tu=g6||OD||Function("return this")(),v6=typeof xu=="object"&&xu&&!xu.nodeType&&xu,Su=v6&&typeof ul=="object"&&ul&&!ul.nodeType&&ul,b6=Su&&Su.exports===v6,rv=b6&&g6.process,i6=function(){try{var r=Su&&Su.require&&Su.require("util").types;return r||rv&&rv.binding&&rv.binding("util")}catch{}}(),n6=i6&&i6.isTypedArray;function C6(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}c(C6,"apply");function LD(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}c(LD,"baseTimes");function AD(r){return function(e){return r(e)}}c(AD,"baseUnary");function kD(r,e){return r==null?void 0:r[e]}c(kD,"getValue");function FD(r,e){return function(t){return r(e(t))}}c(FD,"overArg");var BD=Array.prototype,RD=Function.prototype,ff=Object.prototype,iv=Tu["__core-js_shared__"],mf=RD.toString,mn=ff.hasOwnProperty,o6=function(){var r=/[^.]+$/.exec(iv&&iv.keys&&iv.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),x6=ff.toString,ND=mf.call(Object),GD=RegExp("^"+mf.call(mn).replace(ED,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),df=b6?Tu.Buffer:void 0,a6=Tu.Symbol,s6=Tu.Uint8Array,l6=df?df.allocUnsafe:void 0,S6=FD(Object.getPrototypeOf,Object),c6=Object.create,VD=ff.propertyIsEnumerable,jD=BD.splice,ga=a6?a6.toStringTag:void 0,hf=function(){try{var r=uv(Object,"defineProperty");return r({},"",{}),r}catch{}}(),HD=df?df.isBuffer:void 0,u6=Math.max,UD=Date.now,M6=uv(Tu,"Map"),Mu=uv(Object,"create"),WD=function(){function r(){}return c(r,"object"),function(e){if(!fn(e))return{};if(c6)return c6(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function va(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}c(va,"Hash");function XD(){this.__data__=Mu?Mu(null):{},this.size=0}c(XD,"hashClear");function YD(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}c(YD,"hashDelete");function ZD(r){var e=this.__data__;if(Mu){var t=e[r];return t===d6?void 0:t}return mn.call(e,r)?e[r]:void 0}c(ZD,"hashGet");function zD(r){var e=this.__data__;return Mu?e[r]!==void 0:mn.call(e,r)}c(zD,"hashHas");function qD(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Mu&&e===void 0?d6:e,this}c(qD,"hashSet");va.prototype.clear=XD;va.prototype.delete=YD;va.prototype.get=ZD;va.prototype.has=zD;va.prototype.set=qD;function yn(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}c(yn,"ListCache");function $D(){this.__data__=[],this.size=0}c($D,"listCacheClear");function JD(r){var e=this.__data__,t=yf(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():jD.call(e,t,1),--this.size,!0}c(JD,"listCacheDelete");function KD(r){var e=this.__data__,t=yf(e,r);return t<0?void 0:e[t][1]}c(KD,"listCacheGet");function QD(r){return yf(this.__data__,r)>-1}c(QD,"listCacheHas");function eO(r,e){var t=this.__data__,i=yf(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}c(eO,"listCacheSet");yn.prototype.clear=$D;yn.prototype.delete=JD;yn.prototype.get=KD;yn.prototype.has=QD;yn.prototype.set=eO;function pl(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}c(pl,"MapCache");function tO(){this.size=0,this.__data__={hash:new va,map:new(M6||yn),string:new va}}c(tO,"mapCacheClear");function rO(r){var e=vf(this,r).delete(r);return this.size-=e?1:0,e}c(rO,"mapCacheDelete");function iO(r){return vf(this,r).get(r)}c(iO,"mapCacheGet");function nO(r){return vf(this,r).has(r)}c(nO,"mapCacheHas");function oO(r,e){var t=vf(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}c(oO,"mapCacheSet");pl.prototype.clear=tO;pl.prototype.delete=rO;pl.prototype.get=iO;pl.prototype.has=nO;pl.prototype.set=oO;function dl(r){var e=this.__data__=new yn(r);this.size=e.size}c(dl,"Stack");function aO(){this.__data__=new yn,this.size=0}c(aO,"stackClear");function sO(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}c(sO,"stackDelete");function lO(r){return this.__data__.get(r)}c(lO,"stackGet");function cO(r){return this.__data__.has(r)}c(cO,"stackHas");function uO(r,e){var t=this.__data__;if(t instanceof yn){var i=t.__data__;if(!M6||i.length<Q_-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new pl(i)}return t.set(r,e),this.size=t.size,this}c(uO,"stackSet");dl.prototype.clear=aO;dl.prototype.delete=sO;dl.prototype.get=lO;dl.prototype.has=cO;dl.prototype.set=uO;function pO(r,e){var t=sv(r),i=!t&&av(r),n=!t&&!i&&E6(r),o=!t&&!i&&!n&&D6(r),a=t||i||n||o,u=a?LD(r.length,String):[],l=u.length;for(var p in r)(e||mn.call(r,p))&&!(a&&(p=="length"||n&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||I6(p,l)))&&u.push(p);return u}c(pO,"arrayLikeKeys");function nv(r,e,t){(t!==void 0&&!bf(r[e],t)||t===void 0&&!(e in r))&&lv(r,e,t)}c(nv,"assignMergeValue");function dO(r,e,t){var i=r[e];(!(mn.call(r,e)&&bf(i,t))||t===void 0&&!(e in r))&&lv(r,e,t)}c(dO,"assignValue");function yf(r,e){for(var t=r.length;t--;)if(bf(r[t][0],e))return t;return-1}c(yf,"assocIndexOf");function lv(r,e,t){e=="__proto__"&&hf?hf(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}c(lv,"baseAssignValue");var hO=PO();function gf(r){return r==null?r===void 0?mD:uD:ga&&ga in Object(r)?IO(r):LO(r)}c(gf,"baseGetTag");function p6(r){return Pu(r)&&gf(r)==f6}c(p6,"baseIsArguments");function fO(r){if(!fn(r)||DO(r))return!1;var e=dv(r)?GD:_D;return e.test(BO(r))}c(fO,"baseIsNative");function mO(r){return Pu(r)&&_6(r.length)&&!!De[gf(r)]}c(mO,"baseIsTypedArray");function yO(r){if(!fn(r))return OO(r);var e=w6(r),t=[];for(var i in r)i=="constructor"&&(e||!mn.call(r,i))||t.push(i);return t}c(yO,"baseKeysIn");function cv(r,e,t,i,n){r!==e&&hO(e,function(o,a){if(n||(n=new dl),fn(o))gO(r,e,a,t,cv,i,n);else{var u=i?i(ov(r,a),o,a+"",r,e,n):void 0;u===void 0&&(u=o),nv(r,a,u)}},O6)}c(cv,"baseMerge");function gO(r,e,t,i,n,o,a){var u=ov(r,t),l=ov(e,t),p=a.get(l);if(p){nv(r,t,p);return}var h=o?o(u,l,t+"",r,e,a):void 0,y=h===void 0;if(y){var g=sv(l),v=!g&&E6(l),S=!g&&!v&&D6(l);h=l,g||v||S?sv(u)?h=u:RO(u)?h=SO(u):v?(y=!1,h=bO(l,!0)):S?(y=!1,h=xO(l,!0)):h=[]:NO(l)||av(l)?(h=u,av(u)?h=GO(u):(!fn(u)||dv(u))&&(h=wO(l))):y=!1}y&&(a.set(l,h),n(h,l,i,o,a),a.delete(l)),nv(r,t,h)}c(gO,"baseMergeDeep");function T6(r,e){return kO(AO(r,e,L6),r+"")}c(T6,"baseRest");var vO=hf?function(r,e){return hf(r,"toString",{configurable:!0,enumerable:!1,value:HO(e),writable:!0})}:L6;function bO(r,e){if(e)return r.slice();var t=r.length,i=l6?l6(t):new r.constructor(t);return r.copy(i),i}c(bO,"cloneBuffer");function CO(r){var e=new r.constructor(r.byteLength);return new s6(e).set(new s6(r)),e}c(CO,"cloneArrayBuffer");function xO(r,e){var t=e?CO(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}c(xO,"cloneTypedArray");function SO(r,e){var t=-1,i=r.length;for(e||(e=Array(i));++t<i;)e[t]=r[t];return e}c(SO,"copyArray");function MO(r,e,t,i){var n=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var u=e[o],l=i?i(t[u],r[u],u,t,r):void 0;l===void 0&&(l=r[u]),n?lv(t,u,l):dO(t,u,l)}return t}c(MO,"copyObject");function TO(r){return T6(function(e,t){var i=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=r.length>3&&typeof o=="function"?(n--,o):void 0,a&&EO(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++i<n;){var u=t[i];u&&r(e,u,i,o)}return e})}c(TO,"createAssigner");function PO(r){return function(e,t,i){for(var n=-1,o=Object(e),a=i(e),u=a.length;u--;){var l=a[r?u:++n];if(t(o[l],l,o)===!1)break}return e}}c(PO,"createBaseFor");function P6(r,e,t,i,n,o){return fn(r)&&fn(e)&&(o.set(e,r),cv(r,e,void 0,P6,o),o.delete(e)),r}c(P6,"customDefaultsMerge");function vf(r,e){var t=r.__data__;return _O(e)?t[typeof e=="string"?"string":"hash"]:t.map}c(vf,"getMapData");function uv(r,e){var t=kD(r,e);return fO(t)?t:void 0}c(uv,"getNative");function IO(r){var e=mn.call(r,ga),t=r[ga];try{r[ga]=void 0;var i=!0}catch{}var n=x6.call(r);return i&&(e?r[ga]=t:delete r[ga]),n}c(IO,"getRawTag");function wO(r){return typeof r.constructor=="function"&&!w6(r)?WD(S6(r)):{}}c(wO,"initCloneObject");function I6(r,e){var t=typeof r;return e=e==null?h6:e,!!e&&(t=="number"||t!="symbol"&&DD.test(r))&&r>-1&&r%1==0&&r<e}c(I6,"isIndex");function EO(r,e,t){if(!fn(t))return!1;var i=typeof e;return(i=="number"?pv(t)&&I6(e,t.length):i=="string"&&e in t)?bf(t[e],r):!1}c(EO,"isIterateeCall");function _O(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}c(_O,"isKeyable");function DO(r){return!!o6&&o6 in r}c(DO,"isMasked");function w6(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||ff;return r===t}c(w6,"isPrototype");function OO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}c(OO,"nativeKeysIn");function LO(r){return x6.call(r)}c(LO,"objectToString");function AO(r,e,t){return e=u6(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,o=u6(i.length-e,0),a=Array(o);++n<o;)a[n]=i[e+n];n=-1;for(var u=Array(e+1);++n<e;)u[n]=i[n];return u[e]=t(a),C6(r,this,u)}}c(AO,"overRest");function ov(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}c(ov,"safeGet");var kO=FO(vO);function FO(r){var e=0,t=0;return function(){var i=UD(),n=tD-(i-t);if(t=i,n>0){if(++e>=eD)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}c(FO,"shortOut");function BO(r){if(r!=null){try{return mf.call(r)}catch{}try{return r+""}catch{}}return""}c(BO,"toSource");function bf(r,e){return r===e||r!==r&&e!==e}c(bf,"eq");var av=p6(function(){return arguments}())?p6:function(r){return Pu(r)&&mn.call(r,"callee")&&!VD.call(r,"callee")},sv=Array.isArray;function pv(r){return r!=null&&_6(r.length)&&!dv(r)}c(pv,"isArrayLike");function RO(r){return Pu(r)&&pv(r)}c(RO,"isArrayLikeObject");var E6=HD||UO;function dv(r){if(!fn(r))return!1;var e=gf(r);return e==m6||e==sD||e==iD||e==pD}c(dv,"isFunction");function _6(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=h6}c(_6,"isLength");function fn(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}c(fn,"isObject");function Pu(r){return r!=null&&typeof r=="object"}c(Pu,"isObjectLike");function NO(r){if(!Pu(r)||gf(r)!=y6)return!1;var e=S6(r);if(e===null)return!0;var t=mn.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&mf.call(t)==ND}c(NO,"isPlainObject");var D6=n6?AD(n6):mO;function GO(r){return MO(r,O6(r))}c(GO,"toPlainObject");var VO=T6(function(r){return r.push(void 0,P6),C6(jO,void 0,r)});function O6(r){return pv(r)?pO(r,!0):yO(r)}c(O6,"keysIn");var jO=TO(function(r,e,t,i){cv(r,e,t,i)});function HO(r){return function(){return r}}c(HO,"constant");function L6(r){return r}c(L6,"identity");function UO(){return!1}c(UO,"stubFalse");ul.exports=VO});var _M=N((mte,Bu)=>{"use strict";m();var hL=!1,Pa=!1,SM=!0,MM=!1,f={},TM=!1;typeof Bu<"u"&&Bu.exports?(Bu.exports=f,TM=!0):typeof document<"u"?window.ClipperLib=f:self.ClipperLib=f;var kf;TM?(nt="chrome",kf="Netscape"):(nt=navigator.userAgent.toString().toLowerCase(),kf=navigator.appName);var nt,pe={};nt.indexOf("chrome")!=-1&&nt.indexOf("chromium")==-1?pe.chrome=1:pe.chrome=0;nt.indexOf("chromium")!=-1?pe.chromium=1:pe.chromium=0;nt.indexOf("safari")!=-1&&nt.indexOf("chrome")==-1&&nt.indexOf("chromium")==-1?pe.safari=1:pe.safari=0;nt.indexOf("firefox")!=-1?pe.firefox=1:pe.firefox=0;nt.indexOf("firefox/17")!=-1?pe.firefox17=1:pe.firefox17=0;nt.indexOf("firefox/15")!=-1?pe.firefox15=1:pe.firefox15=0;nt.indexOf("firefox/3")!=-1?pe.firefox3=1:pe.firefox3=0;nt.indexOf("opera")!=-1?pe.opera=1:pe.opera=0;nt.indexOf("msie 10")!=-1?pe.msie10=1:pe.msie10=0;nt.indexOf("msie 9")!=-1?pe.msie9=1:pe.msie9=0;nt.indexOf("msie 8")!=-1?pe.msie8=1:pe.msie8=0;nt.indexOf("msie 7")!=-1?pe.msie7=1:pe.msie7=0;nt.indexOf("msie ")!=-1?pe.msie=1:pe.msie=0;f.biginteger_used=null;var co,fL=0xdeadbeefcafe,CM=(fL&16777215)==15715070;function F(r,e,t){f.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof e>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}c(F,"BigInteger");function fe(){return new F(null)}c(fe,"nbi");function mL(r,e,t,i,n,o){for(;--o>=0;){var a=e*this[r++]+t[i]+n;n=Math.floor(a/67108864),t[i++]=a&67108863}return n}c(mL,"am1");function yL(r,e,t,i,n,o){for(var a=e&32767,u=e>>15;--o>=0;){var l=this[r]&32767,p=this[r++]>>15,h=u*l+p*a;l=a*l+((h&32767)<<15)+t[i]+(n&1073741823),n=(l>>>30)+(h>>>15)+u*p+(n>>>30),t[i++]=l&1073741823}return n}c(yL,"am2");function gL(r,e,t,i,n,o){for(var a=e&16383,u=e>>14;--o>=0;){var l=this[r]&16383,p=this[r++]>>14,h=u*l+p*a;l=a*l+((h&16383)<<14)+t[i]+n,n=(l>>28)+(h>>14)+u*p,t[i++]=l&268435455}return n}c(gL,"am3");CM&&kf=="Microsoft Internet Explorer"?(F.prototype.am=yL,co=30):CM&&kf!="Netscape"?(F.prototype.am=mL,co=26):(F.prototype.am=gL,co=28);F.prototype.DB=co;F.prototype.DM=(1<<co)-1;F.prototype.DV=1<<co;var Hv=52;F.prototype.FV=Math.pow(2,Hv);F.prototype.F1=Hv-co;F.prototype.F2=2*co-Hv;var vL="0123456789abcdefghijklmnopqrstuvwxyz",Bf=new Array,ml,Sr;ml=48;for(Sr=0;Sr<=9;++Sr)Bf[ml++]=Sr;ml=97;for(Sr=10;Sr<36;++Sr)Bf[ml++]=Sr;ml=65;for(Sr=10;Sr<36;++Sr)Bf[ml++]=Sr;function xM(r){return vL.charAt(r)}c(xM,"int2char");function PM(r,e){var t=Bf[r.charCodeAt(e)];return t==null?-1:t}c(PM,"intAt");function bL(r){for(var e=this.t-1;e>=0;--e)r[e]=this[e];r.t=this.t,r.s=this.s}c(bL,"bnpCopyTo");function CL(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}c(CL,"bnpFromInt");function lo(r){var e=fe();return e.fromInt(r),e}c(lo,"nbv");function xL(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var i=r.length,n=!1,o=0;--i>=0;){var a=t==8?r[i]&255:PM(r,i);if(a<0){r.charAt(i)=="-"&&(n=!0);continue}n=!1,o==0?this[this.t++]=a:o+t>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=t,o>=this.DB&&(o-=this.DB)}t==8&&r[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),n&&F.ZERO.subTo(this,this)}c(xL,"bnpFromString");function SL(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}c(SL,"bnpClamp");function ML(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<<e)-1,i,n=!1,o="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(i=this[a]>>u)>0&&(n=!0,o=xM(i));a>=0;)u<e?(i=(this[a]&(1<<u)-1)<<e-u,i|=this[--a]>>(u+=this.DB-e)):(i=this[a]>>(u-=e)&t,u<=0&&(u+=this.DB,--a)),i>0&&(n=!0),n&&(o+=xM(i));return n?o:"0"}c(ML,"bnToString");function TL(){var r=fe();return F.ZERO.subTo(this,r),r}c(TL,"bnNegate");function PL(){return this.s<0?this.negate():this}c(PL,"bnAbs");function IL(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this[t]-r[t])!=0)return e;return 0}c(IL,"bnCompareTo");function Rf(r){var e=1,t;return(t=r>>>16)!=0&&(r=t,e+=16),(t=r>>8)!=0&&(r=t,e+=8),(t=r>>4)!=0&&(r=t,e+=4),(t=r>>2)!=0&&(r=t,e+=2),(t=r>>1)!=0&&(r=t,e+=1),e}c(Rf,"nbits");function wL(){return this.t<=0?0:this.DB*(this.t-1)+Rf(this[this.t-1]^this.s&this.DM)}c(wL,"bnBitLength");function EL(r,e){var t;for(t=this.t-1;t>=0;--t)e[t+r]=this[t];for(t=r-1;t>=0;--t)e[t]=0;e.t=this.t+r,e.s=this.s}c(EL,"bnpDLShiftTo");function _L(r,e){for(var t=r;t<this.t;++t)e[t-r]=this[t];e.t=Math.max(this.t-r,0),e.s=this.s}c(_L,"bnpDRShiftTo");function DL(r,e){var t=r%this.DB,i=this.DB-t,n=(1<<i)-1,o=Math.floor(r/this.DB),a=this.s<<t&this.DM,u;for(u=this.t-1;u>=0;--u)e[u+o+1]=this[u]>>i|a,a=(this[u]&n)<<t;for(u=o-1;u>=0;--u)e[u]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}c(DL,"bnpLShiftTo");function OL(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var i=r%this.DB,n=this.DB-i,o=(1<<i)-1;e[0]=this[t]>>i;for(var a=t+1;a<this.t;++a)e[a-t-1]|=(this[a]&o)<<n,e[a-t]=this[a]>>i;i>0&&(e[this.t-t-1]|=(this.s&o)<<n),e.t=this.t-t,e.clamp()}c(OL,"bnpRShiftTo");function LL(r,e){for(var t=0,i=0,n=Math.min(r.t,this.t);t<n;)i+=this[t]-r[t],e[t++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i-=r.s;t<this.t;)i+=this[t],e[t++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t<r.t;)i-=r[t],e[t++]=i&this.DM,i>>=this.DB;i-=r.s}e.s=i<0?-1:0,i<-1?e[t++]=this.DV+i:i>0&&(e[t++]=i),e.t=t,e.clamp()}c(LL,"bnpSubTo");function AL(r,e){var t=this.abs(),i=r.abs(),n=t.t;for(e.t=n+i.t;--n>=0;)e[n]=0;for(n=0;n<i.t;++n)e[n+t.t]=t.am(0,i[n],e,n,0,t.t);e.s=0,e.clamp(),this.s!=r.s&&F.ZERO.subTo(e,e)}c(AL,"bnpMultiplyTo");function kL(r){for(var e=this.abs(),t=r.t=2*e.t;--t>=0;)r[t]=0;for(t=0;t<e.t-1;++t){var i=e.am(t,e[t],r,2*t,0,1);(r[t+e.t]+=e.am(t+1,2*e[t],r,2*t+1,i,e.t-t-1))>=e.DV&&(r[t+e.t]-=e.DV,r[t+e.t+1]=1)}r.t>0&&(r[r.t-1]+=e.am(t,e[t],r,2*t,0,1)),r.s=0,r.clamp()}c(kL,"bnpSquareTo");function FL(r,e,t){var i=r.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t){e!=null&&e.fromInt(0),t!=null&&this.copyTo(t);return}t==null&&(t=fe());var o=fe(),a=this.s,u=r.s,l=this.DB-Rf(i[i.t-1]);l>0?(i.lShiftTo(l,o),n.lShiftTo(l,t)):(i.copyTo(o),n.copyTo(t));var p=o.t,h=o[p-1];if(h!=0){var y=h*(1<<this.F1)+(p>1?o[p-2]>>this.F2:0),g=this.FV/y,v=(1<<this.F1)/y,S=1<<this.F2,T=t.t,b=T-p,x=e==null?fe():e;for(o.dlShiftTo(b,x),t.compareTo(x)>=0&&(t[t.t++]=1,t.subTo(x,t)),F.ONE.dlShiftTo(p,x),x.subTo(o,o);o.t<p;)o[o.t++]=0;for(;--b>=0;){var I=t[--T]==h?this.DM:Math.floor(t[T]*g+(t[T-1]+S)*v);if((t[T]+=o.am(0,I,t,b,0,p))<I)for(o.dlShiftTo(b,x),t.subTo(x,t);t[T]<--I;)t.subTo(x,t)}e!=null&&(t.drShiftTo(p,e),a!=u&&F.ZERO.subTo(e,e)),t.t=p,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&F.ZERO.subTo(t,t)}}}c(FL,"bnpDivRemTo");function BL(r){var e=fe();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(F.ZERO)>0&&r.subTo(e,e),e}c(BL,"bnMod");function Ia(r){this.m=r}c(Ia,"Classic");function RL(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}c(RL,"cConvert");function NL(r){return r}c(NL,"cRevert");function GL(r){r.divRemTo(this.m,null,r)}c(GL,"cReduce");function VL(r,e,t){r.multiplyTo(e,t),this.reduce(t)}c(VL,"cMulTo");function jL(r,e){r.squareTo(e),this.reduce(e)}c(jL,"cSqrTo");Ia.prototype.convert=RL;Ia.prototype.revert=NL;Ia.prototype.reduce=GL;Ia.prototype.mulTo=VL;Ia.prototype.sqrTo=jL;function HL(){if(this.t<1)return 0;var r=this[0];if(!(r&1))return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e}c(HL,"bnpInvDigit");function wa(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}c(wa,"Montgomery");function UL(r){var e=fe();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(F.ZERO)>0&&this.m.subTo(e,e),e}c(UL,"montConvert");function WL(r){var e=fe();return r.copyTo(e),this.reduce(e),e}c(WL,"montRevert");function XL(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var e=0;e<this.m.t;++e){var t=r[e]&32767,i=t*this.mpl+((t*this.mph+(r[e]>>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r[t]+=this.m.am(0,i,r,e,0,this.m.t);r[t]>=r.DV;)r[t]-=r.DV,r[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}c(XL,"montReduce");function YL(r,e){r.squareTo(e),this.reduce(e)}c(YL,"montSqrTo");function ZL(r,e,t){r.multiplyTo(e,t),this.reduce(t)}c(ZL,"montMulTo");wa.prototype.convert=UL;wa.prototype.revert=WL;wa.prototype.reduce=XL;wa.prototype.mulTo=ZL;wa.prototype.sqrTo=YL;function zL(){return(this.t>0?this[0]&1:this.s)==0}c(zL,"bnpIsEven");function qL(r,e){if(r>4294967295||r<1)return F.ONE;var t=fe(),i=fe(),n=e.convert(this),o=Rf(r)-1;for(n.copyTo(t);--o>=0;)if(e.sqrTo(t,i),(r&1<<o)>0)e.mulTo(i,n,t);else{var a=t;t=i,i=a}return e.revert(t)}c(qL,"bnpExp");function $L(r,e){var t;return r<256||e.isEven()?t=new Ia(e):t=new wa(e),this.exp(r,t)}c($L,"bnModPowInt");F.prototype.copyTo=bL;F.prototype.fromInt=CL;F.prototype.fromString=xL;F.prototype.clamp=SL;F.prototype.dlShiftTo=EL;F.prototype.drShiftTo=_L;F.prototype.lShiftTo=DL;F.prototype.rShiftTo=OL;F.prototype.subTo=LL;F.prototype.multiplyTo=AL;F.prototype.squareTo=kL;F.prototype.divRemTo=FL;F.prototype.invDigit=HL;F.prototype.isEven=zL;F.prototype.exp=qL;F.prototype.toString=ML;F.prototype.negate=TL;F.prototype.abs=PL;F.prototype.compareTo=IL;F.prototype.bitLength=wL;F.prototype.mod=BL;F.prototype.modPowInt=$L;F.ZERO=lo(0);F.ONE=lo(1);function JL(){var r=fe();return this.copyTo(r),r}c(JL,"bnClone");function KL(){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]}c(KL,"bnIntValue");function QL(){return this.t==0?this.s:this[0]<<24>>24}c(QL,"bnByteValue");function eA(){return this.t==0?this.s:this[0]<<16>>16}c(eA,"bnShortValue");function tA(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}c(tA,"bnpChunkSize");function rA(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}c(rA,"bnSigNum");function iA(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),i=lo(t),n=fe(),o=fe(),a="";for(this.divRemTo(i,n,o);n.signum()>0;)a=(t+o.intValue()).toString(r).substr(1)+a,n.divRemTo(i,n,o);return o.intValue().toString(r)+a}c(iA,"bnpToRadix");function nA(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),i=Math.pow(e,t),n=!1,o=0,a=0,u=0;u<r.length;++u){var l=PM(r,u);if(l<0){r.charAt(u)=="-"&&this.signum()==0&&(n=!0);continue}a=e*a+l,++o>=t&&(this.dMultiply(i),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),n&&F.ZERO.subTo(this,this)}c(nA,"bnpFromRadix");function oA(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(F.ONE.shiftLeft(r-1),Uv,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(F.ONE.shiftLeft(r-1),this);else{var i=new Array,n=r&7;i.length=(r>>3)+1,e.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}c(oA,"bnpFromNumber");function aA(){var r=this.t,e=new Array;e[0]=this.s;var t=this.DB-r*this.DB%8,i,n=0;if(r-- >0)for(t<this.DB&&(i=this[r]>>t)!=(this.s&this.DM)>>t&&(e[n++]=i|this.s<<this.DB-t);r>=0;)t<8?(i=(this[r]&(1<<t)-1)<<8-t,i|=this[--r]>>(t+=this.DB-8)):(i=this[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),i&128&&(i|=-256),n==0&&(this.s&128)!=(i&128)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e}c(aA,"bnToByteArray");function sA(r){return this.compareTo(r)==0}c(sA,"bnEquals");function lA(r){return this.compareTo(r)<0?this:r}c(lA,"bnMin");function cA(r){return this.compareTo(r)>0?this:r}c(cA,"bnMax");function uA(r,e,t){var i,n,o=Math.min(r.t,this.t);for(i=0;i<o;++i)t[i]=e(this[i],r[i]);if(r.t<this.t){for(n=r.s&this.DM,i=o;i<this.t;++i)t[i]=e(this[i],n);t.t=this.t}else{for(n=this.s&this.DM,i=o;i<r.t;++i)t[i]=e(n,r[i]);t.t=r.t}t.s=e(this.s,r.s),t.clamp()}c(uA,"bnpBitwiseTo");function pA(r,e){return r&e}c(pA,"op_and");function dA(r){var e=fe();return this.bitwiseTo(r,pA,e),e}c(dA,"bnAnd");function Uv(r,e){return r|e}c(Uv,"op_or");function hA(r){var e=fe();return this.bitwiseTo(r,Uv,e),e}c(hA,"bnOr");function IM(r,e){return r^e}c(IM,"op_xor");function fA(r){var e=fe();return this.bitwiseTo(r,IM,e),e}c(fA,"bnXor");function wM(r,e){return r&~e}c(wM,"op_andnot");function mA(r){var e=fe();return this.bitwiseTo(r,wM,e),e}c(mA,"bnAndNot");function yA(){for(var r=fe(),e=0;e<this.t;++e)r[e]=this.DM&~this[e];return r.t=this.t,r.s=~this.s,r}c(yA,"bnNot");function gA(r){var e=fe();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}c(gA,"bnShiftLeft");function vA(r){var e=fe();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}c(vA,"bnShiftRight");function bA(r){if(r==0)return-1;var e=0;return r&65535||(r>>=16,e+=16),r&255||(r>>=8,e+=8),r&15||(r>>=4,e+=4),r&3||(r>>=2,e+=2),r&1||++e,e}c(bA,"lbit");function CA(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+bA(this[r]);return this.s<0?this.t*this.DB:-1}c(CA,"bnGetLowestSetBit");function xA(r){for(var e=0;r!=0;)r&=r-1,++e;return e}c(xA,"cbit");function SA(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=xA(this[t]^e);return r}c(SA,"bnBitCount");function MA(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<r%this.DB)!=0}c(MA,"bnTestBit");function TA(r,e){var t=F.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}c(TA,"bnpChangeBit");function PA(r){return this.changeBit(r,Uv)}c(PA,"bnSetBit");function IA(r){return this.changeBit(r,wM)}c(IA,"bnClearBit");function wA(r){return this.changeBit(r,IM)}c(wA,"bnFlipBit");function EA(r,e){for(var t=0,i=0,n=Math.min(r.t,this.t);t<n;)i+=this[t]+r[t],e[t++]=i&this.DM,i>>=this.DB;if(r.t<this.t){for(i+=r.s;t<this.t;)i+=this[t],e[t++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t<r.t;)i+=r[t],e[t++]=i&this.DM,i>>=this.DB;i+=r.s}e.s=i<0?-1:0,i>0?e[t++]=i:i<-1&&(e[t++]=this.DV+i),e.t=t,e.clamp()}c(EA,"bnpAddTo");function _A(r){var e=fe();return this.addTo(r,e),e}c(_A,"bnAdd");function DA(r){var e=fe();return this.subTo(r,e),e}c(DA,"bnSubtract");function OA(r){var e=fe();return this.multiplyTo(r,e),e}c(OA,"bnMultiply");function LA(){var r=fe();return this.squareTo(r),r}c(LA,"bnSquare");function AA(r){var e=fe();return this.divRemTo(r,e,null),e}c(AA,"bnDivide");function kA(r){var e=fe();return this.divRemTo(r,null,e),e}c(kA,"bnRemainder");function FA(r){var e=fe(),t=fe();return this.divRemTo(r,e,t),new Array(e,t)}c(FA,"bnDivideAndRemainder");function BA(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}c(BA,"bnpDMultiply");function RA(r,e){if(r!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=r;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}c(RA,"bnpDAddOffset");function Ru(){}c(Ru,"NullExp");function EM(r){return r}c(EM,"nNop");function NA(r,e,t){r.multiplyTo(e,t)}c(NA,"nMulTo");function GA(r,e){r.squareTo(e)}c(GA,"nSqrTo");Ru.prototype.convert=EM;Ru.prototype.revert=EM;Ru.prototype.mulTo=NA;Ru.prototype.sqrTo=GA;function VA(r){return this.exp(r,new Ru)}c(VA,"bnPow");function jA(r,e,t){var i=Math.min(this.t+r.t,e);for(t.s=0,t.t=i;i>0;)t[--i]=0;var n;for(n=t.t-this.t;i<n;++i)t[i+this.t]=this.am(0,r[i],t,i,0,this.t);for(n=Math.min(r.t,e);i<n;++i)this.am(0,r[i],t,i,0,e-i);t.clamp()}c(jA,"bnpMultiplyLowerTo");function HA(r,e,t){--e;var i=t.t=this.t+r.t-e;for(t.s=0;--i>=0;)t[i]=0;for(i=Math.max(e-this.t,0);i<r.t;++i)t[this.t+i-e]=this.am(e-i,r[i],t,0,0,this.t+i-e);t.clamp(),t.drShiftTo(1,t)}c(HA,"bnpMultiplyUpperTo");function yl(r){this.r2=fe(),this.q3=fe(),F.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}c(yl,"Barrett");function UA(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 e=fe();return r.copyTo(e),this.reduce(e),e}c(UA,"barrettConvert");function WA(r){return r}c(WA,"barrettRevert");function XA(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)}c(XA,"barrettReduce");function YA(r,e){r.squareTo(e),this.reduce(e)}c(YA,"barrettSqrTo");function ZA(r,e,t){r.multiplyTo(e,t),this.reduce(t)}c(ZA,"barrettMulTo");yl.prototype.convert=UA;yl.prototype.revert=WA;yl.prototype.reduce=XA;yl.prototype.mulTo=ZA;yl.prototype.sqrTo=YA;function zA(r,e){var t=r.bitLength(),i,n=lo(1),o;if(t<=0)return n;t<18?i=1:t<48?i=3:t<144?i=4:t<768?i=5:i=6,t<8?o=new Ia(e):e.isEven()?o=new yl(e):o=new wa(e);var a=new Array,u=3,l=i-1,p=(1<<i)-1;if(a[1]=o.convert(this),i>1){var h=fe();for(o.sqrTo(a[1],h);u<=p;)a[u]=fe(),o.mulTo(h,a[u-2],a[u]),u+=2}var y=r.t-1,g,v=!0,S=fe(),T;for(t=Rf(r[y])-1;y>=0;){for(t>=l?g=r[y]>>t-l&p:(g=(r[y]&(1<<t+1)-1)<<l-t,y>0&&(g|=r[y-1]>>this.DB+t-l)),u=i;!(g&1);)g>>=1,--u;if((t-=u)<0&&(t+=this.DB,--y),v)a[g].copyTo(n),v=!1;else{for(;u>1;)o.sqrTo(n,S),o.sqrTo(S,n),u-=2;u>0?o.sqrTo(n,S):(T=n,n=S,S=T),o.mulTo(S,a[g],n)}for(;y>=0&&!(r[y]&1<<t);)o.sqrTo(n,S),T=n,n=S,S=T,--t<0&&(t=this.DB-1,--y)}return o.revert(n)}c(zA,"bnModPow");function qA(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var i=e;e=t,t=i}var n=e.getLowestSetBit(),o=t.getLowestSetBit();if(o<0)return e;for(n<o&&(o=n),o>0&&(e.rShiftTo(o,e),t.rShiftTo(o,t));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return o>0&&t.lShiftTo(o,t),t}c(qA,"bnGCD");function $A(r){if(r<=0)return 0;var e=this.DV%r,t=this.s<0?r-1:0;if(this.t>0)if(e==0)t=this[0]%r;else for(var i=this.t-1;i>=0;--i)t=(e*t+this[i])%r;return t}c($A,"bnpModInt");function JA(r){var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return F.ZERO;for(var t=r.clone(),i=this.clone(),n=lo(1),o=lo(0),a=lo(0),u=lo(1);t.signum()!=0;){for(;t.isEven();)t.rShiftTo(1,t),e?((!n.isEven()||!o.isEven())&&(n.addTo(this,n),o.subTo(r,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(r,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),e?((!a.isEven()||!u.isEven())&&(a.addTo(this,a),u.subTo(r,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(r,u),u.rShiftTo(1,u);t.compareTo(i)>=0?(t.subTo(i,t),e&&n.subTo(a,n),o.subTo(u,o)):(i.subTo(t,i),e&&a.subTo(n,a),u.subTo(o,u))}if(i.compareTo(F.ONE)!=0)return F.ZERO;if(u.compareTo(r)>=0)return u.subtract(r);if(u.signum()<0)u.addTo(r,u);else return u;return u.signum()<0?u.add(r):u}c(JA,"bnModInverse");var It=[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],KA=(1<<26)/It[It.length-1];function QA(r){var e,t=this.abs();if(t.t==1&&t[0]<=It[It.length-1]){for(e=0;e<It.length;++e)if(t[0]==It[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<It.length;){for(var i=It[e],n=e+1;n<It.length&&i<KA;)i*=It[n++];for(i=t.modInt(i);e<n;)if(i%It[e++]==0)return!1}return t.millerRabin(r)}c(QA,"bnIsProbablePrime");function ek(r){var e=this.subtract(F.ONE),t=e.getLowestSetBit();if(t<=0)return!1;var i=e.shiftRight(t);r=r+1>>1,r>It.length&&(r=It.length);for(var n=fe(),o=0;o<r;++o){n.fromInt(It[Math.floor(Math.random()*It.length)]);var a=n.modPow(i,this);if(a.compareTo(F.ONE)!=0&&a.compareTo(e)!=0){for(var u=1;u++<t&&a.compareTo(e)!=0;)if(a=a.modPowInt(2,this),a.compareTo(F.ONE)==0)return!1;if(a.compareTo(e)!=0)return!1}}return!0}c(ek,"bnpMillerRabin");F.prototype.chunkSize=tA;F.prototype.toRadix=iA;F.prototype.fromRadix=nA;F.prototype.fromNumber=oA;F.prototype.bitwiseTo=uA;F.prototype.changeBit=TA;F.prototype.addTo=EA;F.prototype.dMultiply=BA;F.prototype.dAddOffset=RA;F.prototype.multiplyLowerTo=jA;F.prototype.multiplyUpperTo=HA;F.prototype.modInt=$A;F.prototype.millerRabin=ek;F.prototype.clone=JL;F.prototype.intValue=KL;F.prototype.byteValue=QL;F.prototype.shortValue=eA;F.prototype.signum=rA;F.prototype.toByteArray=aA;F.prototype.equals=sA;F.prototype.min=lA;F.prototype.max=cA;F.prototype.and=dA;F.prototype.or=hA;F.prototype.xor=fA;F.prototype.andNot=mA;F.prototype.not=yA;F.prototype.shiftLeft=gA;F.prototype.shiftRight=vA;F.prototype.getLowestSetBit=CA;F.prototype.bitCount=SA;F.prototype.testBit=MA;F.prototype.setBit=PA;F.prototype.clearBit=IA;F.prototype.flipBit=wA;F.prototype.add=_A;F.prototype.subtract=DA;F.prototype.multiply=OA;F.prototype.divide=AA;F.prototype.remainder=kA;F.prototype.divideAndRemainder=FA;F.prototype.modPow=zA;F.prototype.modInverse=JA;F.prototype.pow=VA;F.prototype.gcd=qA;F.prototype.isProbablePrime=QA;F.prototype.square=LA;var ue=F;ue.prototype.IsNegative=function(){return this.compareTo(ue.ZERO)==-1};ue.op_Equality=function(r,e){return r.compareTo(e)==0};ue.op_Inequality=function(r,e){return r.compareTo(e)!=0};ue.op_GreaterThan=function(r,e){return r.compareTo(e)>0};ue.op_LessThan=function(r,e){return r.compareTo(e)<0};ue.op_Addition=function(r,e){return new ue(r).add(new ue(e))};ue.op_Subtraction=function(r,e){return new ue(r).subtract(new ue(e))};ue.Int128Mul=function(r,e){return new ue(r).multiply(new ue(e))};ue.op_Division=function(r,e){return r.divide(e)};ue.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof Ff>"u"&&(Ff=c(function(r,e){var t;if(typeof Object.getOwnPropertyNames>"u"){for(t in e.prototype)(typeof r.prototype[t]>"u"||r.prototype[t]==Object.prototype[t])&&(r.prototype[t]=e.prototype[t]);for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}else{for(var i=Object.getOwnPropertyNames(e.prototype),n=0;n<i.length;n++)typeof Object.getOwnPropertyDescriptor(r.prototype,i[n])>"u"&&Object.defineProperty(r.prototype,i[n],Object.getOwnPropertyDescriptor(e.prototype,i[n]));for(t in e)typeof r[t]>"u"&&(r[t]=e[t]);r.$baseCtor=e}},"Inherit"));var Ff;f.Path=function(){return[]};f.Paths=function(){return[]};f.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])};f.DoublePoint0=function(){this.X=0,this.Y=0};f.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};f.DoublePoint2=function(r,e){this.X=r,this.Y=e};f.PolyNode=function(){this.m_Parent=null,this.m_polygon=new f.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};f.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,e=this.m_Parent;e!==null;)r=!r,e=e.m_Parent;return r};f.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};f.PolyNode.prototype.Contour=function(){return this.m_polygon};f.PolyNode.prototype.AddChild=function(r){var e=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=e};f.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};f.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]};f.PolyNode.prototype.Childs=function(){return this.m_Childs};f.PolyNode.prototype.Parent=function(){return this.m_Parent};f.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};f.PolyTree=function(){this.m_AllPolys=[],f.PolyNode.call(this)};f.PolyTree.prototype.Clear=function(){for(var r=0,e=this.m_AllPolys.length;r<e;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};f.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};f.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};Ff(f.PolyTree,f.PolyNode);f.Math_Abs_Int64=f.Math_Abs_Int32=f.Math_Abs_Double=function(r){return Math.abs(r)};f.Math_Max_Int32_Int32=function(r,e){return Math.max(r,e)};pe.msie||pe.opera||pe.safari?f.Cast_Int32=function(r){return r|0}:f.Cast_Int32=function(r){return~~r};pe.chrome?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:pe.firefox&&typeof Number.toInteger=="function"?f.Cast_Int64=function(r){return Number.toInteger(r)}:pe.msie7||pe.msie8?f.Cast_Int64=function(r){return parseInt(r,10)}:pe.msie?f.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:f.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};f.Clear=function(r){r.length=0};f.PI=3.141592653589793;f.PI2=2*3.141592653589793;f.IntPoint=function(){var r=arguments,e=r.length;if(this.X=0,this.Y=0,Pa)if(this.Z=0,e==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(e==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(e==1)if(r[0]instanceof f.DoublePoint){var t=r[0];this.X=f.Clipper.Round(t.X),this.Y=f.Clipper.Round(t.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(e==2)this.X=r[0],this.Y=r[1];else if(e==1)if(r[0]instanceof f.DoublePoint){var t=r[0];this.X=f.Clipper.Round(t.X),this.Y=f.Clipper.Round(t.Y)}else{var i=r[0];this.X=i.X,this.Y=i.Y}else this.X=0,this.Y=0};f.IntPoint.op_Equality=function(r,e){return r.X==e.X&&r.Y==e.Y};f.IntPoint.op_Inequality=function(r,e){return r.X!=e.X||r.Y!=e.Y};Pa?(f.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y),this.Z=0},f.IntPoint2=function(r,e){this.X=r,this.Y=e,this.Z=0},f.IntPoint3=function(r,e,t){this.X=r,this.Y=e,this.Z=t}):(f.IntPoint0=function(){this.X=0,this.Y=0},f.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},f.IntPoint1dp=function(r){this.X=f.Clipper.Round(r.X),this.Y=f.Clipper.Round(r.Y)},f.IntPoint2=function(r,e){this.X=r,this.Y=e});f.IntRect=function(){var r=arguments,e=r.length;e==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):e==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)};f.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};f.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};f.IntRect4=function(r,e,t,i){this.left=r,this.top=e,this.right=t,this.bottom=i};f.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};f.PolyType={ptSubject:0,ptClip:1};f.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};f.JoinType={jtSquare:0,jtRound:1,jtMiter:2};f.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};MM&&(f.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});f.EdgeSide={esLeft:0,esRight:1};f.Direction={dRightToLeft:0,dLeftToRight:1};f.TEdge=function(){this.Bot=new f.IntPoint,this.Curr=new f.IntPoint,this.Top=new f.IntPoint,this.Delta=new f.IntPoint,this.Dx=0,this.PolyTyp=f.PolyType.ptSubject,this.Side=f.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};f.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new f.IntPoint};f.MyIntersectNodeSort=function(){};f.MyIntersectNodeSort.Compare=function(r,e){return e.Pt.Y-r.Pt.Y};f.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};f.Scanbeam=function(){this.Y=0,this.Next=null};f.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};f.OutPt=function(){this.Idx=0,this.Pt=new f.IntPoint,this.Next=null,this.Prev=null};f.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new f.IntPoint};f.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};f.ClipperBase.horizontal=-9007199254740992;f.ClipperBase.Skip=-2;f.ClipperBase.Unassigned=-1;f.ClipperBase.tolerance=1e-20;hL?(f.ClipperBase.loRange=46340,f.ClipperBase.hiRange=46340):(f.ClipperBase.loRange=47453132,f.ClipperBase.hiRange=0xfffffffffffff);f.ClipperBase.near_zero=function(r){return r>-f.ClipperBase.tolerance&&r<f.ClipperBase.tolerance};f.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};f.ClipperBase.prototype.PointIsVertex=function(r,e){var t=e;do{if(f.IntPoint.op_Equality(t.Pt,r))return!0;t=t.Next}while(t!=e);return!1};f.ClipperBase.prototype.PointOnLineSegment=function(r,e,t,i){return i?r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&ue.op_Equality(ue.Int128Mul(r.X-e.X,t.Y-e.Y),ue.Int128Mul(t.X-e.X,r.Y-e.Y)):r.X==e.X&&r.Y==e.Y||r.X==t.X&&r.Y==t.Y||r.X>e.X==r.X<t.X&&r.Y>e.Y==r.Y<t.Y&&(r.X-e.X)*(t.Y-e.Y)==(t.X-e.X)*(r.Y-e.Y)};f.ClipperBase.prototype.PointOnPolygon=function(r,e,t){for(var i=e;;){if(this.PointOnLineSegment(r,i.Pt,i.Next.Pt,t))return!0;if(i=i.Next,i==e)break}return!1};f.ClipperBase.prototype.SlopesEqual=f.ClipperBase.SlopesEqual=function(){var r=arguments,e=r.length,t,i,n,o,a,u,l;return e==3?(t=r[0],i=r[1],l=r[2],l?ue.op_Equality(ue.Int128Mul(t.Delta.Y,i.Delta.X),ue.Int128Mul(t.Delta.X,i.Delta.Y)):f.Cast_Int64(t.Delta.Y*i.Delta.X)==f.Cast_Int64(t.Delta.X*i.Delta.Y)):e==4?(n=r[0],o=r[1],a=r[2],l=r[3],l?ue.op_Equality(ue.Int128Mul(n.Y-o.Y,o.X-a.X),ue.Int128Mul(n.X-o.X,o.Y-a.Y)):f.Cast_Int64((n.Y-o.Y)*(o.X-a.X))-f.Cast_Int64((n.X-o.X)*(o.Y-a.Y))===0):(n=r[0],o=r[1],a=r[2],u=r[3],l=r[4],l?ue.op_Equality(ue.Int128Mul(n.Y-o.Y,a.X-u.X),ue.Int128Mul(n.X-o.X,a.Y-u.Y)):f.Cast_Int64((n.Y-o.Y)*(a.X-u.X))-f.Cast_Int64((n.X-o.X)*(a.Y-u.Y))===0)};f.ClipperBase.SlopesEqual3=function(r,e,t){return t?ue.op_Equality(ue.Int128Mul(r.Delta.Y,e.Delta.X),ue.Int128Mul(r.Delta.X,e.Delta.Y)):f.Cast_Int64(r.Delta.Y*e.Delta.X)==f.Cast_Int64(r.Delta.X*e.Delta.Y)};f.ClipperBase.SlopesEqual4=function(r,e,t,i){return i?ue.op_Equality(ue.Int128Mul(r.Y-e.Y,e.X-t.X),ue.Int128Mul(r.X-e.X,e.Y-t.Y)):f.Cast_Int64((r.Y-e.Y)*(e.X-t.X))-f.Cast_Int64((r.X-e.X)*(e.Y-t.Y))===0};f.ClipperBase.SlopesEqual5=function(r,e,t,i,n){return n?ue.op_Equality(ue.Int128Mul(r.Y-e.Y,t.X-i.X),ue.Int128Mul(r.X-e.X,t.Y-i.Y)):f.Cast_Int64((r.Y-e.Y)*(t.X-i.X))-f.Cast_Int64((r.X-e.X)*(t.Y-i.Y))===0};f.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,e=this.m_edges.length;r<e;++r){for(var t=0,i=this.m_edges[r].length;t<i;++t)this.m_edges[r][t]=null;f.Clear(this.m_edges[r])}f.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};f.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};f.ClipperBase.prototype.RangeTest=function(r,e){e.Value?(r.X>f.ClipperBase.hiRange||r.Y>f.ClipperBase.hiRange||-r.X>f.ClipperBase.hiRange||-r.Y>f.ClipperBase.hiRange)&&f.Error("Coordinate outside allowed range in RangeTest()."):(r.X>f.ClipperBase.loRange||r.Y>f.ClipperBase.loRange||-r.X>f.ClipperBase.loRange||-r.Y>f.ClipperBase.loRange)&&(e.Value=!0,this.RangeTest(r,e))};f.ClipperBase.prototype.InitEdge=function(r,e,t,i){r.Next=e,r.Prev=t,r.Curr.X=i.X,r.Curr.Y=i.Y,r.OutIdx=-1};f.ClipperBase.prototype.InitEdge2=function(r,e){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=e};f.ClipperBase.prototype.FindNextLocMin=function(r){for(var e;;){for(;f.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||f.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=f.ClipperBase.horizontal&&r.Prev.Dx!=f.ClipperBase.horizontal)break;for(;r.Prev.Dx==f.ClipperBase.horizontal;)r=r.Prev;for(e=r;r.Dx==f.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){e.Prev.Bot.X<r.Bot.X&&(r=e);break}}return r};f.ClipperBase.prototype.ProcessBound=function(r,e){var t=r,i=r,n,o;if(r.Dx==f.ClipperBase.horizontal&&(e?o=r.Prev.Bot.X:o=r.Next.Bot.X,r.Bot.X!=o&&this.ReverseHorizontal(r)),i.OutIdx!=f.ClipperBase.Skip)if(e){for(;i.Top.Y==i.Next.Bot.Y&&i.Next.OutIdx!=f.ClipperBase.Skip;)i=i.Next;if(i.Dx==f.ClipperBase.horizontal&&i.Next.OutIdx!=f.ClipperBase.Skip){for(n=i;n.Prev.Dx==f.ClipperBase.horizontal;)n=n.Prev;n.Prev.Top.X==i.Next.Top.X?e||(i=n.Prev):n.Prev.Top.X>i.Next.Top.X&&(i=n.Prev)}for(;r!=i;)r.NextInLML=r.Next,r.Dx==f.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==f.ClipperBase.horizontal&&r!=t&&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!=f.ClipperBase.Skip;)i=i.Prev;if(i.Dx==f.ClipperBase.horizontal&&i.Prev.OutIdx!=f.ClipperBase.Skip){for(n=i;n.Next.Dx==f.ClipperBase.horizontal;)n=n.Next;n.Next.Top.X==i.Prev.Top.X?e||(i=n.Next):n.Next.Top.X>i.Prev.Top.X&&(i=n.Next)}for(;r!=i;)r.NextInLML=r.Prev,r.Dx==f.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==f.ClipperBase.horizontal&&r!=t&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),i=i.Prev}if(i.OutIdx==f.ClipperBase.Skip){if(r=i,e){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=i&&r.Dx==f.ClipperBase.horizontal;)r=r.Next}if(r==i)e?i=r.Next:i=r.Prev;else{e?r=i.Next:r=i.Prev;var a=new f.LocalMinima;a.Next=null,a.Y=r.Bot.Y,a.LeftBound=null,a.RightBound=r,a.RightBound.WindDelta=0,i=this.ProcessBound(a.RightBound,e),this.InsertLocalMinima(a)}}return i};f.ClipperBase.prototype.AddPath=function(r,e,t){SM?!t&&e==f.PolyType.ptClip&&f.Error("AddPath: Open paths must be subject."):t||f.Error("AddPath: Open paths have been disabled.");var i=r.length-1;if(t)for(;i>0&&f.IntPoint.op_Equality(r[i],r[0]);)--i;for(;i>0&&f.IntPoint.op_Equality(r[i],r[i-1]);)--i;if(t&&i<2||!t&&i<1)return!1;for(var n=new Array,o=0;o<=i;o++)n.push(new f.TEdge);var a=!0;n[1].Curr.X=r[1].X,n[1].Curr.Y=r[1].Y;var u={Value:this.m_UseFullRange};this.RangeTest(r[0],u),this.m_UseFullRange=u.Value,u.Value=this.m_UseFullRange,this.RangeTest(r[i],u),this.m_UseFullRange=u.Value,this.InitEdge(n[0],n[1],n[i],r[0]),this.InitEdge(n[i],n[0],n[i-1],r[i]);for(var o=i-1;o>=1;--o)u.Value=this.m_UseFullRange,this.RangeTest(r[o],u),this.m_UseFullRange=u.Value,this.InitEdge(n[o],n[o+1],n[o-1],r[o]);for(var l=n[0],p=l,h=l;;){if(f.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(t&&f.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(!t&&p==p.Next||t&&p.Prev==p.Next)return!1;t||(this.m_HasOpenPaths=!0,l.Prev.OutIdx=f.ClipperBase.Skip);var y=l;p=l;do this.InitEdge2(p,e),p=p.Next,a&&p.Curr.Y!=l.Curr.Y&&(a=!1);while(p!=l);if(a){if(t)return!1;p.Prev.OutIdx=f.ClipperBase.Skip,p.Prev.Bot.X<p.Prev.Top.X&&this.ReverseHorizontal(p.Prev);var g=new f.LocalMinima;for(g.Next=null,g.Y=p.Bot.Y,g.LeftBound=null,g.RightBound=p,g.RightBound.Side=f.EdgeSide.esRight,g.RightBound.WindDelta=0;p.Next.OutIdx!=f.ClipperBase.Skip;)p.NextInLML=p.Next,p.Bot.X!=p.Prev.Top.X&&this.ReverseHorizontal(p),p=p.Next;return this.InsertLocalMinima(g),this.m_edges.push(n),!0}this.m_edges.push(n);for(var v,S=null;p=this.FindNextLocMin(p),p!=S;){S==null&&(S=p);var g=new f.LocalMinima;g.Next=null,g.Y=p.Bot.Y,p.Dx<p.Prev.Dx?(g.LeftBound=p.Prev,g.RightBound=p,v=!1):(g.LeftBound=p,g.RightBound=p.Prev,v=!0),g.LeftBound.Side=f.EdgeSide.esLeft,g.RightBound.Side=f.EdgeSide.esRight,t?g.LeftBound.Next==g.RightBound?g.LeftBound.WindDelta=-1:g.LeftBound.WindDelta=1:g.LeftBound.WindDelta=0,g.RightBound.WindDelta=-g.LeftBound.WindDelta,p=this.ProcessBound(g.LeftBound,v);var T=this.ProcessBound(g.RightBound,!v);g.LeftBound.OutIdx==f.ClipperBase.Skip?g.LeftBound=null:g.RightBound.OutIdx==f.ClipperBase.Skip&&(g.RightBound=null),this.InsertLocalMinima(g),v||(p=T)}return!0};f.ClipperBase.prototype.AddPaths=function(r,e,t){for(var i=!1,n=0,o=r.length;n<o;++n)this.AddPath(r[n],e,t)&&(i=!0);return i};f.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,e,t){return f.IntPoint.op_Equality(r,t)||f.IntPoint.op_Equality(r,e)||f.IntPoint.op_Equality(t,e)?!1:r.X!=t.X?e.X>r.X==e.X<t.X:e.Y>r.Y==e.Y<t.Y};f.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var e=r.Next;return r.Prev=null,e};f.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=f.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};f.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 e=this.m_MinimaList;e.Next!==null&&r.Y<e.Next.Y;)e=e.Next;r.Next=e.Next,e.Next=r}};f.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};f.ClipperBase.prototype.ReverseHorizontal=function(r){var e=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=e,Pa&&(e=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=e)};f.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var e=r.LeftBound;e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=f.EdgeSide.esLeft,e.OutIdx=f.ClipperBase.Unassigned),e=r.RightBound,e!=null&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=f.EdgeSide.esRight,e.OutIdx=f.ClipperBase.Unassigned),r=r.Next}};f.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=f.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=f.PolyFillType.pftEvenOdd,this.m_SubjFillType=f.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,f.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=f.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,Pa&&(this.ZFillFunction=null)};f.Clipper.ioReverseSolution=1;f.Clipper.ioStrictlySimple=2;f.Clipper.ioPreserveCollinear=4;f.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),f.ClipperBase.prototype.Clear.call(this))};f.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};f.Clipper.prototype.Reset=function(){f.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};f.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new f.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var e=new f.Scanbeam;e.Y=r,e.Next=this.m_Scanbeam,this.m_Scanbeam=e}else{for(var t=this.m_Scanbeam;t.Next!==null&&r<=t.Next.Y;)t=t.Next;if(r==t.Y)return;var e=new f.Scanbeam;e.Y=r,e.Next=t.Next,t.Next=e}};f.Clipper.prototype.Execute=function(){var r=arguments,e=r.length,t=r[1]instanceof f.PolyTree;if(e==4&&!t){var i=r[0],n=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&f.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,f.Clear(n),this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!1;try{var u=this.ExecuteInternal();u&&this.BuildResult(n)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return u}else if(e==4&&t){var i=r[0],l=r[1],o=r[2],a=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=o,this.m_ClipFillType=a,this.m_ClipType=i,this.m_UsingPolyTree=!0;try{var u=this.ExecuteInternal();u&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return u}else if(e==2&&!t){var i=r[0],n=r[1];return this.Execute(i,n,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}else if(e==2&&t){var i=r[0],l=r[1];return this.Execute(i,l,f.PolyFillType.pftEvenOdd,f.PolyFillType.pftEvenOdd)}};f.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var e=r.FirstLeft;e!==null&&(e.IsHole==r.IsHole||e.Pts===null);)e=e.FirstLeft;r.FirstLeft=e}};f.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),f.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var e=this.PopScanbeam();if(!this.ProcessIntersections(r,e))return!1;this.ProcessEdgesAtTopOfScanbeam(e),r=e}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts===null||n.IsOpen||(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)}this.JoinCommonEdges();for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts!==null&&!n.IsOpen&&this.FixupOutPolygon(n)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{f.Clear(this.m_Joins),f.Clear(this.m_GhostJoins)}};f.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,e=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,e=null,r};f.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,e=this.m_PolyOuts.length;r<e;++r)this.DisposeOutRec(r);f.Clear(this.m_PolyOuts)};f.Clipper.prototype.DisposeOutRec=function(r){var e=this.m_PolyOuts[r];e.Pts!==null&&this.DisposeOutPts(e.Pts),e=null,this.m_PolyOuts[r]=null};f.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var e=null;for(r.Prev.Next=null;r!==null;)e=r,r=r.Next,e=null}};f.Clipper.prototype.AddJoin=function(r,e,t){var i=new f.Join;i.OutPt1=r,i.OutPt2=e,i.OffPt.X=t.X,i.OffPt.Y=t.Y,this.m_Joins.push(i)};f.Clipper.prototype.AddGhostJoin=function(r,e){var t=new f.Join;t.OutPt1=r,t.OffPt.X=e.X,t.OffPt.Y=e.Y,this.m_GhostJoins.push(t)};Pa&&(f.Clipper.prototype.SetZ=function(r,e){r.Z=0,this.ZFillFunction!==null&&(e.OutIdx<0?this.ZFillFunction(e.Bot,e.Top,r):this.ZFillFunction(e.Top,e.Bot,r))});f.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var e=this.m_CurrentLM.LeftBound,t=this.m_CurrentLM.RightBound;this.PopLocalMinima();var i=null;if(e===null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(i=this.AddOutPt(t,t.Bot))):t==null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(i=this.AddOutPt(e,e.Bot)),this.InsertScanbeam(e.Top.Y)):(this.InsertEdgeIntoAEL(e,null),this.InsertEdgeIntoAEL(t,e),this.SetWindingCount(e),t.WindCnt=e.WindCnt,t.WindCnt2=e.WindCnt2,this.IsContributing(e)&&(i=this.AddLocalMinPoly(e,t,e.Bot)),this.InsertScanbeam(e.Top.Y)),t!=null&&(f.ClipperBase.IsHorizontal(t)?this.AddEdgeToSEL(t):this.InsertScanbeam(t.Top.Y)),!(e==null||t==null)){if(i!==null&&f.ClipperBase.IsHorizontal(t)&&this.m_GhostJoins.length>0&&t.WindDelta!==0)for(var n=0,o=this.m_GhostJoins.length;n<o;n++){var a=this.m_GhostJoins[n];this.HorzSegmentsOverlap(a.OutPt1.Pt,a.OffPt,t.Bot,t.Top)&&this.AddJoin(a.OutPt1,i,a.OffPt)}if(e.OutIdx>=0&&e.PrevInAEL!==null&&e.PrevInAEL.Curr.X==e.Bot.X&&e.PrevInAEL.OutIdx>=0&&f.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(i,u,e.Top)}if(e.NextInAEL!=t){if(t.OutIdx>=0&&t.PrevInAEL.OutIdx>=0&&f.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(i,u,t.Top)}var l=e.NextInAEL;if(l!==null)for(;l!=t;)this.IntersectEdges(t,l,e.Curr,!1),l=l.NextInAEL}}}};f.Clipper.prototype.InsertEdgeIntoAEL=function(r,e){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(e===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(e===null&&(e=this.m_ActiveEdges);e.NextInAEL!==null&&!this.E2InsertsBeforeE1(e.NextInAEL,r);)e=e.NextInAEL;r.NextInAEL=e.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=r),r.PrevInAEL=e,e.NextInAEL=r}};f.Clipper.prototype.E2InsertsBeforeE1=function(r,e){return e.Curr.X==r.Curr.X?e.Top.Y>r.Top.Y?e.Top.X<f.Clipper.TopX(r,e.Top.Y):r.Top.X>f.Clipper.TopX(e,r.Top.Y):e.Curr.X<r.Curr.X};f.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_SubjFillType==f.PolyFillType.pftEvenOdd:this.m_ClipFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==f.PolyType.ptSubject?this.m_ClipFillType==f.PolyFillType.pftEvenOdd:this.m_SubjFillType==f.PolyFillType.pftEvenOdd};f.Clipper.prototype.IsContributing=function(r){var e,t;switch(r.PolyTyp==f.PolyType.ptSubject?(e=this.m_SubjFillType,t=this.m_ClipFillType):(e=this.m_ClipFillType,t=this.m_SubjFillType),e){case f.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case f.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case f.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case f.ClipType.ctIntersection:switch(t){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctUnion:switch(t){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case f.ClipType.ctDifference:if(r.PolyTyp==f.PolyType.ptSubject)switch(t){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(t){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2!==0;case f.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case f.ClipType.ctXor:if(r.WindDelta===0)switch(t){case f.PolyFillType.pftEvenOdd:case f.PolyFillType.pftNonZero:return r.WindCnt2===0;case f.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};f.Clipper.prototype.SetWindingCount=function(r){for(var e=r.PrevInAEL;e!==null&&(e.PolyTyp!=r.PolyTyp||e.WindDelta===0);)e=e.PrevInAEL;if(e===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,e=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=f.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var t=!0,i=e.PrevInAEL;i!==null;)i.PolyTyp==e.PolyTyp&&i.WindDelta!==0&&(t=!t),i=i.PrevInAEL;r.WindCnt=t?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=e.WindCnt2,e=e.NextInAEL}else e.WindCnt*e.WindDelta<0?Math.abs(e.WindCnt)>1?e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=e.WindCnt<0?e.WindCnt-1:e.WindCnt+1:e.WindDelta*r.WindDelta<0?r.WindCnt=e.WindCnt:r.WindCnt=e.WindCnt+r.WindDelta,r.WindCnt2=e.WindCnt2,e=e.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;e!=r;)e.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),e=e.NextInAEL;else for(;e!=r;)r.WindCnt2+=e.WindDelta,e=e.NextInAEL};f.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)};f.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};f.Clipper.prototype.SwapPositionsInAEL=function(r,e){if(!(r.NextInAEL==r.PrevInAEL||e.NextInAEL==e.PrevInAEL)){if(r.NextInAEL==e){var t=e.NextInAEL;t!==null&&(t.PrevInAEL=r);var i=r.PrevInAEL;i!==null&&(i.NextInAEL=e),e.PrevInAEL=i,e.NextInAEL=r,r.PrevInAEL=e,r.NextInAEL=t}else if(e.NextInAEL==r){var t=r.NextInAEL;t!==null&&(t.PrevInAEL=e);var i=e.PrevInAEL;i!==null&&(i.NextInAEL=r),r.PrevInAEL=i,r.NextInAEL=e,e.PrevInAEL=r,e.NextInAEL=t}else{var t=r.NextInAEL,i=r.PrevInAEL;r.NextInAEL=e.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=e.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),e.NextInAEL=t,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=i,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e)}r.PrevInAEL===null?this.m_ActiveEdges=r:e.PrevInAEL===null&&(this.m_ActiveEdges=e)}};f.Clipper.prototype.SwapPositionsInSEL=function(r,e){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(e.NextInSEL===null&&e.PrevInSEL===null)){if(r.NextInSEL==e){var t=e.NextInSEL;t!==null&&(t.PrevInSEL=r);var i=r.PrevInSEL;i!==null&&(i.NextInSEL=e),e.PrevInSEL=i,e.NextInSEL=r,r.PrevInSEL=e,r.NextInSEL=t}else if(e.NextInSEL==r){var t=r.NextInSEL;t!==null&&(t.PrevInSEL=e);var i=e.PrevInSEL;i!==null&&(i.NextInSEL=r),r.PrevInSEL=i,r.NextInSEL=e,e.PrevInSEL=r,e.NextInSEL=t}else{var t=r.NextInSEL,i=r.PrevInSEL;r.NextInSEL=e.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=e.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),e.NextInSEL=t,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=i,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e)}r.PrevInSEL===null?this.m_SortedEdges=r:e.PrevInSEL===null&&(this.m_SortedEdges=e)}};f.Clipper.prototype.AddLocalMaxPoly=function(r,e,t){this.AddOutPt(r,t),e.WindDelta==0&&this.AddOutPt(e,t),r.OutIdx==e.OutIdx?(r.OutIdx=-1,e.OutIdx=-1):r.OutIdx<e.OutIdx?this.AppendPolygon(r,e):this.AppendPolygon(e,r)};f.Clipper.prototype.AddLocalMinPoly=function(r,e,t){var i,n,o;if(f.ClipperBase.IsHorizontal(e)||r.Dx>e.Dx?(i=this.AddOutPt(r,t),e.OutIdx=r.OutIdx,r.Side=f.EdgeSide.esLeft,e.Side=f.EdgeSide.esRight,n=r,n.PrevInAEL==e?o=e.PrevInAEL:o=n.PrevInAEL):(i=this.AddOutPt(e,t),r.OutIdx=e.OutIdx,r.Side=f.EdgeSide.esRight,e.Side=f.EdgeSide.esLeft,n=e,n.PrevInAEL==r?o=r.PrevInAEL:o=n.PrevInAEL),o!==null&&o.OutIdx>=0&&f.Clipper.TopX(o,t.Y)==f.Clipper.TopX(n,t.Y)&&f.ClipperBase.SlopesEqual(n,o,this.m_UseFullRange)&&n.WindDelta!==0&&o.WindDelta!==0){var a=this.AddOutPt(o,t);this.AddJoin(i,a,n.Top)}return i};f.Clipper.prototype.CreateOutRec=function(){var r=new f.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};f.Clipper.prototype.AddOutPt=function(r,e){var t=r.Side==f.EdgeSide.esLeft;if(r.OutIdx<0){var i=this.CreateOutRec();i.IsOpen=r.WindDelta===0;var n=new f.OutPt;return i.Pts=n,n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,n.Next=n,n.Prev=n,i.IsOpen||this.SetHoleState(r,i),Pa&&(f.IntPoint.op_Equality(e,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):f.IntPoint.op_Equality(e,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),r.OutIdx=i.Idx,n}else{var i=this.m_PolyOuts[r.OutIdx],o=i.Pts;if(t&&f.IntPoint.op_Equality(e,o.Pt))return o;if(!t&&f.IntPoint.op_Equality(e,o.Prev.Pt))return o.Prev;var n=new f.OutPt;return n.Idx=i.Idx,n.Pt.X=e.X,n.Pt.Y=e.Y,n.Next=o,n.Prev=o.Prev,n.Prev.Next=n,o.Prev=n,t&&(i.Pts=n),Pa&&(f.IntPoint.op_Equality(e,r.Bot)?(n.Pt.X=r.Bot.X,n.Pt.Y=r.Bot.Y,n.Pt.Z=r.Bot.Z):f.IntPoint.op_Equality(e,r.Top)?(n.Pt.X=r.Top.X,n.Pt.Y=r.Top.Y,n.Pt.Z=r.Top.Z):this.SetZ(n.Pt,r)),n}};f.Clipper.prototype.SwapPoints=function(r,e){var t=new f.IntPoint(r.Value);r.Value.X=e.Value.X,r.Value.Y=e.Value.Y,e.Value.X=t.X,e.Value.Y=t.Y};f.Clipper.prototype.HorzSegmentsOverlap=function(r,e,t,i){return r.X>t.X==r.X<i.X||e.X>t.X==e.X<i.X||t.X>r.X==t.X<e.X||i.X>r.X==i.X<e.X||r.X==t.X&&e.X==i.X?!0:r.X==i.X&&e.X==t.X};f.Clipper.prototype.InsertPolyPtBetween=function(r,e,t){var i=new f.OutPt;return i.Pt.X=t.X,i.Pt.Y=t.Y,e==r.Next?(r.Next=i,e.Prev=i,i.Next=e,i.Prev=r):(e.Next=i,r.Prev=i,i.Next=r,i.Prev=e),i};f.Clipper.prototype.SetHoleState=function(r,e){for(var t=!1,i=r.PrevInAEL;i!==null;)i.OutIdx>=0&&i.WindDelta!=0&&(t=!t,e.FirstLeft===null&&(e.FirstLeft=this.m_PolyOuts[i.OutIdx])),i=i.PrevInAEL;t&&(e.IsHole=!0)};f.Clipper.prototype.GetDx=function(r,e){return r.Y==e.Y?f.ClipperBase.horizontal:(e.X-r.X)/(e.Y-r.Y)};f.Clipper.prototype.FirstIsBottomPt=function(r,e){for(var t=r.Prev;f.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Prev;var i=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=r.Next;f.IntPoint.op_Equality(t.Pt,r.Pt)&&t!=r;)t=t.Next;var n=Math.abs(this.GetDx(r.Pt,t.Pt));for(t=e.Prev;f.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Prev;var o=Math.abs(this.GetDx(e.Pt,t.Pt));for(t=e.Next;f.IntPoint.op_Equality(t.Pt,e.Pt)&&t!=e;)t=t.Next;var a=Math.abs(this.GetDx(e.Pt,t.Pt));return i>=o&&i>=a||n>=o&&n>=a};f.Clipper.prototype.GetBottomPt=function(r){for(var e=null,t=r.Next;t!=r;)t.Pt.Y>r.Pt.Y?(r=t,e=null):t.Pt.Y==r.Pt.Y&&t.Pt.X<=r.Pt.X&&(t.Pt.X<r.Pt.X?(e=null,r=t):t.Next!=r&&t.Prev!=r&&(e=t)),t=t.Next;if(e!==null)for(;e!=t;)for(this.FirstIsBottomPt(t,e)||(r=e),e=e.Next;f.IntPoint.op_Inequality(e.Pt,r.Pt);)e=e.Next;return r};f.Clipper.prototype.GetLowermostRec=function(r,e){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts));var t=r.BottomPt,i=e.BottomPt;return t.Pt.Y>i.Pt.Y?r:t.Pt.Y<i.Pt.Y?e:t.Pt.X<i.Pt.X?r:t.Pt.X>i.Pt.X||t.Next==t?e:i.Next==i||this.FirstIsBottomPt(t,i)?r:e};f.Clipper.prototype.Param1RightOfParam2=function(r,e){do if(r=r.FirstLeft,r==e)return!0;while(r!==null);return!1};f.Clipper.prototype.GetOutRec=function(r){for(var e=this.m_PolyOuts[r];e!=this.m_PolyOuts[e.Idx];)e=this.m_PolyOuts[e.Idx];return e};f.Clipper.prototype.AppendPolygon=function(r,e){var t=this.m_PolyOuts[r.OutIdx],i=this.m_PolyOuts[e.OutIdx],n;this.Param1RightOfParam2(t,i)?n=i:this.Param1RightOfParam2(i,t)?n=t:n=this.GetLowermostRec(t,i);var o=t.Pts,a=o.Prev,u=i.Pts,l=u.Prev,p;r.Side==f.EdgeSide.esLeft?(e.Side==f.EdgeSide.esLeft?(this.ReversePolyPtLinks(u),u.Next=o,o.Prev=u,a.Next=l,l.Prev=a,t.Pts=l):(l.Next=o,o.Prev=l,u.Prev=a,a.Next=u,t.Pts=u),p=f.EdgeSide.esLeft):(e.Side==f.EdgeSide.esRight?(this.ReversePolyPtLinks(u),a.Next=l,l.Prev=a,u.Next=o,o.Prev=u):(a.Next=u,u.Prev=a,o.Prev=l,l.Next=o),p=f.EdgeSide.esRight),t.BottomPt=null,n==i&&(i.FirstLeft!=t&&(t.FirstLeft=i.FirstLeft),t.IsHole=i.IsHole),i.Pts=null,i.BottomPt=null,i.FirstLeft=t;var h=r.OutIdx,y=e.OutIdx;r.OutIdx=-1,e.OutIdx=-1;for(var g=this.m_ActiveEdges;g!==null;){if(g.OutIdx==y){g.OutIdx=h,g.Side=p;break}g=g.NextInAEL}i.Idx=t.Idx};f.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var e,t;e=r;do t=e.Next,e.Next=e.Prev,e.Prev=t,e=t;while(e!=r)}};f.Clipper.SwapSides=function(r,e){var t=r.Side;r.Side=e.Side,e.Side=t};f.Clipper.SwapPolyIndexes=function(r,e){var t=r.OutIdx;r.OutIdx=e.OutIdx,e.OutIdx=t};f.Clipper.prototype.IntersectEdges=function(r,e,t,i){var n=!i&&r.NextInLML===null&&r.Top.X==t.X&&r.Top.Y==t.Y,o=!i&&e.NextInLML===null&&e.Top.X==t.X&&e.Top.Y==t.Y,a=r.OutIdx>=0,u=e.OutIdx>=0;if(SM&&(r.WindDelta===0||e.WindDelta===0)){r.WindDelta===0&&e.WindDelta===0?(n||o)&&a&&u&&this.AddLocalMaxPoly(r,e,t):r.PolyTyp==e.PolyTyp&&r.WindDelta!=e.WindDelta&&this.m_ClipType==f.ClipType.ctUnion?r.WindDelta===0?u&&(this.AddOutPt(r,t),a&&(r.OutIdx=-1)):a&&(this.AddOutPt(e,t),u&&(e.OutIdx=-1)):r.PolyTyp!=e.PolyTyp&&(r.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=f.ClipType.ctUnion||e.WindCnt2===0)?(this.AddOutPt(r,t),a&&(r.OutIdx=-1)):e.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=f.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(e,t),u&&(e.OutIdx=-1))),n&&(r.OutIdx<0?this.DeleteFromAEL(r):f.Error("Error intersecting polylines")),o&&(e.OutIdx<0?this.DeleteFromAEL(e):f.Error("Error intersecting polylines"));return}if(r.PolyTyp==e.PolyTyp)if(this.IsEvenOddFillType(r)){var l=r.WindCnt;r.WindCnt=e.WindCnt,e.WindCnt=l}else r.WindCnt+e.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=e.WindDelta,e.WindCnt-r.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(e)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=e.WindDelta,this.IsEvenOddFillType(r)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2-=r.WindDelta;var p,h,y,g;r.PolyTyp==f.PolyType.ptSubject?(p=this.m_SubjFillType,y=this.m_ClipFillType):(p=this.m_ClipFillType,y=this.m_SubjFillType),e.PolyTyp==f.PolyType.ptSubject?(h=this.m_SubjFillType,g=this.m_ClipFillType):(h=this.m_ClipFillType,g=this.m_SubjFillType);var v,S;switch(p){case f.PolyFillType.pftPositive:v=r.WindCnt;break;case f.PolyFillType.pftNegative:v=-r.WindCnt;break;default:v=Math.abs(r.WindCnt);break}switch(h){case f.PolyFillType.pftPositive:S=e.WindCnt;break;case f.PolyFillType.pftNegative:S=-e.WindCnt;break;default:S=Math.abs(e.WindCnt);break}if(a&&u)n||o||v!==0&&v!=1||S!==0&&S!=1||r.PolyTyp!=e.PolyTyp&&this.m_ClipType!=f.ClipType.ctXor?this.AddLocalMaxPoly(r,e,t):(this.AddOutPt(r,t),this.AddOutPt(e,t),f.Clipper.SwapSides(r,e),f.Clipper.SwapPolyIndexes(r,e));else if(a)(S===0||S==1)&&(this.AddOutPt(r,t),f.Clipper.SwapSides(r,e),f.Clipper.SwapPolyIndexes(r,e));else if(u)(v===0||v==1)&&(this.AddOutPt(e,t),f.Clipper.SwapSides(r,e),f.Clipper.SwapPolyIndexes(r,e));else if((v===0||v==1)&&(S===0||S==1)&&!n&&!o){var T,b;switch(y){case f.PolyFillType.pftPositive:T=r.WindCnt2;break;case f.PolyFillType.pftNegative:T=-r.WindCnt2;break;default:T=Math.abs(r.WindCnt2);break}switch(g){case f.PolyFillType.pftPositive:b=e.WindCnt2;break;case f.PolyFillType.pftNegative:b=-e.WindCnt2;break;default:b=Math.abs(e.WindCnt2);break}if(r.PolyTyp!=e.PolyTyp)this.AddLocalMinPoly(r,e,t);else if(v==1&&S==1)switch(this.m_ClipType){case f.ClipType.ctIntersection:T>0&&b>0&&this.AddLocalMinPoly(r,e,t);break;case f.ClipType.ctUnion:T<=0&&b<=0&&this.AddLocalMinPoly(r,e,t);break;case f.ClipType.ctDifference:(r.PolyTyp==f.PolyType.ptClip&&T>0&&b>0||r.PolyTyp==f.PolyType.ptSubject&&T<=0&&b<=0)&&this.AddLocalMinPoly(r,e,t);break;case f.ClipType.ctXor:this.AddLocalMinPoly(r,e,t);break}else f.Clipper.SwapSides(r,e)}n!=o&&(n&&r.OutIdx>=0||o&&e.OutIdx>=0)&&(f.Clipper.SwapSides(r,e),f.Clipper.SwapPolyIndexes(r,e)),n&&this.DeleteFromAEL(r),o&&this.DeleteFromAEL(e)};f.Clipper.prototype.DeleteFromAEL=function(r){var e=r.PrevInAEL,t=r.NextInAEL;e===null&&t===null&&r!=this.m_ActiveEdges||(e!==null?e.NextInAEL=t:this.m_ActiveEdges=t,t!==null&&(t.PrevInAEL=e),r.NextInAEL=null,r.PrevInAEL=null)};f.Clipper.prototype.DeleteFromSEL=function(r){var e=r.PrevInSEL,t=r.NextInSEL;e===null&&t===null&&r!=this.m_SortedEdges||(e!==null?e.NextInSEL=t:this.m_SortedEdges=t,t!==null&&(t.PrevInSEL=e),r.NextInSEL=null,r.PrevInSEL=null)};f.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&f.Error("UpdateEdgeIntoAEL: invalid call");var e=r.PrevInAEL,t=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,e!==null?e.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,t!==null&&(t.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=e,r.NextInAEL=t,f.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};f.Clipper.prototype.ProcessHorizontals=function(r){for(var e=this.m_SortedEdges;e!==null;)this.DeleteFromSEL(e),this.ProcessHorizontal(e,r),e=this.m_SortedEdges};f.Clipper.prototype.GetHorzDirection=function(r,e){r.Bot.X<r.Top.X?(e.Left=r.Bot.X,e.Right=r.Top.X,e.Dir=f.Direction.dLeftToRight):(e.Left=r.Top.X,e.Right=r.Bot.X,e.Dir=f.Direction.dRightToLeft)};f.Clipper.prototype.PrepareHorzJoins=function(r,e){var t=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=f.EdgeSide.esLeft&&(t=t.Prev),e&&(f.IntPoint.op_Equality(t.Pt,r.Top)?this.AddGhostJoin(t,r.Bot):this.AddGhostJoin(t,r.Top))};f.Clipper.prototype.ProcessHorizontal=function(r,e){var t={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,t);for(var i=t.Dir,n=t.Left,o=t.Right,a=r,u=null;a.NextInLML!==null&&f.ClipperBase.IsHorizontal(a.NextInLML);)a=a.NextInLML;for(a.NextInLML===null&&(u=this.GetMaximaPair(a));;){for(var l=r==a,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==f.Direction.dLeftToRight&&p.Curr.X<=o||i==f.Direction.dRightToLeft&&p.Curr.X>=n){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,e),p==u&&l){i==f.Direction.dLeftToRight?this.IntersectEdges(r,p,p.Top,!1):this.IntersectEdges(p,r,p.Top,!1),u.OutIdx>=0&&f.Error("ProcessHorizontal error");return}else if(i==f.Direction.dLeftToRight){var y=new f.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(r,p,y,!0)}else{var y=new f.IntPoint(p.Curr.X,r.Curr.Y);this.IntersectEdges(p,r,y,!0)}this.SwapPositionsInAEL(r,p)}else if(i==f.Direction.dLeftToRight&&p.Curr.X>=o||i==f.Direction.dRightToLeft&&p.Curr.X<=n)break;p=h}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,e),r.NextInLML!==null&&f.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var t={Dir:i,Left:n,Right:o};this.GetHorzDirection(r,t),i=t.Dir,n=t.Left,o=t.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var g=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var v=r.PrevInAEL,h=r.NextInAEL;if(v!==null&&v.Curr.X==r.Bot.X&&v.Curr.Y==r.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&f.ClipperBase.SlopesEqual(r,v,this.m_UseFullRange)){var S=this.AddOutPt(v,r.Bot);this.AddJoin(g,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&&f.ClipperBase.SlopesEqual(r,h,this.m_UseFullRange)){var S=this.AddOutPt(h,r.Bot);this.AddJoin(g,S,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else u!==null?u.OutIdx>=0?(i==f.Direction.dLeftToRight?this.IntersectEdges(r,u,r.Top,!1):this.IntersectEdges(u,r,r.Top,!1),u.OutIdx>=0&&f.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(u)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};f.Clipper.prototype.GetNextInAEL=function(r,e){return e==f.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};f.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};f.Clipper.prototype.IsMaxima=function(r,e){return r!==null&&r.Top.Y==e&&r.NextInLML===null};f.Clipper.prototype.IsIntermediate=function(r,e){return r.Top.Y==e&&r.NextInLML!==null};f.Clipper.prototype.GetMaximaPair=function(r){var e=null;return f.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?e=r.Next:f.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(e=r.Prev),e!==null&&(e.OutIdx==-2||e.NextInAEL==e.PrevInAEL&&!f.ClipperBase.IsHorizontal(e))?null:e};f.Clipper.prototype.ProcessIntersections=function(r,e){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,e),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,f.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};f.Clipper.prototype.BuildIntersectList=function(r,e){if(this.m_ActiveEdges!==null){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;t!==null;)t.PrevInSEL=t.PrevInAEL,t.NextInSEL=t.NextInAEL,t.Curr.X=f.Clipper.TopX(t,e),t=t.NextInAEL;for(var i=!0;i&&this.m_SortedEdges!==null;){for(i=!1,t=this.m_SortedEdges;t.NextInSEL!==null;){var n=t.NextInSEL,o=new f.IntPoint;if(t.Curr.X>n.Curr.X){!this.IntersectPoint(t,n,o)&&t.Curr.X>n.Curr.X+1&&f.Error("Intersection error"),o.Y>r&&(o.Y=r,Math.abs(t.Dx)>Math.abs(n.Dx)?o.X=f.Clipper.TopX(n,r):o.X=f.Clipper.TopX(t,r));var a=new f.IntersectNode;a.Edge1=t,a.Edge2=n,a.Pt.X=o.X,a.Pt.Y=o.Y,this.m_IntersectList.push(a),this.SwapPositionsInSEL(t,n),i=!0}else t=n}if(t.PrevInSEL!==null)t.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};f.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};f.Clipper.IntersectNodeSort=function(r,e){return e.Pt.Y-r.Pt.Y};f.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,e=0;e<r;e++){if(!this.EdgesAdjacent(this.m_IntersectList[e])){for(var t=e+1;t<r&&!this.EdgesAdjacent(this.m_IntersectList[t]);)t++;if(t==r)return!1;var i=this.m_IntersectList[e];this.m_IntersectList[e]=this.m_IntersectList[t],this.m_IntersectList[t]=i}this.SwapPositionsInSEL(this.m_IntersectList[e].Edge1,this.m_IntersectList[e].Edge2)}return!0};f.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,e=this.m_IntersectList.length;r<e;r++){var t=this.m_IntersectList[r];this.IntersectEdges(t.Edge1,t.Edge2,t.Pt,!0),this.SwapPositionsInAEL(t.Edge1,t.Edge2)}this.m_IntersectList.length=0};var tk=c(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),rk=c(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),ik=c(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),nk=c(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");pe.msie?f.Clipper.Round=tk:pe.chromium?f.Clipper.Round=ik:pe.safari?f.Clipper.Round=nk:f.Clipper.Round=rk;f.Clipper.TopX=function(r,e){return e==r.Top.Y?r.Top.X:r.Bot.X+f.Clipper.Round(r.Dx*(e-r.Bot.Y))};f.Clipper.prototype.IntersectPoint=function(r,e,t){t.X=0,t.Y=0;var i,n;if(f.ClipperBase.SlopesEqual(r,e,this.m_UseFullRange)||r.Dx==e.Dx)return e.Bot.Y>r.Bot.Y?(t.X=e.Bot.X,t.Y=e.Bot.Y):(t.X=r.Bot.X,t.Y=r.Bot.Y),!1;if(r.Delta.X===0)t.X=r.Bot.X,f.ClipperBase.IsHorizontal(e)?t.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,t.Y=f.Clipper.Round(t.X/e.Dx+n));else if(e.Delta.X===0)t.X=e.Bot.X,f.ClipperBase.IsHorizontal(r)?t.Y=r.Bot.Y:(i=r.Bot.Y-r.Bot.X/r.Dx,t.Y=f.Clipper.Round(t.X/r.Dx+i));else{i=r.Bot.X-r.Bot.Y*r.Dx,n=e.Bot.X-e.Bot.Y*e.Dx;var o=(n-i)/(r.Dx-e.Dx);t.Y=f.Clipper.Round(o),Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=f.Clipper.Round(r.Dx*o+i):t.X=f.Clipper.Round(e.Dx*o+n)}if(t.Y<r.Top.Y||t.Y<e.Top.Y){if(r.Top.Y>e.Top.Y)return t.Y=r.Top.Y,t.X=f.Clipper.TopX(e,r.Top.Y),t.X<r.Top.X;t.Y=e.Top.Y,Math.abs(r.Dx)<Math.abs(e.Dx)?t.X=f.Clipper.TopX(r,t.Y):t.X=f.Clipper.TopX(e,t.Y)}return!0};f.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var e=this.m_ActiveEdges;e!==null;){var t=this.IsMaxima(e,r);if(t){var i=this.GetMaximaPair(e);t=i===null||!f.ClipperBase.IsHorizontal(i)}if(t){var n=e.PrevInAEL;this.DoMaxima(e),n===null?e=this.m_ActiveEdges:e=n.NextInAEL}else{if(this.IsIntermediate(e,r)&&f.ClipperBase.IsHorizontal(e.NextInLML)?(e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot),this.AddEdgeToSEL(e)):(e.Curr.X=f.Clipper.TopX(e,r),e.Curr.Y=r),this.StrictlySimple){var n=e.PrevInAEL;if(e.OutIdx>=0&&e.WindDelta!==0&&n!==null&&n.OutIdx>=0&&n.Curr.X==e.Curr.X&&n.WindDelta!==0){var o=this.AddOutPt(n,e.Curr),a=this.AddOutPt(e,e.Curr);this.AddJoin(o,a,e.Curr)}}e=e.NextInAEL}}for(this.ProcessHorizontals(!0),e=this.m_ActiveEdges;e!==null;){if(this.IsIntermediate(e,r)){var o=null;e.OutIdx>=0&&(o=this.AddOutPt(e,e.Top)),e=this.UpdateEdgeIntoAEL(e);var n=e.PrevInAEL,u=e.NextInAEL;if(n!==null&&n.Curr.X==e.Bot.X&&n.Curr.Y==e.Bot.Y&&o!==null&&n.OutIdx>=0&&n.Curr.Y>n.Top.Y&&f.ClipperBase.SlopesEqual(e,n,this.m_UseFullRange)&&e.WindDelta!==0&&n.WindDelta!==0){var a=this.AddOutPt(n,e.Bot);this.AddJoin(o,a,e.Top)}else if(u!==null&&u.Curr.X==e.Bot.X&&u.Curr.Y==e.Bot.Y&&o!==null&&u.OutIdx>=0&&u.Curr.Y>u.Top.Y&&f.ClipperBase.SlopesEqual(e,u,this.m_UseFullRange)&&e.WindDelta!==0&&u.WindDelta!==0){var a=this.AddOutPt(u,e.Bot);this.AddJoin(o,a,e.Top)}}e=e.NextInAEL}};f.Clipper.prototype.DoMaxima=function(r){var e=this.GetMaximaPair(r);if(e===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var t=r.NextInAEL,i=!0;t!==null&&t!=e;)this.IntersectEdges(r,t,r.Top,!0),this.SwapPositionsInAEL(r,t),t=r.NextInAEL;r.OutIdx==-1&&e.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(e)):r.OutIdx>=0&&e.OutIdx>=0?this.IntersectEdges(r,e,r.Top,!1):i&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),e.OutIdx>=0&&(this.AddOutPt(e,r.Top),e.OutIdx=-1),this.DeleteFromAEL(e)):f.Error("DoMaxima error")};f.Clipper.ReversePaths=function(r){for(var e=0,t=r.length;e<t;e++)r[e].reverse()};f.Clipper.Orientation=function(r){return f.Clipper.Area(r)>=0};f.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var e=0,t=r;do e++,t=t.Next;while(t!=r);return e};f.Clipper.prototype.BuildResult=function(r){f.Clear(r);for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e];if(i.Pts!==null){var n=i.Pts.Prev,o=this.PointCount(n);if(!(o<2)){for(var a=new Array(o),u=0;u<o;u++)a[u]=n.Pt,n=n.Prev;r.push(a)}}}};f.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e],n=this.PointCount(i.Pts);if(!(i.IsOpen&&n<2||!i.IsOpen&&n<3)){this.FixHoleLinkage(i);var o=new f.PolyNode;r.m_AllPolys.push(o),i.PolyNode=o,o.m_polygon.length=n;for(var a=i.Pts.Prev,u=0;u<n;u++)o.m_polygon[u]=a.Pt,a=a.Prev}}for(var e=0,t=this.m_PolyOuts.length;e<t;e++){var i=this.m_PolyOuts[e];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))}};f.Clipper.prototype.FixupOutPolygon=function(r){var e=null;r.BottomPt=null;for(var t=r.Pts;;){if(t.Prev==t||t.Prev==t.Next){this.DisposeOutPts(t),r.Pts=null;return}if(f.IntPoint.op_Equality(t.Pt,t.Next.Pt)||f.IntPoint.op_Equality(t.Pt,t.Prev.Pt)||f.ClipperBase.SlopesEqual(t.Prev.Pt,t.Pt,t.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(t.Prev.Pt,t.Pt,t.Next.Pt))){e=null;var i=t;t.Prev.Next=t.Next,t.Next.Prev=t.Prev,t=t.Prev,i=null}else{if(t==e)break;e===null&&(e=t),t=t.Next}}r.Pts=t};f.Clipper.prototype.DupOutPt=function(r,e){var t=new f.OutPt;return t.Pt.X=r.Pt.X,t.Pt.Y=r.Pt.Y,t.Idx=r.Idx,e?(t.Next=r.Next,t.Prev=r,r.Next.Prev=t,r.Next=t):(t.Prev=r.Prev,t.Next=r,r.Prev.Next=t,r.Prev=t),t};f.Clipper.prototype.GetOverlap=function(r,e,t,i,n){return r<e?t<i?(n.Left=Math.max(r,t),n.Right=Math.min(e,i)):(n.Left=Math.max(r,i),n.Right=Math.min(e,t)):t<i?(n.Left=Math.max(e,t),n.Right=Math.min(r,i)):(n.Left=Math.max(e,i),n.Right=Math.min(r,t)),n.Left<n.Right};f.Clipper.prototype.JoinHorz=function(r,e,t,i,n,o){var a=r.Pt.X>e.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight,u=t.Pt.X>i.Pt.X?f.Direction.dRightToLeft:f.Direction.dLeftToRight;if(a==u)return!1;if(a==f.Direction.dLeftToRight){for(;r.Next.Pt.X<=n.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;o&&r.Pt.X!=n.X&&(r=r.Next),e=this.DupOutPt(r,!o),f.IntPoint.op_Inequality(e.Pt,n)&&(r=e,r.Pt.X=n.X,r.Pt.Y=n.Y,e=this.DupOutPt(r,!o))}else{for(;r.Next.Pt.X>=n.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==n.Y;)r=r.Next;!o&&r.Pt.X!=n.X&&(r=r.Next),e=this.DupOutPt(r,o),f.IntPoint.op_Inequality(e.Pt,n)&&(r=e,r.Pt.X=n.X,r.Pt.Y=n.Y,e=this.DupOutPt(r,o))}if(u==f.Direction.dLeftToRight){for(;t.Next.Pt.X<=n.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;o&&t.Pt.X!=n.X&&(t=t.Next),i=this.DupOutPt(t,!o),f.IntPoint.op_Inequality(i.Pt,n)&&(t=i,t.Pt.X=n.X,t.Pt.Y=n.Y,i=this.DupOutPt(t,!o))}else{for(;t.Next.Pt.X>=n.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y==n.Y;)t=t.Next;!o&&t.Pt.X!=n.X&&(t=t.Next),i=this.DupOutPt(t,o),f.IntPoint.op_Inequality(i.Pt,n)&&(t=i,t.Pt.X=n.X,t.Pt.Y=n.Y,i=this.DupOutPt(t,o))}return a==f.Direction.dLeftToRight==o?(r.Prev=t,t.Next=r,e.Next=i,i.Prev=e):(r.Next=t,t.Prev=r,e.Prev=i,i.Next=e),!0};f.Clipper.prototype.JoinPoints=function(r,e,t){var i=r.OutPt1,n=new f.OutPt,o=r.OutPt2,a=new f.OutPt,u=r.OutPt1.Pt.Y==r.OffPt.Y;if(u&&f.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&f.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(n=r.OutPt1.Next;n!=i&&f.IntPoint.op_Equality(n.Pt,r.OffPt);)n=n.Next;var l=n.Pt.Y>r.OffPt.Y;for(a=r.OutPt2.Next;a!=o&&f.IntPoint.op_Equality(a.Pt,r.OffPt);)a=a.Next;var p=a.Pt.Y>r.OffPt.Y;return l==p?!1:l?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}else if(u){for(n=i;i.Prev.Pt.Y==i.Pt.Y&&i.Prev!=n&&i.Prev!=o;)i=i.Prev;for(;n.Next.Pt.Y==n.Pt.Y&&n.Next!=i&&n.Next!=o;)n=n.Next;if(n.Next==i||n.Next==o)return!1;for(a=o;o.Prev.Pt.Y==o.Pt.Y&&o.Prev!=a&&o.Prev!=n;)o=o.Prev;for(;a.Next.Pt.Y==a.Pt.Y&&a.Next!=o&&a.Next!=i;)a=a.Next;if(a.Next==o||a.Next==i)return!1;var h={Left:null,Right:null};if(!this.GetOverlap(i.Pt.X,n.Pt.X,o.Pt.X,a.Pt.X,h))return!1;var y=h.Left,g=h.Right,v=new f.IntPoint,S;return i.Pt.X>=y&&i.Pt.X<=g?(v.X=i.Pt.X,v.Y=i.Pt.Y,S=i.Pt.X>n.Pt.X):o.Pt.X>=y&&o.Pt.X<=g?(v.X=o.Pt.X,v.Y=o.Pt.Y,S=o.Pt.X>a.Pt.X):n.Pt.X>=y&&n.Pt.X<=g?(v.X=n.Pt.X,v.Y=n.Pt.Y,S=n.Pt.X>i.Pt.X):(v.X=a.Pt.X,v.Y=a.Pt.Y,S=a.Pt.X>o.Pt.X),r.OutPt1=i,r.OutPt2=o,this.JoinHorz(i,n,o,a,v,S)}else{for(n=i.Next;f.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Next;var T=n.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange);if(T){for(n=i.Prev;f.IntPoint.op_Equality(n.Pt,i.Pt)&&n!=i;)n=n.Prev;if(n.Pt.Y>i.Pt.Y||!f.ClipperBase.SlopesEqual(i.Pt,n.Pt,r.OffPt,this.m_UseFullRange))return!1}for(a=o.Next;f.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Next;var b=a.Pt.Y>o.Pt.Y||!f.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange);if(b){for(a=o.Prev;f.IntPoint.op_Equality(a.Pt,o.Pt)&&a!=o;)a=a.Prev;if(a.Pt.Y>o.Pt.Y||!f.ClipperBase.SlopesEqual(o.Pt,a.Pt,r.OffPt,this.m_UseFullRange))return!1}return n==i||a==o||n==a||e==t&&T==b?!1:T?(n=this.DupOutPt(i,!1),a=this.DupOutPt(o,!0),i.Prev=o,o.Next=i,n.Next=a,a.Prev=n,r.OutPt1=i,r.OutPt2=n,!0):(n=this.DupOutPt(i,!0),a=this.DupOutPt(o,!1),i.Next=o,o.Prev=i,n.Prev=a,a.Next=n,r.OutPt1=i,r.OutPt2=n,!0)}};f.Clipper.GetBounds=function(r){for(var e=0,t=r.length;e<t&&r[e].length==0;)e++;if(e==t)return new f.IntRect(0,0,0,0);var i=new f.IntRect;for(i.left=r[e][0].X,i.right=i.left,i.top=r[e][0].Y,i.bottom=i.top;e<t;e++)for(var n=0,o=r[e].length;n<o;n++)r[e][n].X<i.left?i.left=r[e][n].X:r[e][n].X>i.right&&(i.right=r[e][n].X),r[e][n].Y<i.top?i.top=r[e][n].Y:r[e][n].Y>i.bottom&&(i.bottom=r[e][n].Y);return i};f.Clipper.prototype.GetBounds2=function(r){var e=r,t=new f.IntRect;for(t.left=r.Pt.X,t.right=r.Pt.X,t.top=r.Pt.Y,t.bottom=r.Pt.Y,r=r.Next;r!=e;)r.Pt.X<t.left&&(t.left=r.Pt.X),r.Pt.X>t.right&&(t.right=r.Pt.X),r.Pt.Y<t.top&&(t.top=r.Pt.Y),r.Pt.Y>t.bottom&&(t.bottom=r.Pt.Y),r=r.Next;return t};f.Clipper.PointInPolygon=function(r,e){var t=0,i=e.length;if(i<3)return 0;for(var n=e[0],o=1;o<=i;++o){var a=o==i?e[0]:e[o];if(a.Y==r.Y&&(a.X==r.X||n.Y==r.Y&&a.X>r.X==n.X<r.X))return-1;if(n.Y<r.Y!=a.Y<r.Y){if(n.X>=r.X)if(a.X>r.X)t=1-t;else{var u=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(u==0)return-1;u>0==a.Y>n.Y&&(t=1-t)}else if(a.X>r.X){var u=(n.X-r.X)*(a.Y-r.Y)-(a.X-r.X)*(n.Y-r.Y);if(u==0)return-1;u>0==a.Y>n.Y&&(t=1-t)}}n=a}return t};f.Clipper.prototype.PointInPolygon=function(r,e){for(var t=0,i=e;;){var n=e.Pt.X,o=e.Pt.Y,a=e.Next.Pt.X,u=e.Next.Pt.Y;if(u==r.Y&&(a==r.X||o==r.Y&&a>r.X==n<r.X))return-1;if(o<r.Y!=u<r.Y){if(n>=r.X)if(a>r.X)t=1-t;else{var l=(n-r.X)*(u-r.Y)-(a-r.X)*(o-r.Y);if(l==0)return-1;l>0==u>o&&(t=1-t)}else if(a>r.X){var l=(n-r.X)*(u-r.Y)-(a-r.X)*(o-r.Y);if(l==0)return-1;l>0==u>o&&(t=1-t)}}if(e=e.Next,i==e)break}return t};f.Clipper.prototype.Poly2ContainsPoly1=function(r,e){var t=r;do{var i=this.PointInPolygon(t.Pt,e);if(i>=0)return i!=0;t=t.Next}while(t!=r);return!0};f.Clipper.prototype.FixupFirstLefts1=function(r,e){for(var t=0,i=this.m_PolyOuts.length;t<i;t++){var n=this.m_PolyOuts[t];n.Pts!==null&&n.FirstLeft==r&&this.Poly2ContainsPoly1(n.Pts,e.Pts)&&(n.FirstLeft=e)}};f.Clipper.prototype.FixupFirstLefts2=function(r,e){for(var t=0,i=this.m_PolyOuts,n=i.length,o=i[t];t<n;t++,o=i[t])o.FirstLeft==r&&(o.FirstLeft=e)};f.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};f.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,e=this.m_Joins.length;r<e;r++){var t=this.m_Joins[r],i=this.GetOutRec(t.OutPt1.Idx),n=this.GetOutRec(t.OutPt2.Idx);if(!(i.Pts==null||n.Pts==null)){var o;if(i==n?o=i:this.Param1RightOfParam2(i,n)?o=n:this.Param1RightOfParam2(n,i)?o=i:o=this.GetLowermostRec(i,n),!!this.JoinPoints(t,i,n))if(i==n){if(i.Pts=t.OutPt1,i.BottomPt=null,n=this.CreateOutRec(),n.Pts=t.OutPt2,this.UpdateOutPtIdxs(n),this.m_UsingPolyTree)for(var a=0,u=this.m_PolyOuts.length;a<u-1;a++){var l=this.m_PolyOuts[a];l.Pts==null||f.Clipper.ParseFirstLeft(l.FirstLeft)!=i||l.IsHole==i.IsHole||this.Poly2ContainsPoly1(l.Pts,t.OutPt2)&&(l.FirstLeft=n)}this.Poly2ContainsPoly1(n.Pts,i.Pts)?(n.IsHole=!i.IsHole,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):this.Poly2ContainsPoly1(i.Pts,n.Pts)?(n.IsHole=i.IsHole,i.IsHole=!n.IsHole,n.FirstLeft=i.FirstLeft,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):(n.IsHole=i.IsHole,n.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,n))}else n.Pts=null,n.BottomPt=null,n.Idx=i.Idx,i.IsHole=o.IsHole,o==n&&(i.FirstLeft=n.FirstLeft),n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i)}}};f.Clipper.prototype.UpdateOutPtIdxs=function(r){var e=r.Pts;do e.Idx=r.Idx,e=e.Prev;while(e!=r.Pts)};f.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var e=this.m_PolyOuts[r++],t=e.Pts;if(t!==null)do{for(var i=t.Next;i!=e.Pts;){if(f.IntPoint.op_Equality(t.Pt,i.Pt)&&i.Next!=t&&i.Prev!=t){var n=t.Prev,o=i.Prev;t.Prev=o,o.Next=t,i.Prev=n,n.Next=i,e.Pts=t;var a=this.CreateOutRec();a.Pts=i,this.UpdateOutPtIdxs(a),this.Poly2ContainsPoly1(a.Pts,e.Pts)?(a.IsHole=!e.IsHole,a.FirstLeft=e):this.Poly2ContainsPoly1(e.Pts,a.Pts)?(a.IsHole=e.IsHole,e.IsHole=!a.IsHole,a.FirstLeft=e.FirstLeft,e.FirstLeft=a):(a.IsHole=e.IsHole,a.FirstLeft=e.FirstLeft),i=t}i=i.Next}t=t.Next}while(t!=e.Pts)}};f.Clipper.Area=function(r){var e=r.length;if(e<3)return 0;for(var t=0,i=0,n=e-1;i<e;++i)t+=(r[n].X+r[i].X)*(r[n].Y-r[i].Y),n=i;return-t*.5};f.Clipper.prototype.Area=function(r){var e=r.Pts;if(e==null)return 0;var t=0;do t=t+(e.Prev.Pt.X+e.Pt.X)*(e.Prev.Pt.Y-e.Pt.Y),e=e.Next;while(e!=r.Pts);return t*.5};MM&&(f.Clipper.OffsetPaths=function(r,e,t,i,n){var o=new f.Paths,a=new f.ClipperOffset(n,n);return a.AddPaths(r,t,i),a.Execute(o,e),o});f.Clipper.SimplifyPolygon=function(r,e){var t=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPath(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,t,e,e),t};f.Clipper.SimplifyPolygons=function(r,e){typeof e>"u"&&(e=f.PolyFillType.pftEvenOdd);var t=new Array,i=new f.Clipper(0);return i.StrictlySimple=!0,i.AddPaths(r,f.PolyType.ptSubject,!0),i.Execute(f.ClipType.ctUnion,t,e,e),t};f.Clipper.DistanceSqrd=function(r,e){var t=r.X-e.X,i=r.Y-e.Y;return t*t+i*i};f.Clipper.DistanceFromLineSqrd=function(r,e,t){var i=e.Y-t.Y,n=t.X-e.X,o=i*e.X+n*e.Y;return o=i*r.X+n*r.Y-o,o*o/(i*i+n*n)};f.Clipper.SlopesNearCollinear=function(r,e,t,i){return f.Clipper.DistanceFromLineSqrd(e,r,t)<i};f.Clipper.PointsAreClose=function(r,e,t){var i=r.X-e.X,n=r.Y-e.Y;return i*i+n*n<=t};f.Clipper.ExcludeOp=function(r){var e=r.Prev;return e.Next=r.Next,r.Next.Prev=e,e.Idx=0,e};f.Clipper.CleanPolygon=function(r,e){typeof e>"u"&&(e=1.415);var t=r.length;if(t==0)return new Array;for(var i=new Array(t),n=0;n<t;++n)i[n]=new f.OutPt;for(var n=0;n<t;++n)i[n].Pt=r[n],i[n].Next=i[(n+1)%t],i[n].Next.Prev=i[n],i[n].Idx=0;for(var o=e*e,a=i[0];a.Idx==0&&a.Next!=a.Prev;)f.Clipper.PointsAreClose(a.Pt,a.Prev.Pt,o)?(a=f.Clipper.ExcludeOp(a),t--):f.Clipper.PointsAreClose(a.Prev.Pt,a.Next.Pt,o)?(f.Clipper.ExcludeOp(a.Next),a=f.Clipper.ExcludeOp(a),t-=2):f.Clipper.SlopesNearCollinear(a.Prev.Pt,a.Pt,a.Next.Pt,o)?(a=f.Clipper.ExcludeOp(a),t--):(a.Idx=1,a=a.Next);t<3&&(t=0);for(var u=new Array(t),n=0;n<t;++n)u[n]=new f.IntPoint(a.Pt),a=a.Next;return i=null,u};f.Clipper.CleanPolygons=function(r,e){for(var t=new Array(r.length),i=0,n=r.length;i<n;i++)t[i]=f.Clipper.CleanPolygon(r[i],e);return t};f.Clipper.Minkowski=function(r,e,t,i){var n=i?1:0,o=r.length,a=e.length,u=new Array;if(t)for(var l=0;l<a;l++){for(var p=new Array(o),h=0,y=r.length,g=r[h];h<y;h++,g=r[h])p[h]=new f.IntPoint(e[l].X+g.X,e[l].Y+g.Y);u.push(p)}else for(var l=0;l<a;l++){for(var p=new Array(o),h=0,y=r.length,g=r[h];h<y;h++,g=r[h])p[h]=new f.IntPoint(e[l].X-g.X,e[l].Y-g.Y);u.push(p)}for(var v=new Array,l=0;l<a-1+n;l++)for(var h=0;h<o;h++){var S=new Array;S.push(u[l%a][h%o]),S.push(u[(l+1)%a][h%o]),S.push(u[(l+1)%a][(h+1)%o]),S.push(u[l%a][(h+1)%o]),f.Clipper.Orientation(S)||S.reverse(),v.push(S)}var T=new f.Clipper(0);return T.AddPaths(v,f.PolyType.ptSubject,!0),T.Execute(f.ClipType.ctUnion,u,f.PolyFillType.pftNonZero,f.PolyFillType.pftNonZero),u};f.Clipper.MinkowskiSum=function(){var r=arguments,e=r.length;if(e==3){var t=r[0],i=r[1],n=r[2];return f.Clipper.Minkowski(t,i,!0,n)}else if(e==4){for(var t=r[0],o=r[1],a=r[2],n=r[3],u=new f.Clipper,l,p=0,h=o.length;p<h;++p){var l=f.Clipper.Minkowski(t,o[p],!0,n);u.AddPaths(l,f.PolyType.ptSubject,!0)}n&&u.AddPaths(o,f.PolyType.ptClip,!0);var y=new f.Paths;return u.Execute(f.ClipType.ctUnion,y,a,a),y}};f.Clipper.MinkowskiDiff=function(r,e,t){return f.Clipper.Minkowski(r,e,!1,t)};f.Clipper.PolyTreeToPaths=function(r){var e=new Array;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntAny,e),e};f.Clipper.AddPolyNodeToPaths=function(r,e,t){var i=!0;switch(e){case f.Clipper.NodeType.ntOpen:return;case f.Clipper.NodeType.ntClosed:i=!r.IsOpen;break;default:break}r.m_polygon.length>0&&i&&t.push(r.m_polygon);for(var n=0,o=r.Childs(),a=o.length,u=o[n];n<a;n++,u=o[n])f.Clipper.AddPolyNodeToPaths(u,e,t)};f.Clipper.OpenPathsFromPolyTree=function(r){for(var e=new f.Paths,t=0,i=r.ChildCount();t<i;t++)r.Childs()[t].IsOpen&&e.push(r.Childs()[t].m_polygon);return e};f.Clipper.ClosedPathsFromPolyTree=function(r){var e=new f.Paths;return f.Clipper.AddPolyNodeToPaths(r,f.Clipper.NodeType.ntClosed,e),e};Ff(f.Clipper,f.ClipperBase);f.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};f.ClipperOffset=function(r,e){typeof r>"u"&&(r=2),typeof e>"u"&&(e=f.ClipperOffset.def_arc_tolerance),this.m_destPolys=new f.Paths,this.m_srcPoly=new f.Path,this.m_destPoly=new f.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 f.IntPoint,this.m_polyNodes=new f.PolyNode,this.MiterLimit=r,this.ArcTolerance=e,this.m_lowest.X=-1};f.ClipperOffset.two_pi=6.28318530717959;f.ClipperOffset.def_arc_tolerance=.25;f.ClipperOffset.prototype.Clear=function(){f.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};f.ClipperOffset.Round=f.Clipper.Round;f.ClipperOffset.prototype.AddPath=function(r,e,t){var i=r.length-1;if(!(i<0)){var n=new f.PolyNode;if(n.m_jointype=e,n.m_endtype=t,t==f.EndType.etClosedLine||t==f.EndType.etClosedPolygon)for(;i>0&&f.IntPoint.op_Equality(r[0],r[i]);)i--;n.m_polygon.push(r[0]);for(var o=0,a=0,u=1;u<=i;u++)f.IntPoint.op_Inequality(n.m_polygon[o],r[u])&&(o++,n.m_polygon.push(r[u]),(r[u].Y>n.m_polygon[a].Y||r[u].Y==n.m_polygon[a].Y&&r[u].X<n.m_polygon[a].X)&&(a=o));if(!(t==f.EndType.etClosedPolygon&&o<2||t!=f.EndType.etClosedPolygon&&o<0)&&(this.m_polyNodes.AddChild(n),t==f.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new f.IntPoint(0,a);else{var l=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(n.m_polygon[a].Y>l.Y||n.m_polygon[a].Y==l.Y&&n.m_polygon[a].X<l.X)&&(this.m_lowest=new f.IntPoint(this.m_polyNodes.ChildCount()-1,a))}}};f.ClipperOffset.prototype.AddPaths=function(r,e,t){for(var i=0,n=r.length;i<n;i++)this.AddPath(r[i],e,t)};f.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!f.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var e=this.m_polyNodes.Childs()[r];(e.m_endtype==f.EndType.etClosedPolygon||e.m_endtype==f.EndType.etClosedLine&&f.Clipper.Orientation(e.m_polygon))&&e.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var e=this.m_polyNodes.Childs()[r];e.m_endtype==f.EndType.etClosedLine&&!f.Clipper.Orientation(e.m_polygon)&&e.m_polygon.reverse()}};f.ClipperOffset.GetUnitNormal=function(r,e){var t=e.X-r.X,i=e.Y-r.Y;if(t==0&&i==0)return new f.DoublePoint(0,0);var n=1/Math.sqrt(t*t+i*i);return t*=n,i*=n,new f.DoublePoint(i,-t)};f.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,f.ClipperBase.near_zero(r)){for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==f.EndType.etClosedPolygon&&this.m_destPolys.push(t.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var i;this.ArcTolerance<=0?i=f.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*f.ClipperOffset.def_arc_tolerance?i=Math.abs(r)*f.ClipperOffset.def_arc_tolerance:i=this.ArcTolerance;var n=3.14159265358979/Math.acos(1-i/Math.abs(r));this.m_sin=Math.sin(f.ClipperOffset.two_pi/n),this.m_cos=Math.cos(f.ClipperOffset.two_pi/n),this.m_StepsPerRad=n/f.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];this.m_srcPoly=t.m_polygon;var o=this.m_srcPoly.length;if(!(o==0||r<=0&&(o<3||t.m_endtype!=f.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,o==1){if(t.m_jointype==f.JoinType.jtRound)for(var a=1,u=0,l=1;l<=n;l++){this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+u*r)));var p=a;a=a*this.m_cos-this.m_sin*u,u=p*this.m_sin+u*this.m_cos}else for(var a=-1,u=-1,l=0;l<4;++l)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+a*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+u*r))),a<0?a=1:u<0?u=1:a=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var l=0;l<o-1;l++)this.m_normals.push(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[l],this.m_srcPoly[l+1]));if(t.m_endtype==f.EndType.etClosedLine||t.m_endtype==f.EndType.etClosedPolygon?this.m_normals.push(f.ClipperOffset.GetUnitNormal(this.m_srcPoly[o-1],this.m_srcPoly[0])):this.m_normals.push(new f.DoublePoint(this.m_normals[o-2])),t.m_endtype==f.EndType.etClosedPolygon){for(var h=o-1,l=0;l<o;l++)h=this.OffsetPoint(l,h,t.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(t.m_endtype==f.EndType.etClosedLine){for(var h=o-1,l=0;l<o;l++)h=this.OffsetPoint(l,h,t.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var y=this.m_normals[o-1],l=o-1;l>0;l--)this.m_normals[l]=new f.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new f.DoublePoint(-y.X,-y.Y),h=0;for(var l=o-1;l>=0;l--)h=this.OffsetPoint(l,h,t.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var h=0,l=1;l<o-1;++l)h=this.OffsetPoint(l,h,t.m_jointype);var g;if(t.m_endtype==f.EndType.etOpenButt){var l=o-1;g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[l].X+this.m_normals[l].X*r),f.ClipperOffset.Round(this.m_srcPoly[l].Y+this.m_normals[l].Y*r)),this.m_destPoly.push(g),g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[l].X-this.m_normals[l].X*r),f.ClipperOffset.Round(this.m_srcPoly[l].Y-this.m_normals[l].Y*r)),this.m_destPoly.push(g)}else{var l=o-1;h=o-2,this.m_sinA=0,this.m_normals[l]=new f.DoublePoint(-this.m_normals[l].X,-this.m_normals[l].Y),t.m_endtype==f.EndType.etOpenSquare?this.DoSquare(l,h):this.DoRound(l,h)}for(var l=o-1;l>0;l--)this.m_normals[l]=new f.DoublePoint(-this.m_normals[l-1].X,-this.m_normals[l-1].Y);this.m_normals[0]=new f.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),h=o-1;for(var l=h-1;l>0;--l)h=this.OffsetPoint(l,h,t.m_jointype);t.m_endtype==f.EndType.etOpenButt?(g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(g),g=new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),f.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(g)):(h=1,this.m_sinA=0,t.m_endtype==f.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};f.ClipperOffset.prototype.Execute=function(){var r=arguments,e=r[0]instanceof f.PolyTree;if(e){var t=r[0],i=r[1];t.Clear(),this.FixOrientations(),this.DoOffset(i);var n=new f.Clipper(0);if(n.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)n.Execute(f.ClipType.ctUnion,t,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var o=f.Clipper.GetBounds(this.m_destPolys),a=new f.Path;if(a.push(new f.IntPoint(o.left-10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.top-10)),a.push(new f.IntPoint(o.left-10,o.top-10)),n.AddPath(a,f.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(f.ClipType.ctUnion,t,f.PolyFillType.pftNegative,f.PolyFillType.pftNegative),t.ChildCount()==1&&t.Childs()[0].ChildCount()>0){var u=t.Childs()[0];t.Childs()[0]=u.Childs()[0];for(var l=1;l<u.ChildCount();l++)t.AddChild(u.Childs()[l])}else t.Clear()}}else{var t=r[0],i=r[1];f.Clear(t),this.FixOrientations(),this.DoOffset(i);var n=new f.Clipper(0);if(n.AddPaths(this.m_destPolys,f.PolyType.ptSubject,!0),i>0)n.Execute(f.ClipType.ctUnion,t,f.PolyFillType.pftPositive,f.PolyFillType.pftPositive);else{var o=f.Clipper.GetBounds(this.m_destPolys),a=new f.Path;a.push(new f.IntPoint(o.left-10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.bottom+10)),a.push(new f.IntPoint(o.right+10,o.top-10)),a.push(new f.IntPoint(o.left-10,o.top-10)),n.AddPath(a,f.PolyType.ptSubject,!0),n.ReverseSolution=!0,n.Execute(f.ClipType.ctUnion,t,f.PolyFillType.pftNegative,f.PolyFillType.pftNegative),t.length>0&&t.splice(0,1)}}};f.ClipperOffset.prototype.OffsetPoint=function(r,e,t){if(this.m_sinA=this.m_normals[e].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[e].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return e;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 f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[e].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[e].Y*this.m_delta))),this.m_destPoly.push(new f.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(t){case f.JoinType.jtMiter:{var i=1+(this.m_normals[r].X*this.m_normals[e].X+this.m_normals[r].Y*this.m_normals[e].Y);i>=this.m_miterLim?this.DoMiter(r,e,i):this.DoSquare(r,e);break}case f.JoinType.jtSquare:this.DoSquare(r,e);break;case f.JoinType.jtRound:this.DoRound(r,e);break}return e=r,e};f.ClipperOffset.prototype.DoSquare=function(r,e){var t=Math.tan(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[e].X-this.m_normals[e].Y*t)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[e].Y+this.m_normals[e].X*t)))),this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*t)),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*t))))};f.ClipperOffset.prototype.DoMiter=function(r,e,t){var i=this.m_delta/t;this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[e].X+this.m_normals[r].X)*i),f.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[e].Y+this.m_normals[r].Y)*i)))};f.ClipperOffset.prototype.DoRound=function(r,e){for(var t=Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[r].X+this.m_normals[e].Y*this.m_normals[r].Y),i=f.Cast_Int32(f.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(t))),n=this.m_normals[e].X,o=this.m_normals[e].Y,a,u=0;u<i;++u)this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+n*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+o*this.m_delta))),a=n,n=n*this.m_cos-this.m_sin*o,o=a*this.m_sin+o*this.m_cos;this.m_destPoly.push(new f.IntPoint(f.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),f.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};f.Error=function(r){try{throw new Error(r)}catch(e){alert(e.message)}};f.JS={};f.JS.AreaOfPolygon=function(r,e){return e||(e=1),f.Clipper.Area(r)/(e*e)};f.JS.AreaOfPolygons=function(r,e){e||(e=1);for(var t=0,i=0;i<r.length;i++)t+=f.Clipper.Area(r[i]);return t/(e*e)};f.JS.BoundsOfPath=function(r,e){return f.JS.BoundsOfPaths([r],e)};f.JS.BoundsOfPaths=function(r,e){e||(e=1);var t=f.Clipper.GetBounds(r);return t.left/=e,t.bottom/=e,t.right/=e,t.top/=e,t};f.JS.Clean=function(i,e){if(!(i instanceof Array))return[];var t=i[0]instanceof Array,i=f.JS.Clone(i);if(typeof e!="number"||e===null)return f.Error("Delta is not a number in Clean()."),i;if(i.length===0||i.length==1&&i[0].length===0||e<0)return i;t||(i=[i]);for(var n=i.length,o,a,u,l,p,h,y,g=[],v=0;v<n;v++)if(a=i[v],o=a.length,o!==0){if(o<3){u=a,g.push(u);continue}for(u=a,l=e*e,p=a[0],h=1,y=1;y<o;y++)(a[y].X-p.X)*(a[y].X-p.X)+(a[y].Y-p.Y)*(a[y].Y-p.Y)<=l||(u[h]=a[y],p=a[y],h++);p=a[h-1],(a[0].X-p.X)*(a[0].X-p.X)+(a[0].Y-p.Y)*(a[0].Y-p.Y)<=l&&h--,h<o&&u.splice(h,o-h),u.length&&g.push(u)}return!t&&g.length?g=g[0]:!t&&g.length===0?g=[]:t&&g.length===0&&(g=[[]]),g};f.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var e=r[0]instanceof Array;e||(r=[r]);var t=r.length,i,n,o,a,u=new Array(t);for(n=0;n<t;n++){for(i=r[n].length,a=new Array(i),o=0;o<i;o++)a[o]={X:r[n][o].X,Y:r[n][o].Y};u[n]=a}return e||(u=u[0]),u};f.JS.Lighten=function(r,e){if(!(r instanceof Array))return[];if(typeof e!="number"||e===null)return f.Error("Tolerance is not a number in Lighten()."),f.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||e<0)return f.JS.Clone(r);r[0]instanceof Array||(r=[r]);var t,i,n,o,a,u,l,p,h,y,g,v,S,T,b,x,I,E=r.length,w=e*e,_=[];for(t=0;t<E;t++)if(n=r[t],u=n.length,u!=0){for(o=0;o<1e6;o++){for(a=[],u=n.length,n[u-1].X!=n[0].X||n[u-1].Y!=n[0].Y?(v=1,n.push({X:n[0].X,Y:n[0].Y}),u=n.length):v=0,g=[],i=0;i<u-2;i++)l=n[i],h=n[i+1],p=n[i+2],x=l.X,I=l.Y,S=p.X-x,T=p.Y-I,(S!==0||T!==0)&&(b=((h.X-x)*S+(h.Y-I)*T)/(S*S+T*T),b>1?(x=p.X,I=p.Y):b>0&&(x+=S*b,I+=T*b)),S=h.X-x,T=h.Y-I,y=S*S+T*T,y<=w&&(g[i+1]=1,i++);for(a.push({X:n[0].X,Y:n[0].Y}),i=1;i<u-1;i++)g[i]||a.push({X:n[i].X,Y:n[i].Y});if(a.push({X:n[u-1].X,Y:n[u-1].Y}),v&&n.pop(),g.length)n=a;else break}u=a.length,a[u-1].X==a[0].X&&a[u-1].Y==a[0].Y&&a.pop(),a.length>2&&_.push(a)}return!r[0]instanceof Array&&(_=_[0]),typeof _>"u"&&(_=[[]]),_};f.JS.PerimeterOfPath=function(r,e,t){if(typeof r>"u")return 0;var i=Math.sqrt,n=0,o,a,u=0,l=0,p=0,h=0,y=r.length;if(y<2)return 0;for(e&&(r[y]=r[0],y++);--y;)o=r[y],u=o.X,l=o.Y,a=r[y-1],p=a.X,h=a.Y,n+=i((u-p)*(u-p)+(l-h)*(l-h));return e&&r.pop(),n/t};f.JS.PerimeterOfPaths=function(r,e,t){t||(t=1);for(var i=0,n=0;n<r.length;n++)i+=f.JS.PerimeterOfPath(r[n],e,t);return i};f.JS.ScaleDownPath=function(r,e){var t,i;for(e||(e=1),t=r.length;t--;)i=r[t],i.X=i.X/e,i.Y=i.Y/e};f.JS.ScaleDownPaths=function(r,e){var t,i,n,o=Math.round;for(e||(e=1),t=r.length;t--;)for(i=r[t].length;i--;)n=r[t][i],n.X=n.X/e,n.Y=n.Y/e};f.JS.ScaleUpPath=function(r,e){var t,i,n=Math.round;for(e||(e=1),t=r.length;t--;)i=r[t],i.X=n(i.X*e),i.Y=n(i.Y*e)};f.JS.ScaleUpPaths=function(r,e){var t,i,n,o=Math.round;for(e||(e=1),t=r.length;t--;)for(i=r[t].length;i--;)n=r[t][i],n.X=o(n.X*e),n.Y=o(n.Y*e)};f.ExPolygons=function(){return[]};f.ExPolygon=function(){this.outer=null,this.holes=null};f.JS.AddOuterPolyNodeToExPolygons=function(r,e){var t=new f.ExPolygon;t.outer=r.Contour();var i=r.Childs(),n=i.length;t.holes=new Array(n);var o,a,u,l,p,h;for(u=0;u<n;u++)for(o=i[u],t.holes[u]=o.Contour(),l=0,p=o.Childs(),h=p.length;l<h;l++)a=p[l],f.JS.AddOuterPolyNodeToExPolygons(a,e);e.push(t)};f.JS.ExPolygonsToPaths=function(r){var e,t,i,n,o=new f.Paths;for(e=0,i=r.length;e<i;e++)for(o.push(r[e].outer),t=0,n=r[e].holes.length;t<n;t++)o.push(r[e].holes[t]);return o};f.JS.PolyTreeToExPolygons=function(r){var e=new f.ExPolygons,t,i,n,o;for(i=0,n=r.Childs(),o=n.length;i<o;i++)t=n[i],f.JS.AddOuterPolyNodeToExPolygons(t,e);return e};Bu.exports=f});var M8=N((sce,Pm)=>{m();(function(){"use strict";function r(a,u){var l=a.x-u.x,p=a.y-u.y;return l*l+p*p}c(r,"getSqDist");function e(a,u,l){var p=u.x,h=u.y,y=l.x-p,g=l.y-h;if(y!==0||g!==0){var v=((a.x-p)*y+(a.y-h)*g)/(y*y+g*g);v>1?(p=l.x,h=l.y):v>0&&(p+=y*v,h+=g*v)}return y=a.x-p,g=a.y-h,y*y+g*g}c(e,"getSqSegDist");function t(a,u){for(var l=a[0],p=[l],h,y=1,g=a.length;y<g;y++)h=a[y],r(h,l)>u&&(p.push(h),l=h);return l!==h&&p.push(h),p}c(t,"simplifyRadialDist");function i(a,u,l,p,h){for(var y=p,g,v=u+1;v<l;v++){var S=e(a[v],a[u],a[l]);S>y&&(g=v,y=S)}y>p&&(g-u>1&&i(a,u,g,p,h),h.push(a[g]),l-g>1&&i(a,g,l,p,h))}c(i,"simplifyDPStep");function n(a,u){var l=a.length-1,p=[a[0]];return i(a,0,l,u,p),p.push(a[l]),p}c(n,"simplifyDouglasPeucker");function o(a,u,l){if(a.length<=2)return a;var p=u!==void 0?u*u:1;return a=l?a:t(a,p),a=n(a,p),a}c(o,"simplify"),typeof define=="function"&&define.amd?define(function(){return o}):typeof Pm<"u"?(Pm.exports=o,Pm.exports.default=o):typeof self<"u"?self.simplify=o:window.simplify=o})()});m();m();m();m();m();m();var ad="[MappedinJS]",U2=(n=>(n[n.LOG=0]="LOG",n[n.WARN=1]="WARN",n[n.ERROR=2]="ERROR",n[n.SILENT=3]="SILENT",n))(U2||{});function N8(r){0<=r&&r<=3&&(W2.logState=r)}c(N8,"setLoggerLevel");var W2={logState:C.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(ad,...r)},warn(...r){this.logState<=1&&console.warn(ad,...r)},error(...r){this.logState<=2&&console.error(ad,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},throw(r,e){throw new Error("".concat(ad," ").concat(r),e)}},L=W2;m();m();var Rm=class Rm extends Error{};c(Rm,"InvalidTokenError");var To=Rm;To.prototype.name="InvalidTokenError";function G8(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let i=t.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}c(G8,"b64DecodeUnicode");function V8(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return G8(e)}catch{return atob(e)}}c(V8,"base64UrlDecode");function X2(r,e){if(typeof r!="string")throw new To("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,i=r.split(".")[t];if(typeof i!="string")throw new To("Invalid token specified: missing part #".concat(t+1));let n;try{n=V8(i)}catch(o){throw new To("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(o.message,")"))}try{return JSON.parse(n)}catch(o){throw new To("Invalid token specified: invalid json for part #".concat(t+1," (").concat(o.message,")"))}}c(X2,"jwtDecode");m();var ri=63710088e-1;function sd(r){var t,i;let e=X2(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(i=e.capabilities)!=null?i:{}}}c(sd,"decodeAccessToken");function On(r){return r*(Math.PI/180)}c(On,"toRadians");function j8(r){return r*(180/Math.PI)}c(j8,"toDegrees");function ld([r,e],[t,i]){let n=On(i-e),o=On(t-r),a=On(e),u=On(i),l=Math.sin(n/2)*Math.sin(n/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(a)*Math.cos(u),p=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return ri*p}c(ld,"haversineDistance");function Y2([r,e],[t,i]){let n=On(e),o=On(r),a=On(i),l=On(t)-o,p=Math.sin(l)*Math.cos(a),h=Math.cos(n)*Math.sin(a)-Math.sin(n)*Math.cos(a)*Math.cos(l);return j8((Math.atan2(p,h)+Math.PI*2)%(Math.PI*2))}c(Y2,"getForwardBearing");m();function Z2(r,e,t=!1){let i=null,n=0;return function(...o){n++,n===1&&t===!0&&r(...o);let a=c(()=>{(!t||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,e)}}c(Z2,"debounce");m();var Nm=class Nm{constructor(){d(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(i){typeof i=="function"&&i(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let i=this._subscribers[e].indexOf(t);i!==-1&&this._subscribers[e].splice(i,1)}destroy(){this._subscribers={}}};c(Nm,"PubSub");var $=Nm;m();m();var Gm=[0,4,6,8,10],le=c(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let i=0;i<r.length;i++)i>0&&!(i&3)&&(e=Math.random()*4294967296),r[i]=e>>>((i&3)<<3)&255;let t=r.map(i=>i.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],Gm.map((i,n)=>t.slice(i,n===Gm.length-1?void 0:Gm[n+1]).join("")).join("-")},"randomId");var z2="mi-session-data",q2="mi-local-data",Po,Tr,Pr,Yl=class Yl{constructor(){M(this,Tr,void 0);M(this,Pr,void 0);try{let e=sessionStorage.getItem(z2);e?P(this,Tr,JSON.parse(e)):P(this,Tr,{id:le()})}catch{P(this,Tr,{id:le()})}try{let e=localStorage.getItem(q2);e?P(this,Pr,JSON.parse(e)):P(this,Pr,{deviceId:le()})}catch{P(this,Pr,{deviceId:le()})}s(this,Tr).id||(s(this,Tr).id=le()),s(this,Pr).deviceId||(s(this,Pr).deviceId=le())}static getInstance(){return s(this,Po)||P(this,Po,new Yl),s(this,Po)}static ___clearInstance(){P(this,Po,void 0)}saveSessionData(e,t){s(this,Tr)[e]=t;try{return sessionStorage.setItem(z2,JSON.stringify(s(this,Tr))),!0}catch{return!1}}loadSessionData(e){let t=s(this,Tr)[e];if(t!=null)return t}saveLocalData(e,t){s(this,Pr)[e]=t;try{return localStorage.setItem(q2,JSON.stringify(s(this,Pr))),!0}catch{return!1}}loadLocalData(e){let t=s(this,Pr)[e];if(t!=null)return t}};Po=new WeakMap,Tr=new WeakMap,Pr=new WeakMap,c(Yl,"SafeStorage"),M(Yl,Po,void 0);var Hi=Yl;m();m();var Zl=c(r=>r!=null,"notNull");var H8=c(function(){let e=globalThis.fetch;return{fetch(...t){if(!Zl(e))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return e==null?void 0:e(...t)},setFetch(t){e=t}}},"createFetchControl")(),$2=H8.fetch;var e3=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],J2=e3[0],t3="https://api-gateway.mappedin.com/track-analytics/a/",r3="deny-watchposition",i3="load-mapview",n3="load-mapdata",o3="change-language",a3="query-directions";var Ui,Ir,$a,cd,jm=class jm{constructor(){M(this,$a);M(this,Ui,Object.freeze({}));M(this,Ir,void 0);d(this,"oneTimeEventsSent",new Set);d(this,"sendGetDirectionsEvent",Z2((e,t)=>this.sendAnalyticEvent(a3,{start:e,end:t,type:"location_to_location"}),2500));P(this,Ir,V(this,$a,cd).call(this,s(this,Ui)))}init(e){this.reset(),this.updateStateWithOptions(e)}reset(){P(this,Ui,{}),P(this,Ir,V(this,$a,cd).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(e){return P(this,Ui,Object.freeze(Object.assign({},s(this,Ui),e))),P(this,Ir,V(this,$a,cd).call(this,e)),s(this,Ir)}updateState(e){let t={...e};t.mapId&&(t.analyticsBaseUrl=Vm({...s(this,Ir),mapId:t.mapId})),t.context&&(t.context=Q2(t.context)),t.baseUri&&(t.analyticsBaseUrl=Vm({baseUri:t.baseUri,mapId:s(this,Ir).mapId})),Object.assign(s(this,Ir),t),this.handleStateUpdate(e)}handleStateUpdate(e){var t;(t=e.userPosition)!=null&&t.floorLevel?this.sendBlueDotEvents("found-floor"):e.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:e,secret:t,accessToken:i}=this.getState();return!!(e&&t)||!!i}getState(){return s(this,Ir)}getContext(){return this.getState().context||s(this,Ui).context||J2}getSessionId(){return this.getState().sessionId||s(this,Ui).sessionId||K2()}sendAnalyticEvent(e,t={}){let i=this.getState(),n=W8(i.analyticsBaseUrl,e),o={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":i.deviceId};if(i.logEvents&&L.log("Analytics.track",n,o),!i.sendEvents)return Promise.resolve();if(!this.authReady)return L.warn("Auth needs to be ready to send analytics.");let a={...t,g:i.geolocationMode,sdk_version:i.version};return i.userPosition&&Object.assign(a,i.userPosition),o["Content-Type"]="application/json",i.accessToken?o.Authorization="Bearer ".concat(i.accessToken):i.noAuth||i.secret&&i.key&&(o["x-mappedin-key"]=btoa(i.key),o["x-mappedin-secret"]=btoa(i.secret)),$2(n,{method:"POST",mode:"cors",headers:o,body:JSON.stringify(a)})}capture(e,t){if(Y8.includes(e))return L.warn("".concat(e," event is sent internally.")),Promise.resolve();let i=X8.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(i,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent(n3,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent(o3,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent(r3)}sendMapViewLoadedEvent({firstRenderDuration:e,dimension:t}){return this.sendAnalyticEvent(i3,{type:"3d",firstRenderDuration:e,width:t.width,height:t.height,devicePixelRatio:window.devicePixelRatio})}sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};Ui=new WeakMap,Ir=new WeakMap,$a=new WeakSet,cd=c(function(e){var i,n,o,a;let t=(i=e.baseUri)!=null?i:t3;return{baseUri:t,analyticsBaseUrl:Vm({...e,baseUri:t}),version:((n=C==null?void 0:C.env)==null?void 0:n.npm_package_version)||"v6",deviceId:e.deviceId||U8(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||K2(),platformString:e.platformString||"",context:Q2(e.context)||J2,geolocationMode:!1,sendEvents:(o=e.sendEvents)!=null?o:!0,logEvents:(a=e.logEvents)!=null?a:!1,noAuth:e.noAuth||!1,key:e.key,secret:e.secret}},"#getStateWithOption"),c(jm,"AnalyticsInternal");var Ja=jm;function Vm({mapId:r,baseUri:e=t3}){return"".concat(e).concat(r,"/")}c(Vm,"getBaseUrl");function U8(){return Hi.getInstance().loadLocalData("deviceId")}c(U8,"getDeviceIDFromStorage");function K2(){return Hi.getInstance().loadSessionData("id")}c(K2,"getSessionIDFromStorage");function W8(r,e){return r+e}c(W8,"buildUrl");function Q2(r){return e3.find(e=>e===r)}c(Q2,"getValidContext");var X8=["$select-location","$select-category","$query-suggest","$query-search"],Y8=[i3,n3,a3,r3,o3],pB=new Ja,Wi,Hm=class Hm{constructor(e){M(this,Wi,void 0);d(this,"capture");d(this,"updateState");P(this,Wi,e),this.capture=s(this,Wi).capture.bind(s(this,Wi)),this.updateState=s(this,Wi).updateState.bind(s(this,Wi))}getState(){return Object.assign({},s(this,Wi).getState())}};Wi=new WeakMap,c(Hm,"Analytics");var zl=Hm;m();m();var $l,Jl,Kl,Um=class Um{constructor(e,t,{enabled:i=!1}={}){M(this,$l,void 0);d(this,"searchInstance");M(this,Jl,void 0);M(this,Kl,void 0);d(this,"enabled",!1);P(this,$l,e),P(this,Jl,t),P(this,Kl,()=>{var n;(n=this.searchInstance)==null||n.then(o=>o.populate())}),i&&this.enable()}async query(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(e,t)}catch(i){return L.error("Search.query failed due to",i),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return L.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(e,t)}catch(i){return L.error("Search.suggest failed due to",i),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-ATY6WXPD.js").then(({InternalSearch:e})=>new e(s(this,$l)))),s(this,Jl).on("language-change",s(this,Kl)),await this.searchInstance)}};$l=new WeakMap,Jl=new WeakMap,Kl=new WeakMap,c(Um,"Search");var ql=Um;var s3=new WeakMap,Je,Xm=class Xm extends ${constructor(t,{search:i}={}){super();M(this,Je,void 0);d(this,"Analytics");d(this,"Search");d(this,"Query");d(this,"getDirections",c((t,i,n)=>s(this,Je).getDirections(t,i,n),"getDirections"));d(this,"getDirectionsMultiDestination",c((t,i,n)=>s(this,Je).getDirectionsMultiDestination(t,i,n),"getDirectionsMultiDestination"));P(this,Je,t),s3.set(this,t),this.Analytics=new zl(t.Analytics),this.Query=t.Query,this.Search=new ql(this,t,{enabled:i==null?void 0:i.enabled}),s(this,Je).on("language-change",n=>{this.publish("language-change",n)})}getEnv(){return s(this,Je).getEnv()}get mapName(){return s(this,Je).mapName}get mapCenter(){return s(this,Je).mapCenter}get organizationId(){return s(this,Je).organizationId}get outdoorViewToken(){return s(this,Je).outdoorViewToken}getByType(t){return s(this,Je).getByType(t)}getById(t,i){return s(this,Je).getById(t,i)}async changeLanguage(t){return s(this,Je).changeLanguage(t)}get currentLanguage(){return s(this,Je).currentLanguage}getDistance(t,i){return s(this,Je).getDistance(t,i)}toBinaryBundle({downloadLanguagePacks:t=!0}={}){return s(this,Je).toBinaryBundle({downloadLanguagePacks:t})}toJSONBundle({downloadLanguagePacks:t=!0}={}){return s(this,Je).toJSONBundle({downloadLanguagePacks:t})}};Je=new WeakMap,c(Xm,"MapData");var Wm=Xm,ud=Wm;function Ka(r){let e=s3.get(r);if(!e)throw new Error("MapDataInternal not found");return e}c(Ka,"getMapDataInternal");m();m();m();m();var l3=globalThis.fetch,d3,Z8=(d3=C==null?void 0:C.env)==null?void 0:d3.npm_package_version,Zm="https://app.mappedin.com/",z8="https://auth.mappedin.com/",c3="accessTokens",u3="sasTokens";function Xi(){if(l3==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return l3}c(Xi,"isomorphicFetch");var h3={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function f3(r){var t;let e={...h3,...r};return e.headers={...e.headers,"mappedin-sdk-version":Z8},e.things=[],"platformString"in r&&(e.headers={...e.headers,"mappedin-platform-version":r.platformString}),e.noAuth||(e.accessToken?e.authorization="Bearer ".concat(e.accessToken):e.clientId&&e.clientSecret&&(e.authorization="Basic ".concat(globalThis.btoa("".concat(e.clientId,":").concat(e.clientSecret))))),e.language=(t=e.language)==null?void 0:t.toLowerCase(),e}c(f3,"parseOptions");function q8(r,e,t=!1){let i={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};t&&delete i.language;let{headers:n}=r;n["Content-Type"]=n["Content-Type"]||"text/json",r.accessToken?n.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(n["x-mappedin-key"]=btoa(r.clientId),n["x-mappedin-secret"]=btoa(r.clientSecret));let o={method:"GET",headers:n};return r.secure&&(e+="&withcdntoken"),{req:o,url:e}}c(q8,"constructParamsForRequest");async function $8(r,e,t=!1){let i=q8(r,e,t),n=await Xi()(i.url,i.req);if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}c($8,"generateAPIRequest");async function J8(r,e="exports/mvf/1/bundle"){var o;let t=f3({baseUri:"https://api-gateway.mappedin.com/",...h3,...r}),i="".concat(t.baseUri+e,"?venue=").concat(t.venue,"&version=").concat((o=t.version)!=null?o:"2.0.0");return t.headers["Content-Type"]="application/zip",await $8(t,i)}c(J8,"getVenueMVFURL");var Ym=new TextDecoder;async function zm(r,{signal:e}){let t=await(await Xi()(r,{signal:e})).arrayBuffer();return new Uint8Array(t)}c(zm,"getLanguagePackUnitArray");async function Qa(r){let t=(await import("./browser-Q2RAR7TI.js")).unzipSync(r),i={};if(t["enterprise/"]!=null){i.enterprise={};let n=t["enterprise/locations.json"];n&&(i.enterprise.locations=JSON.parse(Ym.decode(n)));let o=t["enterprise/categories.json"];o&&(i.enterprise.categories=JSON.parse(Ym.decode(o)))}return t["manifest.json"]&&(i["manifest.geojson"]=JSON.parse(Ym.decode(t["manifest.json"]))),i}c(Qa,"parseLanguagePack");async function m3(r,{signal:e}){try{let t=await(await Xi()(r,{signal:e})).arrayBuffer();if(e.aborted)return;let i=new Uint8Array(t);return await Qa(i)}catch(t){let i=new Error("downloadLanguagePack failed");throw i.cause=t,i}}c(m3,"downloadLanguagePack");async function qm(r){return new Promise(async(e,t)=>{try{let{url:i,locale_packs:n}=await J8(r,"exports/mvf2/1/bundle"),o=await Xi()(i).then(u=>u.arrayBuffer()),a=new Uint8Array(o);e({compressed:a,localePacks:n})}catch(i){t(i)}})}c(qm,"downloadVenueBundleMVFAPIGateway");async function $m(r,e){return new Promise(async(t,i)=>{try{let{url:n}=await K8(r,e),o=await Xi()(n).then(u=>u.arrayBuffer()),a=new Uint8Array(o);t(a)}catch(n){i(n)}})}c($m,"downloadMVF");function Jm(r){return r.endsWith("/")?r:"".concat(r,"/")}c(Jm,"normalizeUrl");async function K8(r,e){let t="".concat(r.baseUri?Jm(r.baseUri):Zm,"api/venue/").concat(r.mapId,"/mvf").concat(r.viewId?"?configId=".concat(r.viewId):""),i=await Xi()(t,{headers:{Authorization:"Bearer ".concat(e)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}c(K8,"getMakerBundleURL");async function Ql(r,e=!1){let t="".concat(r.key),i=Hi.getInstance(),n=(i==null?void 0:i.loadSessionData(c3))||{},o=Math.floor(Date.now()/1e3);if(n[t]&&o<n[t].expiresTimestamp)return n[t];let a=e?await Q8(r,o):await e9(r,o),u={...n,[t]:a};return i==null||i.saveSessionData(c3,u),a}c(Ql,"getAccessToken");async function Q8(r,e){var o;let t="".concat((o=r.baseAuthUri)!=null?o:z8,"oauth2/token"),i=await Xi()(t,{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 n=await i.json();return{accessToken:n.access_token,expiresTimestamp:e+n.expires_in}}c(Q8,"fetchAccessTokenEnterprise");async function e9(r,e){let t="".concat(r.baseAuthUri?Jm(r.baseAuthUri):Zm,"api/api-key/token"),i=await Xi()(t,{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 n=await i.json();return{accessToken:n.access_token,expiresTimestamp:e+n.expires_in}}c(e9,"fetchAccessToken");function pd(r){var i,n,o,a,u,l,p,h;let e=new TextDecoder,t=e.decode.bind(e);try{let y={"connection.json":JSON.parse(t(r["connection.json"])),"manifest.geojson":JSON.parse(t(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(t(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(t(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(t(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{}};if(r.enterprise!=null&&(y.enterprise={},(i=r.enterprise)!=null&&i["locations.json"]&&(y.enterprise.locations=JSON.parse(t((n=r.enterprise)==null?void 0:n["locations.json"]))),(o=r.enterprise)!=null&&o["categories.json"]&&(y.enterprise.categories=JSON.parse(t((a=r.enterprise)==null?void 0:a["categories.json"]))),(u=r.enterprise)!=null&&u["venue.json"]&&(y.enterprise.venue=JSON.parse(t((l=r.enterprise)==null?void 0:l["venue.json"]))),(p=r.enterprise)!=null&&p["locationInstances.json"]&&(y.enterprise.locationInstances=JSON.parse(t((h=r.enterprise)==null?void 0:h["locationInstances.json"])))),r["floorstack.json"]!=null?y["floorstack.json"]=JSON.parse(t(r["floorstack.json"])):r["mapstack.json"]!=null&&(y["mapstack.json"]=JSON.parse(t(r["mapstack.json"]))),y["floorstack.json"]==null&&y["mapstack.json"]==null&&y["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(y["floor.geojson"]=JSON.parse(t(r["floor.geojson"]))),y["floor.geojson"]==null&&y["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(y["styles.json"]=JSON.parse(t(r["styles.json"]))),"shapes.json"in r&&(y["shapes.json"]=JSON.parse(t(r["shapes.json"]))),r.annotation!=null){y.annotation={};let v=Object.keys(r.annotation);for(let S of v){let T=S.replace(/\.json|\.geojson/g,"");y.annotation[T]=JSON.parse(t(r.annotation[S]))}}let g=Object.keys(r.space);for(let v of g){let S=v.replace(/\.json|\.geojson/g,"");y.space[S]=JSON.parse(t(r.space[v]))}if(r.obstruction!=null){let v=Object.keys(r.obstruction);for(let S of v){let T=S.replace(/\.json|\.geojson/g,"");y.obstruction[T]=JSON.parse(t(r.obstruction[S]))}}else y.obstruction={};if(r.entrance!=null){let v=Object.keys(r.entrance);for(let S of v){let T=S.replace(/\.json|\.geojson/g,"");y.entrance[T]=JSON.parse(t(r.entrance[S]))}}else y.entrance={};if("floorImages"in r&&r.floorImages!=null){y.floorImages={};for(let v of Object.keys(r.floorImages)){let S=v.replace(/\.json|\.geojson/g,"");y.floorImages[S]=JSON.parse(t(r.floorImages[v]))}}if("textAreas"in r&&r.textAreas!=null){y.textAreas={};for(let v of Object.keys(r.textAreas)){let S=v.replace(/\.json|\.geojson/g,"");y.textAreas[S]=JSON.parse(t(r.textAreas[v]))}}if("facade"in r&&r.facade!=null){y.facade={};for(let v of Object.keys(r.facade)){let S=v.replace(/\.json|\.geojson/g,"");y.facade[S]=JSON.parse(t(r.facade[v]))}}if("area"in r&&r.area!=null){y.area={};for(let v of Object.keys(r.area)){let S=v.replace(/\.json|\.geojson/g,"");y.area[S]=JSON.parse(t(r.area[v]))}}return y}catch(y){throw L.error(y),new Error("MVF parsing failed! Probably encountered a bad file.")}}c(pd,"parseMVF");function t9(r){if(r==null||typeof r!="object")return!1;let e=["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&&e.push("styles.json"),"shapes.json"in r&&e.push("shapes.json");for(let t of e)if(r[t]==null||r[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}c(t9,"validateStaticMVFFiles");async function dd(r){return new Promise(async(e,t)=>{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 n=(await import("./browser-Q2RAR7TI.js")).unzipSync(r);if(!t9(n))throw new Error("MVF is missing some expect static files. Unzipping failed.");let o={},a=Object.keys(n);for(let u of a){if(n[u].length===0)continue;let l=u.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){o[l[0]]=n[u];continue}if(l[0]==="image"){L.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else o[l[0]]==null&&(o[l[0]]={}),o[l[0]][l[1]]=n[u]}e(o)}catch(i){t(i)}})}c(dd,"unzipMVF");async function hd(r,e){let t="".concat(e),i=Hi.getInstance(),n=(i==null?void 0:i.loadSessionData(u3))||{},o=Math.floor(Date.now()/1e3);if(n[t]&&o<n[t].expires)return n[t];let a=await r9(r,e),u={...n,[t]:{token:a.token,expires:o+new Date(a.expires).getTime()/1e3}};return i==null||i.saveSessionData(u3,u),a}c(hd,"getSasToken");async function r9(r,e){let t="".concat(r.baseAuthUri?Jm(r.baseAuthUri):Zm,"api/v1/venue/").concat(r.mapId,"/sas-token"),i=await Xi()(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText,": ").concat(await i.text()));return await i.json()}c(r9,"fetchSasToken");function Io(){let r="us",e={};function t(){return o9(s9(r),e)}return c(t,"getState"),{updateByUserOption(i){var n,o;i.environment&&(r=i.environment),i.baseUri&&(e.baseUri=i.baseUri),i.baseAuthUri&&(e.baseAuthUri=i.baseAuthUri),(n=i.analytics)!=null&&n.baseUri&&(e.analyticsBaseUri=(o=i.analytics)==null?void 0:o.baseUri)},updateTileServerBaseUrl(i){e.tileServerUri=i},updateEnvironment(i){r=i},getBaseUri(i){return r==="us"&&i?p3.baseUri:t().baseUri},getBaseAuthUri(i=!1){return r==="us"&&i?p3.baseAuthUri:t().baseAuthUri},getAnalyticsBaseUri(){return t().analyticsBaseUri},getTileServerUri(){return t().tileServerUri},reset(){r="us",e={}},__getState:t}}c(Io,"createEnvControl");var y3=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"}),p3=Object.freeze({...y3,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),i9=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"}),n9=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 o9(r,e){return{...r,...e}}c(o9,"getAuthStateByEnvironment");var a9={eu:i9,us:y3,"us-staging":n9};function s9(r){return a9[r]}c(s9,"getEnvironmentAuthState");m();m();m();m();var yt=63710088e-1,g3={centimeters:yt*100,centimetres:yt*100,degrees:yt/111325,feet:yt*3.28084,inches:yt*39.37,kilometers:yt/1e3,kilometres:yt/1e3,meters:yt,metres:yt,miles:yt/1609.344,millimeters:yt*1e3,millimetres:yt*1e3,nauticalmiles:yt/1852,radians:1,yards:yt*1.0936},RB={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/yt,yards:1.0936133};function Ln(r,e,t){t===void 0&&(t={});var i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=r,i}c(Ln,"feature");function wr(r,e,t){if(t===void 0&&(t={}),!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(!Km(r[0])||!Km(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Ln(i,e,t)}c(wr,"point");function Yi(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:r};return Ln(i,e,t)}c(Yi,"lineString");function ec(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}c(ec,"featureCollection");function v3(r,e){e===void 0&&(e="kilometers");var t=g3[e];if(!t)throw new Error(e+" units is invalid");return r*t}c(v3,"radiansToLength");function b3(r,e){e===void 0&&(e="kilometers");var t=g3[e];if(!t)throw new Error(e+" units is invalid");return r/t}c(b3,"lengthToRadians");function tc(r){var e=r%(2*Math.PI);return e*180/Math.PI}c(tc,"radiansToDegrees");function Ft(r){var e=r%360;return e*Math.PI/180}c(Ft,"degreesToRadians");function Km(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}c(Km,"isNumber");function dr(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")}c(dr,"getCoord");function zt(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")}c(zt,"getCoords");function C3(r){return r.type==="Feature"?r.geometry:r}c(C3,"getGeom");function x3(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}c(x3,"getType");function l9(r,e,t){t===void 0&&(t={});for(var i=dr(r),n=zt(e),o=0;o<n.length-1;o++){var a=!1;if(t.ignoreEndVertices&&(o===0&&(a="start"),o===n.length-2&&(a="end"),o===0&&o+1===n.length-1&&(a="both")),c9(n[o],n[o+1],i,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}c(l9,"booleanPointOnLine");function c9(r,e,t,i,n){var o=t[0],a=t[1],u=r[0],l=r[1],p=e[0],h=e[1],y=t[0]-u,g=t[1]-l,v=p-u,S=h-l,T=y*S-g*v;if(n!==null){if(Math.abs(T)>n)return!1}else if(T!==0)return!1;if(i){if(i==="start")return Math.abs(v)>=Math.abs(S)?v>0?u<o&&o<=p:p<=o&&o<u:S>0?l<a&&a<=h:h<=a&&a<l;if(i==="end")return Math.abs(v)>=Math.abs(S)?v>0?u<=o&&o<p:p<o&&o<=u:S>0?l<=a&&a<h:h<a&&a<=l;if(i==="both")return Math.abs(v)>=Math.abs(S)?v>0?u<o&&o<p:p<o&&o<u:S>0?l<a&&a<h:h<a&&a<l}else return Math.abs(v)>=Math.abs(S)?v>0?u<=o&&o<=p:p<=o&&o<=u:S>0?l<=a&&a<=h:h<=a&&a<=l;return!1}c(c9,"isPointOnLineSegment");var S3=l9;m();m();m();function fd(r,e,t){if(r!==null)for(var i,n,o,a,u,l,p,h=0,y=0,g,v=r.type,S=v==="FeatureCollection",T=v==="Feature",b=S?r.features.length:1,x=0;x<b;x++){p=S?r.features[x].geometry:T?r.geometry:r,g=p?p.type==="GeometryCollection":!1,u=g?p.geometries.length:1;for(var I=0;I<u;I++){var E=0,w=0;if(a=g?p.geometries[I]:p,a!==null){l=a.coordinates;var _=a.type;switch(h=t&&(_==="Polygon"||_==="MultiPolygon")?1:0,_){case null:break;case"Point":if(e(l,y,x,E,w)===!1)return!1;y++,E++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(e(l[i],y,x,E,w)===!1)return!1;y++,_==="MultiPoint"&&E++}_==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(n=0;n<l[i].length-h;n++){if(e(l[i][n],y,x,E,w)===!1)return!1;y++}_==="MultiLineString"&&E++,_==="Polygon"&&w++}_==="Polygon"&&E++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(w=0,n=0;n<l[i].length;n++){for(o=0;o<l[i][n].length-h;o++){if(e(l[i][n][o],y,x,E,w)===!1)return!1;y++}w++}E++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(fd(a.geometries[i],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}c(fd,"coordEach");function Qm(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}c(Qm,"featureEach");function u9(r,e){var t,i,n,o,a,u,l,p,h,y,g=0,v=r.type==="FeatureCollection",S=r.type==="Feature",T=v?r.features.length:1;for(t=0;t<T;t++){for(u=v?r.features[t].geometry:S?r.geometry:r,p=v?r.features[t].properties:S?r.properties:{},h=v?r.features[t].bbox:S?r.bbox:void 0,y=v?r.features[t].id:S?r.id:void 0,l=u?u.type==="GeometryCollection":!1,a=l?u.geometries.length:1,n=0;n<a;n++){if(o=l?u.geometries[n]:u,o===null){if(e(null,g,p,h,y)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,g,p,h,y)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],g,p,h,y)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}c(u9,"geomEach");function rc(r,e){u9(r,function(t,i,n,o,a){var u=t===null?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return e(Ln(t,n,{bbox:o,id:a}),i,0)===!1?!1:void 0}var l;switch(u){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var p=0;p<t.coordinates.length;p++){var h=t.coordinates[p],y={type:l,coordinates:h};if(e(Ln(y,n),i,p)===!1)return!1}})}c(rc,"flattenEach");function p9(r,e){rc(r,function(t,i,n){var o=0;if(t.geometry){var a=t.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var u,l=0,p=0,h=0;if(fd(t,function(y,g,v,S,T){if(u===void 0||i>l||S>p||T>h){u=y,l=i,p=S,h=T,o=0;return}var b=Yi([u,y],t.properties);if(e(b,i,n,T,o)===!1)return!1;o++,u=y})===!1)return!1}}})}c(p9,"segmentEach");function M3(r,e,t){var i=t,n=!1;return p9(r,function(o,a,u,l,p){n===!1&&t===void 0?i=o:i=e(i,o,a,u,l,p),n=!0}),i}c(M3,"segmentReduce");function ey(r){var e=[1/0,1/0,-1/0,-1/0];return fd(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}c(ey,"bbox");ey.default=ey;var md=ey;function d9(r,e){e===void 0&&(e={});var t=md(r),i=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return wr([i,n],e.properties,e)}c(d9,"center");var yd=d9;m();m();function h9(r,e,t){t===void 0&&(t={});var i=dr(r),n=dr(e),o=Ft(n[1]-i[1]),a=Ft(n[0]-i[0]),u=Ft(i[1]),l=Ft(n[1]),p=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(l);return v3(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),t.units)}c(h9,"distance");var An=h9;function gd(r,e){return e===void 0&&(e={}),M3(r,function(t,i){var n=i.geometry.coordinates;return t+An(n[0],n[1],e)},0)}c(gd,"length");m();m();m();function vd(r,e,t){if(t===void 0&&(t={}),t.final===!0)return f9(r,e);var i=dr(r),n=dr(e),o=Ft(i[0]),a=Ft(n[0]),u=Ft(i[1]),l=Ft(n[1]),p=Math.sin(a-o)*Math.cos(l),h=Math.cos(u)*Math.sin(l)-Math.sin(u)*Math.cos(l)*Math.cos(a-o);return tc(Math.atan2(p,h))}c(vd,"bearing");function f9(r,e){var t=vd(e,r);return t=(t+180)%360,t}c(f9,"calculateFinalBearing");m();function wo(r,e,t,i){i===void 0&&(i={});var n=dr(r),o=Ft(n[0]),a=Ft(n[1]),u=Ft(t),l=b3(e,i.units),p=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(u)),h=o+Math.atan2(Math.sin(u)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(p)),y=tc(h),g=tc(p);return wr([y,g],i.properties)}c(wo,"destination");m();m();function m9(r){if(!r)throw new Error("geojson is required");var e=[];return rc(r,function(t){y9(t,e)}),ec(e)}c(m9,"lineSegment");function y9(r,e){var t=[],i=r.geometry;if(i!==null){switch(i.type){case"Polygon":t=zt(i);break;case"LineString":t=[zt(i)]}t.forEach(function(n){var o=g9(n,r.properties);o.forEach(function(a){a.id=e.length,e.push(a)})})}}c(y9,"lineSegmentFeature");function g9(r,e){var t=[];return r.reduce(function(i,n){var o=Yi([i,n],e);return o.bbox=v9(i,n),t.push(o),n}),t}c(g9,"createSegments");function v9(r,e){var t=r[0],i=r[1],n=e[0],o=e[1],a=t<n?t:n,u=i<o?i:o,l=t>n?t:n,p=i>o?i:o;return[a,u,l,p]}c(v9,"bbox");var ty=m9;var LS=Ul(DS(),1);function jw(r,e){var t={},i=[];if(r.type==="LineString"&&(r=Ln(r)),e.type==="LineString"&&(e=Ln(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var n=OS(r,e);return n&&i.push(n),ec(i)}var o=(0,LS.default)();return o.load(ty(e)),Qm(ty(r),function(a){Qm(o.search(a),function(u){var l=OS(a,u);if(l){var p=zt(l).join(",");t[p]||(t[p]=!0,i.push(l))}})}),ec(i)}c(jw,"lineIntersect");function OS(r,e){var t=zt(r),i=zt(e);if(t.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 n=t[0][0],o=t[0][1],a=t[1][0],u=t[1][1],l=i[0][0],p=i[0][1],h=i[1][0],y=i[1][1],g=(y-p)*(a-n)-(h-l)*(u-o),v=(h-l)*(o-p)-(y-p)*(n-l),S=(a-n)*(o-p)-(u-o)*(n-l);if(g===0)return null;var T=v/g,b=S/g;if(T>=0&&T<=1&&b>=0&&b<=1){var x=n+T*(a-n),I=o+T*(u-o);return wr([x,I])}return null}c(OS,"intersects");var AS=jw;function Hw(r,e,t){t===void 0&&(t={});var i=wr([1/0,1/0],{dist:1/0}),n=0;return rc(r,function(o){for(var a=zt(o),u=0;u<a.length-1;u++){var l=wr(a[u]);l.properties.dist=An(e,l,t);var p=wr(a[u+1]);p.properties.dist=An(e,p,t);var h=An(l,p,t),y=Math.max(l.properties.dist,p.properties.dist),g=vd(l,p),v=wo(e,y,g+90,t),S=wo(e,y,g-90,t),T=AS(Yi([v.geometry.coordinates,S.geometry.coordinates]),Yi([l.geometry.coordinates,p.geometry.coordinates])),b=null;T.features.length>0&&(b=T.features[0],b.properties.dist=An(e,b,t),b.properties.location=n+An(l,b,t)),l.properties.dist<i.properties.dist&&(i=l,i.properties.index=u,i.properties.location=n),p.properties.dist<i.properties.dist&&(i=p,i.properties.index=u+1,i.properties.location=n+h),b&&b.properties.dist<i.properties.dist&&(i=b,i.properties.index=u),n+=h}}),i}c(Hw,"nearestPointOnLine");var Cc=Hw;function Uw(r,e,t){var i=zt(t);if(x3(t)!=="LineString")throw new Error("line must be a LineString");var n=Cc(t,r),o=Cc(t,e),a;n.properties.index<=o.properties.index?a=[n,o]:a=[o,n];for(var u=[a[0].geometry.coordinates],l=a[0].properties.index+1;l<a[1].properties.index+1;l++)u.push(i[l]);return u.push(a[1].geometry.coordinates),Yi(u,t.properties)}c(Uw,"lineSlice");var Hg=Uw;var Ww=1e-7;function Ug(r){return{type:"Point",coordinates:r}}c(Ug,"point");function Xw(r,e){let{coordinates:t}=e.geometry,{coordinates:i}=r.geometry,n=t.map(o=>Cc(r,Ug(o)));return i.reduce((o,a)=>{let u=Hg(Ug(a),n[0],r),l=Hg(Ug(a),n[1],r),p=gd(u)<gd(l)?u:l;return p.properties={...r.properties,entrances:[]},o.concat([p])},[])}c(Xw,"splitObstructionByEntrance");function Wg(r,e){return e.reduce((t,i)=>{let n={epsilon:Ww},o=t.obstructions.findIndex(u=>S3(yd(i),u,n)),a=t.obstructions[o];if(a){let[u,l]=Xw(a,i);t.entrances.push(i),t.obstructions.splice(o,1,u,l)}return t},{obstructions:[r],entrances:[]})}c(Wg,"findAndSplitObstructionByAllEntrances");m();m();m();var ps=class ps{constructor(e,t,i){d(this,"__type",ps.__type);d(this,"id",le());d(this,"latitude");d(this,"longitude");d(this,"floorId");this.latitude=e,this.longitude=t,this.floorId=i}static is(e){return e.__type===ps.__type}isEqual(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.floorId===e.floorId}toJSON(){return{latitude:this.latitude,longitude:this.longitude,floor:this.floorId}}destroy(){}};c(ps,"Coordinate"),d(ps,"__type","coordinate");var Xg=ps,se=Xg;m();var Yg=class Yg{constructor(e){d(this,"id");this.id=e}};c(Yg,"BaseMetaData");var gt=Yg;var Vn,vt,Oo,Lo,ds=class ds extends gt{constructor(t,i){super(i.mvfData.properties.id);d(this,"__type",ds.__type);M(this,Vn,void 0);M(this,vt,{});M(this,Oo,void 0);M(this,Lo,void 0);P(this,Vn,t),P(this,Oo,i.floorId),P(this,Lo,i.mvfData)}static is(t){return t.__type===ds.__type}get locations(){return s(this,vt).locations?s(this,vt).locations:(s(this,vt).locations=(s(this,Vn).locationIdsByNodeId[this.id]||[]).map(t=>s(this,Vn).getById("enterprise-location",t)).filter(Boolean),s(this,vt).locations)}get floor(){let t=s(this,Vn).getById("floor",s(this,Oo));if(t==null)throw new Error("Floor ".concat(s(this,Oo)," not found!"));return t}get coordinate(){if(s(this,vt).coordinate==null){let[t,i]=s(this,Lo).geometry.coordinates;s(this,vt).coordinate=new se(i,t,s(this,Oo))}return s(this,vt).coordinate}get externalId(){var t;return(t=s(this,Lo).properties.externalId)!=null?t:""}get neighbors(){if(s(this,vt).neighbours==null){let t=s(this,Lo).properties.neighbors.map(i=>{let n=s(this,Vn).getById("node",i.id);if(n==null)throw new Error("Node ".concat(i.id," not found!"));return n});s(this,vt).neighbours=t}return s(this,vt).neighbours}toJSON(){return{id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(t=>t.id)}}destroy(){for(let t of Object.keys(s(this,vt)))delete s(this,vt)[t]}};Vn=new WeakMap,vt=new WeakMap,Oo=new WeakMap,Lo=new WeakMap,c(ds,"Node"),d(ds,"__type","node");var Zg=ds,ai=Zg;m();m();m();m();var Sc,hs,xc=class xc extends gt{constructor(t){super(String(le()));M(this,Sc,{});M(this,hs,void 0);P(this,hs,t.mvfData)}static is(t){return t.__type===xc.__type}get url(){return s(this,hs).url}get name(){return s(this,hs).displayName}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,Sc)))delete s(this,Sc)[t]}};Sc=new WeakMap,hs=new WeakMap,c(xc,"Hyperlink"),d(xc,"__type","hyperlink");var zg=xc,mh=zg;m();var Tc,Ao,Mc=class Mc extends gt{constructor(t){super(String(le()));M(this,Tc,{});M(this,Ao,void 0);P(this,Ao,t.mvfData)}static is(t){return t.__type===Mc.__type}get url(){return s(this,Ao).url}get name(){return s(this,Ao).altText}get altText(){return s(this,Ao).altText}toJSON(){return{id:this.id,url:this.url,name:this.name}}destroy(){for(let t of globalThis.Object.keys(s(this,Tc)))delete s(this,Tc)[t]}};Tc=new WeakMap,Ao=new WeakMap,c(Mc,"Image"),d(Mc,"__type","image");var qg=Mc,yh=qg;var $g=class $g{constructor(e,t,i){d(this,"id");d(this,"links");d(this,"images");var n,o,a,u;this.id=e,this.links=(o=(n=i==null?void 0:i.links)==null?void 0:n.map(l=>new mh({mvfData:l})))!=null?o:[],this.images=(u=(a=i==null?void 0:i.images)==null?void 0:a.map(l=>new yh({mvfData:{...l,url:t.sasToken?l.url+"?".concat(t.sasToken):l.url}})))!=null?u:[]}};c($g,"BaseMapData");var Re=$g;var Pc,ko,ms,jn,fs=class fs extends Re{constructor(t,i){super(i.mvfData.properties.id,t,i.mvfData.properties.details);d(this,"__type",fs.__type);M(this,Pc,void 0);M(this,ko,void 0);M(this,ms,{});M(this,jn,void 0);P(this,Pc,t),P(this,ko,i.floorId),P(this,jn,i.mvfData)}static is(t){return t.__type===fs.__type}get name(){var t,i;return(i=(t=s(this,jn).properties.details)==null?void 0:t.name)!=null?i:""}get externalId(){var t;return(t=s(this,jn).properties.externalId)!=null?t:""}get description(){var t,i;return(i=(t=s(this,jn).properties.details)==null?void 0:t.description)!=null?i:""}get center(){var t;if(s(this,ms).center==null){let[i,n]=(t=s(this,jn).properties.center)!=null?t:[0,0];s(this,ms).center=new se(n,i,s(this,ko))}return s(this,ms).center}get floor(){let t=s(this,Pc).getById("floor",s(this,ko));if(t==null)throw new Error("Floor ".concat(s(this,ko)," not found!"));return t}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Pc=new WeakMap,ko=new WeakMap,ms=new WeakMap,jn=new WeakMap,c(fs,"Area"),d(fs,"__type","area");var Jg=fs,$i=Jg;m();var Fo,Ji,Bo,si,ys=class ys extends Re{constructor(t,i){super(i.mvfData.properties.id,t,i.mvfData.properties.details);d(this,"__type",ys.__type);M(this,Fo,void 0);M(this,Ji,void 0);M(this,Bo,void 0);M(this,si,void 0);P(this,Ji,{}),P(this,si,i.mvfData),P(this,Fo,t),P(this,Bo,i.floorId)}static is(t){return t.__type===ys.__type}get name(){var t,i,n;return"details"in s(this,si).properties?(n=(i=s(this,si).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,si).properties.externalId)!=null?t:""}get externalId(){var t;return(t=s(this,si).properties.externalId)!=null?t:""}get description(){var t,i;return(i=(t=s(this,si).properties.details)==null?void 0:t.description)!=null?i:""}get floor(){let t=s(this,Fo).getById("floor",s(this,Bo));if(t==null)throw new Error("Floor ".concat(s(this,Bo)," not found!"));return t}get center(){if(s(this,Ji).center==null){let[[t,i],[n,o]]=s(this,si).geometry.coordinates,a=(t+n)/2,u=(i+o)/2;s(this,Ji).center=new se(u,a,s(this,Bo))}return s(this,Ji).center}get isExterior(){var n;let t=s(this,Fo).obstructionIdByEntranceId[this.id],i=s(this,Fo).getMVFFeatureById("obstruction",t);return(n=i==null?void 0:i.properties.footprintComponent)!=null?n:!1}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(s(this,Ji)))delete s(this,Ji)[t]}};Fo=new WeakMap,Ji=new WeakMap,Bo=new WeakMap,si=new WeakMap,c(ys,"Door"),d(ys,"__type","door");var Kg=ys,fr=Kg;m();var Hn,Ro,$t,Jt,gs=class gs extends Re{constructor(t,i){super(i.mvfData.properties.id,t,i.mvfData.properties.details);d(this,"__type",gs.__type);M(this,Hn,void 0);M(this,Ro,void 0);M(this,$t,{});M(this,Jt,void 0);P(this,Hn,t),P(this,Ro,i.floorId),P(this,Jt,i.mvfData)}static is(t){return t.__type===gs.__type}get name(){var t,i,n;return"details"in s(this,Jt).properties?(n=(i=s(this,Jt).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,Jt).properties.externalId)!=null?t:""}get type(){return Zw(s(this,Jt).properties.kind)}get description(){var t,i;return(i=(t=s(this,Jt).properties.details)==null?void 0:t.description)!=null?i:""}get externalId(){var t;return(t=s(this,Jt).properties.externalId)!=null?t:""}get locations(){if(s(this,$t).locations)return s(this,$t).locations;s(this,$t).locations=[];let t=s(this,Hn).locationsBySpaceId[s(this,Jt).properties.id];if((t==null?void 0:t.length)>0)for(let i of t){let n=s(this,Hn).getById("enterprise-location",i.id);n&&s(this,$t).locations.push(n)}return s(this,$t).locations}get floor(){let t=s(this,Hn).getById("floor",s(this,Ro));if(t==null)throw new Error("Floor ".concat(s(this,Ro)," not found!"));return t}get doors(){return s(this,Jt).properties.destinationNodes.reduce((t,i)=>{let n=s(this,Hn).doorsByNodeId[i];return n&&t.push(n),t},[])}get center(){var t;if(s(this,$t).center==null){let[i,n]=(t=s(this,Jt).properties.center)!=null?t:[0,0];s(this,$t).center=new se(n,i,s(this,Ro))}return s(this,$t).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of Object.keys(s(this,$t)))delete s(this,$t)[t]}};Hn=new WeakMap,Ro=new WeakMap,$t=new WeakMap,Jt=new WeakMap,c(gs,"Space"),d(gs,"__type","space");var Qg=gs,Yw=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function Zw(r){if(r==null||r==="default")return"room";let e=r.toLowerCase();return Yw.includes(e)?e:"room"}c(Zw,"validateSpaceType");var Rt=Qg;m();var Dr,Pe,Ki,vs=class vs extends Re{constructor(t,i){super(i.mvfData.id,t);d(this,"__type",vs.__type);M(this,Dr,void 0);M(this,Pe,{});M(this,Ki,void 0);P(this,Dr,t),P(this,Ki,i.mvfData)}static is(t){return t.__type===vs.__type}get name(){var t,i;return"name"in s(this,Ki)?(i=s(this,Ki).name)!=null?i:"":(t=s(this,Ki).externalId)!=null?t:""}get externalId(){var t;return(t=s(this,Ki).externalId)!=null?t:""}get elevation(){return s(this,Ki).elevation}get spaces(){if(s(this,Pe).spaces==null){let t=s(this,Dr).spaces.filter(i=>i.floor.id===this.id);s(this,Pe).spaces=t}return s(this,Pe).spaces}get objects(){if(s(this,Pe).objects==null){let t=s(this,Dr).objects.filter(i=>i.floor.id===this.id);s(this,Pe).objects=t}return s(this,Pe).objects}get connections(){if(s(this,Pe).connections==null){let t=s(this,Dr).connections.filter(i=>i.floors.includes(this));s(this,Pe).connections=t}return s(this,Pe).connections}get doors(){if(s(this,Pe).doors==null){let t=s(this,Dr).doors.filter(i=>i.floor.id===this.id);s(this,Pe).doors=t}return s(this,Pe).doors}get annotations(){if(s(this,Pe).annotations==null){let t=s(this,Dr).annotations.filter(i=>i.floor.id===this.id);s(this,Pe).annotations=t}return s(this,Pe).annotations}get pois(){if(s(this,Pe).pois==null){let t=s(this,Dr).pointsOfInterest.filter(i=>i.floor.id===this.id);s(this,Pe).pois=t}return s(this,Pe).pois}get floorStack(){if(s(this,Pe).floorStack==null){let t=s(this,Dr).floorStacks.find(i=>i.floors.includes(this));s(this,Pe).floorStack=t}return s(this,Pe).floorStack}toJSON(){return{id:this.id,name:this.name,elevation:this.elevation,spaces:this.spaces.map(t=>t.id),objects:this.objects.map(t=>t.id),connections:this.connections.map(t=>t.id),doors:this.doors.map(t=>t.id),annotations:this.annotations.map(t=>t.id),pois:this.pois.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,Pe)))delete s(this,Pe)[t]}};Dr=new WeakMap,Pe=new WeakMap,Ki=new WeakMap,c(vs,"Floor"),d(vs,"__type","floor");var e1=vs,Qi=e1;m();m();m();function Ic(r){return typeof r=="string"?r:r.id}c(Ic,"getId");function t1(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}c(t1,"isPosition");m();function et(r){let e;if(Rt.is(r)||fr.is(r)||Nt.is(r)||$i.is(r)||ci.is(r))e=r.center;else if(li.is(r)||Un.is(r))e=r.coordinate;else if(se.is(r))e=r;else if(ai.is(r))e=r.coordinate;else if(Or.is(r))e=r.coordinates[0];else return;return e}c(et,"getCoordinateFromStuffs");m();m();var wc={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]}},ui="ExteriorWalls",Wn="Walls",kS=0,bs="InteriorDoors",Cs="ExteriorDoors",He="GeometryLayer",Xn="LabelsLayer",pi="MarkersLayer",xs="FootprintLayer",FS="ImagesLayer";var BS=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"];function r1(r){var e,t;if((e=r.outdoorView)!=null&&e.enabled&&!((t=r.outdoorView)!=null&&t.token)){let i=new Error("Missing outdoorView token");throw i.name="MissingOutdoorViewToken",i}}c(r1,"validateOptions");function i1(r,e){var n,o,a,u;let t=((n=r==null?void 0:r.outdoorView)==null?void 0:n.token)||e.outdoorViewToken,i={...wc,...r!=null?r:{},outdoorView:{enabled:((o=r==null?void 0:r.outdoorView)==null?void 0:o.enabled)===void 0?!!t:(a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled,layersHiddenByGeometry:(u=wc.outdoorView)==null?void 0:u.layersHiddenByGeometry,...r==null?void 0:r.outdoorView}};return t&&i.outdoorView&&(i.outdoorView.token=t),i}c(i1,"handleShow3DMapOptionDefault");function RS(r){let e={remove_watermark:!1};if(r)try{let t=sd(r);Object.assign(e,t.capabilities)}catch(t){L.error("Error decoding capabilities from token",t)}return e}c(RS,"handleTokenCapabilities");var Ms,en,Lr,Ss=class Ss extends Re{constructor(t,i){let n=Object.values(i.mvfDataByFloorId)[0];super(n.properties.id,t,"details"in n.properties?n.properties.details:void 0);d(this,"__type",Ss.__type);M(this,Ms,void 0);M(this,en,void 0);M(this,Lr,void 0);P(this,en,{}),P(this,Ms,t),P(this,Lr,i.mvfDataByFloorId)}static is(t){return t.__type===Ss.__type}get name(){var i,n,o;let t=Object.values(s(this,Lr))[0];return"details"in t.properties?(o=(n=t.properties.details)==null?void 0:n.name)!=null?o:"":(i=t.properties.externalId)!=null?i:""}get description(){var t,i;return(i=(t=Object.values(s(this,Lr))[0].properties.details)==null?void 0:t.description)!=null?i:""}get accessible(){var t;return(t=Object.values(s(this,Lr))[0].properties.accessible)!=null?t:!1}get externalId(){var t;return(t=Object.values(s(this,Lr))[0].properties.externalId)!=null?t:""}get type(){var t,i;return(i=(t=Object.values(s(this,Lr))[0].properties.kind)==null?void 0:t.split(".")[1])!=null?i:"unknown"}get coordinates(){return s(this,en).coordinates==null&&(s(this,en).coordinates=Object.entries(s(this,Lr)).map(([t,i])=>new se(i.geometry.coordinates[1],i.geometry.coordinates[0],t))),s(this,en).coordinates}get nodes(){return Object.values(s(this,Lr))[0].properties.nodes.map(t=>s(this,Ms).getById("node",t))}get floors(){return this.coordinates.map(t=>t.floorId?s(this,Ms).getById("floor",t.floorId):void 0).filter(Zl)}toJSON(){return{id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(t=>t.toJSON()),floors:this.floors.map(t=>t.id)}}destroy(){for(let t of Object.keys(s(this,en)))delete s(this,en)[t]}};Ms=new WeakMap,en=new WeakMap,Lr=new WeakMap,c(Ss,"Connection"),d(Ss,"__type","connection");var n1=Ss,tn=n1;m();var Ec,No,Yn,Ar,Ts=class Ts extends Re{constructor(t,i){super(i.mvfData.properties.id,t,i.mvfData.properties.details);d(this,"__type",Ts.__type);M(this,Ec,void 0);M(this,No,void 0);M(this,Yn,{});M(this,Ar,void 0);P(this,Ec,t),P(this,No,i.floorId),P(this,Ar,i.mvfData)}static is(t){return t.__type===Ts.__type}get name(){var t,i,n;return"details"in s(this,Ar).properties?(n=(i=s(this,Ar).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,Ar).properties.externalId)!=null?t:""}get externalId(){var t;return(t=s(this,Ar).properties.externalId)!=null?t:""}get description(){var t,i;return(i=(t=s(this,Ar).properties.details)==null?void 0:t.description)!=null?i:""}get type(){let t=s(this,Ar).properties.kind;return t==null&&(t="object"),t==="Desks"&&(t="desk"),t.toLowerCase()}get floor(){let t=s(this,Ec).getById("floor",s(this,No));if(t==null)throw new Error("Floor ".concat(s(this,No)," not found!"));return t}get center(){var t;if(s(this,Yn).center==null){let[i,n]=(t=s(this,Ar).properties.center)!=null?t:[0,0];s(this,Yn).center=new se(n,i,s(this,No))}return s(this,Yn).center}toJSON(){return{id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let t of globalThis.Object.keys(s(this,Yn)))s(this,Yn)[t]=null}};Ec=new WeakMap,No=new WeakMap,Yn=new WeakMap,Ar=new WeakMap,c(Ts,"MapObject"),d(Ts,"__type","object");var o1=Ts,Nt=o1;m();var _c,Go,Zn,di,Ps=class Ps extends Re{constructor(t,i){super(i.mvfData.properties.id,t,i.mvfData.properties.details);d(this,"__type",Ps.__type);M(this,_c,void 0);M(this,Go,void 0);M(this,Zn,{});M(this,di,void 0);P(this,_c,t),P(this,di,i.mvfData),P(this,Go,i.floorId)}static is(t){return t.__type===Ps.__type}get name(){var t,i,n;return"details"in s(this,di).properties?(n=(i=s(this,di).properties.details)==null?void 0:i.name)!=null?n:"":(t=s(this,di).properties.externalId)!=null?t:""}get description(){var t,i;return(i=(t=s(this,di).properties.details)==null?void 0:t.description)!=null?i:""}get floor(){let t=s(this,_c).getById("floor",s(this,Go));if(t==null)throw new Error("Floor ".concat(s(this,Go)," not found!"));return t}get coordinate(){var t;if(s(this,Zn).coordinate==null){let[i,n]=(t=s(this,di).geometry.coordinates)!=null?t:[0,0];s(this,Zn).coordinate=new se(n,i,s(this,Go))}return s(this,Zn).coordinate}get externalId(){var t;return(t=s(this,di).properties.externalId)!=null?t:""}toJSON(){return{id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let t in s(this,Zn))s(this,Zn)[t]=null}};_c=new WeakMap,Go=new WeakMap,Zn=new WeakMap,di=new WeakMap,c(Ps,"PointOfInterest"),d(Ps,"__type","point-of-interest");var a1=Ps,li=a1;m();var Dc,Vo,zn,jo,Oc,l1,Is=class Is extends Re{constructor(t,i){super(i.mvfData.properties.id,t);M(this,Oc);d(this,"__type",Is.__type);M(this,Dc,void 0);M(this,Vo,void 0);M(this,zn,{});M(this,jo,void 0);P(this,Dc,t),P(this,Vo,i.floorId),P(this,jo,i.mvfData)}static is(t){return t.__type===Is.__type}get group(){return V(this,Oc,l1).call(this).group}get type(){return V(this,Oc,l1).call(this).type}get externalId(){var t;return(t=s(this,jo).properties.externalId)!=null?t:""}get coordinate(){if(s(this,zn).coordinate==null){let[t,i]=s(this,jo).geometry.coordinates;s(this,zn).coordinate=new se(i,t,s(this,Vo))}return s(this,zn).coordinate}get floor(){let t=s(this,Dc).getById("floor",s(this,Vo));if(t==null)throw new Error("Floor ".concat(s(this,Vo)," not found!"));return t}toJSON(){return{id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let t of Object.keys(s(this,zn)))delete s(this,zn)[t]}};Dc=new WeakMap,Vo=new WeakMap,zn=new WeakMap,jo=new WeakMap,Oc=new WeakSet,l1=c(function(){let[t,i]=s(this,jo).properties.symbolId.split("--");return{group:t,type:i}},"#getGroupAndTypeFromSymbolId"),c(Is,"Annotation"),d(Is,"__type","annotation");var s1=Is,Un=s1;m();var Ho,mr,kr,Es,ws=class ws extends Re{constructor(t,i){super(i.mvfData.id,t);d(this,"__type",ws.__type);M(this,Ho,void 0);M(this,mr,{});M(this,kr,void 0);M(this,Es,void 0);P(this,Ho,t),P(this,kr,i.mvfData),P(this,Es,i.facadeId)}static is(t){return t.__type===ws.__type}get type(){return s(this,kr).type}get name(){var t;return(t=s(this,kr).name)!=null?t:""}get externalId(){var t;return(t=s(this,kr).externalId)!=null?t:""}get floors(){var t,i;if(s(this,mr).floors==null){let n=((i=(t=s(this,kr).floors)!=null?t:s(this,kr).maps)!=null?i:[]).reduce((o,a)=>{let u=s(this,Ho).floorsById[a];return u&&o.push(u),o},[]);n.length===0&&L.error("Floor stack ".concat(this.id," has no floors")),s(this,mr).floors=n}return s(this,mr).floors}get defaultFloor(){if(s(this,mr).defaultFloor!=null)return s(this,mr).defaultFloor;let t=s(this,kr).defaultFloor?s(this,Ho).getById("floor",s(this,kr).defaultFloor):void 0;return s(this,mr).defaultFloor=t||this.floors.reduce((i,n)=>Math.abs(n.elevation)<Math.abs(i.elevation)?n:i),s(this,mr).defaultFloor}get facade(){return s(this,Es)?s(this,Ho).facadesById[s(this,Es)]:void 0}toJSON(){return{id:this.id,name:this.name,type:this.type,floors:this.floors.map(t=>t.id)}}destroy(){for(let t of globalThis.Object.keys(s(this,mr)))delete s(this,mr)[t]}};Ho=new WeakMap,mr=new WeakMap,kr=new WeakMap,Es=new WeakMap,c(ws,"FloorStack"),d(ws,"__type","floor-stack");var c1=ws,gh=c1;m();var Ds,Uo,Lc,hi,_s=class _s extends Re{constructor(t,i){super(i.mvfData.id,t);d(this,"__type",_s.__type);M(this,Ds,void 0);M(this,Uo,void 0);M(this,Lc,void 0);M(this,hi,{});P(this,Ds,i.mvfData),P(this,Uo,t),P(this,Lc,i.floorStackId)}static is(t){return t.__type===_s.__type}get floorStack(){return s(this,Uo).getById("floor-stack",s(this,Lc))}get spaces(){if(!s(this,hi).spaces){s(this,hi).spaces=[];for(let t of s(this,Ds).spaces){let i=s(this,Uo).getById("space",t.spaceId);i&&s(this,hi).spaces.push(i)}}return s(this,hi).spaces}get center(){if(!s(this,hi).center){let t={type:"FeatureCollection",features:[]};for(let n of this.spaces){let o=s(this,Uo).mvfSpacesById[n.id];o&&t.features.push(o)}if(t.features.length===0)throw new Error("No geometry found for facade!");let i=yd(t);s(this,hi).center=new se(i.geometry.coordinates[1],i.geometry.coordinates[0],s(this,Ds).spaces[0].floorId)}return s(this,hi).center}};Ds=new WeakMap,Uo=new WeakMap,Lc=new WeakMap,hi=new WeakMap,c(_s,"Facade"),d(_s,"__type","facade");var u1=_s,ci=u1;m();var zw=c((r,e)=>{var v,S;let t={},i={},n={},o={},a={},u={},l={},p={},h={},y={},g=globalThis.Object.keys(r.space);for(let T of g){let b=r.space[T];if(b!=null)for(let x of b.features){y[x.properties.id]=T,a[x.properties.id]=x;for(let I of x.properties.destinationNodes)n[I]==null&&(n[I]=[]),n[I].push(x.properties.id);if(x.properties.kind==="desk-entrance"&&(o[x.properties.externalId]==null&&(o[x.properties.externalId]=[]),o[x.properties.externalId].push(...x.properties.destinationNodes)),!["void","desk-entrance"].includes((v=x.properties.kind)!=null?v:"")){if((S=x.properties.kind)!=null&&S.includes("connection")){let I="".concat(x.geometry.coordinates[1],"-").concat(x.geometry.coordinates[0]);p[I]==null&&(p[I]=[]),p[I].push(x.properties.id);continue}if(x.properties.kind==="poi"){let I=new li(e,{floorId:T,mvfData:x});i[x.properties.id]=I,l[T]||(l[T]=[]),l[T].push(x)}else{let I=new Rt(e,{floorId:T,mvfData:x});t[x.properties.id]=I,u[T]||(u[T]=[]),u[T].push(x)}}}}for(let T in p){let b=p[T],x={};for(let E of b){let w=y[E],_=a[E];x[w]=_}let I=new tn(e,{mvfDataByFloorId:x});h[I.id]=I}return{spacesById:t,poisById:i,connectionsById:h,spaceIdsByDestinationNodeId:n,objectEntranceNodeIdsByObstructionId:o,mvfSpacesById:a,connectionIdsByLatLon:p,mvfSpacesByFloorId:u,mvfPoisByFloorId:l}},"processMVFSpaces"),qw=c((r,e)=>{var o,a;let t={},i={},n={};for(let u of r["node.geojson"].features){i[u.properties.id]=u;let l=new ai(e,{mvfData:u,floorId:(o=u.properties.floor)!=null?o:u.properties.map});t[u.properties.id]=l;let p=(a=u.properties.floor)!=null?a:u.properties.map;n[p]||(n[p]=[]),n[p].push(u)}return{nodesById:t,mvfNodesById:i,mvfNodesByFloorId:n}},"processMVFNodes"),$w=c((r,e)=>{let t={},i={},n={},o=globalThis.Object.keys(r.obstruction);for(let a of o){let u=r.obstruction[a];if(u!=null)for(let l of u.features){i[l.properties.id]=l;for(let h of l.properties.entrances)n[h]=l.properties.id;if(l.properties.kind==="Wall")continue;let p=new Nt(e,{floorId:a,mvfData:l});t[l.properties.id]=p}}return{objectsById:t,mvfObstructionById:i,obstructionIdByEntranceId:n}},"processMVFObstructions"),Jw=c((r,e)=>{let t={},i={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let n of r["floor.geojson"].features){i[n.properties.id]=n.properties;let o=new Qi(e,{mvfData:n.properties});t[n.properties.id]=o}else for(let n of r["map.geojson"]){i[n.id]=n;let o=new Qi(e,{mvfData:n});t[n.id]=o}return{floorsById:t,mvfFloorsById:i}},"processMVFFloors"),Kw=c((r,e)=>{var u;let t={},i={},n={},o={},a=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(a!=null)for(let l of a){let p=(u=r.facade)==null?void 0:u[l.id],h=new gh(e,{mvfData:l,facadeId:p==null?void 0:p.id});if(t[l.id]=h,i[l.id]=l,p){let y=new ci(e,{mvfData:p,floorStackId:l.id});n[p.id]=y;for(let g of p.spaces)o[g.spaceId]=y}}return{floorStacksById:t,mvfFloorStacksById:i,facadesById:n,facadesBySpaceId:o}},"processMVFFloorStacks"),Qw=c(r=>{let e={},t=r["connection.json"].reduce((i,n)=>(n.nodes.forEach(o=>i[o]=n),e[n.id]=n,i),{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:t}},"processMVFConnections"),eE=c((r,e)=>{let t={},i={},n={},o={},a=globalThis.Object.keys(r.entrance);for(let u of a){let l=r.entrance[u];if(l!=null)for(let p of l.features){n[p.properties.id]=p;let h=new fr(e,{floorId:u,mvfData:p});p.properties.node&&(i[p.properties.node]=h),t[p.properties.id]=h,o[u]||(o[u]=[]),o[u].push(p)}}return{doorsById:t,doorsByNodeId:i,mvfEntrancesById:n,mvfEntrancesByFloorId:o}},"processMVFEntrances"),tE=c((r,e,t)=>{var i;if(r.textAreas!=null)for(let n in r.textAreas){let o=(i=r.textAreas[n])==null?void 0:i.features;if(o!=null){for(let a of o)if("anchorId"in a.properties){let u=a==null?void 0:a.properties,l=e[u.anchorId]||t[u.anchorId];if(l!=null&&u!=null){let p=l.properties;p.textArea=u,p.textArea&&(p.textArea.position=a.geometry.coordinates)}}}}},"processMVFTextAreas"),rE=c((r,e,t)=>{var i;if(r.floorImages!=null)for(let n in r.floorImages){let o=(i=r.floorImages[n])==null?void 0:i.features;if(o!=null){for(let a of o)if("anchorId"in a.properties){let u=a==null?void 0:a.properties,l=e[u.anchorId]||t[u.anchorId];if(l!=null&&u!=null){let p=l.properties;p.image=u,p.image&&(p.image.position=a.geometry.coordinates)}}}}},"processMVFPolygonImages"),iE=c((r,e)=>{let t={},i={},n={};if(r.annotation==null)return{annotationsById:t,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n};let o=globalThis.Object.keys(r.annotation);for(let a of o){let u=r.annotation[a];if(u!=null)for(let l of u.features){i[l.properties.id]=l;let p=new Un(e,{floorId:a,mvfData:l});t[l.properties.id]=p,n[a]||(n[a]=[]),n[a].push(l)}}return{annotationsById:t,mvfAnnotationsById:i,mvfAnnotationsByFloorId:n}},"processMVFAnnotations"),nE=c((r,e)=>{let t={},i={};if(r.area==null)return{areasById:t,mvfAreasById:i};let n=globalThis.Object.keys(r.area);for(let o of n){let a=r.area[o];if(a!=null)for(let u of a.features){i[u.properties.id]=u;let l=new $i(e,{floorId:o,mvfData:u});t[u.properties.id]=l}}return{areasById:t,mvfAreasById:i}},"processMVFAreas"),NS=c((r,e)=>{var v,S,T,b,x,I,E,w,_;let t={},i={},n=((S=(v=r.enterprise)==null?void 0:v.locations)!=null?S:[]).reduce((D,B)=>(D[B.id]=B,D),{}),o={},a={},u={},l={},p={},h=((T=r.enterprise)==null?void 0:T.venue)||{},y={};for(let D of(x=(b=r.enterprise)==null?void 0:b.categories)!=null?x:[])o[D.id]=new vh(e,{mvfData:D}),a[D.id]=D,D.locations.forEach(B=>{l[B]==null&&(l[B]=[]),l[B].push(D.id)});let g={};for(let D of(E=(I=r.enterprise)==null?void 0:I.locationInstances)!=null?E:[]){let B=n[D.parent],U=Object.keys(B),G={};for(let Y of U)G[Y]=void 0;let j={...G,polygons:[],nodes:[],...D};g[j.parent]==null&&(g[j.parent]=[]),g[j.parent].push(new Or(e,{mvfData:j,categoryIds:l[j.id],parentId:D.parent})),y[j.id]=D}for(let D of(_=(w=r.enterprise)==null?void 0:w.locations)!=null?_:[]){i[D.id]=new Or(e,{mvfData:D,categoryIds:l[D.id],locationInstances:g[D.id]}),D.nodes.forEach(B=>{p[B.id]==null&&(p[B.id]=[]),p[B.id].push(D.id)});for(let B of D.polygons)u[B.id]==null&&(u[B.id]=[]),u[B.id].push(D)}if(e.enterpriseMode===!0){for(let D in e.mvfConnectionsById){let B={};for(let U of e.mvfConnectionsById[D].nodes){let G=e.nodesById[U],j=e.mvfConnectionsById[D];G!=null&&(B[G.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[G.coordinate.longitude,G.coordinate.latitude]},properties:{id:D,externalId:j.externalId,kind:"enterprise."+j.type,destinationNodes:[],flags:"",type:j.type,nodes:j.nodes,accessible:j.accessible}})}Object.keys(B).length>0&&(t[D]=new tn(e,{mvfDataByFloorId:B}))}e.connectionsById=t}return{locationIdsByNodeId:p,locationsBySpaceId:u,mvfLocationsById:n,mvfCategoriesById:a,locationsById:i,locationInstancesById:y,categoriesById:o,venue:h}},"createEnterpriseDataFromMVF"),GS=c((r,e)=>{let{spacesById:t,spaceIdsByDestinationNodeId:i,poisById:n,mvfSpacesById:o,objectEntranceNodeIdsByObstructionId:a,connectionsById:u,connectionIdsByLatLon:l,mvfSpacesByFloorId:p,mvfPoisByFloorId:h}=zw(r,e),{nodesById:y,mvfNodesById:g,mvfNodesByFloorId:v}=qw(r,e),{objectsById:S,mvfObstructionById:T,obstructionIdByEntranceId:b}=$w(r,e),{floorsById:x,mvfFloorsById:I}=Jw(r,e),{floorStacksById:E,mvfFloorStacksById:w,facadesById:_,facadesBySpaceId:D}=Kw(r,e),{mvfConnectionsById:B,mvfConnectionsByNodeId:U}=Qw(r),{doorsById:G,doorsByNodeId:j,mvfEntrancesById:Y,mvfEntrancesByFloorId:ce}=eE(r,e),{annotationsById:ge,mvfAnnotationsById:we,mvfAnnotationsByFloorId:Le}=iE(r,e),{areasById:qe,mvfAreasById:Wt}=nE(r,e);return rE(r,o,T),tE(r,o,T),{spacesById:t,nodesById:y,objectsById:S,floorsById:x,floorStacksById:E,facadesById:_,facadesBySpaceId:D,connectionsById:u,doorsById:G,doorsByNodeId:j,poisById:n,annotationsById:ge,areasById:qe,spaceIdsByDestinationNodeId:i,objectEntranceNodeIdsByObstructionId:a,obstructionIdByEntranceId:b,connectionIdsByLatLon:l,mvfSpacesById:o,mvfNodesById:g,mvfObstructionById:T,mvfFloorsById:I,mvfFloorStacksById:w,mvfConnectionsById:B,mvfConnectionsByNodeId:U,mvfEntrancesById:Y,mvfAnnotationsById:we,mvfNodesByFloorId:v,mvfSpacesByFloorId:p,mvfPoisByFloorId:h,mvfAreasById:Wt,mvfEntrancesByFloorId:ce,mvfAnnotationsByFloorId:Le}},"createDataFromMVF");m();var oE=new Set(["polygons"]),Fr,Fe,Gt,Ac,Os=class Os extends gt{constructor(t,i){super(i.mvfData.externalId);d(this,"__type",Os.__type);d(this,"description");d(this,"name","");d(this,"amenity");d(this,"externalId","");d(this,"extra");d(this,"gallery");d(this,"instances");d(this,"logo");d(this,"operationHours");d(this,"phone");d(this,"picture");d(this,"shortName");d(this,"showFloatingLabelWhenImagePresent");d(this,"showLogo");d(this,"siblingGroups");d(this,"social");d(this,"sortOrder",-1);d(this,"states");d(this,"tags");d(this,"type","");M(this,Fr,void 0);M(this,Fe,{});M(this,Gt,void 0);M(this,Ac,void 0);P(this,Fr,t),P(this,Gt,i.mvfData),P(this,Ac,i.categoryIds||[]),this.instances=i.locationInstances||[];for(let n in i.mvfData)!oE.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{enumerable:!0,get(){if(i.parentId){let o=s(this,Fr).locationsById[i.parentId];return s(this,Gt)[n]!=null?s(this,Fr).getPropTranslation(this.__type,n,s(this,Gt).id,s(this,Gt)[n]):s(this,Fr).getPropTranslation(this.__type,n,s(this,Gt).id,o[n])}return s(this,Fr).getPropTranslation(this.__type,n,s(this,Gt).id,s(this,Gt)[n])}})}static is(t){return t.__type===Os.__type}get categories(){return s(this,Fe).categories?s(this,Fe).categories:(s(this,Fe).categories=(s(this,Ac).map(t=>s(this,Fr).getById("enterprise-category",t))||[]).filter(Boolean),s(this,Fe).categories)}get coordinates(){if(s(this,Fe).coordinates)return s(this,Fe).coordinates;s(this,Fe).coordinates=[];for(let t=0;t<this.nodes.length;t++)s(this,Fe).coordinates.push(this.nodes[t].coordinate);return s(this,Fe).coordinates}get nodes(){if(s(this,Fe).nodes)return s(this,Fe).nodes;s(this,Fe).nodes=[];for(let t=0;t<s(this,Gt).nodes.length;t++){let i=s(this,Fr).getById("node",s(this,Gt).nodes[t].id);i&&s(this,Fe).nodes.push(i)}return s(this,Fe).nodes}get spaces(){if(s(this,Fe).spaces)return s(this,Fe).spaces;s(this,Fe).spaces=[];for(let t=0;t<s(this,Gt).polygons.length;t++){let i=s(this,Fr).getById("space",s(this,Gt).polygons[t].id);i&&s(this,Fe).spaces.push(i)}return s(this,Fe).spaces}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,Fe)))delete s(this,Fe)[t]}};Fr=new WeakMap,Fe=new WeakMap,Gt=new WeakMap,Ac=new WeakMap,c(Os,"EnterpriseLocation"),d(Os,"__type","enterprise-location");var p1=Os,Or=p1;m();var aE=new Set,Wo,bt,fi,Ls=class Ls extends gt{constructor(t,i){super(i.mvfData.externalId);d(this,"__type",Ls.__type);d(this,"name","");d(this,"color");d(this,"externalId","");d(this,"extra");d(this,"icon");d(this,"iconFromDefaultList");d(this,"sortOrder",-1);M(this,Wo,void 0);M(this,bt,{});M(this,fi,void 0);P(this,Wo,t),P(this,fi,i.mvfData);for(let n in i.mvfData)!aE.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&Object.defineProperty(this,n,{get(){return s(this,Wo).getPropTranslation(this.__type,n,s(this,fi).id,s(this,fi)[n])}})}static is(t){return t.__type===Ls.__type}get children(){if(s(this,bt).children)return s(this,bt).children;s(this,bt).children=[];for(let t=0;t<s(this,fi).children.length;t++){let i=s(this,Wo).getById("enterprise-category",s(this,fi).children[t]);i&&s(this,bt).children.push(i)}return s(this,bt).children}get locations(){if(s(this,bt).locations)return s(this,bt).locations;s(this,bt).locations=[];for(let t=0;t<s(this,fi).locations.length;t++){let i=s(this,Wo).getById("enterprise-location",s(this,fi).locations[t]);i&&s(this,bt).locations.push(i)}return s(this,bt).locations}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,bt)))delete s(this,bt)[t]}};Wo=new WeakMap,bt=new WeakMap,fi=new WeakMap,c(Ls,"EnterpriseCategory"),d(Ls,"__type","enterprise-category");var d1=Ls,vh=d1;m();var sE=new Set,kc,Fc,As=class As extends gt{constructor(t,i){super(i.mvfData.externalId);d(this,"__type",As.__type);d(this,"countrycode");d(this,"externalId","");d(this,"defaultLanguage",{code:"en",name:"English"});d(this,"defaultMap");d(this,"extra");d(this,"icon");d(this,"languages",[]);d(this,"links",[]);d(this,"logo");d(this,"mappedinWebUrl");d(this,"slug","");d(this,"topLocations");d(this,"tzid");M(this,kc,{});M(this,Fc,void 0);P(this,Fc,i.mvfData);for(let n in i.mvfData)!sE.has(n)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),n)&&(this[n]=i.mvfData[n])}static is(t){return t.__type===As.__type}get name(){var t;return(t=s(this,Fc).name)!=null?t:""}toJSON(){return{id:this.id,name:this.name}}destroy(){for(let t of Object.keys(s(this,kc)))delete s(this,kc)[t]}};kc=new WeakMap,Fc=new WeakMap,c(As,"EnterpriseVenue"),d(As,"__type","enterprise-venue");var h1=As,f1=h1;m();function m1(r){var t,i,n,o,a;let e=((i=(t=r.enterprise)==null?void 0:t.locations)==null?void 0:i.reduce((u,l)=>(u[l.id]=l,u),{}))||{};for(let u of((n=r.enterprise)==null?void 0:n.locationInstances)||[])e[u.id]=u;return{type:"downloaded",data:r,optimized:{locations:e,categories:(a=(o=r.enterprise)==null?void 0:o.categories)==null?void 0:a.reduce((u,l)=>(u[l.id]=l,u),{})}}}c(m1,"parseLocalePackToLanguagePack");m();m();m();m();m();m();m();var y1=class y1{constructor({origin:e,destination:t,distance:i=0,angle:n=0,pathWeight:o=0}){d(this,"origin");d(this,"destination");d(this,"distance");d(this,"angle");d(this,"weight");this.origin=e,this.destination=t,this.distance=i,this.angle=n;let a=o||0;if(this.weight=a>=0?this.distance+a:0,isNaN(this.angle))throw new Error("nan angle")}};c(y1,"Edge");var Xo=y1;m();m();m();function g1(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=dr(r),n=C3(e),o=n.type,a=e.bbox,u=n.coordinates;if(a&&lE(i,a)===!1)return!1;o==="Polygon"&&(u=[u]);for(var l=!1,p=0;p<u.length&&!l;p++)if(VS(i,u[p][0],t.ignoreBoundary)){for(var h=!1,y=1;y<u[p].length&&!h;)VS(i,u[p][y],!t.ignoreBoundary)&&(h=!0),y++;h||(l=!0)}return l}c(g1,"booleanPointInPolygon");function VS(r,e,t){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var n=0,o=e.length-1;n<e.length;o=n++){var a=e[n][0],u=e[n][1],l=e[o][0],p=e[o][1],h=r[1]*(a-l)+u*(l-r[0])+p*(r[0]-a)===0&&(a-r[0])*(l-r[0])<=0&&(u-r[1])*(p-r[1])<=0;if(h)return!t;var y=u>r[1]!=p>r[1]&&r[0]<(l-a)*(r[1]-u)/(p-u)+a;y&&(i=!i)}return i}c(VS,"inRing");function lE(r,e){return e[0]<=r[0]&&e[1]<=r[1]&&e[2]>=r[0]&&e[3]>=r[1]}c(lE,"inBBox");m();m();function rn([r,e],[t,i]){let n=e-i,o=r-t;return(Math.atan2(o,n)+Math.PI*3)%(Math.PI*2)}c(rn,"getAngle");m();var cE=63710088e-1;function Br(r,e){let[t,i]=r.map(h=>h*Math.PI/180),[n,o]=e.map(h=>h*Math.PI/180),a=o-i,u=n-t,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(u/2)*Math.sin(u/2),p=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return cE*p}c(Br,"getDistance");m();m();function bh(r,e,t,i){let[n,o]=r,[a,u]=e,[l,p]=t,[h,y]=i;if(o===u&&n===a||p===y&&l===h)return null;let g=(h-l)*(u-o)-(y-p)*(a-n);if(g===0)return null;let v=((y-p)*(n-l)-(h-l)*(o-p))/g,S=((u-o)*(n-l)-(a-n)*(o-p))/g;if(v<0||v>1||S<0||S>1)return null;let T=o+v*(u-o);return[n+v*(a-n),T]}c(bh,"getLineIntersection");m();function v1(r,e,t,i){let n=wo(r,t/1e3,i),o=wo(e,t/1e3,i);return[n.geometry.coordinates,o.geometry.coordinates]}c(v1,"getOffsetLine");m();function b1(r){let e=r*(180/Math.PI);return e=e%360,e>180?e-=360:e<-180&&(e+=360),Object.is(e,-0)?0:e}c(b1,"radToDegNormalized");function jS(r,e,t=[],i=0){let n=!0,o=r.geometry.coordinates,a=e.geometry.coordinates,u=b1(rn(o,a)-Math.PI/2),l=b1(rn(o,a)+Math.PI/2);return t.forEach(p=>{if(i>0){let h=v1(o,a,i,u),y=v1(o,a,i,l);if(bh(h[0],h[1],p[0],p[1])||bh(y[0],y[1],p[0],p[1])){n=!1;return}}else if(bh(o,a,p[0],p[1])){n=!1;return}}),n}c(jS,"hasLineOfSight");var Yo,Bc,C1,xh,HS,Sh,US,Mh,WS,Th,XS,Ph,YS,Ih,ZS,wh,x1=class x1{constructor({nodes:e,groupBy:t}){M(this,Bc);M(this,xh);M(this,Sh);M(this,Mh);M(this,Th);M(this,Ph);M(this,Ih);d(this,"edges",{});d(this,"nodesById");d(this,"nodesByGroup",new Map);M(this,Yo,void 0);M(this,wh,c((e,t)=>{let i=0;for(let n of t)(!n[s(this,Yo)]||n[s(this,Yo)]===e.properties[s(this,Yo)])&&g1(e.geometry.coordinates,n.geometry.geometry)&&(i+=Math.max(0,n.cost));return i},"#getZonalCost"));P(this,Yo,t);let{features:i}=e;this.nodesById=V(this,xh,HS).call(this,i),V(this,Sh,US).call(this),V(this,Mh,WS).call(this,i,t)}getShortestEuclideanDistance(e,t){return t.reduce((i,n)=>{let o=Br(e.geometry.coordinates,n.geometry.coordinates);return Math.min(i,o)},Number.MAX_VALUE)}aStar({originIds:e,destinationNodeIds:t,excludedNodeIds:i,zones:n}){let o=V(this,Bc,C1).call(this,e),a=V(this,Bc,C1).call(this,t);if(o.length===0||a.length===0)return[];let{frontier:u,cameFrom:l,costSoFar:p}=V(this,Th,XS).call(this,o,a);for(;u.length>0;){let h=u.shift();if(!h)break;if(V(this,Ph,YS).call(this,h.origin,a))return V(this,Ih,ZS).call(this,l,h.origin.properties.id);for(let y of this.edges[h.origin.properties.id]){let g=p[h.origin.properties.id]+y.weight+s(this,wh).call(this,y.destination,n);if(!(g===1/0||i!=null&&i.has(y.destination.properties.id))&&(p[y.destination.properties.id]==null||g<p[y.destination.properties.id])){let v=g+this.getShortestEuclideanDistance(y.destination,a);p[y.destination.properties.id]=g,l[y.destination.properties.id]=y,u.push({origin:y.destination,priority:v})}}u.sort((y,g)=>y.priority-g.priority)}return[]}};Yo=new WeakMap,Bc=new WeakSet,C1=c(function(e){return e.map(t=>this.nodesById[t]).filter(Boolean)},"#filterValidNodes"),xh=new WeakSet,HS=c(function(e){return e.reduce((t,i)=>(t[i.properties.id]=i,t),{})},"#createNodesById"),Sh=new WeakSet,US=c(function(){for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].properties.neighbors=this.nodesById[e].properties.neighbors.filter(({id:t})=>!!this.nodesById[t]))},"#removeInvalidNeighbors"),Mh=new WeakSet,WS=c(function(e,t){e.forEach(i=>{let n=t==="default"?t:i.properties[t];this.nodesByGroup.has(n)||this.nodesByGroup.set(n,[]),this.nodesByGroup.get(n).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:o,weight:a})=>{let u=this.nodesById[o],l=Br(i.geometry.coordinates,u.geometry.coordinates),p=rn(i.geometry.coordinates,u.geometry.coordinates);return new Xo({origin:i,destination:u,pathWeight:a,distance:l,angle:p})})})},"#initializeEdgesAndGroups"),Th=new WeakSet,XS=c(function(e,t){let i=[],n={},o={};return e.forEach(a=>{let u=this.getShortestEuclideanDistance(a,t);i.push({origin:a,priority:u}),n[a.properties.id]=null,o[a.properties.id]=0}),i.sort((a,u)=>a.priority-u.priority),{frontier:i,cameFrom:n,costSoFar:o}},"#initializeSearch"),Ph=new WeakSet,YS=c(function(e,t){return t.some(i=>i.properties.id===e.properties.id)},"#isDestinationNode"),Ih=new WeakSet,ZS=c(function(e,t){let i=[],n=e[t];for(;n;)i.push(n),n=e[n.origin.properties.id];return i.reverse()},"#reconstructPath"),wh=new WeakMap,c(x1,"NavigationGraph");var Ch=x1;var uE=.4,S1=class S1{constructor({nodes:e,geojsonCollection:t,groupBy:i="default"}){d(this,"groupBy");d(this,"graph");d(this,"geometryEdgesByMapId",new Map);d(this,"generatePath",c(e=>{let{destination:t}=e[e.length-1],i={type:"FeatureCollection",features:[]};for(let o=0;o<e.length;o++){let{origin:a}=e[o],u={id:a.properties.id,angle:e[o].angle,distance:e[o].distance};this.groupBy!=="default"&&(u.groupBy=a.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[a.geometry.coordinates[0],a.geometry.coordinates[1]]},properties:u})}let n={id:t.properties.id};return this.groupBy!=="default"&&(n.groupBy=t.properties[this.groupBy]),i.features.push({type:"Feature",geometry:{type:"Point",coordinates:[t.geometry.coordinates[0],t.geometry.coordinates[1]]},properties:n}),i},"generatePath"));d(this,"getDistance",c((e,t)=>Br(e,t),"getDistance"));d(this,"getAngle",c((e,t)=>rn(e,t),"getAngle"));this.groupBy=i,this.graph=new Ch({nodes:e,groupBy:this.groupBy}),((t==null?void 0:t.features)||[]).forEach(o=>{let a=null;if(o.geometry.type==="LineString"?a=o.geometry.coordinates:o.geometry.type==="Polygon"&&(a=o.geometry.coordinates.flat()),a){let u=this.groupBy==="default"?this.groupBy:o.properties[this.groupBy];this.geometryEdgesByMapId.has(u)||this.geometryEdgesByMapId.set(u,[]),a.forEach((l,p)=>{this.geometryEdgesByMapId.get(u).push([l,a[p+1]||a[0]])})}})}getDirections({zones:e,originIds:t,destinationNodeIds:i,excludedNodeIds:n,simplify:o}){var p,h;let a=(p=o==null?void 0:o.enabled)!=null?p:!0,u=e!=null?e:[],l=this.graph.aStar({originIds:t,destinationNodeIds:i,zones:u,excludedNodeIds:new Set(n)});return l.length===0?{type:"FeatureCollection",features:[]}:(a&&(l=this.simplifyAllSteps(l,(h=o==null?void 0:o.bufferRadius)!=null?h:uE)),this.generatePath(l))}simplifyAllSteps(e,t){var l,p;let i=[],n=[e[0]];for(let h=1;h<e.length;h++)if(this.groupBy!=="default"&&e[h].origin.properties[this.groupBy]!==e[h-1].origin.properties[this.groupBy]){let y=e[h-1].origin.properties[this.groupBy],g=(l=this.geometryEdgesByMapId.get(y))!=null?l:[];i.push(...this.simplifySteps(n,g,t)),n=[e[h]]}else n.push(e[h]);let o=e[e.length-1],a=this.groupBy==="default"?this.groupBy:o.origin.properties[this.groupBy],u=(p=this.geometryEdgesByMapId.get(a))!=null?p:[];return i.push(...this.simplifySteps(n,u,t)),i}simplifySteps(e,t,i){if(e.length<3)return e;let n=[e[0]],o=1;for(let a=o+2;a<e.length;a++)if(!jS(e[o].origin,e[a].origin,t,i)){let u=a-1;n.push(new Xo({...e[o],destination:e[u].origin,distance:Br(e[o].origin.geometry.coordinates,e[u].origin.geometry.coordinates),angle:rn(e[o].origin.geometry.coordinates,e[u].origin.geometry.coordinates)})),o=u}return n.push(new Xo({...e[o],destination:e[e.length-1].origin,distance:Br(e[o].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates),angle:rn(e[o].origin.geometry.coordinates,e[e.length-1].origin.geometry.coordinates)}),e[e.length-1]),n}};c(S1,"Navigator");var ks=S1;m();function mi(r){return[r.longitude,r.latitude]}c(mi,"convertCoordinateToPosition");function pE(r){return new Map(r.map(e=>{let{properties:t}=e,{id:i}=t;return[i,e]}))}c(pE,"getEntranceMap");var M1=c((r,e)=>{let t=pE(e),i={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of r){let o=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((u,l)=>(t.has(l)&&u.push(t.get(l)),u),[]);if(a.length){let{entrances:u,obstructions:l}=Wg(n,a);o=l.map(p=>p.geometry.coordinates),i.entrances.features.push(...u)}i.walls.geometry.coordinates.push(...o)}return i},"cutEntrancesFromLineStrings");function zS(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.text&&(t.text=r.text),r.appearance&&(t.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!==void 0&&(t.enabled=r.enabled),r.interactive!==null&&(t.options.interactive=r.interactive),t}c(zS,"translateLabelStateToGeojsonCore");function qS(r,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=r.rank),r.enabled!=null&&(t.enabled=r.enabled),r.interactive!=null&&(t.options.interactive=r.interactive),t}c(qS,"translateMarkerStateToGeojsonCore");function Eh(r,e){var i,n;let t={};return e==null||(r.color&&(t.color=r.color),r.topColor&&(t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(t.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(t.topTexture=r.topTexture.url),r.opacity!==void 0&&(t.opacity=r.opacity)),t}c(Eh,"translateDoorsStateToGeojsonCore");function T1(r,e){var i,n;let t={};return e==null||(r.color&&(t.color=r.color),r.topColor&&(t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(t.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(t.topTexture=r.topTexture.url)),t}c(T1,"translateWallsStateToGeojsonCore");function $S(r,e){var i,n;let t={};return e==null||(r.color&&(r.color==="initial"?t.color=e.initialColor:t.color=r.color),r.topColor&&(t.topColor=r.topColor),r.visible!==void 0&&(t.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(t.texture=r.texture.url),((n=r.topTexture)==null?void 0:n.url)!==void 0&&(t.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(t.hoverColor=r.hoverColor),r.interactive!==void 0&&(t.interactive=r.interactive),r.height!==void 0&&(t.height=r.height),r.opacity!==void 0&&(t.opacity=r.opacity)),t}c($S,"translateSpaceStateToGeojsonCore");function JS(r,e){return((e-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}c(JS,"differenceBetweenAngles");function KS(r,e){let t="Left";return r<=-Math.PI/4?t="Right":r<=-e?t="SlightRight":r<=e?t="Straight":r<=Math.PI/4?t="SlightLeft":t="Left",t}c(KS,"getRelativeBearing");function QS(r){let e={};for(let t in r){let i=r[t];if(i!=null){if(i.id=t,"polygons"in i)for(let n of i.polygons)e[n]=i;else if("lineStrings"in i)for(let n of i.lineStrings)e[n]=i;else if("points"in i)for(let n of i.points)e[n]=i}}return e}c(QS,"extractStyleMap");function P1(r,e){return r.reduce((t,i)=>{let n=e[i.properties.id];return n==null||(t.has(n)||t.set(n,[]),t.get(n).push(i)),t},new Map)}c(P1,"groupGeometryByStyle");function Rc(r,e={}){var n,o,a,u,l,p;let t={...r},i=(o=(n=e==null?void 0:e.style)==null?void 0:n.shading)!=null?o:e==null?void 0:e.shadingAndOutlines;if(i===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof i=="object"&&(t.shading={start:i.start,end:i.end,intensity:i.intensity}),t.outline=(u=(a=e==null?void 0:e.style)==null?void 0:a.outlines)!=null?u:e==null?void 0:e.shadingAndOutlines,"lineStrings"in r){let h=(p=(l=e==null?void 0:e.style)==null?void 0:l.wallTopColor)!=null?p:e==null?void 0:e.wallTopColor;h!=null&&(t.topColor=h)}return t}c(Rc,"translateToCoreStyle");var e7=c((r,e)=>{var n;let i=((n=e.currentMap)==null?void 0:n.currentFloor).layers.get(He);switch(r){case"interior-walls":return i==null?void 0:i.layers.get(Wn);case"exterior-walls":return i==null?void 0:i.layers.get(ui);case"interior-doors":return i==null?void 0:i.layers.get(bs);case"exterior-doors":return i==null?void 0:i.layers.get(Cs);default:return typeof r=="string"?r:r.id}},"getTargetID");function I1(r){return new Promise(e=>{r.onComplete(e),r.onStop(e)})}c(I1,"tweenToPromise");function t7(r){return[...new Set(r)]}c(t7,"unique");var r7=Math.PI*.1,Ct,xt,Kt,nn,Zo,Ah,i7,qn,Fs,kh,n7,w1=class w1{constructor(e,t){M(this,Ah);M(this,qn);M(this,kh);M(this,Ct,{});M(this,xt,void 0);M(this,Kt,void 0);M(this,nn,void 0);M(this,Zo,void 0);P(this,xt,t),P(this,Kt,e.features),P(this,xt,t),P(this,Kt,e.features)}get path(){return s(this,Kt).map(e=>s(this,xt).getById("node",e.properties.id)).filter(Boolean)}get coordinates(){return s(this,Ct).coordinates?s(this,Ct).coordinates:(s(this,Ct).coordinates=s(this,Kt).map(e=>new se(e.geometry.coordinates[1],e.geometry.coordinates[0],e.properties.groupBy)),s(this,Ct).coordinates)}get distance(){return s(this,Ct).distance?s(this,Ct).distance:(s(this,Ct).distance=s(this,Kt).reduce((e,t)=>e+(t.properties.distance||0),0),s(this,Ct).distance)}get instructions(){if(s(this,Kt).length<2)return[];if(s(this,Ct).instructions)return s(this,Ct).instructions;let e=[],t=0;for(let i=0;i<s(this,Kt).length;i++){let n=s(this,Kt)[i],o=s(this,Kt)[i-1],a=s(this,Kt)[i+1],u=new se(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),l=V(this,Ah,i7).call(this,{prevDirection:o,direction:n,nextDirection:a});t+=(o==null?void 0:o.properties.distance)||0;for(let p of l)p&&(e.push({action:p,distance:t,coordinate:u,node:s(this,xt).getById("node",n.properties.id)}),t=0)}return s(this,Ct).instructions=e,s(this,Ct).instructions}};Ct=new WeakMap,xt=new WeakMap,Kt=new WeakMap,nn=new WeakMap,Zo=new WeakMap,Ah=new WeakSet,i7=c(function(e){var g,v,S;let{prevDirection:t,direction:i,nextDirection:n}=e,o=t&&s(this,xt).getById("floor",t.properties.groupBy),a=s(this,xt).getById("floor",i.properties.groupBy),u=n&&s(this,xt).getById("floor",n.properties.groupBy),l=[];t||l.push({type:"Departure"});let p=s(this,xt).getMVFFeatureByNodeId("connection",i.properties.id),h=s(this,xt).getMVFFeatureByNodeId("connection",(g=n==null?void 0:n.properties.id)!=null?g:""),y=p?s(this,xt).getById("connection",p.id):void 0;if(p)if(!s(this,nn)||s(this,nn)==="exit")l.push(V(this,qn,Fs).call(this,"TakeConnection",a,u,y,p)),P(this,nn,"take"),P(this,Zo,y);else{let T=s(this,xt).getMVFFeatureByNodeId("connection",(v=t==null?void 0:t.properties.id)!=null?v:""),b=s(this,xt).getById("connection",(S=T==null?void 0:T.id)!=null?S:"");l.push(V(this,qn,Fs).call(this,"ExitConnection",a,o,b,T)),P(this,nn,"exit"),P(this,Zo,y)}else h&&s(this,nn)==="take"?(l.push(V(this,qn,Fs).call(this,"ExitConnection",a,o,s(this,Zo))),P(this,nn,"exit"),P(this,Zo,y)):u&&a.id!==u.id?l.push(V(this,qn,Fs).call(this,"TakeConnection",a,u,y)):o&&o.id!==a.id?l.push(V(this,qn,Fs).call(this,"ExitConnection",a,o,y)):l.push(V(this,kh,n7).call(this,t,i));return n||l.push({type:"Arrival"}),l},"#getActions"),qn=new WeakSet,Fs=c(function(e,t,i,n,o){var l,p;let a="none";if(t.elevation!=null&&(i==null?void 0:i.elevation)!=null){let h=t.elevation-i.elevation;h>0?a="down":h<0&&(a="up")}let u=(p=(l=n==null?void 0:n.type)!=null?l:o==null?void 0:o.type)!=null?p:"stairs";return{type:e,fromFloor:t,toFloor:i,direction:a,connection:n,connectionType:u}},"#createConnectionAction"),kh=new WeakSet,n7=c(function(e,t){let i=e?-JS(e.properties.angle,t.properties.angle):0;return Math.abs(i)>=r7?{type:"Turn",bearing:KS(i,r7),referencePosition:"At"}:null},"#createTurnAction"),c(w1,"Directions");var Oh=w1,E1=class E1{constructor({nodes:e,geojsonCollection:t,connections:i,groupBy:n}){d(this,"navigator");d(this,"connections");d(this,"getDirections",c((e,t,i,n)=>{let{accessible:o,smoothing:{enabled:a,radius:u}}=i,l=e.flatMap(v=>this.getNodesFromTarget(v,n)),p=t.flatMap(v=>this.getNodesFromTarget(v,n)),h=this.getExcludedNodeIds(o).filter(v=>!l.includes(v)&&!p.includes(v)),y=this.navigator.getDirections({zones:i.zones.map(v=>{var S;return{geometry:v.geometry,cost:v.cost,map:(S=v.floor)==null?void 0:S.id}}),originIds:l,destinationNodeIds:p,excludedNodeIds:h,simplify:{enabled:a,bufferRadius:u}});this.addCoordinateDirections(y,e,t);let g=new Oh(y,n);if(!(g.distance===0&&new Set([...l,...p]).size===l.length+p.length))return g},"getDirections"));d(this,"getExcludedNodeIds",c(e=>e?this.connections.reduce((t,i)=>i.accessible?t:t.concat(i.nodes),[]):[],"getExcludedNodeIds"));d(this,"addCoordinateDirections",c((e,[t],[i])=>{if(e.features.length){if(se.is(t)){let n=this.createDirectionFeature(t,this.navigator.getAngle([t.longitude,t.latitude],e.features[0].geometry.coordinates),this.navigator.getDistance([t.longitude,t.latitude],e.features[0].geometry.coordinates));e.features.splice(0,0,n)}if(se.is(i)){let n=this.createDirectionFeature(i,0,0),o=e.features[e.features.length-1];o.properties.distance=this.navigator.getDistance(o.geometry.coordinates,[i.longitude,i.latitude]),o.properties.angle=this.navigator.getAngle(o.geometry.coordinates,[i.longitude,i.latitude]),e.features.push(n)}}},"addCoordinateDirections"));d(this,"getNodesFromTarget",c((e,t)=>{var i,n,o,a;if(se.is(e)){let u=t.Query.nearest(e,{types:["node"]});return(i=u==null?void 0:u[0])!=null&&i.feature.id?[u[0].feature.id]:[]}else if(li.is(e)){let u=t.Query.nearest(e,{types:["node"]});return(n=u==null?void 0:u[0])!=null&&n.feature.id?[u[0].feature.id]:[]}else if(fr.is(e)){let u=t.Query.nearest(e,{types:["node"]});return(o=u==null?void 0:u[0])!=null&&o.feature.id?[u[0].feature.id]:[]}else if($i.is(e)){let u=t==null?void 0:t.getMVFFeatureById("area",e.id);return(a=u==null?void 0:u.properties.destinationNodes)!=null?a:[]}else if(Rt.is(e)){let u=t==null?void 0:t.getMVFFeatureById("space",e.id);return u==null?[]:u.properties.destinationNodes}else{if(tn.is(e))return e.coordinates.reduce((u,l)=>{var h;let p=t.Query.nearest(l,{types:["node"]});return(h=p==null?void 0:p[0])!=null&&h.feature.id&&u.push(p[0].feature.id),u},[]);if(Nt.is(e)){let u=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return u!=null?u:[]}else return ci.is(e)?e.spaces.flatMap(u=>{var l,p;return(p=(l=t==null?void 0:t.getMVFFeatureById("space",u.id))==null?void 0:l.properties.destinationNodes)!=null?p:[]}).filter(u=>typeof u=="string"):Or.is(e)?e.nodes.map(u=>u.id):ai.is(e)?[e.id]:[]}},"getNodesFromTarget"));d(this,"createDirectionFeature",c((e,t,i)=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{groupBy:e.floorId,id:e.id,angle:t,distance:i}}),"createDirectionFeature"));this.navigator=new ks({nodes:e,geojsonCollection:this.createCollection(t),groupBy:n}),this.connections=i}createCollection(e){return{type:"FeatureCollection",features:Object.entries(e).reduce((t,[i,n])=>t.concat(n.features.map(o=>(o.properties.map=i,o))),[])}}};c(E1,"DirectionsInternal");var Lh=E1;m();m();m();m();m();m();function _1(r){let e=+this._x.call(null,r),t=+this._y.call(null,r);return o7(this.cover(e,t),e,t,r)}c(_1,"default");function o7(r,e,t,i){if(isNaN(e)||isNaN(t))return r;var n,o=r._root,a={data:i},u=r._x0,l=r._y0,p=r._x1,h=r._y1,y,g,v,S,T,b,x,I;if(!o)return r._root=a,r;for(;o.length;)if((T=e>=(y=(u+p)/2))?u=y:p=y,(b=t>=(g=(l+h)/2))?l=g:h=g,n=o,!(o=o[x=b<<1|T]))return n[x]=a,r;if(v=+r._x.call(null,o.data),S=+r._y.call(null,o.data),e===v&&t===S)return a.next=o,n?n[x]=a:r._root=a,r;do n=n?n[x]=new Array(4):r._root=new Array(4),(T=e>=(y=(u+p)/2))?u=y:p=y,(b=t>=(g=(l+h)/2))?l=g:h=g;while((x=b<<1|T)===(I=(S>=g)<<1|v>=y));return n[I]=o,n[x]=a,r}c(o7,"add");function a7(r){var e,t,i=r.length,n,o,a=new Array(i),u=new Array(i),l=1/0,p=1/0,h=-1/0,y=-1/0;for(t=0;t<i;++t)isNaN(n=+this._x.call(null,e=r[t]))||isNaN(o=+this._y.call(null,e))||(a[t]=n,u[t]=o,n<l&&(l=n),n>h&&(h=n),o<p&&(p=o),o>y&&(y=o));if(l>h||p>y)return this;for(this.cover(l,p).cover(h,y),t=0;t<i;++t)o7(this,a[t],u[t],r[t]);return this}c(a7,"addAll");m();function D1(r,e){if(isNaN(r=+r)||isNaN(e=+e))return this;var t=this._x0,i=this._y0,n=this._x1,o=this._y1;if(isNaN(t))n=(t=Math.floor(r))+1,o=(i=Math.floor(e))+1;else{for(var a=n-t||1,u=this._root,l,p;t>r||r>=n||i>e||e>=o;)switch(p=(e<i)<<1|r<t,l=new Array(4),l[p]=u,u=l,a*=2,p){case 0:n=t+a,o=i+a;break;case 1:t=n-a,o=i+a;break;case 2:n=t+a,i=o-a;break;case 3:t=n-a,i=o-a;break}this._root&&this._root.length&&(this._root=u)}return this._x0=t,this._y0=i,this._x1=n,this._y1=o,this}c(D1,"default");m();function O1(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}c(O1,"default");m();function L1(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]]}c(L1,"default");m();m();function tt(r,e,t,i,n){this.node=r,this.x0=e,this.y0=t,this.x1=i,this.y1=n}c(tt,"default");function A1(r,e,t){var i,n=this._x0,o=this._y0,a,u,l,p,h=this._x1,y=this._y1,g=[],v=this._root,S,T;for(v&&g.push(new tt(v,n,o,h,y)),t==null?t=1/0:(n=r-t,o=e-t,h=r+t,y=e+t,t*=t);S=g.pop();)if(!(!(v=S.node)||(a=S.x0)>h||(u=S.y0)>y||(l=S.x1)<n||(p=S.y1)<o))if(v.length){var b=(a+l)/2,x=(u+p)/2;g.push(new tt(v[3],b,x,l,p),new tt(v[2],a,x,b,p),new tt(v[1],b,u,l,x),new tt(v[0],a,u,b,x)),(T=(e>=x)<<1|r>=b)&&(S=g[g.length-1],g[g.length-1]=g[g.length-1-T],g[g.length-1-T]=S)}else{var I=r-+this._x.call(null,v.data),E=e-+this._y.call(null,v.data),w=I*I+E*E;if(w<t){var _=Math.sqrt(t=w);n=r-_,o=e-_,h=r+_,y=e+_,i=v.data}}return i}c(A1,"default");m();function k1(r){if(isNaN(h=+this._x.call(null,r))||isNaN(y=+this._y.call(null,r)))return this;var e,t=this._root,i,n,o,a=this._x0,u=this._y0,l=this._x1,p=this._y1,h,y,g,v,S,T,b,x;if(!t)return this;if(t.length)for(;;){if((S=h>=(g=(a+l)/2))?a=g:l=g,(T=y>=(v=(u+p)/2))?u=v:p=v,e=t,!(t=t[b=T<<1|S]))return this;if(!t.length)break;(e[b+1&3]||e[b+2&3]||e[b+3&3])&&(i=e,x=b)}for(;t.data!==r;)if(n=t,!(t=t.next))return this;return(o=t.next)&&delete t.next,n?(o?n.next=o:delete n.next,this):e?(o?e[b]=o:delete e[b],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(i?i[x]=t:this._root=t),this):(this._root=o,this)}c(k1,"default");function s7(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}c(s7,"removeAll");m();function F1(){return this._root}c(F1,"default");m();function B1(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}c(B1,"default");m();function R1(r){var e=[],t,i=this._root,n,o,a,u,l;for(i&&e.push(new tt(i,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!r(i=t.node,o=t.x0,a=t.y0,u=t.x1,l=t.y1)&&i.length){var p=(o+u)/2,h=(a+l)/2;(n=i[3])&&e.push(new tt(n,p,h,u,l)),(n=i[2])&&e.push(new tt(n,o,h,p,l)),(n=i[1])&&e.push(new tt(n,p,a,u,h)),(n=i[0])&&e.push(new tt(n,o,a,p,h))}return this}c(R1,"default");m();function N1(r){var e=[],t=[],i;for(this._root&&e.push(new tt(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var n=i.node;if(n.length){var o,a=i.x0,u=i.y0,l=i.x1,p=i.y1,h=(a+l)/2,y=(u+p)/2;(o=n[0])&&e.push(new tt(o,a,u,h,y)),(o=n[1])&&e.push(new tt(o,h,u,l,y)),(o=n[2])&&e.push(new tt(o,a,y,h,p)),(o=n[3])&&e.push(new tt(o,h,y,l,p))}t.push(i)}for(;i=t.pop();)r(i.node,i.x0,i.y0,i.x1,i.y1);return this}c(N1,"default");m();function l7(r){return r[0]}c(l7,"defaultX");function G1(r){return arguments.length?(this._x=r,this):this._x}c(G1,"default");m();function c7(r){return r[1]}c(c7,"defaultY");function V1(r){return arguments.length?(this._y=r,this):this._y}c(V1,"default");function Nc(r,e,t){var i=new j1(e==null?l7:e,t==null?c7:t,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}c(Nc,"quadtree");function j1(r,e,t,i,n,o){this._x=r,this._y=e,this._x0=t,this._y0=i,this._x1=n,this._y1=o,this._root=void 0}c(j1,"Quadtree");function u7(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}c(u7,"leaf_copy");var St=Nc.prototype=j1.prototype;St.copy=function(){var r=new j1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,i;if(!e)return r;if(!e.length)return r._root=u7(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(i=e.source[n])&&(i.length?t.push({source:i,target:e.target[n]=new Array(4)}):e.target[n]=u7(i));return r};St.add=_1;St.addAll=a7;St.cover=D1;St.data=O1;St.extent=L1;St.find=A1;St.remove=k1;St.removeAll=s7;St.root=F1;St.size=B1;St.visit=R1;St.visitAfter=N1;St.x=G1;St.y=V1;var Qt,$n,H1=class H1{constructor(e){M(this,Qt,{});M(this,$n,void 0);P(this,$n,e)}getTreeByType(e,t,i){if(s(this,Qt)[e]||(s(this,Qt)[e]={}),s(this,Qt)[e][t]&&s(this,Qt)[e][t][i])return s(this,Qt)[e][t][i];s(this,Qt)[e][t]||(s(this,Qt)[e][t]={}),s(this,Qt)[e][t][i]||(s(this,Qt)[e][t][i]=Nc());let n=s(this,Qt)[e][t][i];n.x(a=>a.geometry.coordinates[1]),n.y(a=>a.geometry.coordinates[0]);let o=[];switch(e){case"node":o=s(this,$n).mvfNodesByFloorId[i]||[];break;case"point-of-interest":o=s(this,$n).mvfPoisByFloorId[i]||[];break;case"door":o=s(this,$n).mvfEntrancesByFloorId[i]||[];break;case"annotation":o=s(this,$n).mvfAnnotationsByFloorId[i]||[];break}return(o==null?void 0:o.length)>0&&n.addAll(o),n}};Qt=new WeakMap,$n=new WeakMap,c(H1,"QueryCache");var Fh=H1;m();var me;(function(r){r.assertEqual=n=>n;function e(n){}c(e,"assertIs"),r.assertIs=e;function t(n){throw new Error}c(t,"assertNever"),r.assertNever=t,r.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},r.getValidEnumValues=n=>{let o=r.objectKeys(n).filter(u=>typeof n[n[u]]!="number"),a={};for(let u of o)a[u]=n[u];return r.objectValues(a)},r.objectValues=n=>r.objectKeys(n).map(function(o){return n[o]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},r.find=(n,o)=>{for(let a of n)if(o(a))return a},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}c(i,"joinValues"),r.joinValues=i,r.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(me||(me={}));var W1;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(W1||(W1={}));var W=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jn=c(r=>{switch(typeof r){case"undefined":return W.undefined;case"string":return W.string;case"number":return isNaN(r)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(r)?W.array:r===null?W.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?W.promise:typeof Map<"u"&&r instanceof Map?W.map:typeof Set<"u"&&r instanceof Set?W.set:typeof Date<"u"&&r instanceof Date?W.date:W.object;default:return W.unknown}},"getParsedType"),R=me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),dE=c(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Hh=class Hh extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(o){return o.message},i={_errors:[]},n=c(o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(t(a));else{let u=i,l=0;for(;l<a.path.length;){let p=a.path[l];l===a.path.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(a))):u[p]=u[p]||{_errors:[]},u=u[p],l++}}},"processError");return n(this),i}static assert(e){if(!(e instanceof Hh))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},i=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}};c(Hh,"ZodError");var tr=Hh;tr.create=r=>new tr(r);var Vs=c((r,e)=>{let t;switch(r.code){case R.invalid_type:r.received===W.undefined?t="Required":t="Expected ".concat(r.expected,", received ").concat(r.received);break;case R.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(r.expected,me.jsonStringifyReplacer));break;case R.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(me.joinValues(r.keys,", "));break;case R.invalid_union:t="Invalid input";break;case R.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(me.joinValues(r.options));break;case R.invalid_enum_value:t="Invalid enum value. Expected ".concat(me.joinValues(r.options),", received '").concat(r.received,"'");break;case R.invalid_arguments:t="Invalid function arguments";break;case R.invalid_return_type:t="Invalid function return type";break;case R.invalid_date:t="Invalid date";break;case R.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(t="".concat(t," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?t='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?t='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):me.assertNever(r.validation):r.validation!=="regex"?t="Invalid ".concat(r.validation):t="Invalid";break;case R.too_small:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):t="Invalid input";break;case R.too_big:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?t="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):t="Invalid input";break;case R.custom:t="Invalid input";break;case R.invalid_intersection_types:t="Intersection results could not be merged";break;case R.not_multiple_of:t="Number must be a multiple of ".concat(r.multipleOf);break;case R.not_finite:t="Number must be finite";break;default:t=e.defaultError,me.assertNever(r)}return{message:t}},"errorMap"),h7=Vs;function hE(r){h7=r}c(hE,"setErrorMap");function Bh(){return h7}c(Bh,"getErrorMap");var Rh=c(r=>{let{data:e,path:t,errorMaps:i,issueData:n}=r,o=[...t,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let u="",l=i.filter(p=>!!p).slice().reverse();for(let p of l)u=p(a,{data:e,defaultError:u}).message;return{...n,path:o,message:u}},"makeIssue"),fE=[];function H(r,e){let t=Bh(),i=Rh({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===Vs?void 0:Vs].filter(n=>!!n)});r.common.issues.push(i)}c(H,"addIssueToContext");var Uh=class Uh{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let i=[];for(let n of t){if(n.status==="aborted")return Q;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){let i=[];for(let n of t){let o=await n.key,a=await n.value;i.push({key:o,value:a})}return Uh.mergeObjectSync(e,i)}static mergeObjectSync(e,t){let i={};for(let n of t){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}};c(Uh,"ParseStatus");var pt=Uh,Q=Object.freeze({status:"aborted"}),Rs=c(r=>({status:"dirty",value:r}),"DIRTY"),Mt=c(r=>({status:"valid",value:r}),"OK"),X1=c(r=>r.status==="aborted","isAborted"),Y1=c(r=>r.status==="dirty","isDirty"),Yc=c(r=>r.status==="valid","isValid"),Zc=c(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function Nh(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}c(Nh,"__classPrivateFieldGet");function f7(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t}c(f7,"__classPrivateFieldSet");var z;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(z||(z={}));var Gc,Vc,z1=class z1{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};c(z1,"ParseInputLazyPath");var gr=z1,p7=c((r,e)=>{if(Yc(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new tr(r.common.issues);return this._error=t,this._error}}},"handleResult");function ne(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:i,description:n}=r;if(e&&(t||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:n}:{errorMap:c((a,u)=>{var l,p;let{message:h}=r;return a.code==="invalid_enum_value"?{message:h!=null?h:u.defaultError}:typeof u.data>"u"?{message:(l=h!=null?h:i)!==null&&l!==void 0?l:u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:(p=h!=null?h:t)!==null&&p!==void 0?p:u.defaultError}},"customMap"),description:n}}c(ne,"processCreateParams");var q1=class q1{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Jn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pt,ctx:{common:e.parent.common,data:e.data,parsedType:Jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Zc(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;let n={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},o=this._parseSync({data:e,path:n.path,parent:n});return p7(n,o)}async parseAsync(e,t){let i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){let i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jn(e)},n=this._parse({data:e,path:i.path,parent:i}),o=await(Zc(n)?n:Promise.resolve(n));return p7(i,o)}refine(e,t){let i=c(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,o)=>{let a=e(n),u=c(()=>o.addIssue({code:R.custom,...i(n)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(e,t){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof t=="function"?t(i,n):t),!1))}_refinement(e){return new rr({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return yr.create(this,this._def)}nullable(){return gi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return eo.create(this,this._def)}or(e){return ta.create([this,e],this._def)}and(e){return ra.create(this,e,this._def)}transform(e){return new rr({...ne(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new sa({...ne(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new zc({typeName:K.ZodBranded,type:this,...ne(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new la({...ne(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return qc.create(this,e)}readonly(){return ca.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};c(q1,"ZodType");var oe=q1,mE=/^c[^\s-]{8,}$/i,yE=/^[0-9a-z]+$/,gE=/^[0-9A-HJKMNP-TV-Z]{26}$/,vE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bE=/^[a-z0-9_-]{21}$/i,CE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,SE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",U1,ME=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,TE=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,PE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,m7="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",IE=new RegExp("^".concat(m7,"$"));function y7(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e="".concat(e,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}c(y7,"timeRegexSource");function wE(r){return new RegExp("^".concat(y7(r),"$"))}c(wE,"timeRegex");function g7(r){let e="".concat(m7,"T").concat(y7(r)),t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(t.join("|"),")"),new RegExp("^".concat(e,"$"))}c(g7,"datetimeRegex");function EE(r,e){return!!((e==="v4"||!e)&&ME.test(r)||(e==="v6"||!e)&&TE.test(r))}c(EE,"isValidIP");var zo=class zo extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==W.string){let o=this._getOrReturnCtx(e);return H(o,{code:R.invalid_type,expected:W.string,received:o.parsedType}),Q}let i=new pt,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,u=e.data.length<o.value;(a||u)&&(n=this._getOrReturnCtx(e,n),a?H(n,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&H(n,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")xE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"email",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")U1||(U1=new RegExp(SE,"u")),U1.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"emoji",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")vE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"uuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")bE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"nanoid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")mE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")yE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"cuid2",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")gE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ulid",code:R.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),H(n,{validation:"url",code:R.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"regex",code:R.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),H(n,{code:R.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:R.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),H(n,{code:R.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?g7(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:R.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?IE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:R.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?wE(o).test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{code:R.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?CE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"duration",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?EE(e.data,o.version)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"ip",code:R.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?PE.test(e.data)||(n=this._getOrReturnCtx(e,n),H(n,{validation:"base64",code:R.invalid_string,message:o.message}),i.dirty()):me.assertNever(o);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(n=>e.test(n),{validation:t,code:R.invalid_string,...z.errToObj(i)})}_addCheck(e){return new zo({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...z.errToObj(e)})}datetime(e){var t,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...z.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...z.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...z.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...z.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...z.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...z.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...z.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...z.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...z.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...z.errToObj(t)})}nonempty(e){return this.min(1,z.errToObj(e))}trim(){return new zo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new zo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new zo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};c(zo,"ZodString");var Kn=zo;Kn.create=r=>{var e;return new Kn({checks:[],typeName:K.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};function _E(r,e){let t=(r.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=t>i?t:i,o=parseInt(r.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return o%a/Math.pow(10,n)}c(_E,"floatSafeRemainder");var jc=class jc extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==W.number){let o=this._getOrReturnCtx(e);return H(o,{code:R.invalid_type,expected:W.number,received:o.parsedType}),Q}let i,n=new pt;for(let o of this._def.checks)o.kind==="int"?me.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:R.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:R.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:R.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?_E(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),H(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),H(i,{code:R.not_finite,message:o.message}),n.dirty()):me.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,z.toString(t))}setLimit(e,t,i,n){return new jc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:z.toString(n)}]})}_addCheck(e){return new jc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&me.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}};c(jc,"ZodNumber");var qo=jc;qo.create=r=>new qo({checks:[],typeName:K.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});var Hc=class Hc extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==W.bigint){let o=this._getOrReturnCtx(e);return H(o,{code:R.invalid_type,expected:W.bigint,received:o.parsedType}),Q}let i,n=new pt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:R.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),H(i,{code:R.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),H(i,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):me.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,z.toString(t))}setLimit(e,t,i,n){return new Hc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:z.toString(n)}]})}_addCheck(e){return new Hc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};c(Hc,"ZodBigInt");var $o=Hc;$o.create=r=>{var e;return new $o({checks:[],typeName:K.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...ne(r)})};var $1=class $1 extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==W.boolean){let i=this._getOrReturnCtx(e);return H(i,{code:R.invalid_type,expected:W.boolean,received:i.parsedType}),Q}return Mt(e.data)}};c($1,"ZodBoolean");var Jo=$1;Jo.create=r=>new Jo({typeName:K.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...ne(r)});var Wh=class Wh extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==W.date){let o=this._getOrReturnCtx(e);return H(o,{code:R.invalid_type,expected:W.date,received:o.parsedType}),Q}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return H(o,{code:R.invalid_date}),Q}let i=new pt,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:R.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(n=this._getOrReturnCtx(e,n),H(n,{code:R.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):me.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Wh({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:z.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:z.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};c(Wh,"ZodDate");var Ko=Wh;Ko.create=r=>new Ko({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:K.ZodDate,...ne(r)});var J1=class J1 extends oe{_parse(e){if(this._getType(e)!==W.symbol){let i=this._getOrReturnCtx(e);return H(i,{code:R.invalid_type,expected:W.symbol,received:i.parsedType}),Q}return Mt(e.data)}};c(J1,"ZodSymbol");var js=J1;js.create=r=>new js({typeName:K.ZodSymbol,...ne(r)});var K1=class K1 extends oe{_parse(e){if(this._getType(e)!==W.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:R.invalid_type,expected:W.undefined,received:i.parsedType}),Q}return Mt(e.data)}};c(K1,"ZodUndefined");var Qo=K1;Qo.create=r=>new Qo({typeName:K.ZodUndefined,...ne(r)});var Q1=class Q1 extends oe{_parse(e){if(this._getType(e)!==W.null){let i=this._getOrReturnCtx(e);return H(i,{code:R.invalid_type,expected:W.null,received:i.parsedType}),Q}return Mt(e.data)}};c(Q1,"ZodNull");var ea=Q1;ea.create=r=>new ea({typeName:K.ZodNull,...ne(r)});var e0=class e0 extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return Mt(e.data)}};c(e0,"ZodAny");var Qn=e0;Qn.create=r=>new Qn({typeName:K.ZodAny,...ne(r)});var t0=class t0 extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Mt(e.data)}};c(t0,"ZodUnknown");var an=t0;an.create=r=>new an({typeName:K.ZodUnknown,...ne(r)});var r0=class r0 extends oe{_parse(e){let t=this._getOrReturnCtx(e);return H(t,{code:R.invalid_type,expected:W.never,received:t.parsedType}),Q}};c(r0,"ZodNever");var Rr=r0;Rr.create=r=>new Rr({typeName:K.ZodNever,...ne(r)});var i0=class i0 extends oe{_parse(e){if(this._getType(e)!==W.undefined){let i=this._getOrReturnCtx(e);return H(i,{code:R.invalid_type,expected:W.void,received:i.parsedType}),Q}return Mt(e.data)}};c(i0,"ZodVoid");var Hs=i0;Hs.create=r=>new Hs({typeName:K.ZodVoid,...ne(r)});var Ns=class Ns extends oe{_parse(e){let{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==W.array)return H(t,{code:R.invalid_type,expected:W.array,received:t.parsedType}),Q;if(n.exactLength!==null){let a=t.data.length>n.exactLength.value,u=t.data.length<n.exactLength.value;(a||u)&&(H(t,{code:a?R.too_big:R.too_small,minimum:u?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(H(t,{code:R.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(H(t,{code:R.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((a,u)=>n.type._parseAsync(new gr(t,a,t.path,u)))).then(a=>pt.mergeArray(i,a));let o=[...t.data].map((a,u)=>n.type._parseSync(new gr(t,a,t.path,u)));return pt.mergeArray(i,o)}get element(){return this._def.type}min(e,t){return new Ns({...this._def,minLength:{value:e,message:z.toString(t)}})}max(e,t){return new Ns({...this._def,maxLength:{value:e,message:z.toString(t)}})}length(e,t){return new Ns({...this._def,exactLength:{value:e,message:z.toString(t)}})}nonempty(e){return this.min(1,e)}};c(Ns,"ZodArray");var sn=Ns;sn.create=(r,e)=>new sn({type:r,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...ne(e)});function Bs(r){if(r instanceof Vt){let e={};for(let t in r.shape){let i=r.shape[t];e[t]=yr.create(Bs(i))}return new Vt({...r._def,shape:()=>e})}else return r instanceof sn?new sn({...r._def,type:Bs(r.element)}):r instanceof yr?yr.create(Bs(r.unwrap())):r instanceof gi?gi.create(Bs(r.unwrap())):r instanceof yi?yi.create(r.items.map(e=>Bs(e))):r}c(Bs,"deepPartialify");var er=class er extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=me.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==W.object){let p=this._getOrReturnCtx(e);return H(p,{code:R.invalid_type,expected:W.object,received:p.parsedType}),Q}let{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Rr&&this._def.unknownKeys==="strip"))for(let p in n.data)a.includes(p)||u.push(p);let l=[];for(let p of a){let h=o[p],y=n.data[p];l.push({key:{status:"valid",value:p},value:h._parse(new gr(n,y,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof Rr){let p=this._def.unknownKeys;if(p==="passthrough")for(let h of u)l.push({key:{status:"valid",value:h},value:{status:"valid",value:n.data[h]}});else if(p==="strict")u.length>0&&(H(n,{code:R.unrecognized_keys,keys:u}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let h of u){let y=n.data[h];l.push({key:{status:"valid",value:h},value:p._parse(new gr(n,y,n.path,h)),alwaysSet:h in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let h of l){let y=await h.key,g=await h.value;p.push({key:y,value:g,alwaysSet:h.alwaysSet})}return p}).then(p=>pt.mergeObjectSync(i,p)):pt.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return z.errToObj,new er({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var n,o,a,u;let l=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,t,i).message)!==null&&a!==void 0?a:i.defaultError;return t.code==="unrecognized_keys"?{message:(u=z.errToObj(e).message)!==null&&u!==void 0?u:l}:{message:l}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}extend(e){return new er({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new er({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new er({...this._def,catchall:e})}pick(e){let t={};return me.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new er({...this._def,shape:()=>t})}omit(e){let t={};return me.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new er({...this._def,shape:()=>t})}deepPartial(){return Bs(this)}partial(e){let t={};return me.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?t[i]=n:t[i]=n.optional()}),new er({...this._def,shape:()=>t})}required(e){let t={};return me.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof yr;)o=o._def.innerType;t[i]=o}}),new er({...this._def,shape:()=>t})}keyof(){return v7(me.objectKeys(this.shape))}};c(er,"ZodObject");var Vt=er;Vt.create=(r,e)=>new Vt({shape:()=>r,unknownKeys:"strip",catchall:Rr.create(),typeName:K.ZodObject,...ne(e)});Vt.strictCreate=(r,e)=>new Vt({shape:()=>r,unknownKeys:"strict",catchall:Rr.create(),typeName:K.ZodObject,...ne(e)});Vt.lazycreate=(r,e)=>new Vt({shape:r,unknownKeys:"strip",catchall:Rr.create(),typeName:K.ZodObject,...ne(e)});var n0=class n0 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i=this._def.options;function n(o){for(let u of o)if(u.result.status==="valid")return u.result;for(let u of o)if(u.result.status==="dirty")return t.common.issues.push(...u.ctx.common.issues),u.result;let a=o.map(u=>new tr(u.ctx.common.issues));return H(t,{code:R.invalid_union,unionErrors:a}),Q}if(c(n,"handleResults"),t.common.async)return Promise.all(i.map(async o=>{let a={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let l of i){let p={...t,common:{...t.common,issues:[]},parent:null},h=l._parseSync({data:t.data,path:t.path,parent:p});if(h.status==="valid")return h;h.status==="dirty"&&!o&&(o={result:h,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let u=a.map(l=>new tr(l));return H(t,{code:R.invalid_union,unionErrors:u}),Q}}get options(){return this._def.options}};c(n0,"ZodUnion");var ta=n0;ta.create=(r,e)=>new ta({options:r,typeName:K.ZodUnion,...ne(e)});var on=c(r=>r instanceof ia?on(r.schema):r instanceof rr?on(r.innerType()):r instanceof na?[r.value]:r instanceof oa?r.options:r instanceof aa?me.objectValues(r.enum):r instanceof sa?on(r._def.innerType):r instanceof Qo?[void 0]:r instanceof ea?[null]:r instanceof yr?[void 0,...on(r.unwrap())]:r instanceof gi?[null,...on(r.unwrap())]:r instanceof zc||r instanceof ca?on(r.unwrap()):r instanceof la?on(r._def.innerType):[],"getDiscriminator"),Xh=class Xh extends oe{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.object)return H(t,{code:R.invalid_type,expected:W.object,received:t.parsedType}),Q;let i=this.discriminator,n=t.data[i],o=this.optionsMap.get(n);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(H(t,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){let n=new Map;for(let o of t){let a=on(o.shape[e]);if(!a.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let u of a){if(n.has(u))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(u)));n.set(u,o)}}return new Xh({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...ne(i)})}};c(Xh,"ZodDiscriminatedUnion");var Gh=Xh;function Z1(r,e){let t=Jn(r),i=Jn(e);if(r===e)return{valid:!0,data:r};if(t===W.object&&i===W.object){let n=me.objectKeys(e),o=me.objectKeys(r).filter(u=>n.indexOf(u)!==-1),a={...r,...e};for(let u of o){let l=Z1(r[u],e[u]);if(!l.valid)return{valid:!1};a[u]=l.data}return{valid:!0,data:a}}else if(t===W.array&&i===W.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<r.length;o++){let a=r[o],u=e[o],l=Z1(a,u);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return t===W.date&&i===W.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}c(Z1,"mergeValues");var o0=class o0 extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e),n=c((o,a)=>{if(X1(o)||X1(a))return Q;let u=Z1(o.value,a.value);return u.valid?((Y1(o)||Y1(a))&&t.dirty(),{status:t.value,value:u.data}):(H(i,{code:R.invalid_intersection_types}),Q)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};c(o0,"ZodIntersection");var ra=o0;ra.create=(r,e,t)=>new ra({left:r,right:e,typeName:K.ZodIntersection,...ne(t)});var Yh=class Yh extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==W.array)return H(i,{code:R.invalid_type,expected:W.array,received:i.parsedType}),Q;if(i.data.length<this._def.items.length)return H(i,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&i.data.length>this._def.items.length&&(H(i,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...i.data].map((a,u)=>{let l=this._def.items[u]||this._def.rest;return l?l._parse(new gr(i,a,i.path,u)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>pt.mergeArray(t,a)):pt.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Yh({...this._def,rest:e})}};c(Yh,"ZodTuple");var yi=Yh;yi.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yi({items:r,typeName:K.ZodTuple,rest:null,...ne(e)})};var Uc=class Uc extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==W.object)return H(i,{code:R.invalid_type,expected:W.object,received:i.parsedType}),Q;let n=[],o=this._def.keyType,a=this._def.valueType;for(let u in i.data)n.push({key:o._parse(new gr(i,u,i.path,u)),value:a._parse(new gr(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?pt.mergeObjectAsync(t,n):pt.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof oe?new Uc({keyType:e,valueType:t,typeName:K.ZodRecord,...ne(i)}):new Uc({keyType:Kn.create(),valueType:e,typeName:K.ZodRecord,...ne(t)})}};c(Uc,"ZodRecord");var Vh=Uc,a0=class a0 extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==W.map)return H(i,{code:R.invalid_type,expected:W.map,received:i.parsedType}),Q;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([u,l],p)=>({key:n._parse(new gr(i,u,i.path,[p,"key"])),value:o._parse(new gr(i,l,i.path,[p,"value"]))}));if(i.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let l of a){let p=await l.key,h=await l.value;if(p.status==="aborted"||h.status==="aborted")return Q;(p.status==="dirty"||h.status==="dirty")&&t.dirty(),u.set(p.value,h.value)}return{status:t.value,value:u}})}else{let u=new Map;for(let l of a){let p=l.key,h=l.value;if(p.status==="aborted"||h.status==="aborted")return Q;(p.status==="dirty"||h.status==="dirty")&&t.dirty(),u.set(p.value,h.value)}return{status:t.value,value:u}}}};c(a0,"ZodMap");var Us=a0;Us.create=(r,e,t)=>new Us({valueType:e,keyType:r,typeName:K.ZodMap,...ne(t)});var Wc=class Wc extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==W.set)return H(i,{code:R.invalid_type,expected:W.set,received:i.parsedType}),Q;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(H(i,{code:R.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(H(i,{code:R.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let o=this._def.valueType;function a(l){let p=new Set;for(let h of l){if(h.status==="aborted")return Q;h.status==="dirty"&&t.dirty(),p.add(h.value)}return{status:t.value,value:p}}c(a,"finalizeSet");let u=[...i.data.values()].map((l,p)=>o._parse(new gr(i,l,i.path,p)));return i.common.async?Promise.all(u).then(l=>a(l)):a(u)}min(e,t){return new Wc({...this._def,minSize:{value:e,message:z.toString(t)}})}max(e,t){return new Wc({...this._def,maxSize:{value:e,message:z.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};c(Wc,"ZodSet");var Ws=Wc;Ws.create=(r,e)=>new Ws({valueType:r,minSize:null,maxSize:null,typeName:K.ZodSet,...ne(e)});var Gs=class Gs extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.function)return H(t,{code:R.invalid_type,expected:W.function,received:t.parsedType}),Q;function i(u,l){return Rh({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bh(),Vs].filter(p=>!!p),issueData:{code:R.invalid_arguments,argumentsError:l}})}c(i,"makeArgsIssue");function n(u,l){return Rh({data:u,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bh(),Vs].filter(p=>!!p),issueData:{code:R.invalid_return_type,returnTypeError:l}})}c(n,"makeReturnsIssue");let o={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof eo){let u=this;return Mt(async function(...l){let p=new tr([]),h=await u._def.args.parseAsync(l,o).catch(v=>{throw p.addIssue(i(l,v)),p}),y=await Reflect.apply(a,this,h);return await u._def.returns._def.type.parseAsync(y,o).catch(v=>{throw p.addIssue(n(y,v)),p})})}else{let u=this;return Mt(function(...l){let p=u._def.args.safeParse(l,o);if(!p.success)throw new tr([i(l,p.error)]);let h=Reflect.apply(a,this,p.data),y=u._def.returns.safeParse(h,o);if(!y.success)throw new tr([n(h,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Gs({...this._def,args:yi.create(e).rest(an.create())})}returns(e){return new Gs({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Gs({args:e||yi.create([]).rest(an.create()),returns:t||an.create(),typeName:K.ZodFunction,...ne(i)})}};c(Gs,"ZodFunction");var jh=Gs,s0=class s0 extends oe{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};c(s0,"ZodLazy");var ia=s0;ia.create=(r,e)=>new ia({getter:r,typeName:K.ZodLazy,...ne(e)});var l0=class l0 extends oe{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return H(t,{received:t.data,code:R.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};c(l0,"ZodLiteral");var na=l0;na.create=(r,e)=>new na({value:r,typeName:K.ZodLiteral,...ne(e)});function v7(r,e){return new oa({values:r,typeName:K.ZodEnum,...ne(e)})}c(v7,"createZodEnum");var Xc=class Xc extends oe{constructor(){super(...arguments),Gc.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),i=this._def.values;return H(t,{expected:me.joinValues(i),received:t.parsedType,code:R.invalid_type}),Q}if(Nh(this,Gc,"f")||f7(this,Gc,new Set(this._def.values),"f"),!Nh(this,Gc,"f").has(e.data)){let t=this._getOrReturnCtx(e),i=this._def.values;return H(t,{received:t.data,code:R.invalid_enum_value,options:i}),Q}return Mt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Xc.create(e,{...this._def,...t})}exclude(e,t=this._def){return Xc.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}};c(Xc,"ZodEnum");var oa=Xc;Gc=new WeakMap;oa.create=v7;var c0=class c0 extends oe{constructor(){super(...arguments),Vc.set(this,void 0)}_parse(e){let t=me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==W.string&&i.parsedType!==W.number){let n=me.objectValues(t);return H(i,{expected:me.joinValues(n),received:i.parsedType,code:R.invalid_type}),Q}if(Nh(this,Vc,"f")||f7(this,Vc,new Set(me.getValidEnumValues(this._def.values)),"f"),!Nh(this,Vc,"f").has(e.data)){let n=me.objectValues(t);return H(i,{received:i.data,code:R.invalid_enum_value,options:n}),Q}return Mt(e.data)}get enum(){return this._def.values}};c(c0,"ZodNativeEnum");var aa=c0;Vc=new WeakMap;aa.create=(r,e)=>new aa({values:r,typeName:K.ZodNativeEnum,...ne(e)});var u0=class u0 extends oe{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.promise&&t.common.async===!1)return H(t,{code:R.invalid_type,expected:W.promise,received:t.parsedType}),Q;let i=t.parsedType===W.promise?t.data:Promise.resolve(t.data);return Mt(i.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};c(u0,"ZodPromise");var eo=u0;eo.create=(r,e)=>new eo({type:r,typeName:K.ZodPromise,...ne(e)});var p0=class p0 extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:a=>{H(i,a),a.fatal?t.abort():t.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let a=n.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async u=>{if(t.value==="aborted")return Q;let l=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return l.status==="aborted"?Q:l.status==="dirty"||t.value==="dirty"?Rs(l.value):l});{if(t.value==="aborted")return Q;let u=this._def.schema._parseSync({data:a,path:i.path,parent:i});return u.status==="aborted"?Q:u.status==="dirty"||t.value==="dirty"?Rs(u.value):u}}if(n.type==="refinement"){let a=c(u=>{let l=n.refinement(u,o);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u},"executeRefinement");if(i.common.async===!1){let u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?Q:(u.status==="dirty"&&t.dirty(),a(u.value),{status:t.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?Q:(u.status==="dirty"&&t.dirty(),a(u.value).then(()=>({status:t.value,value:u.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Yc(a))return a;let u=n.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>Yc(a)?Promise.resolve(n.transform(a.value,o)).then(u=>({status:t.value,value:u})):a);me.assertNever(n)}};c(p0,"ZodEffects");var rr=p0;rr.create=(r,e,t)=>new rr({schema:r,typeName:K.ZodEffects,effect:e,...ne(t)});rr.createWithPreprocess=(r,e,t)=>new rr({schema:e,effect:{type:"preprocess",transform:r},typeName:K.ZodEffects,...ne(t)});var d0=class d0 extends oe{_parse(e){return this._getType(e)===W.undefined?Mt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c(d0,"ZodOptional");var yr=d0;yr.create=(r,e)=>new yr({innerType:r,typeName:K.ZodOptional,...ne(e)});var h0=class h0 extends oe{_parse(e){return this._getType(e)===W.null?Mt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c(h0,"ZodNullable");var gi=h0;gi.create=(r,e)=>new gi({innerType:r,typeName:K.ZodNullable,...ne(e)});var f0=class f0 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return t.parsedType===W.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};c(f0,"ZodDefault");var sa=f0;sa.create=(r,e)=>new sa({innerType:r,typeName:K.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});var m0=class m0 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zc(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tr(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new tr(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};c(m0,"ZodCatch");var la=m0;la.create=(r,e)=>new la({innerType:r,typeName:K.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});var y0=class y0 extends oe{_parse(e){if(this._getType(e)!==W.nan){let i=this._getOrReturnCtx(e);return H(i,{code:R.invalid_type,expected:W.nan,received:i.parsedType}),Q}return{status:"valid",value:e.data}}};c(y0,"ZodNaN");var Xs=y0;Xs.create=r=>new Xs({typeName:K.ZodNaN,...ne(r)});var DE=Symbol("zod_brand"),g0=class g0 extends oe{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}};c(g0,"ZodBranded");var zc=g0,Zh=class Zh extends oe{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return c(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Q:o.status==="dirty"?(t.dirty(),Rs(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})},"handleAsync")();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?Q:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,t){return new Zh({in:e,out:t,typeName:K.ZodPipeline})}};c(Zh,"ZodPipeline");var qc=Zh,v0=class v0 extends oe{_parse(e){let t=this._def.innerType._parse(e),i=c(n=>(Yc(n)&&(n.value=Object.freeze(n.value)),n),"freeze");return Zc(t)?t.then(n=>i(n)):i(t)}unwrap(){return this._def.innerType}};c(v0,"ZodReadonly");var ca=v0;ca.create=(r,e)=>new ca({innerType:r,typeName:K.ZodReadonly,...ne(e)});function b7(r,e={},t){return r?Qn.create().superRefine((i,n)=>{var o,a;if(!r(i)){let u=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,l=(a=(o=u.fatal)!==null&&o!==void 0?o:t)!==null&&a!==void 0?a:!0,p=typeof u=="string"?{message:u}:u;n.addIssue({code:"custom",...p,fatal:l})}}):Qn.create()}c(b7,"custom");var OE={object:Vt.lazycreate},K;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(K||(K={}));var LE=c((r,e={message:"Input not instance of ".concat(r.name)})=>b7(t=>t instanceof r,e),"instanceOfType"),C7=Kn.create,x7=qo.create,AE=Xs.create,kE=$o.create,S7=Jo.create,FE=Ko.create,BE=js.create,RE=Qo.create,NE=ea.create,GE=Qn.create,VE=an.create,jE=Rr.create,HE=Hs.create,UE=sn.create,WE=Vt.create,XE=Vt.strictCreate,YE=ta.create,ZE=Gh.create,zE=ra.create,qE=yi.create,$E=Vh.create,JE=Us.create,KE=Ws.create,QE=jh.create,e_=ia.create,t_=na.create,r_=oa.create,i_=aa.create,n_=eo.create,d7=rr.create,o_=yr.create,a_=gi.create,s_=rr.createWithPreprocess,l_=qc.create,c_=c(()=>C7().optional(),"ostring"),u_=c(()=>x7().optional(),"onumber"),p_=c(()=>S7().optional(),"oboolean"),d_={string:r=>Kn.create({...r,coerce:!0}),number:r=>qo.create({...r,coerce:!0}),boolean:r=>Jo.create({...r,coerce:!0}),bigint:r=>$o.create({...r,coerce:!0}),date:r=>Ko.create({...r,coerce:!0})},h_=Q,A=Object.freeze({__proto__:null,defaultErrorMap:Vs,setErrorMap:hE,getErrorMap:Bh,makeIssue:Rh,EMPTY_PATH:fE,addIssueToContext:H,ParseStatus:pt,INVALID:Q,DIRTY:Rs,OK:Mt,isAborted:X1,isDirty:Y1,isValid:Yc,isAsync:Zc,get util(){return me},get objectUtil(){return W1},ZodParsedType:W,getParsedType:Jn,ZodType:oe,datetimeRegex:g7,ZodString:Kn,ZodNumber:qo,ZodBigInt:$o,ZodBoolean:Jo,ZodDate:Ko,ZodSymbol:js,ZodUndefined:Qo,ZodNull:ea,ZodAny:Qn,ZodUnknown:an,ZodNever:Rr,ZodVoid:Hs,ZodArray:sn,ZodObject:Vt,ZodUnion:ta,ZodDiscriminatedUnion:Gh,ZodIntersection:ra,ZodTuple:yi,ZodRecord:Vh,ZodMap:Us,ZodSet:Ws,ZodFunction:jh,ZodLazy:ia,ZodLiteral:na,ZodEnum:oa,ZodNativeEnum:aa,ZodPromise:eo,ZodEffects:rr,ZodTransformer:rr,ZodOptional:yr,ZodNullable:gi,ZodDefault:sa,ZodCatch:la,ZodNaN:Xs,BRAND:DE,ZodBranded:zc,ZodPipeline:qc,ZodReadonly:ca,custom:b7,Schema:oe,ZodSchema:oe,late:OE,get ZodFirstPartyTypeKind(){return K},coerce:d_,any:GE,array:UE,bigint:kE,boolean:S7,date:FE,discriminatedUnion:ZE,effect:d7,enum:r_,function:QE,instanceof:LE,intersection:zE,lazy:e_,literal:t_,map:JE,nan:AE,nativeEnum:i_,never:jE,null:NE,nullable:a_,number:x7,object:WE,oboolean:p_,onumber:u_,optional:o_,ostring:c_,pipeline:l_,preprocess:s_,promise:n_,record:$E,set:KE,strictObject:XE,string:C7,symbol:BE,transformer:d7,tuple:qE,undefined:RE,union:YE,unknown:VE,void:HE,NEVER:h_,ZodIssueCode:R,quotelessJson:dE,ZodError:tr});var f_=A.object({limit:A.enum(["same-floor","same-elevation"]).optional(),radius:A.number().optional(),types:A.array(A.enum(["node","point-of-interest"])).min(1)}),vi,Jc,b0=class b0{constructor(e){M(this,vi,void 0);M(this,Jc,void 0);P(this,vi,e),P(this,Jc,new Fh(s(this,vi)))}nearest(e,t){try{f_.parse(t)}catch(a){L.error(a);return}let i=et(e);if(!i)return;let n=i.floorId?[i.floorId]:[];if(i.floorId==null)for(let a of s(this,vi).getByType("floor-stack")){let u=a.defaultFloor;u&&n.push(u.id)}else if(t.limit==="same-elevation"){let a=s(this,vi).floorsById[i.floorId];if(a){let u=a==null?void 0:a.elevation;u&&(n=s(this,vi).getByType("floor-stack").map(l=>{var p;return(p=l.floors.find(h=>h.elevation===u))==null?void 0:p.id}).filter(Boolean))}}let o=[];for(let a of t7(t.types))for(let u of n){let l=s(this,Jc).getTreeByType(a,s(this,vi).mapName,u).find(i.latitude,i.longitude,t.radius);if(l){let p=s(this,vi).getById(a,l==null?void 0:l.properties.id);p&&o.push({distance:Br([i.longitude,i.latitude],l.geometry.coordinates),feature:p})}}return o.sort((a,u)=>a.distance-u.distance)}};vi=new WeakMap,Jc=new WeakMap,c(b0,"Query");var $c=b0;var ee,Ys,C0=class C0 extends ${constructor(t,i){var u,l,p,h;super();d(this,"Analytics");M(this,ee,{});d(this,"Query");d(this,"mvf");d(this,"outdoorViewToken");d(this,"spaceIdsByDestinationNodeId");d(this,"objectEntranceNodeIdsByObstructionId");d(this,"obstructionIdByEntranceId");d(this,"venue");d(this,"sasToken");d(this,"directions");d(this,"enterpriseMode",!1);d(this,"nodesById");d(this,"spacesById");d(this,"floorsById");d(this,"floorStacksById");d(this,"facadesById");d(this,"facadesBySpaceId");d(this,"connectionsById");d(this,"objectsById");d(this,"doorsById");d(this,"pointsOfInterestById");d(this,"annotationsById");d(this,"areasById");d(this,"locationsById");d(this,"categoriesById");d(this,"doorsByNodeId");d(this,"locationsBySpaceId");d(this,"locationIdsByNodeId");d(this,"mvfAnnotationsById");d(this,"mvfConnectionsById");d(this,"mvfConnectionsByNodeId");d(this,"mvfEntrancesById");d(this,"mvfNodesById");d(this,"mvfObstructionById");d(this,"mvfSpacesById");d(this,"mvfFloorsById");d(this,"mvfFloorStacksById");d(this,"mvfAreasById");d(this,"mvfNodesByFloorId");d(this,"mvfSpacesByFloorId");d(this,"mvfPoisByFloorId");d(this,"mvfEntrancesByFloorId");d(this,"mvfAnnotationsByFloorId");d(this,"localePacksUrls");d(this,"currentLanguage");d(this,"languagePacks",{});d(this,"binaryBundle");d(this,"envControl");M(this,Ys,void 0);d(this,"getDirectionsMultiDestination",c((t,i,n)=>this.getDirections(t,i,{...n,multiDestination:!0}),"getDirectionsMultiDestination"));d(this,"getDirections",c((t,i,n)=>{let{accessible:o=!1,smoothing:a=!0,multiDestination:u=!1}=n||{},l=typeof a=="object"?a.enabled:a,p=typeof a=="object"?a.radius:void 0,h=(n==null?void 0:n.zones)||[],y={accessible:o,zones:h,smoothing:{enabled:l!=null?l:!0,radius:p!=null?p:.75}};if(u&&Array.isArray(i)){let g=Array.isArray(t)?t:[t],v=[];for(let S of i){let T=Array.isArray(S)?S:[S],b=this.directions.getDirections(g,T,y,this);if(!b){L.error("getDirections failed due to missing directions for one of the segments");return}g=T,v.push(b)}return v}else{let g=Array.isArray(t)?t:[t],v=Array.isArray(i)?i:[i];if(Array.isArray(v[0])){L.error("getDirections does not support multi-destination without multisegment option");return}return g[0].id&&v[0].id&&this.Analytics.sendGetDirectionsEvent(g[0].id,v[0].id),this.directions.getDirections(g,v,y,this)}},"getDirections"));let n=(u=i==null?void 0:i.env)!=null?u:Io();this.envControl=n,this.binaryBundle=i==null?void 0:i.binaryBundle,this.Analytics=new Ja,this.localePacksUrls=(l=i==null?void 0:i.localePacksUrls)!=null?l:{},this.mvf=t,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 o=GS(t,this);this.nodesById=o.nodesById,this.spacesById=o.spacesById,this.floorsById=o.floorsById,this.floorStacksById=o.floorStacksById,this.facadesById=o.facadesById,this.facadesBySpaceId=o.facadesBySpaceId,this.connectionsById=o.connectionsById,this.objectsById=o.objectsById,this.doorsById=o.doorsById,this.pointsOfInterestById=o.poisById,this.annotationsById=o.annotationsById,this.areasById=o.areasById,this.mvfAnnotationsById=o.mvfAnnotationsById,this.mvfConnectionsById=o.mvfConnectionsById,this.mvfConnectionsByNodeId=o.mvfConnectionsByNodeId,this.mvfEntrancesById=o.mvfEntrancesById,this.mvfNodesById=o.mvfNodesById,this.mvfObstructionById=o.mvfObstructionById,this.mvfSpacesById=o.mvfSpacesById,this.mvfFloorsById=o.mvfFloorsById,this.mvfFloorStacksById=o.mvfFloorStacksById,this.mvfNodesByFloorId=o.mvfNodesByFloorId,this.mvfSpacesByFloorId=o.mvfSpacesByFloorId,this.mvfPoisByFloorId=o.mvfPoisByFloorId,this.mvfEntrancesByFloorId=o.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=o.mvfAnnotationsByFloorId,this.mvfAreasById=o.mvfAreasById,this.doorsByNodeId=o.doorsByNodeId,this.spaceIdsByDestinationNodeId=o.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=o.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=o.obstructionIdByEntranceId;let a=NS(t,this);if(this.locationsById=a.locationsById,this.categoriesById=a.categoriesById,this.locationsBySpaceId=a.locationsBySpaceId,this.locationIdsByNodeId=a.locationIdsByNodeId,a.venue.name!=null){this.venue=new f1(this,{mvfData:a.venue});let y={};for(let g in a.mvfLocationsById)y[g]=a.mvfLocationsById[g];for(let g in a.locationInstancesById)y[g]=a.locationInstancesById[g];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{locations:y,categories:a.mvfCategoriesById}},(h=i==null?void 0:i.languagePacks)==null||h.forEach(({language:g,localePack:v})=>{this.languagePacks[g.code]=m1(v)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new $c(this),this.directions=new Lh({nodes:t["node.geojson"],geojsonCollection:t.enterprise?t.space:t.obstruction,connections:t["connection.json"],groupBy:"map"})}getEnv(){let t=this;return{get baseUri(){var i;return t.envControl.getBaseUri((i=t.enterpriseMode)!=null?i:!1)},get baseAuthUri(){return t.envControl.getBaseAuthUri()},get analyticsBaseUri(){return t.envControl.getAnalyticsBaseUri()},get tileServerUri(){return t.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var t;return(t=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?t:""}get mapCenter(){return new se(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get spaces(){return s(this,ee).spaces==null&&(s(this,ee).spaces=globalThis.Object.values(this.spacesById)),s(this,ee).spaces}get objects(){return s(this,ee).objects==null&&(s(this,ee).objects=globalThis.Object.values(this.objectsById)),s(this,ee).objects}get connections(){return s(this,ee).connections==null&&(s(this,ee).connections=globalThis.Object.values(this.connectionsById)),s(this,ee).connections}get floors(){return s(this,ee).floors==null&&(s(this,ee).floors=globalThis.Object.values(this.floorsById)),s(this,ee).floors}get floorStacks(){return s(this,ee).floorStacks==null&&(s(this,ee).floorStacks=globalThis.Object.values(this.floorStacksById)),s(this,ee).floorStacks}get facades(){return s(this,ee).facades==null&&(s(this,ee).facades=globalThis.Object.values(this.facadesById)),s(this,ee).facades}get doors(){return s(this,ee).doors==null&&(s(this,ee).doors=globalThis.Object.values(this.doorsById)),s(this,ee).doors}get pointsOfInterest(){return s(this,ee).pointsOfInterest==null&&(s(this,ee).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),s(this,ee).pointsOfInterest}get annotations(){return s(this,ee).annotations==null&&(s(this,ee).annotations=globalThis.Object.values(this.annotationsById)),s(this,ee).annotations}get areas(){return s(this,ee).areas==null&&(s(this,ee).areas=globalThis.Object.values(this.areasById)),s(this,ee).areas}get nodes(){return s(this,ee).nodes==null&&(s(this,ee).nodes=globalThis.Object.values(this.nodesById)),s(this,ee).nodes}get locations(){return s(this,ee).locations==null&&(s(this,ee).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return s(this,ee).categories==null&&(s(this,ee).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get mvfFloors(){return s(this,ee).mvfFloors==null&&(s(this,ee).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),s(this,ee).mvfFloors}get mvfFloorStacks(){return s(this,ee).mvfFloorStacks==null&&(s(this,ee).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),s(this,ee).mvfFloorStacks}getByType(t){switch(t){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(t,i){switch(t){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:throw new Error("Unknown type: ".concat(t))}}getMapDataById(t){var i,n,o,a,u,l,p,h,y,g;return(g=(y=(h=(p=(l=(u=(a=(o=(n=(i=this.spacesById[t])!=null?i:this.floorsById[t])!=null?n:this.floorStacksById[t])!=null?o:this.facadesById[t])!=null?a:this.nodesById[t])!=null?u:this.doorsById[t])!=null?l:this.connectionsById[t])!=null?p:this.objectsById[t])!=null?h:this.pointsOfInterestById[t])!=null?y:this.annotationsById[t])!=null?g:this.areasById[t]}getMVFFeatureById(t,i){switch(t){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(t))}}getMVFFeatureByNodeId(t,i){switch(t){case"connection":return this.mvfConnectionsByNodeId[i];default:throw new Error("Unsupported MVF feature type: ".concat(t))}}getMVFFeatureByType(t){switch(t){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(t))}}getPropTranslation(t,i,n,o){var p,h;if(!this.currentLanguage)return o;let{code:a}=this.currentLanguage,u=t==="enterprise-category"?"categories":t==="enterprise-location"?"locations":void 0;if(!u)return o;let l=(h=(p=this.languagePacks[a])==null?void 0:p.optimized)==null?void 0:h[u];if(l){let y=l[n];if(y!=null&&y[i]!==void 0)return y[i]}return o}async changeLanguage(t){var u;let i=t.toLowerCase();if(!i){L.error("language code must be defined");return}if(!this.currentLanguage){L.error("languageCode feature is not supported");return}let n=this.currentLanguage.code,o=(u=this.venue)==null?void 0:u.languages.find(({code:l})=>l.toLowerCase()===i.toLowerCase());if(!o){L.warn("language not found");return}if(n===o.code)return;let a=this.languagePacks[o.code];if(!a){let l=this.localePacksUrls[o.code];if(!l){L.error("locale packs url not found for ".concat(o.code));return}s(this,Ys)&&s(this,Ys).abort();let p=new AbortController;P(this,Ys,p);let h;try{h=await m3(l,{signal:p.signal})}catch(y){L.error("failed downloading language pack",y);return}if(!h||p.signal.aborted)return;a=m1(h),this.languagePacks[o.code]=a}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=o,this.publish("language-change",this.currentLanguage)}getDistance(t,i){let n=et(t),o=et(i);return Br([n.longitude,n.latitude],[o.longitude,o.latitude])}async toJSONBundle({downloadLanguagePacks:t=!0}={}){var n;let i=[];if(t&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let u=await zm(this.localePacksUrls[a.code],{signal:o.signal}),l=await Qa(u);l&&i.push({language:{code:a.code,name:a.name},localePack:l})}}catch(u){L.warn("failed downloading language pack",u)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:t=!0}={}){var n;if(!this.binaryBundle){L.error("binary bundle not found");return}let i=[];if(t&&this.enterpriseMode){let o=new AbortController;for(let a of((n=this.venue)==null?void 0:n.languages)||[])try{if(this.localePacksUrls[a.code]){let u=await zm(this.localePacksUrls[a.code],{signal:o.signal});u&&i.push({language:{code:a.code,name:a.name},localePack:u})}}catch(u){L.warn("failed downloading language pack",u)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:i,main:this.binaryBundle}}destroy(){for(let t of globalThis.Object.keys(s(this,ee)))s(this,ee)[t]=null}};ee=new WeakMap,Ys=new WeakMap,c(C0,"MapDataInternal");var Zs=C0;m();m();m();m();var _h=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(_h||{}),Dh=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(Dh||{});m();m();var zs=class zs{constructor(e,t,i){d(this,"id");d(this,"text");d(this,"target");d(this,"__type",zs.__type);this.id=e,this.text=t,this.target=i}static is(e){return e.__type===zs.__type}};c(zs,"Label"),d(zs,"__type","Label");var to=zs;m();var $s,qs=class qs{constructor(e,t,i){d(this,"id");M(this,$s,void 0);d(this,"__type",qs.__type);d(this,"contentEl");this.id=e,this.contentEl=t,P(this,$s,i)}get target(){return s(this,$s)}static is(e){return e.__type===qs.__type}updateTarget(e){P(this,$s,e)}};$s=new WeakMap,c(qs,"Marker"),d(qs,"__type","Marker");var ln=qs;m();var Qc,eu,Js=class Js{constructor(e,t,i){M(this,Qc,void 0);M(this,eu,void 0);d(this,"target");d(this,"__type",Js.__type);P(this,Qc,e),P(this,eu,t),this.target=i}static is(e){return e.__type===Js.__type}get id(){return s(this,Qc)}get url(){return s(this,eu)}};Qc=new WeakMap,eu=new WeakMap,c(Js,"Image"),d(Js,"__type","Image");var Kc=Js;m();var Ks=class Ks{constructor(e,t){d(this,"id");d(this,"groupId");d(this,"__type",Ks.__type);this.id=e,this.groupId=t}static is(e){return e.__type===Ks.__type}};c(Ks,"Model"),d(Ks,"__type","Model");var tu=Ks;m();var x0=class x0{constructor(e,t,i){d(this,"id");d(this,"animation");d(this,"coordinates");d(this,"__type");this.id=e,this.__type="Path",this.animation=t,this.coordinates=i}};c(x0,"Path");var ua=x0;m();var ro,S0=class S0{constructor(e){M(this,ro,void 0);P(this,ro,e)}get center(){return s(this,ro).center}get bearing(){return s(this,ro).bearing}get pitch(){return s(this,ro).pitch}get zoomLevel(){return s(this,ro).zoomLevel}};ro=new WeakMap,c(S0,"CameraTransform");var ru=S0;m();var Qs=class Qs{constructor(e){d(this,"id");d(this,"__type",Qs.__type);this.id=e}static is(e){return e.__type===Qs.__type}};c(Qs,"Shape"),d(Qs,"__type","Shape");var io=Qs;m();m();m();var m_=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>']]),y_=/<svg([^>]*)>/g;function M7(r,e,t){let i=m_.get(r);return i?i.replace(y_,'<svg$1 style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}c(M7,"getStyledIcon");var g_=c(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 '),"getDeparturePin"),v_=c(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 '),"getDestinationPin"),M0="#722ED1",T0="#1890FF",T7=c(({type:r="departure",color:e=T0})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?g_(e):v_(e),"\n </div>"),"DroppedPin"),b_=c(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),P7=c(({type:r="stairs",color:e=M0,direction:t="up"})=>{let i=b_("default"),n=i/2+2,o=t&&t!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(e,"; width:").concat(i,"px; height:").concat(i,'px;"\n >\n ').concat(M7("connection-"+r+"-16x16","white",n)||"","\n </div>\n ").concat(o?'<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(t==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(n,"px; height: ").concat(n,'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>")},"ConnectionMarker");m();var I7=c(async r=>new Promise(e=>setTimeout(e,r)),"ms");var el={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:T0,destinationColor:M0}},cn,un,no,_e,nu,pn,at,bi,vr,dn,pa,$h,w7,tl,zh,rl,qh,Jh,E7,ou,P0=class P0{constructor(e,t,i){M(this,$h);M(this,tl);M(this,rl);M(this,Jh);M(this,cn,new Map);M(this,un,void 0);M(this,no,void 0);M(this,_e,el);M(this,nu,void 0);M(this,pn,void 0);M(this,at,[]);M(this,bi,void 0);M(this,vr,new Map);M(this,dn,new Map);M(this,pa,new Map);M(this,ou,c(e=>{var t;if((t=s(this,_e).createMarkers)!=null&&t.connection&&e.markers.length>0){let{instruction:i}=s(this,cn).get(e.markers[0]);i!=null&&i.action.toFloor&&(s(this,_e).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}))}},"#handleClick"));P(this,un,e),P(this,nu,i),P(this,no,t)}get currentMap(){return s(this,nu).call(this)}get isMultiFloor(){if(!s(this,at).length)return!1;let e=new Set;for(let t of s(this,at))for(let i of t.coordinates)if(i.floorId&&(e.add(i.floorId),e.size>1))return!0;return!1}getPathById(e){return s(this,vr).get(e)}getMarkerById(e){return s(this,cn).get(e)}get paths(){let e=[];return s(this,vr).forEach(({path:t})=>e.push(t)),e}get activeDirections(){return s(this,pa).get(s(this,bi))}get activePath(){var e;if(s(this,bi))return(e=s(this,vr).get(s(this,bi).id))==null?void 0:e.path}get floorStacks(){let e=s(this,no).getMapData();if(!s(this,at).length||!e)return[];let t=new Set;for(let i of s(this,at))for(let n of i.coordinates)if(n.floorId){let o=e.getById("floor",n.floorId);o&&t.add(o.floorStack)}return Array.from(t)}get floors(){let e=s(this,no).getMapData();if(!s(this,at).length||!e)return[];let t=new Set;for(let i of s(this,at))for(let n of i.coordinates)if(n.floorId){let o=e.getById("floor",n.floorId);o&&t.add(o)}return Array.from(t)}setActivePathByIndex(e){let t=s(this,at)[e];if(!s(this,at).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,at)[e]){L.warn("Direction #".concat(e," does not exist"));return}let i=s(this,dn).get(t);if(!i){L.warn("The direction is not a part of muli-direcional path");return}V(this,tl,zh).call(this,i)}setActivePath(e){if(!s(this,at).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!s(this,pa).get(e)){L.warn('Path "'.concat(e.id,'" is not a part of muli-direcional path'));return}V(this,tl,zh).call(this,e)}setActivePathByDirections(e){if(!s(this,at).length){L.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let t=s(this,dn).get(e);if(!t){L.warn("The direction is not a part of muli-direcional path");return}V(this,tl,zh).call(this,t)}async draw(e,t={}){var l;let i=Array.isArray(e)?e:[e],n=i[0],o=i[i.length-1],a=n.coordinates[0];P(this,at,i),a.floorId&&this.currentMap.setFloor(a.floorId),s(this,pn)&&this.clear(),P(this,_e,{setMapOnConnectionClick:(l=t.setMapOnConnectionClick)!=null?l:el.setMapOnConnectionClick,pathOptions:{...el.pathOptions,...t.pathOptions},inactivePathOptions:{...el.inactivePathOptions,...t.inactivePathOptions},createMarkers:{...el.createMarkers,...t.createMarkers},markerOptions:{...el.markerOptions,...t.markerOptions}});let u=!1;return P(this,pn,{promise:new Promise(async p=>{var h,y,g;if(C.env.NODE_ENV!=="test"&&await I7(500),u||!i.length){p();return}(h=s(this,_e).createMarkers)!=null&&h.departure&&V(this,rl,qh).call(this,n.coordinates[0],"departure",n.instructions[0]);for(let v=0;v<i.length;v++){let S=i[v],T=v?{...s(this,_e).inactivePathOptions}:{...s(this,_e).pathOptions};if(S.coordinates.length<2){L.warn("Directions must have at least 2 coordinates"),p();return}let b=this.currentMap.Paths.add(S.coordinates,T),x=b.paths.map(E=>E.id.toString()),I=new ua(le(),b.animation,S.coordinates);for(let E of x){s(this,vr).set(E,{path:I,entityIds:x});let w=v?{...s(this,_e).inactivePathOptions,altitude:0}:{...s(this,_e).pathOptions,altitude:.05};s(this,un).setState(E,w)}if(s(this,vr).set(I.id,{path:I,entityIds:x}),s(this,dn).set(S,I),s(this,pa).set(I,S),C.env.NODE_ENV!=="test"&&await b.animation,u){p();return}(y=s(this,_e).createMarkers)!=null&&y.connection&&V(this,Jh,E7).call(this,S.instructions,"connection"),v===0&&(P(this,bi,s(this,dn).get(s(this,at)[0])),s(this,un).on("click",s(this,ou)))}if((g=s(this,_e).createMarkers)!=null&&g.destination&&V(this,rl,qh).call(this,o.coordinates[o.coordinates.length-1],"destination",o.instructions[o.instructions.length-1]),u){p();return}s(this,no).mapObjects.forEach(v=>{v.processFloorChange(v.currentFloorId)}),p()}),cancel:()=>{u=!0}}),s(this,pn).promise}clear(){s(this,cn).forEach((e,t)=>{this.currentMap.Markers.remove(t.toString())}),s(this,cn).clear(),s(this,vr).forEach(({path:e,entityIds:t})=>{s(this,vr).delete(e.id),t.forEach(i=>s(this,vr).delete(i)),this.currentMap.Paths.remove(t)}),s(this,pn)&&(s(this,pn).cancel(),P(this,pn,void 0)),P(this,at,[]),s(this,dn).clear(),s(this,pa).clear(),P(this,bi,void 0),s(this,un).off("click",s(this,ou)),s(this,no).mapObjects.forEach(e=>{e.processFloorChange(e.currentFloorId)})}};cn=new WeakMap,un=new WeakMap,no=new WeakMap,_e=new WeakMap,nu=new WeakMap,pn=new WeakMap,at=new WeakMap,bi=new WeakMap,vr=new WeakMap,dn=new WeakMap,pa=new WeakMap,$h=new WeakSet,w7=c(function(e){return e!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(e.type)},"#isVortexAction"),tl=new WeakSet,zh=c(function(e){P(this,bi,e),s(this,at).forEach(t=>{let i=s(this,dn).get(t);if(i){let n=s(this,vr).get(i.id),o=n.path.id===s(this,bi).id?{...s(this,_e).pathOptions,altitude:.05}:{...s(this,_e).inactivePathOptions,altitude:0};n.entityIds.forEach(a=>{s(this,un).setState(a,o)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),rl=new WeakSet,qh=c(function(e,t,i){var n,o,a,u,l;if(t==="connection"&&i){let p=i.action.type==="ExitConnection"?s(this,_e).markerOptions.departureColor:s(this,_e).markerOptions.destinationColor,h;if(typeof((n=s(this,_e).createMarkers)==null?void 0:n.connection)=="function"){let g=s(this,_e).createMarkers.connection(i);s(this,un).setState(g.id.toString(),{options:{interactive:!0}}),h={id:g.id,type:"marker"}}else h=this.currentMap.Markers.add(i.coordinate,P7({type:(a=(o=i.action.connection)==null?void 0:o.type)!=null?a:i.action.connectionType,color:p,direction:i.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let y=this.currentMap.Markers.getContentEl(h.id.toString());if(!y)throw new Error("marker component should exist");s(this,cn).set(h.id,{instruction:i,marker:new ln(h.id.toString(),y,i.coordinate)})}else{let p=t==="departure"?s(this,_e).markerOptions.departureColor:s(this,_e).markerOptions.destinationColor,h;typeof((u=s(this,_e).createMarkers)==null?void 0:u.departure)=="function"&&t==="departure"?h={id:s(this,_e).createMarkers.departure(i).id,type:"marker"}:typeof((l=s(this,_e).createMarkers)==null?void 0:l.destination)=="function"&&t==="destination"?h={id:s(this,_e).createMarkers.destination(i).id,type:"marker"}:h=this.currentMap.Markers.add(e,T7({type:t,color:p}),{anchor:"top",rank:"always-visible"}),s(this,cn).set(h.id,void 0)}},"#addMarker"),Jh=new WeakSet,E7=c(function(e,t){e.filter(n=>V(this,$h,w7).call(this,n.action)).forEach(n=>{V(this,rl,qh).call(this,n.coordinate,t,n)})},"#addMarkers"),ou=new WeakMap,c(P0,"Navigation");var iu=P0;m();m();m();var C_=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>']]),x_=/<svg([^>]*)>/g;function _7(r,e,t){let i=C_.get(r);return i?i.replace(x_,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(e,"; width:").concat(t,"px; height:").concat(t,'px">')):""}c(_7,"getStyledIcon");var da,il,au,I0,Qh,D7,ef,O7,su,w0,tf,L7,E0=class E0{constructor(e,t){M(this,au);M(this,Qh);M(this,ef);M(this,su);M(this,tf);M(this,da,void 0);M(this,il,void 0);d(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});P(this,da,e),P(this,il,t)}auto(){let e=s(this,il)[Object.keys(s(this,il))[0]];[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space")].forEach(t=>{if(t.__type==="connection")t.coordinates.forEach(i=>{let n=t.name||t.externalId;n&&s(this,da).Labels.add(i,n,V(this,au,I0).call(this,t))});else{t.__type==="space"&&t.name!==""&&s(this,da).updateState(t,{interactive:!0,hoverColor:"#F0F0F0"});let i=t.name||t.externalId;i&&s(this,da).Labels.add(t,i,V(this,au,I0).call(this,t))}})}};da=new WeakMap,il=new WeakMap,au=new WeakSet,I0=c(function(e){let t=_7(V(this,Qh,D7).call(this,e),"white",12);return{appearance:{text:{foregroundColor:V(this,su,w0).call(this,e)},marker:{foregroundColor:{active:V(this,su,w0).call(this,e)},icon:t,iconSize:12}},interactive:!0,rank:V(this,tf,L7).call(this,e)}},"#generatLabelAppearance"),Qh=new WeakSet,D7=c(function(e){return e.__type==="connection"?V(this,ef,O7).call(this,e.type):e.name.includes("Washroom")?"washroom-14x14":e.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),ef=new WeakSet,O7=c(function(e){let t="";switch(e){case"elevator":t="connection-elevator-12x12";break;case"escalator":t="connection-escalator-12x12";break;case"stairs":t="connection-stairs-12x12";break}return t},"#attemptIconNameForConnection"),su=new WeakSet,w0=c(function(e){return e.__type==="connection"?this.colors.connection:e.__type==="point-of-interest"?this.colors.point:"name"in e&&e.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),tf=new WeakSet,L7=c(function(e){return e.__type==="connection"?"high":(e.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),c(E0,"Labels");var Kh=E0;var _0=class _0{constructor(e,t){d(this,"Labels");d(this,"auto",c(()=>{this.Labels.auto()},"auto"));this.Labels=new Kh(e,t)}};c(_0,"DefaultTheme");var rf=_0;m();var ae,nf,A7,D0=class D0{constructor(e){M(this,nf);M(this,ae,void 0);d(this,"setMinPitch",c(e=>{s(this,ae).camera.setMinPitch(e)},"setMinPitch"));d(this,"setMaxPitch",c(e=>{s(this,ae).camera.setMaxPitch(e)},"setMaxPitch"));d(this,"setMinZoomLevel",c(e=>{s(this,ae).camera.setMinZoomLevel(e,!0)},"setMinZoomLevel"));d(this,"setMaxZoomLevel",c(e=>{s(this,ae).camera.setMaxZoomLevel(e)},"setMaxZoomLevel"));P(this,ae,e)}setScreenOffsets(e){s(this,ae).camera.setInsetPadding(e)}get screenOffsets(){return s(this,ae).camera.insetsPadding}get panMode(){return s(this,ae).camera.panMode}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&s(this,ae).camera.setPanMode(e)}focusOn(e,t){var o,a,u;let i=[],n=Array.isArray(e)&&!t1(e)?e:[e];for(let l of n)if(l!=null)if(tn.is(l)){let p;for(p of l.coordinates)if(p.floorId!=null){let h=s(this,ae).getBoundingArea(p.floorId);h&&i.push([p.longitude,p.latitude,(o=h[0][2])!=null?o:s(this,ae).camera.elevation])}else i.push([p.longitude,p.latitude,s(this,ae).camera.elevation])}else if(Qi.is(l)||Rt.is(l)||Nt.is(l)||$i.is(l)){let p=s(this,ae).getBoundingArea(l.id),h=Rt.is(l)||Nt.is(l)?s(this,ae).getBoundingArea(l.floor.id):s(this,ae).getBoundingArea(l.id);p&&(h?i.push(...p.map(y=>{var g;return[y[0],y[1],(g=h[0][2])!=null?g:s(this,ae).camera.elevation]})):i.push(...p))}else if(se.is(l)||ai.is(l)||li.is(l)||Un.is(l)||fr.is(l)){let p=et(l);if(p)if(p.floorId!=null){let h=s(this,ae).getBoundingArea(p.floorId);h&&i.push([p.longitude,p.latitude,(a=h[0][2])!=null?a:s(this,ae).camera.elevation])}else i.push([p.longitude,p.latitude,s(this,ae).camera.elevation])}else if(Or.is(l)||ci.is(l))for(let p of l.spaces){let h=s(this,ae).getBoundingArea(p.id);h&&i.push(...h)}else t1(l)&&i.push(l);return((u=t==null?void 0:t.axisAlignedPadding)==null?void 0:u.vertical)!==void 0&&(i=V(this,nf,A7).call(this,i,t.axisAlignedPadding)),s(this,ae).camera.focusOn(i,{pitch:t==null?void 0:t.pitch,bearing:t==null?void 0:t.bearing,padding:t==null?void 0:t.screenOffsets,maxZoomLevel:t==null?void 0:t.maxZoomLevel,minZoomLevel:t==null?void 0:t.minZoomLevel,duration:t==null?void 0:t.duration,easing:t==null?void 0:t.easing})}animateTo(e,t){var p;let{center:i,zoomLevel:n,bearing:o,pitch:a}=e,u=i!=null?i:this.center,l=[u.longitude,u.latitude,this.elevation];return s(this,ae).camera.animateTo({center:l,zoomLevel:n!=null?n:this.zoomLevel,bearing:o!=null?o:this.bearing,pitch:a!=null?a:this.pitch,duration:(p=t==null?void 0:t.duration)!=null?p:600,easing:t==null?void 0:t.easing})}set(e){let{center:t=this.center,zoomLevel:i=this.zoomLevel,bearing:n=this.bearing,pitch:o=this.pitch}=e,a=[t.longitude,t.latitude];s(this,ae).camera.setCenter(a),s(this,ae).camera.setZoomLevel(i),s(this,ae).camera.setBearing(n),s(this,ae).camera.setPitch(o)}get center(){let e=s(this,ae).camera.center;return new se(e[1],e[0],void 0)}setAutoMinZoomLevel(e){s(this,ae).camera.setAutoMinZoomLevel(e)}get autoMinZoomLevel(){return s(this,ae).camera.autoMinZoomLevel}get zoomLevel(){return s(this,ae).camera.zoomLevel}get pitch(){return s(this,ae).camera.pitch}get minPitch(){return s(this,ae).camera.minPitch}get maxPitch(){return s(this,ae).camera.maxPitch}get bearing(){let e=s(this,ae).camera.bearing;return(e<0?e+360:e)%360}get minZoomLevel(){return s(this,ae).camera.minZoomLevel}get maxZoomLevel(){return s(this,ae).camera.maxZoomLevel}setElevation(e){s(this,ae).camera.setElevation(e)}get elevation(){return s(this,ae).camera.elevation}animateElevation(e,t){return s(this,ae).camera.animateElevation(e,t)}};ae=new WeakMap,nf=new WeakSet,A7=c(function(e,t){var o;let i=(o=t==null?void 0:t.vertical)!=null?o:0;return[e.map(a=>{var u;return[a[0],a[1],((u=a[2])!=null?u:0)-i]}),e.map(a=>{var u;return[a[0],a[1],(u=a[2])!=null?u:0]}),e.map(a=>{var u;return[a[0],a[1],((u=a[2])!=null?u:0)+i]})].flat()},"#expandCoordinateCloud"),c(D0,"Camera");var lu=D0;m();var nl,O0=class O0{constructor({currentMapGetter:e}){M(this,nl,void 0);P(this,nl,e)}get currentMap(){return s(this,nl).call(this)}async getCurrentSceneGLTF(e){let t=s(this,nl).call(this);return t?t==null?void 0:t.Exporter.getCurrentSceneGLTF(e):(L.error("There is no map to export. Please load a map first."),new Blob)}};nl=new WeakMap,c(O0,"Exporter");var cu=O0;m();var Ci,pu,L0=class L0{constructor({currentMapGetter:e}){M(this,Ci,new Map);M(this,pu,void 0);P(this,pu,e)}get currentMap(){return s(this,pu).call(this)}getById(e){return s(this,Ci).get(e)}add(e,t,i){let n=et(e);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Labels.add(mi(n),t,{...i,floorId:n.floorId,rank:(i==null?void 0:i.rank)||"medium"}),u=new to(a.id.toString(),t,e);return s(this,Ci).set(u.id,{label:u,entityId:u.id}),u}all(){var t;let e=[];return(t=this.currentMap)==null||t.Labels.all({onCreate:(i,n,o)=>{let a=new to(i.toString(),n,o);s(this,Ci).set(a.id,{label:a,entityId:a.id}),e.push(a)}}),e}remove(e){var i;let t=s(this,Ci).get(e.id);t&&((i=this.currentMap)==null||i.Labels.remove(t.entityId),s(this,Ci).delete(e.id.toString()))}removeAll(){let e=[];return s(this,Ci).forEach(({label:t})=>{this.remove(t),e.push(t),s(this,Ci).delete(t.id.toString())}),e}};Ci=new WeakMap,pu=new WeakMap,c(L0,"Labels");var uu=L0;m();m();var k7={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},F7={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},B7=.5,A0=class A0{constructor(e,t=new Map){d(this,"containerId");d(this,"layers");this.containerId=e,this.layers=t}};c(A0,"Layer");var ol=A0,k0=class k0{constructor(e,t,i,n,o,a,u){d(this,"id");d(this,"name");d(this,"elevation");d(this,"containerId");d(this,"externalId");d(this,"metadata");d(this,"shortName");d(this,"subtitle");d(this,"loaded",!1);d(this,"styleMap",{});d(this,"obstructions");d(this,"entrances");d(this,"spaces");d(this,"floorImages");d(this,"renderer");d(this,"options");d(this,"layers",new Map);d(this,"footprint");d(this,"floorStackId");d(this,"multiFloorView");d(this,"load",c(()=>{var n,o,a,u;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let e=this.renderer.addGroupContainer("".concat(Xn,"-").concat(this.id),{},this.id);this.layers.set(Xn,new ol(e.id.toString()));let t=this.renderer.addGroupContainer("".concat(pi,"-").concat(this.id),{},this.id);this.layers.set(pi,new ol(t.id.toString()));let i=this.renderer.addGroupContainer("".concat(He,"-").concat(this.id),{},this.id);if(this.layers.set(He,new ol(i.id.toString())),this.spaces!=null&&this.spaces.features.length>0){let l=this.spaces.features.filter(g=>{var v;return g.geometry.type==="Polygon"&&((v=g.properties.kind)==null?void 0:v.toLowerCase())!=="void"}),p=P1(l,this.styleMap),h=this.renderer.addGroupContainer("spaces-".concat(this.id),{},i),y=0;for(let[g,v]of p){let S=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(y),{features:v},Rc(g,this.options),h);y++;let T=h.id.toString();this.layers.get(He).layers.set(g.id||T,S.id.toString())}}if(this.obstructions!=null&&this.obstructions.features.length>0){let l=this.obstructions.features.filter(x=>x.geometry.type==="Polygon"&&x.properties.kind==="object"),p=P1(l,this.styleMap),h=this.renderer.addGroupContainer("objects-".concat(this.id),{},i),y=0;for(let[x,I]of p){let E=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(y),{features:I},Rc(x,this.options),h);y++;let w=h.id.toString();this.layers.get(He).layers.set(x.id||w,E.id.toString())}let g=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind==="Wall"&&x.properties.footprintComponent===!1),v=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind==="Wall"&&x.properties.footprintComponent===!0),S=this.entrances,T=k7,b=k7;if(g!=null&&g.length>0){let x=this.styleMap[(n=g[0].properties)==null?void 0:n.id];x!=null&&(T={...x}),b=T;let{walls:I,entrances:E}=M1(g,(S==null?void 0:S.features)||[]),w=Math.max(T.height-.11,B7),_={...F7,height:w},D=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),E,_,i);this.layers.get(He).layers.set(bs,D.id.toString());let B=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[I]},Rc(T,this.options),i);this.layers.get(He).layers.set(Wn,B.id.toString())}if(v!=null&&v.length>0){let x=this.styleMap[(o=v[0].properties)==null?void 0:o.id];x!=null&&(b={...x,id:ui});let{walls:I,entrances:E}=M1(v,(S==null?void 0:S.features)||[]),w=Math.max(b.height-.11,B7),_={...F7,height:w},D=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),E,_,i);this.layers.get(He).layers.set(Cs,D.id.toString());let B=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[I]},Rc(b,this.options),i);this.layers.get(He).layers.set(ui,B.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&&((a=p.properties)==null?void 0:a.anchorId)==null||this.renderer.addImage(le(),p,{url:p.properties.path,flipImageToFaceCamera:!0},l);this.layers.set(FS,new ol(l.id.toString()))}return(u=this.multiFloorView)!=null&&u.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var p,h,y;this.id=t.id,this.options=o;let l=i.addGroupContainer(this.id,{visible:!1,interactive:!0},e);if(this.containerId=l.id.toString(),this.externalId=t.externalId,this.metadata=t.metadata,this.shortName=t.shortName,this.subtitle=t.subtitle,this.name=t.name,this.elevation=t.elevation,a!=null&&u!=null&&(this.styleMap=u,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=(p=a.floorImages)==null?void 0:p[this.id],this.footprint=(h=a["floor.geojson"])==null?void 0:h.features.find(g=>g.properties.id===t.id)),this.renderer=i,this.floorStackId=e,this.multiFloorView=n,this.footprint&&(n!=null&&n.enabled)&&this.obstructions!=null&&this.obstructions.features.length>0){let g=this.obstructions.features.filter(v=>v.geometry.type==="LineString"&&v.properties.kind==="Wall"&&v.properties.footprintComponent===!0);if(g!=null&&g.length>0){let v=this.styleMap[(y=g[0].properties)==null?void 0:y.id],S=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},{...v,height:-n.floorHeight,altitude:n.floorHeight/2,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"double",color:this.elevation<0?"#F0EEE8":v.color},this.id);this.layers.set(xs,{containerId:S.id.toString(),layers:new Map})}}}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(e){this.renderer.setState(this.containerId,{visible:e})}};c(k0,"FloorObject");var du=k0;m();m();m();m();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();m();m();m();m();function R7(r){return md(r)}c(R7,"getBoundingBoxFromFeature");m();var of="#ffffff";var F0=class F0{constructor(e={}){d(this,"initialColor",of);d(this,"color",of);d(this,"topColor");d(this,"topTexture");d(this,"texture");d(this,"hoverColor");d(this,"dirty",!0);d(this,"visible",!0);d(this,"opacity",1);d(this,"width",.1);d(this,"height",.1);d(this,"initialHeight",.1);d(this,"altitude",0);d(this,"join","round");d(this,"cap","round");d(this,"outline",!0);d(this,"showImage",!0);d(this,"showTextLabel",!1);d(this,"flipImageToFaceCamera",!0);d(this,"flipTextToFaceCamera",!0);d(this,"url");d(this,"side","double");this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.showTextLabel=(e==null?void 0:e.showTextLabel)!==void 0?e.showTextLabel:this.showTextLabel,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.flipTextToFaceCamera=(e==null?void 0:e.flipTextToFaceCamera)!==void 0?e.flipTextToFaceCamera:this.flipTextToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side}};c(F0,"StyleComponent");var Nr=F0;var B0=class B0 extends za{constructor(){super(...arguments);d(this,"userData",{entities:{}})}};c(B0,"EntityBatchedMesh");var xi=B0,hu,fu,ha,R0=class R0{constructor(e){d(this,"mesh");d(this,"focusMesh");d(this,"outline");d(this,"imageMesh");d(this,"textAreaMesh");d(this,"type","geometry");d(this,"dirty",!0);d(this,"detached",!1);d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"currentHeight",.1);d(this,"focusable",!1);d(this,"color",new Ee);d(this,"topColor",new Ee);d(this,"position",new q);M(this,hu,0);M(this,fu,1);M(this,ha,void 0);d(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,e),this.imageMesh&&(this.imageMesh.visible=e)}setOpacity(e){this.mesh&&(this.material&&(this.material.opacity=e,this.material.transparent=e<1),this.outline&&(this.outline.material.opacity=e),e===0?this.mesh.visible=!1:this.mesh.visible=!0)}setColor(e,t){this.color.set(e),this.topColor.set(t),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return s(this,hu)}set altitude(e){this.mesh&&(this.mesh.position.z=e,P(this,hu,e))}get opacity(){return s(this,fu)}set opacity(e){this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.outline&&(this.outline.material.opacity=e),this.material.needsUpdate=!0),P(this,fu,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}get featureBbox(){return s(this,ha)?s(this,ha):(P(this,ha,R7(this.feature)),s(this,ha))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};hu=new WeakMap,fu=new WeakMap,ha=new WeakMap,c(R0,"MeshComponent");var Ie=R0;m();var M_="#ffffff",oo,N0=class N0{constructor(e={}){d(this,"color",M_);d(this,"topColor");d(this,"opacity",1);M(this,oo,void 0);d(this,"outline",!0);d(this,"texture");d(this,"topTexture");d(this,"dirty",!0);var t,i;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.topColor=e==null?void 0:e.topColor,this.opacity=(i=e==null?void 0:e.opacity)!=null?i:this.opacity,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return s(this,oo)}set shading(e){var t;if(!e){P(this,oo,void 0);return}P(this,oo,(t=s(this,oo))!=null?t:{start:0,end:0,intensity:0}),Object.assign(s(this,oo),e)}};oo=new WeakMap,c(N0,"GeometryGroupStyleComponent");var fa=N0;m();m();function ao(r){var t;let e=(t=r.parent)==null?void 0:t.children.find(i=>i.userData.outlineOfEntityId===r.userData.entityId);return e instanceof Mo?e:void 0}c(ao,"findOutline");m();m();m();m();var G0=class G0{constructor(){d(this,"hover",!1);d(this,"dirty",!1)}};c(G0,"InteractionComponent");var al=G0;m();m();var N7=["","","low","medium","high","always-visible"];function G7(r){return Math.min(5,Math.max(2,r))}c(G7,"clampTierNumber");function sl(r){if(typeof r=="number")return G7(r);let e=N7.indexOf(r);return e===-1?3:e}c(sl,"convertCollisionRankingTierToNumber");function mu(r){let e=G7(r);return N7[e]}c(mu,"convertNumberToCollisionRankingTier");var af=4,V0=A.object({rank:A.union([A.enum(["low","medium","high","always-visible"]),A.number()]).optional(),interactive:A.union([A.boolean(),A.literal("pointer-events-auto")]).optional(),id:A.string().optional(),anchor:A.union([A.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),A.array(A.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:A.boolean().optional()});function V7(r,e,t){A.array(A.number()).refine(i=>i.length===2||i.length===3,{message:"Array length must be either 2 or 3"}).parse(r),A.string().parse(e),V0.parse(t)}c(V7,"validateMarker");var ma=class ma{constructor(e,t={}){d(this,"id");d(this,"type","marker");d(this,"rank",0);d(this,"initialRank",0);d(this,"activeAnchor","center");d(this,"pointerEvents","none");d(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1});d(this,"projection",new te);d(this,"enabled",!0);d(this,"offscreen",!1);d(this,"activeStrategyIndex",-1);d(this,"strategyIndex",-1);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"containerEl");d(this,"contentEl",null);d(this,"contentHtml","");d(this,"style",{top:"0px",left:"0px"});d(this,"dirty",!1);d(this,"collisionDirty",!0);d(this,"visibilityNeedsUpdate","show");d(this,"visible",!1);d(this,"animation",null);d(this,"currentStrategyIndex",-1);d(this,"onStrategySelected",c((e,t=!1)=>{if(this.currentStrategyIndex===e||t)return;this.currentStrategyIndex=e,this.activeAnchor=this.strategies[e].name,this.containerEl.getAttribute("data-anchor")!==this.activeAnchor&&this.containerEl.setAttribute("data-anchor",this.activeAnchor);let{width:i,height:n}=this.dimensions,o=-n/2+"px",a=-i/2+"px";switch(this.style.top=o,this.style.left=a,this.activeAnchor){case"top":{this.style.top=-n+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-i+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-n+"px",this.style.left=-i+"px";break}case"top-right":{this.style.top=-n+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-i+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=o,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));d(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(t==null?void 0:t.id)||le(),this.options={...this.options,...t},typeof t.rank=="string")this.rank=sl(t.rank);else if(t.rank!=null&&t.rank>0)this.rank=t.rank;else{let n=Math.trunc(C.env.NODE_ENV==="test"?ma.testId:ma.testId*10)/10;ma.testId+=.001,this.rank=n}typeof t.interactive=="string"&&(this.pointerEvents=t.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,this.initialRank=this.rank;let i=document.createElement("div");i.style.opacity="0",i.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=i.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(e,t){if(e!=null&&t!=null)this.dimensions={width:e,height:t};else{let{width:i,height:n}=this.containerEl.getBoundingClientRect();this.dimensions={width:i,height:n}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"})}get strategies(){let{width:e,height:t}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(n=>({name:n,getBoundingBox:()=>{let o=t/2,a=t/2,u=e/2,l=e/2;switch(n){case"top":{o=t,a=0;break}case"bottom":{o=0,a=t;break}case"left":{u=e,l=0;break}case"right":{u=0,l=e;break}case"top-left":{o=t,u=e,a=0,l=0;break}case"top-right":{o=t,l=e,a=0,u=0;break}case"bottom-left":{a=t,u=e,o=0,l=0;break}case"bottom-right":{a=t,l=e,o=0,u=0;break}}return[o+af,a+af,u+af,l+af]}}))}toPackedMessage(e=!1){return this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0,this.visible&&e&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((t,i)=>[...t.getBoundingBox(),i]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};c(ma,"MarkerComponent"),d(ma,"testId",0);var Si=ma;m();m();var j0=class j0 extends mt{constructor(){super(...arguments);d(this,"userData",{entityId:"",type:"geometry"})}};c(j0,"Geometry3DObject3D");var br=j0,H0=class H0{constructor(e,t){d(this,"id",le());d(this,"components");this.components=[e,t]}get object3d(){return this.components[0].mesh}get parent(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}};c(H0,"Geometry3D");var xe=H0;m();var ll=A.object({type:A.enum(["Point"]),coordinates:A.array(A.number()).length(2)});var T_=A.object({interactive:A.boolean().optional(),id:A.string().optional(),nearRadius:A.number().optional(),farRadius:A.number().optional(),accentColor:A.string().optional(),displayArrowsOnPath:A.boolean().optional(),animateArrowsOnPath:A.boolean().optional()}),P_=A.object({type:A.enum(["Feature"]),geometry:ll,properties:A.object({parentId:A.any().optional()})});function j7(r,e){A.object({features:A.array(P_)}).parse(r),T_.parse(e)}c(j7,"validatePath");var yu,U0=class U0{constructor(e,t){d(this,"type","path");d(this,"mesh",new br);d(this,"material");d(this,"geometry");d(this,"outline");d(this,"feature");d(this,"options");d(this,"nearRadius",.2);d(this,"farRadius",.4);d(this,"accentColor","blue");d(this,"completeFraction",1);d(this,"altitudeAdjustment",1);d(this,"displayArrowsOnPath",!1);d(this,"animateArrowsOnPath",!1);d(this,"isVertical",!1);d(this,"dirty",!0);d(this,"materialDirty",!0);d(this,"position",new q);M(this,yu,0);var i,n,o,a,u;this.feature=e,this.options=t||{},this.accentColor=(i=t==null?void 0:t.accentColor)!=null?i:this.accentColor,this.nearRadius=(n=t==null?void 0:t.nearRadius)!=null?n:this.nearRadius,this.farRadius=(o=t==null?void 0:t.farRadius)!=null?o:this.farRadius,this.displayArrowsOnPath=(a=t==null?void 0:t.displayArrowsOnPath)!=null?a:this.displayArrowsOnPath,this.animateArrowsOnPath=(u=t==null?void 0:t.animateArrowsOnPath)!=null?u:this.animateArrowsOnPath}setColor(){}setOpacity(){}set visible(e){this.mesh&&(this.mesh.visible=e)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return s(this,yu)}set altitude(e){this.mesh&&(this.mesh.position.z=e,P(this,yu,e))}set complete(e){this.material&&(this.material.uniforms.complete.value=e,this.material.needsUpdate=!0)}};yu=new WeakMap,c(U0,"PathComponent");var Mi=U0;m();m();var W0=class W0 extends mt{};c(W0,"Geometry2DObject3D");var cl=W0,X0=class X0{constructor(e,t){d(this,"id");d(this,"positionDirty",!0);d(this,"object3d",new cl);d(this,"components");d(this,"disposed",!1);d(this,"worldPosition",new q);this.id=e.id||le(),this.components=[e],this.object3d=new cl,this.object3d.position.copy(t),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parent(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}};c(X0,"Geometry2D");var Cr=X0;m();var gu="mappedin";m();function Y0(r){let e=r.min,t=r.max,i=new q(e.x,e.y,e.z),n=new q(t.x,e.y,e.z),o=new q(e.x,t.y,e.z),a=new q(t.x,t.y,e.z);return[i,n,o,a]}c(Y0,"getCornersOfBoundingBox");m();function ya(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}c(ya,"getPixelRatio");m();function so(r,e,t=!1){let i=null,n=0;return function(...o){n++,n===1&&t===!0&&r(...o);let a=c(()=>{(!t||n>1)&&r(...o),i=null,n=0},"later");clearTimeout(i),i=setTimeout(a,e)}}c(so,"debounce");m();var I_=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:i}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),o=t==="iPad"||t.indexOf("Mac")===0&&i>0&&!window.MSStream,a=/android/i.test(e);return r={isIpad:o,isMobile:a||n||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),H7=I_.getDeviceType,U7=(()=>{let r,e,t;function i(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let o=r.getContext("webgl")||r.getContext("experimental-webgl");if(!o)return e;try{let a=H7().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=a?o.getParameter(a.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let u=new Error("Failed getting device info");throw u.name="FailedGettingDeviceInfo",u}}c(i,"getInfo");function n(){var a,u;if(!H7().isWindows)return!1;if(t!==void 0)return t;let o=(u=(a=w_())==null?void 0:a.toLowerCase())!=null?u:"";return t=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),t}return c(n,"shouldDisableOffscreenCanvas"),{getInfo:i,shouldDisableOffscreenCanvas:n,_setCanvas(o){r=o,e=void 0,t=void 0}}})(),w_=U7.getInfo,Z0=U7.shouldDisableOffscreenCanvas;m();function vu(r,e){let t={};for(let i=0;i<e.length;i++){let n=e[i];n in r&&(t[n]=r[n])}return t}c(vu,"pick");function z0(r){return Object.keys(r).length===0}c(z0,"isEmpty");m();var q0=c(r=>e=>{if(!e.includes("mappedin")){let t={};for(let i in r){let n=r[i];e.includes("mappedin")||(r[i]=n)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function sf(r,e,t,i){let n=r*(Math.PI/180),o=i/ri,a=r+o*180/Math.PI,u=t/ri/Math.cos(n),l=e+u*180/Math.PI;return{lat:a,lon:l}}c(sf,"cartesianToGeographic");function lf(r,e,t,i){let n=t*(Math.PI/180),o=i*(Math.PI/180),a=r*(Math.PI/180),u=e*(Math.PI/180),l=n-a,p=o-u,h=ri*p*Math.cos(a),y=ri*l;return{x:h,y}}c(lf,"geographicToCartesian");var $0=c((r,e)=>{var t;if(r.children&&r.visible)for(let i of r.children){if(i.visible)if((t=i.userData)!=null&&t.entities3D&&i.type==="geometry-group"){e.add(i.userData.entityId);for(let n of i.userData.entities3D.values())e.add(n)}else(i.type==="group-container"||i.type==="custom-geometry"||i instanceof br)&&e.add(i.userData.entityId);$0(i,e)}return e},"populateGeometry3DIdsInScene"),J0=c((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let i of r.children)i.visible&&i instanceof cl&&e.add(i.userData.entityId),J0(i,e);return e},"populateGeometry2DIdsInScene");function K0(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?K0(r[t],e[t]):r[t]=e[t]}return r}c(K0,"mergeObjects");function cf(r,e,t,i){let n={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},o=new ji,a=new q(n.scale,-n.scale,n.scale),u=new ji().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(a),l=t.elevation;return{id:gu,type:"custom",renderingMode:"3d",render:(p,h)=>{if(o.fromArray(h),l!==t.elevation){let y=od.fromLngLat(r.toLngLat(),t.elevation);u.makeTranslation(n.translateX,n.translateY,-y.z).scale(a)}e.projectionMatrix=o.multiply(u),l=t.elevation,i()}}}c(cf,"createCustomLayer");function E_(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}c(E_,"fetchToken");async function W7(r){let e=await E_(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}c(W7,"getRequestHeaders");function X7(r,e=0){let t=3735928559^e,i=1103547991^e;for(let n=0,o;n<r.length;n++)o=r.charCodeAt(n),t=Math.imul(t^o,2654435761),i=Math.imul(i^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}c(X7,"cyrb53");var Q0=c(r=>r,"linearEase");var Y7=c(r=>1-Math.cos(r*Math.PI/2),"easeIn");function xr(r,e,t,i,n,o=Q0){r=Math.max(e,Math.min(r,t));let a=(r-Math.min(e,t))/Math.abs(t-e),u=o(a);return i+u*(n-i)}c(xr,"interpolate");function ev(r,e,t){let i=r*(Math.PI/180)/2,n=e/2;return t*Math.tan(i)/n}c(ev,"getProjectionScaleFactor");function bu(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}c(bu,"getGeometryByGeometryId");function Z7(r){return new H2(new Bm(r[0][0],r[0][1]),new Bm(r[1][0],r[1][1])).getCenter().toArray()}c(Z7,"getBoundingBoxCenter");function z7(r){return Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&(r instanceof j2||Number.isFinite(r.min.z)&&Number.isFinite(r.max.z))}c(z7,"isFiniteBox");m();m();function uf(r){"@babel/helpers - typeof";return uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uf(r)}c(uf,"_typeof");var __=/^\s+/,D_=/\s+$/;function X(r,e){if(r=r||"",e=e||{},r instanceof X)return r;if(!(this instanceof X))return new X(r,e);var t=O_(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=t.ok}c(X,"tinycolor");X.prototype={isDark:c(function(){return this.getBrightness()<128},"isDark"),isLight:c(function(){return!this.isDark()},"isLight"),isValid:c(function(){return this._ok},"isValid"),getOriginalInput:c(function(){return this._originalInput},"getOriginalInput"),getFormat:c(function(){return this._format},"getFormat"),getAlpha:c(function(){return this._a},"getAlpha"),getBrightness:c(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:c(function(){var e=this.toRgb(),t,i,n,o,a,u;return t=e.r/255,i=e.g/255,n=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),n<=.03928?u=n/12.92:u=Math.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*u},"getLuminance"),setAlpha:c(function(e){return this._a=t6(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:c(function(){var e=$7(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:c(function(){var e=$7(this._r,this._g,this._b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+i+"%, "+n+"%)":"hsva("+t+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHsvString"),toHsl:c(function(){var e=q7(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:c(function(){var e=q7(this._r,this._g,this._b),t=Math.round(e.h*360),i=Math.round(e.s*100),n=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+i+"%, "+n+"%)":"hsla("+t+", "+i+"%, "+n+"%, "+this._roundA+")"},"toHslString"),toHex:c(function(e){return J7(this._r,this._g,this._b,e)},"toHex"),toHexString:c(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:c(function(e){return F_(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:c(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:c(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:c(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:c(function(){return{r:Math.round(Be(this._r,255)*100)+"%",g:Math.round(Be(this._g,255)*100)+"%",b:Math.round(Be(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:c(function(){return this._a==1?"rgb("+Math.round(Be(this._r,255)*100)+"%, "+Math.round(Be(this._g,255)*100)+"%, "+Math.round(Be(this._b,255)*100)+"%)":"rgba("+Math.round(Be(this._r,255)*100)+"%, "+Math.round(Be(this._g,255)*100)+"%, "+Math.round(Be(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:c(function(){return this._a===0?"transparent":this._a<1?!1:Z_[J7(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:c(function(e){var t="#"+K7(this._r,this._g,this._b,this._a),i=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=X(e);i="#"+K7(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+i+")"},"toFilter"),toString:c(function(e){var t=!!e;e=e||this._format;var i=!1,n=this._a<1&&this._a>=0,o=!t&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},"toString"),clone:c(function(){return X(this.toString())},"clone"),_applyModification:c(function(e,t){var i=e.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},"_applyModification"),lighten:c(function(){return this._applyModification(G_,arguments)},"lighten"),brighten:c(function(){return this._applyModification(V_,arguments)},"brighten"),darken:c(function(){return this._applyModification(j_,arguments)},"darken"),desaturate:c(function(){return this._applyModification(B_,arguments)},"desaturate"),saturate:c(function(){return this._applyModification(R_,arguments)},"saturate"),greyscale:c(function(){return this._applyModification(N_,arguments)},"greyscale"),spin:c(function(){return this._applyModification(H_,arguments)},"spin"),_applyCombination:c(function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},"_applyCombination"),analogous:c(function(){return this._applyCombination(X_,arguments)},"analogous"),complement:c(function(){return this._applyCombination(U_,arguments)},"complement"),monochromatic:c(function(){return this._applyCombination(Y_,arguments)},"monochromatic"),splitcomplement:c(function(){return this._applyCombination(W_,arguments)},"splitcomplement"),triad:c(function(){return this._applyCombination(Q7,[3])},"triad"),tetrad:c(function(){return this._applyCombination(Q7,[4])},"tetrad")};X.fromRatio=function(r,e){if(uf(r)=="object"){var t={};for(var i in r)r.hasOwnProperty(i)&&(i==="a"?t[i]=r[i]:t[i]=Cu(r[i]));r=t}return X(r,e)};function O_(r){var e={r:0,g:0,b:0},t=1,i=null,n=null,o=null,a=!1,u=!1;return typeof r=="string"&&(r=J_(r)),uf(r)=="object"&&(hn(r.r)&&hn(r.g)&&hn(r.b)?(e=L_(r.r,r.g,r.b),a=!0,u=String(r.r).substr(-1)==="%"?"prgb":"rgb"):hn(r.h)&&hn(r.s)&&hn(r.v)?(i=Cu(r.s),n=Cu(r.v),e=k_(r.h,i,n),a=!0,u="hsv"):hn(r.h)&&hn(r.s)&&hn(r.l)&&(i=Cu(r.s),o=Cu(r.l),e=A_(r.h,i,o),a=!0,u="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=t6(t),{ok:a,format:r.format||u,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}c(O_,"inputToRGB");function L_(r,e,t){return{r:Be(r,255)*255,g:Be(e,255)*255,b:Be(t,255)*255}}c(L_,"rgbToRgb");function q7(r,e,t){r=Be(r,255),e=Be(e,255),t=Be(t,255);var i=Math.max(r,e,t),n=Math.min(r,e,t),o,a,u=(i+n)/2;if(i==n)o=a=0;else{var l=i-n;switch(a=u>.5?l/(2-i-n):l/(i+n),i){case r:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-r)/l+2;break;case t:o=(r-e)/l+4;break}o/=6}return{h:o,s:a,l:u}}c(q7,"rgbToHsl");function A_(r,e,t){var i,n,o;r=Be(r,360),e=Be(e,100),t=Be(t,100);function a(p,h,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?p+(h-p)*6*y:y<1/2?h:y<2/3?p+(h-p)*(2/3-y)*6:p}if(c(a,"hue2rgb"),e===0)i=n=o=t;else{var u=t<.5?t*(1+e):t+e-t*e,l=2*t-u;i=a(l,u,r+1/3),n=a(l,u,r),o=a(l,u,r-1/3)}return{r:i*255,g:n*255,b:o*255}}c(A_,"hslToRgb");function $7(r,e,t){r=Be(r,255),e=Be(e,255),t=Be(t,255);var i=Math.max(r,e,t),n=Math.min(r,e,t),o,a,u=i,l=i-n;if(a=i===0?0:l/i,i==n)o=0;else{switch(i){case r:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-r)/l+2;break;case t:o=(r-e)/l+4;break}o/=6}return{h:o,s:a,v:u}}c($7,"rgbToHsv");function k_(r,e,t){r=Be(r,360)*6,e=Be(e,100),t=Be(t,100);var i=Math.floor(r),n=r-i,o=t*(1-e),a=t*(1-n*e),u=t*(1-(1-n)*e),l=i%6,p=[t,a,o,o,u,t][l],h=[u,t,t,a,o,o][l],y=[o,o,u,t,t,a][l];return{r:p*255,g:h*255,b:y*255}}c(k_,"hsvToRgb");function J7(r,e,t,i){var n=[Vr(Math.round(r).toString(16)),Vr(Math.round(e).toString(16)),Vr(Math.round(t).toString(16))];return i&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}c(J7,"rgbToHex");function F_(r,e,t,i,n){var o=[Vr(Math.round(r).toString(16)),Vr(Math.round(e).toString(16)),Vr(Math.round(t).toString(16)),Vr(r6(i))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}c(F_,"rgbaToHex");function K7(r,e,t,i){var n=[Vr(r6(i)),Vr(Math.round(r).toString(16)),Vr(Math.round(e).toString(16)),Vr(Math.round(t).toString(16))];return n.join("")}c(K7,"rgbaToArgbHex");X.equals=function(r,e){return!r||!e?!1:X(r).toRgbString()==X(e).toRgbString()};X.random=function(){return X.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function B_(r,e){e=e===0?0:e||10;var t=X(r).toHsl();return t.s-=e/100,t.s=pf(t.s),X(t)}c(B_,"_desaturate");function R_(r,e){e=e===0?0:e||10;var t=X(r).toHsl();return t.s+=e/100,t.s=pf(t.s),X(t)}c(R_,"_saturate");function N_(r){return X(r).desaturate(100)}c(N_,"_greyscale");function G_(r,e){e=e===0?0:e||10;var t=X(r).toHsl();return t.l+=e/100,t.l=pf(t.l),X(t)}c(G_,"_lighten");function V_(r,e){e=e===0?0:e||10;var t=X(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),X(t)}c(V_,"_brighten");function j_(r,e){e=e===0?0:e||10;var t=X(r).toHsl();return t.l-=e/100,t.l=pf(t.l),X(t)}c(j_,"_darken");function H_(r,e){var t=X(r).toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,X(t)}c(H_,"_spin");function U_(r){var e=X(r).toHsl();return e.h=(e.h+180)%360,X(e)}c(U_,"_complement");function Q7(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=X(r).toHsl(),i=[X(r)],n=360/e,o=1;o<e;o++)i.push(X({h:(t.h+o*n)%360,s:t.s,l:t.l}));return i}c(Q7,"polyad");function W_(r){var e=X(r).toHsl(),t=e.h;return[X(r),X({h:(t+72)%360,s:e.s,l:e.l}),X({h:(t+216)%360,s:e.s,l:e.l})]}c(W_,"_splitcomplement");function X_(r,e,t){e=e||6,t=t||30;var i=X(r).toHsl(),n=360/t,o=[X(r)];for(i.h=(i.h-(n*e>>1)+720)%360;--e;)i.h=(i.h+n)%360,o.push(X(i));return o}c(X_,"_analogous");function Y_(r,e){e=e||6;for(var t=X(r).toHsv(),i=t.h,n=t.s,o=t.v,a=[],u=1/e;e--;)a.push(X({h:i,s:n,v:o})),o=(o+u)%1;return a}c(Y_,"_monochromatic");X.mix=function(r,e,t){t=t===0?0:t||50;var i=X(r).toRgb(),n=X(e).toRgb(),o=t/100,a={r:(n.r-i.r)*o+i.r,g:(n.g-i.g)*o+i.g,b:(n.b-i.b)*o+i.b,a:(n.a-i.a)*o+i.a};return X(a)};X.readability=function(r,e){var t=X(r),i=X(e);return(Math.max(t.getLuminance(),i.getLuminance())+.05)/(Math.min(t.getLuminance(),i.getLuminance())+.05)};X.isReadable=function(r,e,t){var i=X.readability(r,e),n,o;switch(o=!1,n=K_(t),n.level+n.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7;break}return o};X.mostReadable=function(r,e,t){var i=null,n=0,o,a,u,l;t=t||{},a=t.includeFallbackColors,u=t.level,l=t.size;for(var p=0;p<e.length;p++)o=X.readability(r,e[p]),o>n&&(n=o,i=X(e[p]));return X.isReadable(r,i,{level:u,size:l})||!a?i:(t.includeFallbackColors=!1,X.mostReadable(r,["#fff","#000"],t))};var tv=X.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Z_=X.hexNames=z_(tv);function z_(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}c(z_,"flip");function t6(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}c(t6,"boundAlpha");function Be(r,e){q_(r)&&(r="100%");var t=$_(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}c(Be,"bound01");function pf(r){return Math.min(1,Math.max(0,r))}c(pf,"clamp01");function nr(r){return parseInt(r,16)}c(nr,"parseIntFromHex");function q_(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}c(q_,"isOnePointZero");function $_(r){return typeof r=="string"&&r.indexOf("%")!=-1}c($_,"isPercentage");function Vr(r){return r.length==1?"0"+r:""+r}c(Vr,"pad2");function Cu(r){return r<=1&&(r=r*100+"%"),r}c(Cu,"convertToPercentage");function r6(r){return Math.round(parseFloat(r)*255).toString(16)}c(r6,"convertDecimalToHex");function e6(r){return nr(r)/255}c(e6,"convertHexToDecimal");var Gr=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function hn(r){return!!Gr.CSS_UNIT.exec(r)}c(hn,"isValidCSSUnit");function J_(r){r=r.replace(__,"").replace(D_,"").toLowerCase();var e=!1;if(tv[r])r=tv[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=Gr.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=Gr.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Gr.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=Gr.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Gr.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=Gr.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Gr.hex8.exec(r))?{r:nr(t[1]),g:nr(t[2]),b:nr(t[3]),a:e6(t[4]),format:e?"name":"hex8"}:(t=Gr.hex6.exec(r))?{r:nr(t[1]),g:nr(t[2]),b:nr(t[3]),format:e?"name":"hex"}:(t=Gr.hex4.exec(r))?{r:nr(t[1]+""+t[1]),g:nr(t[2]+""+t[2]),b:nr(t[3]+""+t[3]),a:e6(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=Gr.hex3.exec(r))?{r:nr(t[1]+""+t[1]),g:nr(t[2]+""+t[2]),b:nr(t[3]+""+t[3]),format:e?"name":"hex"}:!1}c(J_,"stringInputToObject");function K_(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}c(K_,"validateWCAG2Parms");var fv=Ul(hv());var yv=A.object({rank:A.union([A.enum(["low","medium","high","always-visible"]),A.number()]).optional(),interactive:A.boolean().optional(),appearance:A.object({margin:A.number().min(6).optional(),text:A.object({numLines:A.number().optional(),lineHeight:A.number().optional(),size:A.number().optional(),maxWidth:A.number().optional(),foregroundColor:A.string().optional(),backgroundColor:A.string().optional()}).optional(),marker:A.object({size:A.number().optional(),foregroundColor:A.object({active:A.string().optional(),inactive:A.string().optional()}).optional(),backgroundColor:A.object({active:A.string().optional(),inactive:A.string().optional()}).optional()}).optional()}).optional()});function R6(r,e,t){A.array(A.number()).length(2).parse(r),A.string().parse(e),yv.parse(t||{})}c(R6,"validateLabel");var hl={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},WO={lightOnDark:{...hl,text:{...hl.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...hl.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...hl,text:{...hl.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...hl.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},XO="LOW_PRIORITY",A6=4,YO=6,ZO=20,zO=2.5,qO=2,$O="cover",k6=.5,F6=6.5,B6={heightAbovePolygon:0,appearance:WO.darkOnLight};var ba=class ba{constructor(e,t,i){d(this,"lines",0);d(this,"id");d(this,"rank");d(this,"type","label");d(this,"initialRank");d(this,"contextConfigured",!1);d(this,"fillText");d(this,"newStyle",{});d(this,"opacity",0);d(this,"visibilityNeedsUpdate",!1);d(this,"activeStrategyIndex",-1);d(this,"text");d(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});d(this,"projection",new te);d(this,"_cache",{});d(this,"appearance");d(this,"options");d(this,"visible",!1);d(this,"enabled",!0);d(this,"offscreen",!1);d(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});d(this,"dimensions",{width:0,height:0});d(this,"currentStrategyIndex",-1);d(this,"totalMarkerSize",0);d(this,"dirty",!0);d(this,"collisionDirty",!0);d(this,"lastTextAlign");d(this,"imageHash");d(this,"markerSize",0);d(this,"iconVisible",!1);d(this,"zoomProportion",0);d(this,"dp");d(this,"animate",!0);d(this,"onStrategySelected",c(e=>{if(this.currentStrategyIndex===e)return;let t=this.strategies[e];t&&t.onStrategySelected(this),this.currentStrategyIndex=e;let i=this.style;this.style=this.newStyle,this.newStyle=i},"onStrategySelected"));d(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a;if(this.id=(o=t.id)!=null?o:le(),this.options=(0,fv.default)({},t,B6),this.text=e,this.dp=(u=1)=>u*i.pixelRatio,typeof t.rank=="string")this.rank=sl(t.rank),this.initialRank=this.rank;else if(t.rank!=null&&t.rank>0)this.rank=t.rank,this.initialRank=t.rank;else{let u=Math.trunc(C.env.NODE_ENV==="test"?ba.testId:ba.testId*10)/10;ba.testId+=.001,this.rank=u,this.initialRank=u}let n=(0,fv.default)({},this.options.appearance,B6.appearance);this.appearance={margin:n.margin,text:{lineHeight:n.text.lineHeight,numLines:n.text.numLines,size:n.text.size,maxWidth:n.text.maxWidth,foregroundColor:n.text.foregroundColor,backgroundColor:n.text.backgroundColor},marker:{foregroundColor:{active:n.marker.foregroundColor.active,inactive:n.marker.foregroundColor.inactive||X(n.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:n.marker.backgroundColor.active,inactive:n.marker.backgroundColor.inactive||X(n.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:n.marker.icon,iconSize:n.marker.iconSize||ZO,iconPadding:(a=n.marker.iconPadding)!=null?a:qO,iconFit:n.marker.iconFit||$O,iconVisibilityThreshold:n.marker.iconVisibilityThreshold==null?k6:n.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=k6}=this.appearance.marker,t=this.dp();this.zoomProportion<=e&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(F6)),this.totalMarkerSize=Math.ceil((this.markerSize+zO)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:t}=this.dimensions,{margin:i}=this.appearance;this.calculateMarkerSize();let n=Math.max(YO,i),o=this.iconVisible?n/2:0,a=this.iconVisible?this.totalMarkerSize:F6*2,u=[{name:"RIGHT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,t);return[l/2+n,l/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+e+n]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=this.totalMarkerSize/2+A6,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,t);return[l/2+n,l/2+n,this.totalMarkerSize/2+e+n,this.totalMarkerSize/2+n]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=-e-this.totalMarkerSize/2-A6,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let l=this.dp();return[t+this.totalMarkerSize/2/l+n,this.totalMarkerSize/2+n,e/2+n,e/2+n]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-t-this.totalMarkerSize/2,this.newStyle.left=-e/2}},{name:XO,getBoundingBox:()=>[a/2+o,a/2+o,a/2+o,a/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n,this.totalMarkerSize/2+n],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:u}updatePosition(){}disable(){this.visible=!1}toPackedMessage(e=!1){return this.visible&&e&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((t,i)=>[...t.getBoundingBox(),i]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};c(ba,"LabelComponent"),d(ba,"testId",0);var mv=ba,Ti=mv;function Tt(r,e,t){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return e===!0?(r instanceof Cr&&r.components[1]===void 0?(r.components[1]=new al,r.components[1].dirty=!0):r instanceof xe&&r.components[2]===void 0?(r.components[2]=new al,r.components[2].dirty=!0):r instanceof Xe&&r.components[1]===void 0&&(r.components[1]=new al,r.components[1].dirty=!0),!0):(r instanceof Cr?r.components[1]=void 0:r instanceof xe?r.components[2]=void 0:r instanceof Xe&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let i;for(let n of r.userData.entities3D.values())i=t.geometry3DMap.get(n),Tt(i,e,t);return!0}}return!1}c(Tt,"updateInteractivity");function N6(r,e,t){if(!(!(t!=null&&t.color)&&!(t!=null&&t.topColor))){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let i,n,o=r.components[0];for(let a of r.userData.entities3D.values())i=e.geometry3DMap.get(a),i&&(n=i.components[1],n.color===o.color&&(n.initialColor=t.color||o.color,n.color=t.color||o.color,n.dirty=!0),n.topColor===o.topColor&&(n.topColor=t.topColor||o.topColor,n.dirty=!0));return t.color!==void 0&&(o.color=t.color,o.dirty=!0),t.topColor!==void 0&&(o.topColor=t.topColor,o.dirty=!0),!0}return!1}}c(N6,"updateGroupColor");function G6(r,e){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let t=r.components[0];return t.shading=t.shading||{},t.shading&&(e.start!==t.shading.start||e.end!==t.shading.end||e.intensity!==t.shading.intensity)&&(Object.assign(t.shading,e),r.userData.shadingDirty=!0),!0}return!1}c(G6,"updateGroupShading");function V6(r,e){e!==void 0&&r.type==="geometry"&&(e.showImage!==void 0&&(r.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}c(V6,"updateImageProps");function gv(r,e,t){var i;if(t!==void 0){if(r.type==="geometry"){let n=r.components[1];if(n.height!==t)return n.height=t,n.dirty=!0,((i=r.parent)==null?void 0:i.type)==="geometry-group"&&(r.parent.userData.outlineDirty=!0),!0}else if(r.type==="geometry-group"){for(let n of r.userData.entities3D.values()){let o=e.geometry3DMap.get(n),a=o==null?void 0:o.components[1];a!=null&&(o==null?void 0:o.type)==="geometry"&&a.height!==t&&(a.height=t,a.dirty=!0)}return r.userData.outlineDirty=!0,!0}}return!1}c(gv,"updateHeight");function vv(r,e){e!==void 0&&(r.type==="path"||r.type==="geometry")&&(e.initialColor!==void 0&&(r.components[1].initialColor=e.initialColor),e.color!==void 0&&(r.components[1].color=e.color),e.topColor!==void 0&&(r.components[1].topColor=e.topColor),r.components[1].dirty=!0)}c(vv,"updateColor");function bv(r,e,t){e!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(t(e[1],e[0],e[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(t(e[1],e[0],e[2]||0)))}c(bv,"updatePosition");function Cv(r,e){var t;return e!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parent!==e&&r.parent instanceof Xe?((t=r.parent)==null||t.removeEntity(r),e.addEntity(r),!0):!1}c(Cv,"updateParent");function j6(r,e){e!==void 0&&(r.type==="marker"||r.type==="label")&&(r.components[0].enabled=e)}c(j6,"updateEnabled");function H6(r,e,t){if(e!==void 0&&r.type==="marker"){let i=r.components[0];if(e.contentHTML!==void 0)return i.containerEl.innerHTML=e.contentHTML,!0;if(e.options!=null){try{V0.parse(e.options||{})}catch(n){return L.error(n),!1}return e.options.interactive==="pointer-events-auto"?(i.pointerEvents="auto",Tt(r,!1,t)):(i.pointerEvents="none",Tt(r,e.options.interactive,t)),U6(r,e.options.rank),!0}}return!1}c(H6,"updateMarker");function U6(r,e){return e!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=sl(e),!0):!1}c(U6,"updateRank");function W6(r,e,t){var i,n,o,a,u;if(e!==void 0&&r.type==="label"){let l=r.components[0];e.text!==void 0&&(l.text=e.text,l.dirty=!0);try{yv.parse(e.options||{})}catch(p){L.error(p);return}((i=e.options)==null?void 0:i.appearance)!==void 0&&Object.keys((n=e.options)==null?void 0:n.appearance).length>0&&(K0(l.appearance,((o=e.options)==null?void 0:o.appearance)||{}),l.dirty=!0),Tt(r,(a=e.options)==null?void 0:a.interactive,t),U6(r,(u=e.options)==null?void 0:u.rank)}}c(W6,"updateLabel");function X6(r,e){e!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=e,r.components[1].dirty=!0)}c(X6,"updateHoverColor");function xv(r,e){e!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=e)}c(xv,"updateFlipImageToFaceCamera");function Ca(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"){r.components[1].visible=e,r.components[1].dirty=!0;let t=r.parent;t instanceof rt&&(t.userData.outlineDirty=!0)}else(r.type==="group-container"||r.type==="geometry-group")&&r.setVisible(e);return!0}return!1}c(Ca,"updateVisibility");function Y6(r,e,t){if(t!==void 0&&r.type==="geometry-group"){let i=r.components[0];for(let n of r.userData.entities3D.values()){let o=e.geometry3DMap.get(n),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],a.opacity===i.opacity&&(o.components[1].opacity=t,o.components[1].dirty=!0))}return r.setOpacity(t),i.opacity=t,!0}return!1}c(Y6,"updateOpacity");function Z6(r,e){if(e!==void 0&&r.type==="geometry-group"){let t=r.components[0];(e==null?void 0:e.texture)!=null&&t.texture!==(e==null?void 0:e.texture)&&(t.texture=e.texture,t.dirty=!0),(e==null?void 0:e.topTexture)!=null&&t.topTexture!==(e==null?void 0:e.topTexture)&&(t.topTexture=e.topTexture,t.dirty=!0)}}c(Z6,"updateGroupTexture");function z6(r,e){if(r.type==="geometry"){let t=!1,i=r.components[1];if((e==null?void 0:e.texture)!=null&&i.texture!==(e==null?void 0:e.texture)&&(i.texture=e.texture,t=!0),(e==null?void 0:e.topTexture)!=null&&i.topTexture!==(e==null?void 0:e.topTexture)&&(i.topTexture=e.topTexture,t=!0),t&&r.components[0]instanceof Ie){let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),!0}}return!1}c(z6,"updateIndividualGeometryTexture");function q6(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.opacity!==e){t.opacity=e;let i=r.components[0];i.detached===!1&&(i.detached=!0,i.dirty=!0),e===0?t.visible=!1:t.visible=!0,t.dirty=!0;let n=r.parent;return(n==null?void 0:n.type)==="geometry-group"&&(n.userData.outlineDirty=!0,n.userData.shadingDirty=!0),!0}}return!1}c(q6,"updateIndividualGeometryOpacity");function Cf(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=e,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==e)return r.setAltitude(e),!0}return!1}c(Cf,"updateAltitude");function Sv(r,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=e,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=e,r.components[1].dirty=!0;let t=r.parent;t instanceof rt&&(t.userData.outlineDirty=!0)}return!0}return!1}c(Sv,"updateOutline");function $6(r,e){let{visible:t,color:i}=e,n=r.components[0];n instanceof Mi&&(t!=null&&Ca(r,t),i!=null&&vv(r,{color:i}),Object.assign(n,Mv(e)),z0(e)||(n.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(n.dirty=!0)))}c($6,"handlePathUpdate");function Mv(r){return vu(r,JO)}c(Mv,"pickPathOptions");var JO=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];m();m();m();m();var Iv=class Iv extends A2{constructor(t){let i=t,n=3,o=n*4;super(new Float32Array(t*o),n,t,T2,M2);d(this,"_width");d(this,"_height");d(this,"_propertiesLength");this._width=o,this._height=i,this._propertiesLength=n}setColor(t,i,n){let o=this.image.data,a=t*this._width;o[a]=i.r,o[a+1]=i.g,o[a+2]=i.b,o[a+3]=0,o[a+4]=n.r,o[a+5]=n.g,o[a+6]=n.b,o[a+7]=0,this.needsUpdate=!0}getColor(t){let i=this.image.data,n=t*this._width,o=new Ee(i[n],i[n+1],i[n+2]),a=new Ee(i[n+4],i[n+5],i[n+6]);return{color:o,topColor:a}}setTexture(t,i,n){let o=this.image.data,a=t*this._width;o[a+8]=i?1:0,o[a+9]=n?1:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}};c(Iv,"BatchedPropertiesTexture");var xf=Iv;var J6="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var K6="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}\n";var eL=-.05,tL=1,wv=class wv extends Qr{constructor(t,i,n=1){super(t);d(this,"propertiesTexture");d(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});d(this,"showTextures",c(t=>{let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(t,i,n),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new xf(i),this.uniforms.uRepeatYFactor.value=n,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,u=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,p=this.uniforms.uTopTexture,h=this.uniforms.uTexture,y=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=J6,o.fragmentShader=K6,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:u,uGradientStart:l,uMinSideAlpha:{value:eL},uMaxSideAlpha:{value:tL},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:p,uTexture:h,uRepeatYFactor:y})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(t){t!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=t,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(t){t.wrapS=$r,t.wrapT=$r,t.colorSpace=Gi,this.uniforms.uTexture.value=t}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(t){t.wrapS=$r,t.wrapT=$r,t.colorSpace=Gi,this.uniforms.uTopTexture.value=t}setGradientShading(t,i,n){this.uniforms.uGradientStart.value=t,this.uniforms.uGradientEnd.value=i,this.uniforms.uGradientIntensity.value=n}setColor(t,i,n){this.propertiesTexture.setColor(t,i,n)}getColor(t){return this.propertiesTexture.getColor(t)}hideTextures(t){let i=!!this.uniforms.uTexture.value,n=!!this.uniforms.uTopTexture.value;(i||n)&&(this.propertiesTexture.setTexture(t,!1,!1),this.needsUpdate=!0)}removeSideTexture(t){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let i=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(t,!1,i),this.needsUpdate=!0}}removeTopTexture(t){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let i=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(t,i,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};c(wv,"BatchedStandardMaterial");var xa=wv;var nL=80;function Q6(r,e){var u,l;let t=0;for(let p of r)t+=((l=(u=p.components[0])==null?void 0:u.geometry)==null?void 0:l.attributes.position.count)||0;let i=new Ee(e.color),n;n=new xa({color:i,side:e.side==="back"?S2:e.side==="front"?x2:Ni,opacity:e.opacity||1,transparent:e.opacity!==void 0?e.opacity<1:!1},r.length);let o=new xi(r.length,t,0,n),a;for(let p of r)a=p.components[0],!(!(a instanceof Ie)||!a.geometry)&&(a.mesh=o,a.material=n,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=p.id,n instanceof xa&&n.setColor(a.instanceIndex,i,e.topColor?new Ee(e.topColor):i));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}c(Q6,"batchGeometries");function Ev(r,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let t=new F2(r,nL),i=_v(e.color.getHexString()),n=new td({linewidth:2,color:i,transparent:!0}),o=new Mo(t,n);return o.layers.set(1),o}c(Ev,"createOutlines");function _v(r){return X(r).darken(30).toRgbString()}c(_v,"darkenColorForOutline");m();function eM(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}c(eM,"scrubMaterial");function Ye(r){for(let e=r.children.length-1;e>=0;e--)Ye(r.children[e]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(e){eM(e)}):"material"in r&&typeof r.material<"u"&&eM(r.material)}c(Ye,"destroyObject3D");var wu,Dv=class Dv{constructor(e){d(this,"rendererState");d(this,"dirty",!0);M(this,wu,!0);this.rendererState=e}get geometries3DDirty(){return s(this,wu)}set geometries3DDirty(e){P(this,wu,e)}update(e,t=!1){var o,a;let i=t&&e>=16&&e<=19,n;if(this.geometries3DDirty){let u;for(let l of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(l),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let p=n.children[0];n.userData.outlineDirty=!1;let h=ao(n);if(h&&Ye(h),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let y;if(p instanceof xi){let S=[],T,b,x,I;for(let E of n.userData.entities3D)I=this.rendererState.geometry3DMap.get(E),I instanceof xe&&(b=I.components[0],x=I.components[1],b instanceof Ie&&x.visible&&x.opacity>0&&x.outline&&!b.detached&&(T=b==null?void 0:b.geometry,T&&S.push(T)));S.length>0&&(y=ti(S))}else y=p.geometry;y&&(u=Ev(y,p.material),u.position.z=n.altitude,u.userData.outlineOfEntityId=n.userData.entityId);let g,v;for(let S of n.userData.entities3D.values()){let T=this.rendererState.geometry3DMap.get(S);g=T==null?void 0:T.components[0],v=T==null?void 0:T.components[1],g instanceof Ie&&(u&&(T==null?void 0:T.type)==="geometry"&&!g.detached?(T.components[0].outline=u,(o=n.parent)==null||o.add(u)):(T==null?void 0:T.type)==="geometry"&&g.geometry!=null&&g.material!=null&&g.detached&&(g.outline&&Ye(g.outline),v&&v.opacity>0&&v.visible&&v.outline&&(g.outline=Ev(g.geometry,g.material),(a=n.parent)==null||a.add(g.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}if((i||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let u=xr(e,16,19,0,1),l;for(let p of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(p),(l==null?void 0:l.type)==="geometry-group"&&l.components[0]!=null&&l.components[0].outline&&l.visible){let h=ao(l);if(h&&h.visible){let y=Array.isArray(h.material)?h.material:[h.material];for(let g of y)g.opacity=Math.min(u,l.components[0].opacity)}}else if((l==null?void 0:l.type)==="geometry"&&l.components[0]instanceof Ie&&l.components[0].detached){let h=l.components[0].outline;if(h){let y=Array.isArray(h.material)?h.material:[h.material];for(let g of y)g.opacity=Math.min(u,l.components[1].opacity)}}}this.dirty=!1}};wu=new WeakMap,c(Dv,"OutlineInterpolationSystem");var Iu=Dv;var Ov=class Ov extends mt{constructor(t,i=new fa){super();d(this,"visible",!0);d(this,"type","geometry-group");d(this,"components");d(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[i],this.userData.entityId=t}setVisible(t){this.visible=t;let i=ao(this);i&&(i.visible=t),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let n of this.children)if(!n.userData.detached){t=n;break}return t instanceof xi?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};c(Ov,"GeometryGroupObject3D");var rt=Ov;var Eu=class Eu extends mt{constructor(t){super();d(this,"childrenIds",new Set);d(this,"type","group-container");d(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});d(this,"components",[]);this.userData.entityId=t}addEntity(t){t instanceof Eu?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof Cr?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof rt?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof xe&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof Eu?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof Cr?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof rt?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof xe&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible=t,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};c(Eu,"GroupContainerObject3D");var Xe=Eu;m();var iM=!1;function nM(){iM=!0}c(nM,"enableTestMode");var Lv=class Lv{constructor(e,t=2){d(this,"backgroundAlpha",1);d(this,"backgroundColor",new Ee);d(this,"width",0);d(this,"height",0);d(this,"options",{});d(this,"renderer");var i,n;try{this.options=e;let o={canvas:e.canvas,alpha:e.alpha||!1,stencil:!1,antialias:typeof e.antialias=="boolean"?e.antialias:!0,outputColorSpace:Gi,powerPreference:"high-performance",preserveDrawingBuffer:!0};iM?(this.renderer={setSize:()=>{},state:{reset:()=>{}},properties:{get:()=>{}},getSize:()=>({width:window.innerWidth,height:innerHeight}),getDrawingBufferSize:()=>({width:window.innerWidth,height:innerHeight}),getClearAlpha:()=>1,getClearColor:()=>new Ee,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=t===2?new O2(o):new L2(o),this.backgroundColor=new Ee((i=e.backgroundColor)!=null?i:"#ffffff"),this.backgroundAlpha=(n=e.backgroundAlpha)!=null?n:1}catch(o){L.error(o),e.onWebGLRendererError&&e.onWebGLRendererError(o)}}destroy(){var e,t;this.renderer&&((t=(e=this.renderer).dispose)==null||t.call(e))}render(e,t){this.renderer&&(this.renderer.state.reset(),t.layers.enable(0),t.layers.enable(1),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(e,t),this.renderer.state.reset())}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(e,t){C.env.NODE_ENV==="test"||!this.renderer||(this.width=e,this.height=t,this.renderer.setSize(e,t,!1))}setBackgroundColor(e,t){this.backgroundColor=e,this.backgroundAlpha=t}domElement(){var e;return(e=this.renderer)==null?void 0:e.domElement}};c(Lv,"Renderer");var Sf=Lv;m();m();var oM='"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),Q=new s(0,t-5,e,t+S),Y=Z(e,t,i,o,h),F=[O,K,W,Q],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,V,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,_=U-D,A=V-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+_)+d,P=Math.max(P,L+A)+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.enabled){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&&F.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Y)){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{enabled: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';m();m();m();m();m();function aM(r,e){return e.x+e.w<r.x+r.w&&e.x>r.x&&e.y>r.y&&e.y+e.h<r.y+r.h}c(aM,"contains");m();function sM(r,e){let[t,i]=e;return t>=r.x&&t<=r.x+r.w&&i>=r.y&&i<=r.y+r.h}c(sM,"intersectPoint");m();function lM(r,e){let t=e.x,i=e.y,n=e.x+e.w,o=e.y+e.h,a=r.x,u=r.y,l=r.x+r.w,p=r.y+r.h;return t<l&&a<n&&i<p&&u<o}c(lM,"intersects");m();function vn(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}c(vn,"appendItems");m();var Av=class Av{constructor(e,t,i,n,o){d(this,"x");d(this,"y");d(this,"w");d(this,"h");d(this,"userData");this.userData=typeof o>"u"?null:o,this.x=e,this.y=t,this.w=i,this.h=n}contains(e){return e===this?!1:aM(this,e)}intersects(e){return lM(this,e)}intersectsPoint(e){return sM(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};c(Av,"Rectangle");var it=Av;var Sa=class Sa{constructor(e,t){d(this,"topLeft");d(this,"topRight");d(this,"bottomLeft");d(this,"bottomRight");d(this,"divided",!1);d(this,"boundary");d(this,"capacity",16);d(this,"objects",[]);d(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:n}=this.boundary;this.topLeft=new Sa(new it(e,t,i/2,n/2),this),this.topRight=new Sa(new it(e+i/2,t,i/2,n/2),this),this.bottomLeft=new Sa(new it(e,t+n/2,i/2,n/2),this),this.bottomRight=new Sa(new it(e+i/2,t+n/2,i/2,n/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(vn(t,this.topLeft.queryRect(e)),vn(t,this.topRight.queryRect(e)),vn(t,this.bottomLeft.queryRect(e)),vn(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(vn(t,this.topLeft.queryPoint(e)),vn(t,this.topRight.queryPoint(e)),vn(t,this.bottomLeft.queryPoint(e)),vn(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()}};c(Sa,"QuadTree");var Pi=Sa;m();function uM(r,e,t){let i,n,o,a=null,u=0;t||(t={});let l=c(function(){u=t.leading===!1?0:Date.now(),a=null,o=r.apply(i,n),a||(i=n=null)},"later");return function(){let p=Date.now();!u&&t.leading===!1&&(u=p);let h=e-(p-u);return i=globalThis,n=arguments,h<=0||h>e?(a&&(clearTimeout(a),a=null),u=p,o=r.apply(i,n),a||(i=n=null)):!a&&t.trailing!==!1&&(a=setTimeout(l,h)),o}}c(uM,"throttle");var Ma=!1,oL=150,kv=class kv extends ${constructor(t,i,n=new Worker(URL.createObjectURL(new Blob([oM],{type:"text/javascript"})))){super();d(this,"worker");d(this,"debugContext");d(this,"debugCanvas");d(this,"collidersDirty",!0);d(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);d(this,"visibleCollidersQTree",new Pi(new it(0,0,0,0)));d(this,"interactiveCollidersQTree",new Pi(new it(0,0,0,0)));d(this,"coreState");d(this,"postMessage");d(this,"showCollisionBoxes",c(()=>{Ma=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));d(this,"hideCollisionBoxes",c(()=>{Ma=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));d(this,"currentMsgId","");d(this,"working",!1);d(this,"_postMessage",c(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));d(this,"componentArray",[]);d(this,"update",c((t,i,n="bottom-left",o=!0)=>{let a=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let u;for(let l of this.coreState.geometry2DIdsInScene){let p=this.coreState.geometry2DMap.get(l);p&&(u=p.components[0],this.componentArray.push(u))}this.resize(t,i,n),this.collidersDirty=!1,a=!0}else a=this.componentArray.some(u=>u.collisionDirty===!0);a&&this.componentArray.sort((u,l)=>l.rank-u.rank);for(let u=0;u<this.componentArray.length;u++)if(this.packedMessage){let l=this.componentArray[u].toPackedMessage(!o&&!a);this.packedMessage[0][u]==null&&(this.packedMessage[0][u]=[]),this.packedMessage[0][u][0]==null&&(this.packedMessage[0][u][0]=[]),this.packedMessage[0][u][0]=l.bboxes,this.packedMessage[0][u][1]=l.enabled?1:0,this.packedMessage[0][u][2]=l.rank===5?1:0,this.packedMessage[0][u][3]=l.x,this.packedMessage[0][u][4]=l.y,this.packedMessage[0][u][5]=l.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][u][6]=l.lockedToStrategyIndex}this.working||this.postMessage()},"update"));d(this,"resolve",c(t=>{if(this.working=!1,this.collidersDirty||!t.data)return;let i=t.data.colliders,n=-1,o,a,u;Ma&&(this.visibleCollidersQTree=new Pi(new it(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Pi(new it(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&&(n=i[l][0],o=i[l][2],p.offscreen=i[l][1]===1,n!==-1&&o!=null?(u=new it(o.x,o.y,o.w,o.h,{entityId:p.id}),Ma&&this.visibleCollidersQTree.insert(u),a=this.coreState.geometry2DMap.get(p.id),(a==null?void 0:a.components[1])!=null&&this.interactiveCollidersQTree.insert(new it(o.x,o.y,o.w,o.h,{entityId:p.id})),(p.visible===!1||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="show"),n!==-1&&n!==p.activeStrategyIndex&&(p.activeBoundingBox=u,p.onStrategySelected(n))):((p.visible===!0||p.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in p&&(p.visibilityNeedsUpdate="hide"),n!==-1&&n!==p.activeStrategyIndex&&p.onStrategySelected(n)))}Ma&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));d(this,"drawDebug",c(()=>{Ma&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));d(this,"destroy",c(()=>{this.worker.terminate()},"destroy"));this.coreState=i,this.debugCanvas=t,this.debugContext=t.getContext("2d"),this.worker=n,this.worker.onmessage=o=>this.resolve(o),this.postMessage=uM(this._postMessage,oL,!1),Ma?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(t,i,n){this.packedMessage[6]=n,this.packedMessage[5]=i,this.packedMessage[4]=t,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};c(kv,"CollisionSystem");var Mf=kv;m();m();m();m();var Bv=class Bv{constructor(e){d(this,"type");d(this,"event");this.type=0,this.event=e}get timestamp(){return this.event.timeStamp}};c(Bv,"Tap");var Tf=Bv,Rv=class Rv{constructor(){d(this,"taps",[])}add(e){this.lastPointerDown&&e.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(e)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===1}get isSingleTapWithOneFinger(){var e;return this.isSingleTap&&((e=this.lastPointerDown)==null?void 0:e.type)===0}get isDoubleTapWithOneFinger(){var e,t;return this.isDoubleTap&&((e=this.taps[0])==null?void 0:e.type)===0&&((t=this.taps[1])==null?void 0:t.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(e){this.taps=this.taps.filter(t=>e-t.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};c(Rv,"TapsController");var Pf=Rv;m();function pM(r){let e=new Set;for(let t of r){let i=t.object;for(;i.parent&&!e.has(i.parent);)i=i.parent,i instanceof Xe&&i.type==="group-container"&&i.visible&&i.components[1]&&e.add(i)}return Array.from(e)}c(pM,"getUniqueIntersectedGroupContainers");function dM(r,e){if(r==null||e==null)return r===e;if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}c(dM,"arraysEqual");var fl,Nv=class Nv extends ${constructor(t,i,n,o,a){super();d(this,"raycaster",new ei);d(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}});d(this,"coreState");d(this,"camera");d(this,"cameraPlane");d(this,"_quadtree",new Pi(new it(0,0,0,0)));d(this,"_container");d(this,"lastPointerEvent");d(this,"cursor","grab");d(this,"touchesCount",0);d(this,"isUserInteracting");d(this,"hasTouched",!1);M(this,fl,void 0);d(this,"onPointerMoveRaf",c(t=>{this.lastPointerEvent=t,s(this,fl)&&cancelAnimationFrame(s(this,fl)),P(this,fl,requestAnimationFrame(()=>{this.onPointerMove(t)}))},"onPointerMoveRaf"));d(this,"onPointerMove",c(t=>{t.preventDefault(),this.updateInteractionStateIfPanning(t),(t.pointerType!=="touch"||t.pointerType===void 0&&this.hasTouched)&&this.handleHover(t),this.handleCursor()},"onPointerMove"));d(this,"tapsControl",new Pf);d(this,"onPointerDown",c(t=>{t.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:t.timeStamp,clientX:t.clientX,clientY:t.clientY},this.lastPointerEvent=t,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),t.pointerType==="touch"&&(this.tapsControl.add(new Tf(t)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));d(this,"clickTimeout");d(this,"onPointerUp",c(t=>{this.tapsControl.discardOutsideOfWaitWindow(t.timeStamp),this.lastPointerEvent=t,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(t);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)&&(t.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",t),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(t),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",t),this.flush()):this.handleClick(t)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));d(this,"dirty3D",!0);d(this,"cachedHitBoxes",{entities:[],groups:[]});d(this,"ndcPoint",new te);d(this,"debugPanel");d(this,"resize",c(()=>{let{top:t,left:i}=this._container.getBoundingClientRect();this.state.containerOffset=[t,i]},"resize"));this.isUserInteracting=a,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=n,this._container=t,this.coreState=i,this.cameraPlane=o,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive"),this.resize()}updateQuadtree(t){this._quadtree=t}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let t=this.state.hovered3DEntity.components[2];t&&(t.dirty=!0)}}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(t){let i=t||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!i||this.isUserInteracting())return;let{entity3D:n,entity2D:o,position:a,groupContainers:u}=this.intersect(i);(this.handle3DEntityHover(n)||this.handle2DEntityHover(o)||this.handle3DContainerHover(u))&&this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:a,groupContainers:u}),this.handleCursor()}handleCursor(){let t=!!(this.state.hovered3DEntity||this.state.hovered2DEntity),i=!!this.state.interaction.mouseDownStart,n=this.state.interaction.isPanning,o=lL(t,n,i);this.cursor!==o&&(this.cursor=o,o==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}handle2DEntityHover(t){let i=this.state.hovered2DEntity!==t;return this.state.hovered2DEntity=t,i}handleClick(t){let i=this.intersect(t);this.publish("click",{entity2D:i.entity2D,entity3D:i.entity3D,position:i.position,groupContainers:i.groupContainers,pointerEvent:{button:t.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let t;for(let i of this.coreState.geometry3DIdsInScene)t=this.coreState.geometry3DMap.get(i),((t==null?void 0:t.type)==="geometry"||(t==null?void 0:t.type)==="model"||(t==null?void 0:t.type)==="path")&&t.components[2]?t.components[0].mesh&&!this.cachedHitBoxes.entities.includes(t.components[0].mesh)&&this.cachedHitBoxes.entities.push(t.components[0].mesh):(t==null?void 0:t.type)==="group-container"&&t.components[1]&&!this.cachedHitBoxes.groups.includes(t)&&this.cachedHitBoxes.groups.push(t);return this.dirty3D=!1,this.cachedHitBoxes}return this.cachedHitBoxes}intersect(t){var S,T;let i=[t.offsetX,t.offsetY],n=this._quadtree.queryPoint(i),[o]=n.filter(b=>b.intersectsPoint(i)),a=this.state.containerOffset[0],u=this.state.containerOffset[1];this.ndcPoint.x=(t.clientX-u)/this._container.clientWidth*2-1,this.ndcPoint.y=-((t.clientY-a)/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(b=>b.object.visible),[h]=p,y=(S=h==null?void 0:h.instanceId)!=null?S:h==null?void 0:h.batchId,g=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(b=>b.object.visible),v;return g!=null&&g.length>0&&(v=pM(g)),{entity2D:((T=o==null?void 0:o.userData)==null?void 0:T.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(o==null?void 0:o.userData.entityId),entity3D:y!=null?this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entities[y]):this.coreState.geometry3DMap.get(h==null?void 0:h.object.userData.entityId),position:Array.isArray(g)&&(g==null?void 0:g.length)>0?g[0].point:l==null?void 0:l.point,groupContainers:v}}handle3DEntityHover(t){this.state.lastHover!==t&&(this.state.lastHover&&fM(this.state.lastHover,!1),t&&fM(t,!0));let i=this.state.hovered3DEntity!==t;return this.state.hovered3DEntity=t,this.state.lastHover=t,i}handle3DContainerHover(t){let i=!dM(this.state.hovered3DContainers,t);return this.state.hovered3DContainers=t,i}updateInteractionStateIfPanning(t){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(t.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(t.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 t=document.createElement("div");t.style.position="absolute",t.style.top="0",t.style.right="0",t.style.backgroundColor="white",t.style.padding="10px",document.body.append(t),t.id="interaction-debug-panel",this.debugPanel=t,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 n,o,a;this.queueDebugMessage("CLICK \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#fdffb6")}),this.on("hover",i=>{var n,o,a;this.queueDebugMessage("HOVER \n3D: ".concat((n=i.entity3D)==null?void 0:n.id," \n2D: ").concat((o=i.entity2D)==null?void 0:o.id," \nPos: ").concat((a=i.position)==null?void 0:a.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(t,i){var o;let n=document.createElement("pre");n.style.maxWidth="300px",n.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",n.style.backgroundColor=i,n.textContent=t,(o=this.debugPanel)==null||o.prepend(n),setTimeout(()=>{n.style.opacity="0",setTimeout(()=>{n.remove()},500)},2500)}getCursor(){return this.cursor}};fl=new WeakMap,c(Nv,"InteractionSystem");var _u=Nv;function fM(r,e){let t=r.components[2];t&&(t.hover=e,t.dirty=!0)}c(fM,"updateHover");function lL(r,e,t){return e?"grabbing":r?"pointer":t?"grabbing":"grab"}c(lL,"processCursor");m();var Gv=class Gv extends ${constructor(){super();d(this,"interpolators",new Map);d(this,"update",c(t=>{for(let[i,n]of this.interpolators)i instanceof Ie?i.setOpacity(n(t)):i instanceof Ti?i.enabled=n(t):n(t)},"update"))}addEntity3D(t,i){let[n,o,a,u]=i[1];this.interpolators.set(t,l=>xr(l,n,o,a,u))}addEntity2D(t,i){let[n,o,a]=i[1];this.interpolators.set(t,u=>u<n?o:a)}addAny(t,i){this.interpolators.set(t,i)}destroy(){this.interpolators.clear()}};c(Gv,"ZoomInterpolationSystem");var If=Gv;m();m();var Ta,Ii,wf,Ef,mM,Ou,_f,Df,yM,Of,gM,Lu,Lf,Au,ku,Af,jv=class jv{constructor(e){M(this,Ef);M(this,Df);M(this,Of);M(this,Ta,null);M(this,Ii,void 0);d(this,"getCurrentSceneGLTF",c(async e=>{let t={onlyVisible:!0,binary:!0,light:!0,scale:1,...e},i=await V(this,Ef,mM).call(this),n=s(this,wf).call(this,t),o=await i.parseAsync(n,{trs:!1,maxTextureSize:1/0,onlyVisible:t.onlyVisible,binary:t.binary,scale:t.scale}),a;if(o instanceof ArrayBuffer)a=new Blob([o],{type:"application/octet-stream"});else{let u=JSON.stringify(o,null,2);a=new Blob([u],{type:"text/plain"})}return a},"getCurrentSceneGLTF"));M(this,wf,c(e=>{let{scale:t,light:i,onlyVisible:n}=e,o=new Za,a=new Vi().setFromObject(s(this,Ii).entityScene);if(s(this,Ou).call(this,s(this,Ii).entityScene,o,n),i){let u=new id(16777215,.3*Math.PI);u.position.set(0,Math.max(a.max.x,a.max.y)*t*.5,a.max.y*t*4),u.lookAt(0,0,-1),u.target.position.set(0,0,-1),u.add(u.target),o.add(u)}return o},"#getExportedScene"));M(this,Ou,c((e,t,i)=>{e.material&&(e instanceof za?V(this,Df,yM).call(this,e).forEach(n=>t.add(n)):e instanceof Mo&&t.add(V(this,Of,gM).call(this,e))),e.children.forEach(n=>{(!i||n.visible)&&s(this,Ou).call(this,n,t,i)})},"#processObject3D"));M(this,_f,c((e,t,i)=>{let n=new N2({color:new Ee(e),metalness:0});return n.opacity=t,n.transparent=i,n},"#createStandardMaterial"));M(this,Lu,c(e=>{let{geometry:t,material:i,position:n,rotation:o,quaternion:a,scale:u}=e;if(!(t!=null&&t.isBufferGeometry))return e;let l=t.attributes.position,p=t.attributes.normal,h=t.attributes.uv;return s(this,Lf).call(this,l,p),s(this,ku).call(this,n,u,o,a),h&&s(this,Af).call(this,h),i!=null&&i.map&&t.type==="PlaneGeometry"&&(e.side=Ni),e},"#convertGeometry"));M(this,Lf,c((e,t)=>{let i=new q,n=new q;for(let o=0;o<e.count;o++)i.fromBufferAttribute(e,o),s(this,Au).call(this,i),e.setXYZ(o,i.x,i.y,i.z),t&&(n.fromBufferAttribute(t,o),s(this,Au).call(this,n),t.setXYZ(o,n.x,n.y,n.z))},"#convertAttributes"));M(this,Au,c(e=>{let t=e.y;e.y=e.z,e.z=-t},"#convertVector"));M(this,ku,c((e,t,i,n)=>{let o=e.y;e.y=e.z,e.z=-o;let a=t.y;if(t.y=t.z,t.z=a,i instanceof Ya)i.order="YXZ",i.set(i.x,i.y,i.z,i.order);else{let u=n.y;n.set(n.x,n.z,-u,n.w)}},"#convertObjectProperties"));M(this,Af,c(e=>{for(let t=0;t<e.count;t++){let i=e.getX(t),n=e.getY(t);e.setXY(t,i,n)}},"#convertUVs"));P(this,Ii,e),s(this,Ii).entityScene=e.entityScene,s(this,Ii).geometry3DMap=e.geometry3DMap}destroy(){P(this,Ta,null)}};Ta=new WeakMap,Ii=new WeakMap,wf=new WeakMap,Ef=new WeakSet,mM=c(async function(){if(!s(this,Ta)){let{GLTFExporter:e}=await import("./GLTFExporter-V3JBMXKP.js");P(this,Ta,new e)}return s(this,Ta)},"#getGLTFExporter"),Ou=new WeakMap,_f=new WeakMap,Df=new WeakSet,yM=c(function(e){var a,u;let t=[],n=((a=e.userData)!=null&&a.entities?Object.values((u=e.userData)==null?void 0:u.entities):[]).map(l=>s(this,Ii).geometry3DMap.get(l)),o=new Map;return n.forEach(l=>{var v;if(!l||!(l instanceof xe))return;let p=l.components[1],h=l.components[2];if(!p.visible||p.opacity===0)return;let y=h!=null&&h.hover?p.hoverColor||s(this,Ii).hoverColor:p.color,g="".concat(y,"-").concat(p.opacity,"-").concat(Number(p.visible));o.has(g)||o.set(g,[]),(v=o.get(g))==null||v.push(l)}),o.forEach((l,p)=>{let[h,y,g]=p.split("-"),v=l.reduce((x,I)=>{let E=I.components[0];if(E.type==="custom-geometry")return x;let w=E==null?void 0:E.geometry;return w&&x.push(w),x},[]),S=s(this,_f).call(this,h,Number(y),e.material.transparent),T=ti(v,!0),b=new Te(T,S);b.position.copy(e.position),b.rotation.copy(e.rotation),b.scale.copy(e.scale),b.visible=!!g,s(this,ku).call(this,b.position,b.scale,b.rotation,b.quaternion),t.push(s(this,Lu).call(this,b))}),t},"#processBatchedMesh"),Of=new WeakSet,gM=c(function(e){let t=e.geometry.clone(),i=e.material,n=new Zt({color:i.color,side:Ni});n.opacity=i.opacity,n.transparent=i.transparent;let o=new Mo(t,n);return o.position.copy(e.position),o.rotation.copy(e.rotation),o.scale.copy(e.scale),o.visible=e.visible,s(this,Lu).call(this,o)},"#processLineSegments"),Lu=new WeakMap,Lf=new WeakMap,Au=new WeakMap,ku=new WeakMap,Af=new WeakMap,c(jv,"ExporterSystem");var Du=jv;m();m();m();m();var Fu={top:0,bottom:0,left:0,right:0,type:"pixel"};m();m();var cL="gray",uL=.1;function vM(r,e,t){let{color:i=cL,opacity:n=1,altitude:o=0,height:a=uL}=t||{};Array.isArray(n)&&(n=1);let u={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o},center:{x:0,y:0,z:(a+o)/2}},l=new Jr,p=r.geometry.coordinates[0].map(v=>{let S=e(v[1],v[0]);return u.min.x=Math.min(u.min.x,S.x),u.min.y=Math.min(u.min.y,S.y),u.max.x=Math.max(u.max.x,S.x),u.max.y=Math.max(u.max.y,S.y),S});l.moveTo(p[0].x,p[0].y),p.slice(1).forEach(v=>l.lineTo(v.x,v.y)),l.lineTo(p[0].x,p[0].y);let h=r.geometry.coordinates.slice(1);l.holes=h.map(v=>{let S=v.map(b=>e(b[1],b[0])),T=new Dn;return T.moveTo(S[0].x,S[0].y),S.slice(1).forEach(b=>T.lineTo(b.x,b.y)),T.lineTo(S[0].x,S[0].y),T});let y={bevelEnabled:!1,depth:a},g=new Kr(l,y);return g.translate(0,0,o||0),g.userData={style:{color:i,opacity:n}},g}c(vM,"renderPolygonGeometry");m();var pL="gray",dL=.1;function bM(r,e,t){let{color:i=pL,opacity:n=1,altitude:o=0,height:a=dL}=t||{};Array.isArray(n)&&(n=1);let u={min:{x:1/0,y:1/0,z:o},max:{x:-1/0,y:-1/0,z:a+o}},l={bevelEnabled:!1,depth:a},p=[];r.geometry.coordinates.forEach(y=>{let g=new Jr,v=y[0].map(b=>{let x=e(b[1],b[0]);return u.min.x=Math.min(u.min.x,x.x),u.min.y=Math.min(u.min.y,x.y),u.max.x=Math.max(u.max.x,x.x),u.max.y=Math.max(u.max.y,x.y),x});g.moveTo(v[0].x,v[0].y),v.slice(1).forEach(b=>g.lineTo(b.x,b.y)),g.lineTo(v[0].x,v[0].y);let S=y.slice(1);g.holes=S.map(b=>{let x=b.map(E=>e(E[1],E[0])),I=new Dn;return I.moveTo(x[0].x,x[0].y),x.slice(1).forEach(E=>I.lineTo(E.x,E.y)),I.lineTo(x[0].x,x[0].y),I});let T=new Kr(g,l);p.push(T)});let h=ti(p);return h.translate(0,0,o||0),h.userData={style:{color:i,opacity:n}},h}c(bM,"renderMultiPolygonGeometry");m();m();var Wv=Ul(_M());function DM(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}c(DM,"JSClipperError");DM.prototype=Error.prototype;Wv.default.Error=function(r){throw new DM(r)};var jt=Wv.default;var ok="gray",Xv=new jt.ClipperOffset,wt=100;function OM(r,e,t){let{color:i=ok,opacity:n=1,width:o=1,join:a="round",cap:u="round",height:l=.01,altitude:p=0}=t||{};Array.isArray(n)&&(n=0);let h=[];for(let T=0;T<r.geometry.coordinates.length-1;T++){let b=e(r.geometry.coordinates[T][1],r.geometry.coordinates[T][0]),x=e(r.geometry.coordinates[T+1][1],r.geometry.coordinates[T+1][0]);h.push([b,x])}Xv.AddPaths(h.map(T=>T.map(b=>({X:b.x*wt,Y:b.y*wt}))),a==="round"?jt.JoinType.jsRound:a==="miter"?jt.JoinType.jsMiter:jt.JoinType.jsSquare,u==="round"?jt.EndType.etOpenRound:u==="butt"?jt.EndType.etOpenButt:jt.EndType.etOpenSquare);let y=new jt.PolyTree;Xv.Execute(y,o/2*wt);let g=[],v={bevelEnabled:!1,depth:l};for(let T of y.m_AllPolys){let b=new Jr;if(T.IsHole())continue;let x=T.m_polygon;b.moveTo(x[0].X/wt,x[0].Y/wt),x.slice(1).forEach(I=>b.lineTo(I.X/wt,I.Y/wt)),b.lineTo(x[0].X/wt,x[0].Y/wt),b.holes=T.m_Childs.map(I=>{let E=new Dn,w=I.m_polygon;return E.moveTo(w[0].X/wt,w[0].Y/wt),w.slice(1).forEach(_=>E.lineTo(_.X/wt,_.Y/wt)),E.lineTo(w[0].X/wt,w[0].Y/wt),E}),g.push(new Kr(b,v))}let S=ti(g);return S.translate(0,0,p||0),S.userData={style:{color:i,opacity:n}},Xv.Clear(),S}c(OM,"renderLineStringGeometry");m();var Et=100,ak=.22,sk=.01;function LM(r,e,t={}){let{width:i=ak,height:n=sk,color:o="gray",opacity:a=1,altitude:u=0}=t,l={min:{x:1/0,y:1/0,z:u},max:{x:-1/0,y:-1/0,z:u+n}},p={bevelEnabled:!1,depth:n},h=new jt.ClipperOffset,y=r.geometry.coordinates.map(T=>T.map(b=>e(b[1],b[0])));h.AddPaths(y.map(T=>T.map(b=>({X:b.x*Et,Y:b.y*Et}))),jt.JoinType.jsMiter,jt.EndType.etOpenRound);let g=new jt.PolyTree;h.Execute(g,i/2*Et);let v=[];for(let T of g.m_AllPolys){let b=new Jr;if(T.IsHole())continue;l.min.x=Math.min(l.min.x,T.m_polygon[0].X),l.min.y=Math.min(l.min.y,T.m_polygon[0].Y),l.max.x=Math.max(l.max.x,T.m_polygon[0].X),l.max.y=Math.max(l.max.y,T.m_polygon[0].Y);let x=T.m_polygon;b.moveTo(x[0].X/Et,x[0].Y/Et),x.slice(1).forEach(I=>b.lineTo(I.X/Et,I.Y/Et)),b.lineTo(x[0].X/Et,x[0].Y/Et),b.holes=T.m_Childs.map(I=>{let E=new Dn,w=I.m_polygon;return E.moveTo(w[0].X/Et,w[0].Y/Et),w.slice(1).forEach(_=>E.lineTo(_.X/Et,_.Y/Et)),E.lineTo(w[0].X/Et,w[0].Y/Et),E}),v.push(new Kr(b,p))}let S=ti(v);return S.translate(0,0,u||0),S.userData={style:{color:o,opacity:a}},h.Clear(),S}c(LM,"renderMultiLineStringGeometry");m();var lk=A.object({rotation:A.array(A.number()).length(3).optional(),altitude:A.number().optional(),scale:A.array(A.number()).length(3).optional(),interactive:A.boolean().optional(),id:A.union([A.number(),A.string()]).optional()}),ck=A.object({type:A.enum(["Feature"]),geometry:ll,properties:lk}),uk=A.object({type:A.enum(["FeatureCollection"]),features:A.array(ck)}),pk=A.object({url:A.string(),color:A.string().optional(),opacity:A.number().optional()});function AM(r,e,t){A.union([A.number(),A.string()]).parse(r),uk.parse(e),pk.parse(t)}c(AM,"validateModelGroup");var Nu,Gu,Yv=class Yv{constructor(e){d(this,"mesh");d(this,"type","model");d(this,"outline");d(this,"geometry");d(this,"material");d(this,"feature");d(this,"instanceIndex",-1);d(this,"visible",!0);d(this,"color",new Ee);d(this,"position",new q);M(this,Nu,0);M(this,Gu,1);this.feature=e}setOpacity(){}setColor(){}get altitude(){return s(this,Nu)}set altitude(e){this.mesh&&(this.mesh.position.z=e,P(this,Nu,e))}get opacity(){return s(this,Gu)}set opacity(e){var t,i;if(this.mesh){for(let n of this.mesh.children)if(n instanceof ed){((t=n.userData)==null?void 0:t.originalOpacity)===void 0&&(n.userData.originalOpacity=n.material.opacity);let o=xr(e,0,(i=n.userData)==null?void 0:i.originalOpacity,0,1);n.material.opacity=o,n.material.transparent=o<1,n.material.needsUpdate=!0}}P(this,Gu,e)}};Nu=new WeakMap,Gu=new WeakMap,c(Yv,"ModelComponent");var uo=Yv;function dk(r){let{color:e,opacity:t,topColor:i,texture:n,topTexture:o}=r;return"".concat(e).concat(t).concat(i||"").concat(n||"").concat(o||"")}c(dk,"generateIndex");var hk=1e4,Zv=class Zv extends ${constructor(t,i){super();d(this,"state");d(this,"convertTo3DMapPosition");d(this,"loader");this.state=t,this.convertTo3DMapPosition=i}async getGLTFLoader(){if(this.loader)return;let{GLTFLoader:t}=await import("./GLTFLoader-JYDXWLFZ.js");this.loader=new t}createEntityFromFeature(t,i,n){let o=new Ie(i),a=new xe(o,new Nr(n));return a.id=t,a}createModelFromFeature(t,i,n){let o=new uo(i),a=new xe(o,new Nr(n));return a.id=t,a}populateEntityMesh(t,i){let n=t.components[0];n.geometry=i,n.currentHeight=t.components[1].height,n.dirty=!1}async populateModelGroup(t,i,n){let o=new ji,a=new Ya,u=new w2,l=new q,p=new br;return this.loader||await this.getGLTFLoader(),this.loader.load(i,h=>{var v,S,T,b,x,I;h.scene.traverse(E=>{let w=E;if("isMesh"in w&&w.isMesh===!0){let _=new ed(w.geometry,w.material,t.size);_.userData={entities:{}},p.add(_),n.add(p)}});let y=0,g;for(let E of t.values()){g=this.state.geometry3DMap.get(E);let w=g.components[0],_=g.components[0].feature;w.mesh=p,w.instanceIndex=y;let{x:D,y:B,z:U}=this.convertTo3DMapPosition(_.geometry.coordinates[1],_.geometry.coordinates[0],0);w.position.set(D,B,U),a.set(((v=_.properties.rotation)==null?void 0:v[0])||0,((S=_.properties.rotation)==null?void 0:S[1])||0,((T=_.properties.rotation)==null?void 0:T[2])||0),l.set(((b=_.properties.scale)==null?void 0:b[0])||1,((x=_.properties.scale)==null?void 0:x[1])||1,((I=_.properties.scale)==null?void 0:I[2])||1),u.setFromEuler(a),o.compose(w.position,u,l),p.children.forEach(G=>{let j=G;j.setMatrixAt(y,o),j.userData.entities[y]=g.id}),y++}this.publish("model-loaded")}),p}populateEntityGroup(t){let i,n,o,a;for(let u of t.values())a=this.state.geometry3DMap.get(u),a.components[0]instanceof Ie&&(n=a.components[0].feature,o=a.components[1],n.geometry.type==="Polygon"?(i=vM(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiPolygon"?(i=bM(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="LineString"?(i=OM(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)):n.geometry.type==="MultiLineString"&&(i=LM(n,this.convertTo3DMapPosition,o),this.populateEntityMesh(a,i)));return t}optimize(t){if(t.visible&&(t instanceof rt||t instanceof Xe)){for(let o of t.children)this.optimize(o);if(t instanceof Xe||t.userData.dirty===!1)return;let i={};if(!t.userData.modelURL&&t.userData.dirty)try{this.populateEntityGroup(t.userData.entities3D)}catch(o){L.warn(o)}else t.userData.modelURL&&t.userData.dirty&&(this.populateModelGroup(t.userData.entities3D,t.userData.modelURL,t),t.userData.dirty=!1);let n=0;if(t.userData.dirty){let o=0,a;for(let u of t.userData.entities3D.values()){a=this.state.geometry3DMap.get(u);let l=a.components[0],p=a.components[1];if(l instanceof Ie){o++,o>=hk&&(o=0,n++);let h=dk(p)+n;i[h]===void 0&&(i[h]={style:p,entities:[]}),i[h].entities.push(a)}else l.mesh&&l.mesh.parent!==t&&t.add(l.mesh)}for(let u in i){let l=Q6(i[u].entities,i[u].style);t.add(l),t.userData.outlineDirty=!0,t.userData.dirty=!1}}}}update(){this.optimize(this.state.entityScene)}};c(Zv,"MeshCreationAndOptimizationSystem");var Nf=Zv;m();var zv=class zv{constructor(e,t){d(this,"state");d(this,"dirty",!0);d(this,"domTree");this.state=e,this.domTree=t}update(){if(this.dirty){let e;for(let t of Array.from(this.domTree.children))if(e=this.state.geometry2DMap.get(t.userData.entityId),e){let i=e.components[0];(!i.enabled||!i.visible||!this.state.geometry2DIdsInScene.has(t.userData.entityId))&&this.domTree.removeChild(t)}else this.domTree.removeChild(t);for(let t of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(t),e){let i=e.components[0];i instanceof Si&&i.enabled&&i.containerEl&&!this.domTree.contains(i.containerEl)&&(i.containerEl.userData={entityId:e.id},this.domTree.appendChild(i.containerEl),i.updateDimensions())}this.dirty=!1}}};c(zv,"DOMVisibilitySystem");var Gf=zv;m();var qv=class qv{constructor(e,t){d(this,"state");d(this,"project");this.state=e,this.project=t}update(){let e;for(let t of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(t),e&&this.project(e.components[0].projection,e.position)}};c(qv,"TwoDProjectionSystem");var Vf=qv;m();m();var fk=c(function(){let e,t;return i=>{if((!t||!t)&&(e=document.createElement("canvas"),e.width=500*i,e.height=500*i,e.style.width="500px",e.style.height="500px",t=e.getContext("2d")),!t)throw new Error("Could not get 2D context");return{measureCanvas:e,measureCanvasContext:t}}},"createMeasureCanvasContext")(),kM=c(({text:r,size:e,maxWidth:t,pixelRatio:i,maxLines:n=2,lineHeight:o=1.2,options:a={strokeText:!0}})=>{let u="bold ".concat(e*i,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:l}=fk(i);l.font=u;let p=[],h=r.split(" "),y=0,g=0,v=0;for(;g<h.length;){let x=h[g];if(y===n&&y>0){p[y-1]+="...";break}if(p[y]==null&&(p[y]=x,g++),h.length===1){p[y]=x;break}if(h[g]==null)break;let{width:I}=l.measureText(p[y]+" "+h[g]);I<=t*i?(p[y]+=" "+h[g],g++):y++}p.forEach(x=>{let{width:I}=l.measureText(x);v=Math.max(I,v)});let S=e*i*o,T=p.length*S;return{maxWidth:v,maxHeight:T,lines:p.length,draw:(x,I,E)=>{p.length===1?(a.strokeText&&x.strokeText(p[0],I,E),x.fillText(p[0],I,E)):(a.strokeText&&(x.strokeText(p[0],I,E-S/2),x.strokeText(p[1],I,E+S/2)),x.fillText(p[0],I,E-S/2),x.fillText(p[1],I,E+S/2))}}},"shaveText");m();function FM(r){let e=new Image;return r&&(/^\s*<svg(?:\s[^>]*)?>/.test(r)?e.src="data:image/svg+xml;base64,".concat(btoa(r)):e.src=r),e}c(FM,"createImage");var mk=3.5,yk=2.5,gk=2,vk=5,Vu=2.5;var $v=class $v{constructor(e,t){d(this,"dirty",!1);d(this,"state");d(this,"colliderContext");d(this,"colliderCanvas");d(this,"pinCache",{});d(this,"imagePromiseCache",{});d(this,"imageDimensionsCache",{});d(this,"textCache",{});d(this,"update",c((e,t,i)=>{let n=(e-t)/(i-t),o=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let a,u,l,p,h,y;for(let g of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(g),y!=null&&y.components[0]instanceof Ti&&!y.disposed){if(h=y.components[0],u=h.appearance.marker.foregroundColor,l=h.appearance.marker.backgroundColor,p=h.markerSize,a="".concat(u.active,"-").concat(u.inactive,"-").concat(l.active,"-").concat(l.inactive,"-").concat(p),this.pinCache[a]||this.prepare(h,a,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:v,width:S,height:T}=this.processText(h.text,h.appearance.text.size,h.appearance.text.maxWidth,h.appearance.text.numLines,h.appearance.text.lineHeight);["left","center","right"].forEach(x=>{this.textCache[h.id][x]=this.textToCanvas(v,h.appearance.text.size,x,S,T,h.appearance.text.foregroundColor,h.appearance.text.backgroundColor)}),h.dimensions={width:Math.ceil(S/o),height:Math.ceil(T/o)},h.currentStrategyIndex===-1&&(h.currentStrategyIndex=0);let b=h.strategies[h.currentStrategyIndex];if(b){b.onStrategySelected(h);let x=h.style;h.style=h.newStyle,h.newStyle=x}}h.visible&&(h.enabled||h.visibilityNeedsUpdate!==!1)&&(h.zoomProportion=n,this.draw(h,a,this.colliderContext))}this.dirty=!1},"update"));d(this,"processText",c((e,t,i,n,o)=>{let a=this.state.pixelRatio,{draw:u,maxWidth:l,maxHeight:p}=kM({text:e,size:t,pixelRatio:a,maxWidth:i,maxLines:n,lineHeight:o});return{textDrawFn:u,width:l+Vu*a*2,height:p+Vu*a*2}},"processText"));d(this,"textToCanvas",c((e,t,i,n,o,a,u)=>{let l=this.state.pixelRatio,p,h=n,y=o;window.OffscreenCanvas!=null&&!Z0()?p=new OffscreenCanvas(h,y):(p=document.createElement("canvas"),p.width=h,p.height=y,p.style.width=h+"px",p.style.height=y+"px");let g=p.getContext("2d",{willReadFrequently:!0});if(!g)return;g.textAlign=i,g.font="bold ".concat(t*l,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),g.textBaseline="middle",g.lineJoin="miter",g.miterLimit=2,g.strokeStyle="white",g.lineWidth=Vu*l,g.fillStyle=a,g.strokeStyle=u;let v=i==="left"?0:i==="center"?h/2:h-Vu*l/2;return e(g,v,(y+Vu*l/2)/2),p},"textToCanvas"));d(this,"cacheImage",c(e=>{if(!e.appearance.marker.icon)return;let t=X7(e.appearance.marker.icon);if(e.imageHash=t,!this.imagePromiseCache[t]){let i=FM(e.appearance.marker.icon);i.onload=()=>{this.imagePromiseCache[t]=i}}},"cacheImage"));d(this,"createPinCanvas",c((e,t,i,n)=>{let o,a=this.state.pixelRatio,u=e.totalMarkerSize*2*a;window.OffscreenCanvas!=null?o=new OffscreenCanvas(u,u):(o=document.createElement("canvas"),o.width=u,o.height=u,o.style.width=u/a+"px",o.style.height=u/a+"px");let l=o.getContext("2d");return l.shadowColor="rgba(0,0,0,0.3)",l.shadowOffsetY=gk*a,l.shadowBlur=vk*a,l.beginPath(),l.arc(u/2,u/2,t/2+yk*a/2,0,2*Math.PI),l.fillStyle=i,l.fill(),l.beginPath(),l.arc(u/2,u/2,t/2,0,2*Math.PI),l.shadowColor="transparent",l.fillStyle=n,l.fill(),o},"createPinCanvas"));d(this,"prepare",c((e,t,i)=>{let n=this.state.pixelRatio;i.lineWidth=4*n;let o=this.createPinCanvas(e,e.markerSize,e.appearance.marker.backgroundColor.active,e.appearance.marker.foregroundColor.active),a=this.createPinCanvas(e,e.iconVisible?e.markerSize:mk*n,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive);this.pinCache[t]=[o,a]},"prepare"));this.state=e,this.colliderCanvas=t,this.colliderContext=t.getContext("2d")}draw(e,t,i){if(!e.visible)return;i.save(),i.globalAlpha=e.opacity;let n=this.state.pixelRatio,o=e.projection.x*n,a=e.projection.y*n,u=e.style.pinVisibility===1?this.pinCache[t][0]:this.pinCache[t][1];if(i.drawImage(u,o-e.totalMarkerSize*n,a-e.totalMarkerSize*n),e.appearance.marker.icon&&e.iconVisible&&e.imageHash&&e.appearance.marker.iconSize&&this.imagePromiseCache[e.imageHash]){let l=this.imagePromiseCache[e.imageHash],p=(e.appearance.marker.iconSize-e.appearance.marker.iconPadding)*n,h=e.appearance.marker.iconFit,y=p,g=p,v="".concat(e.imageHash,"_").concat(h);if(this.imageDimensionsCache[v])y=this.imageDimensionsCache[v].width,g=this.imageDimensionsCache[v].height;else{let S=l.width*n,T=l.height*n;if(h==="contain"){let b=Math.sqrt(S**2+T**2),x=p/b;y=S*x,g=T*x}if(h==="cover"){let b=p/S,x=p/T,I=Math.max(b,x);y=S*I,g=T*I}}i.save(),i.beginPath(),i.arc(o,a,p/2,0,2*Math.PI),i.closePath(),i.clip(),i.drawImage(l,o-y/2,a-g/2,y,g),i.restore()}e.style.textLabelVisible&&e.style.textAlign!=null&&e.style.left&&e.style.top&&i.drawImage(this.textCache[e.id][e.style.textAlign],o+e.style.left*n,a+e.style.top*n),i.restore()}};c($v,"TwoDDrawSystem");var jf=$v;m();m();var po=class po{constructor(){d(this,"loader");this.loader=new qa}static getInstance(){return po.instance||(po.instance=new po),po.instance}getLoader(){return this.loader}};c(po,"TextureLoaderSingleton"),d(po,"instance");var Jv=po,ho=Jv.getInstance();function bk(r,e){let t=r.components[2],i=r.components[1];return t!=null&&t.hover?[i.hoverColor||e,i.hoverColor||e]:[i.color,i.topColor||i.color]}c(bk,"processColor");var ju,Kv,Qv=class Qv extends ${constructor(t){super();M(this,ju);d(this,"state");d(this,"textureLoadingCache",new Map);this.state=t}setShading(t,i){t.material&&t.material.setGradientShading(i.start,i.end,i.intensity)}processTextures(t,i,n){i.texture!==t.texture&&i.texture!==""&&V(this,ju,Kv).call(this,i.texture,t,"texture"),i.topTexture!==t.topTexture&&i.topTexture!==""&&V(this,ju,Kv).call(this,i.topTexture,t,"topTexture"),(t.texture!=null||t.topTexture!=null)&&(n!=null&&n.hover&&t.texturesVisible?t.hideTextures():t.texturesVisible||t.showTextures(),i.texture===""&&t.removeSideTexture(),i.topTexture===""&&t.removeTopTexture())}update(){var a,u,l,p;let t,i,n,o;for(let h of this.state.geometry3DIdsInScene)if(o=this.state.geometry3DMap.get(h),o instanceof rt&&o.type==="geometry-group"){if(i=o.components[0],o.userData.shadingDirty){let y=o.userData.entities3D.values().next().value,g=this.state.geometry3DMap.get(y);g instanceof xe&&(g.type==="geometry"||g.type==="custom-geometry")&&(t=g.components[0],o.userData.shadingDirty&&i.shading&&this.setShading(t,i.shading));let v,S;for(let T of o.userData.entities3D.values())v=this.state.geometry3DMap.get(T),S=v.components[0],v.type==="geometry"&&S.detached&&o.userData.shadingDirty&&i.shading&&this.setShading(S,i.shading);o.userData.shadingDirty=!1}if(i.dirty){let y=ao(o);y&&y.material instanceof td&&(y.material.color.set(_v(i.color)),y.material.needsUpdate=!0);let g=o.getfirstChildEntityId();if(g){let v=this.state.geometry3DMap.get(g),S=v==null?void 0:v.components[0];S instanceof Ie&&this.processTextures(S,i)}i.dirty=!1}}else if(o instanceof xe&&(o.type==="geometry"||o.type==="custom-geometry")&&((a=o.components[1])!=null&&a.dirty||(u=o.components[2])!=null&&u.dirty)){t=o.components[0],i=o.components[1],n=o.components[2];let y=bk(o,this.state.hoverColor);t.setColor(y[0],y[1]),i.visible!==t.visible&&(t.visible=i.visible),i.altitude!==t.altitude&&(t.altitude=i.altitude),i.opacity!==t.opacity&&(t.opacity=i.opacity),i.dirty=!1,this.processTextures(t,i,n),o.components[2]&&(o.components[2].dirty=!1)}else(o==null?void 0:o.type)==="model"&&((l=o.components[1])!=null&&l.dirty)?(t=o.components[0],i=o.components[1],i.opacity!==t.opacity&&(t.opacity=i.opacity),i.dirty=!1):(o==null?void 0:o.type)==="image"&&((p=o.components[1])!=null&&p.dirty)&&(t=o.components[0],i=o.components[1],i.visible!==t.visible&&(t.visible=i.visible),i.dirty=!1)}destroy(){this.textureLoadingCache.forEach(async t=>{(await t).dispose()}),this.textureLoadingCache.clear()}};ju=new WeakSet,Kv=c(async function(t,i,n){if(!(!t||!i.showTextures))if(this.textureLoadingCache.has(t)){n==="topTexture"?i.topTexture=await this.textureLoadingCache.get(t):i.texture=await this.textureLoadingCache.get(t),i.showTextures();return}else{let o=new Promise((a,u)=>{ho.getLoader().load(t,l=>{n==="topTexture"?i.topTexture=l:i.texture=l,i.showTextures(),this.publish("texture-loaded"),a(l)},void 0,()=>{L.error("Failed to load texture: ".concat(t)),u("Failed to load texture: ".concat(t))})});this.textureLoadingCache.set(t,o)}},"#loadTexture"),c(Qv,"DrawSystem");var Hf=Qv;m();var eb=class eb extends ${constructor(t){super();d(this,"state");d(this,"animating",new Map);d(this,"isAnimating",!1);d(this,"startTime",-1);d(this,"showDuration",300);d(this,"hideDuration",250);d(this,"update",c(()=>{this.animating.clear();let t,i;for(let n of this.state.geometry2DIdsInScene)t=this.state.geometry2DMap.get(n),t&&(i=t.components[0],i instanceof Ti&&(i.visibilityNeedsUpdate==="show"?(i.visible=!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")},"update"));d(this,"playAnimations");this.state=t,this.playAnimations=this._playAnimations}_playAnimations(){let t=performance.now();for(let[i,[n,o]]of this.animating.entries()){let a=o===1?this.showDuration:this.hideDuration,u=(t-this.startTime)/a;i.opacity=xr(u,0,1,n,o,o===0?Q0:Y7),t-this.startTime>=a&&(o===1?i.visible=!0:o===0&&(i.visible=!1),i.visibilityNeedsUpdate=!1,this.animating.delete(i))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};c(eb,"TwoDVisibilitySystem");var Uf=eb;m();var tb=class tb extends ${constructor(t,i,n,o,a,u,l){super();d(this,"state");d(this,"renderer");d(this,"mode");d(this,"scene");d(this,"cameraObject");d(this,"viewCamera");d(this,"systems");d(this,"twoDdirty",!0);d(this,"threeDdirty",!0);d(this,"frameId",null);d(this,"twoDFrameId",null);d(this,"animationFrameId",null);d(this,"nextFrame",null);d(this,"update",c((t=!1)=>{var i;if(((i=this.renderer)==null?void 0:i.renderer)!=null)if(t)this.commitRenderState(),this.paint();else{if(this.frameId)return;this.frameId=requestAnimationFrame(()=>{var n;((n=this.renderer)==null?void 0:n.renderer)!=null&&this.mode==="standalone"&&(this.commitRenderState(),this.paint())})}},"update"));d(this,"animate2D",c(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));d(this,"drawEntities2D",c(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getZoomScaledMin(),this.systems.cameraSystem.getZoomScaledMax())}))},"drawEntities2D"));d(this,"updateEntities2D",c(()=>{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())})},"updateEntities2D"));d(this,"commitRenderState",c(()=>{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(),J0(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(),$0(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()),this.systems.polygonLabelSystem.update(this.systems.cameraSystem.getRotation()),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.drawSystem.update(),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.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1},"commitRenderState"));this.renderer=t,this.state=i,this.mode=n,this.scene=o,this.cameraObject=a,this.viewCamera=u,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 t;(t=this.renderer)!=null&&t.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)}};c(tb,"RenderSystem");var Wf=tb;m();var rb=class rb{constructor(e){d(this,"rendererState");this.rendererState=e}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(t),e instanceof Xe&&e.components[0]){let i=e.components[0];if(i.dirty){for(let n of e.children)(n instanceof rt||n instanceof Xe)&&(n.userData.entityId!==e.components[0].activeId?n.setVisible(!1):n.setVisible(!0));i.dirty=!1}}}};c(rb,"StackSystem");var Xf=rb;m();m();m();var Ne=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 e=1.70158;return r===1?1:r*r*((e+1)*r-e)},Out:function(r){var e=1.70158;return r===0?0:--r*r*((e+1)*r+e)+1},InOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)}}),Bounce:Object.freeze({In:function(r){return 1-Ne.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?Ne.Bounce.In(r*2)*.5:Ne.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(e){return Math.pow(e,r)},Out:function(e){return 1-Math.pow(1-e,r)},InOut:function(e){return e<.5?Math.pow(e*2,r)/2:(1-Math.pow(2-e*2,r))/2+.5}}}}),Hu=c(function(){return performance.now()},"now"),nb=function(){function r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return c(r,"Group"),r.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];for(var n=0,o=t;n<o.length;n++){var a=o[n];(e=a._group)===null||e===void 0||e.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},r.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=0,n=e;i<n.length;i++){var o=n[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},r.prototype.update=function(e,t){e===void 0&&(e=Hu()),t===void 0&&(t=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var o=this._tweens[i[n]],a=!t;o&&o.update(e,a)===!1&&!t&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),gl={Linear:function(r,e){var t=r.length-1,i=t*e,n=Math.floor(i),o=gl.Utils.Linear;return e<0?o(r[0],r[1],i):e>1?o(r[t],r[t-1],t-i):o(r[n],r[n+1>t?t:n+1],i-n)},Bezier:function(r,e){for(var t=0,i=r.length-1,n=Math.pow,o=gl.Utils.Bernstein,a=0;a<=i;a++)t+=n(1-e,i-a)*n(e,a)*r[a]*o(i,a);return t},CatmullRom:function(r,e){var t=r.length-1,i=t*e,n=Math.floor(i),o=gl.Utils.CatmullRom;return r[0]===r[t]?(e<0&&(n=Math.floor(i=t*(1+e))),o(r[(n-1+t)%t],r[n],r[(n+1)%t],r[(n+2)%t],i-n)):e<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):e>1?r[t]-(o(r[t],r[t],r[t-1],r[t-1],i-t)-r[t]):o(r[n?n-1:0],r[n],r[t<n+1?t:n+1],r[t<n+2?t:n+2],i-n)},Utils:{Linear:function(r,e,t){return(e-r)*t+r},Bernstein:function(r,e){var t=gl.Utils.Factorial;return t(r)/t(e)/t(r-e)},Factorial:function(){var r=[1];return function(e){var t=1;if(r[e])return r[e];for(var i=e;i>1;i--)t*=i;return r[e]=t,t}}(),CatmullRom:function(r,e,t,i,n){var o=(t-r)*.5,a=(i-e)*.5,u=n*n,l=n*u;return(2*e-2*t+o+a)*l+(-3*e+3*t-2*o-a)*u+o*n+e}}},BM=function(){function r(){}return c(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),ib=new nb,dt=function(){function r(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ne.Linear.None,this._interpolationFunction=gl.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=BM.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof t=="object"?(this._group=t,t.add(this)):t===!0&&(this._group=ib,ib.add(this))}return c(r,"Tween"),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(e,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},r.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},r.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},r.prototype.start=function(e,t){if(e===void 0&&(e=Hu()),t===void 0&&(t=!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=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var o in this._valuesEnd)n[o]=this._valuesEnd[o];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},r.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},r.prototype._setupProperties=function(e,t,i,n,o){for(var a in i){var u=e[a],l=Array.isArray(u),p=l?"array":typeof u,h=!l&&Array.isArray(i[a]);if(!(p==="undefined"||p==="function")){if(h){var y=i[a];if(y.length===0)continue;for(var g=[u],v=0,S=y.length;v<S;v+=1){var T=this._handleRelativeValue(u,y[v]);if(isNaN(T)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}g.push(T)}h&&(i[a]=g)}if((p==="object"||l)&&u&&!h){t[a]=l?[]:{};var b=u;for(var x in b)t[a][x]=b[x];n[a]=l?[]:{};var y=i[a];if(!this._isDynamic){var I={};for(var x in y)I[x]=y[x];i[a]=y=I}this._setupProperties(b,t[a],y,n[a],o)}else(typeof t[a]>"u"||o)&&(t[a]=u),l||(t[a]*=1),h?n[a]=i[a].slice().reverse():n[a]=t[a]||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(e){return e===void 0&&(e=Hu()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},r.prototype.resume=function(e){return e===void 0&&(e=Hu()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},r.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},r.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},r.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},r.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},r.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},r.prototype.easing=function(e){return e===void 0&&(e=Ne.Linear.None),this._easingFunction=e,this},r.prototype.interpolation=function(e){return e===void 0&&(e=gl.Linear),this._interpolationFunction=e,this},r.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},r.prototype.onStart=function(e){return this._onStartCallback=e,this},r.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},r.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},r.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},r.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},r.prototype.onStop=function(e){return this._onStopCallback=e,this},r.prototype.update=function(e,t){var i=this,n;if(e===void 0&&(e=Hu()),t===void 0&&(t=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(t)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<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 a=e-this._startTime,u=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),l=this._duration+this._repeat*u,p=c(function(){if(i._duration===0||a>l)return 1;var T=Math.trunc(a/u),b=a-T*u,x=Math.min(b/i._duration,1);return x===0&&a===i._duration?1:x},"calculateElapsedPortion"),h=p(),y=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,y),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||a>=this._duration)if(this._repeat>0){var g=Math.min(Math.trunc((a-this._duration)/u)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=g);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=u*g,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var v=0,S=this._chainedTweens.length;v<S;v++)this._chainedTweens[v].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(e,t,i,n){for(var o in i)if(t[o]!==void 0){var a=t[o]||0,u=i[o],l=Array.isArray(e[o]),p=Array.isArray(u),h=!l&&p;h?e[o]=this._interpolationFunction(u,n):typeof u=="object"&&u?this._updateProperties(e[o],a,u,n):(u=this._handleRelativeValue(a,u),typeof u=="number"&&(e[o]=a+(u-a)*n))}},r.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},r.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],i=this._valuesEnd[e];typeof i=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(i):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},r.autoStartOnUpdate=!1,r}();var tie=BM.nextId,wi=ib,rie=wi.getAll.bind(wi),iie=wi.removeAll.bind(wi),nie=wi.add.bind(wi),oie=wi.remove.bind(wi),aie=wi.update.bind(wi);m();m();m();var RM=c((r,e)=>(e-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),NM=c((r,e)=>new te(r.clientX-e.offsetLeft,r.clientY-e.offsetTop),"getTouchPos"),ob=c((r,e)=>Math.atan2(e.y-r.y,e.x-r.x),"angle"),Uu=c((r,e)=>Math.sqrt((e.y-r.y)**2+(e.x-r.x)**2),"distance"),ab=c((r,e)=>new te((r.x+e.x)/2,(r.y+e.y)/2),"average"),sb=c(r=>{let e=0,{wheelDelta:t,detail:i}=r;return t!==void 0?e=t:i!==void 0&&(e=-i),e},"getScrollDelta");var lb=class lb{constructor(e,t){d(this,"input1");d(this,"input2");d(this,"lastAngle");d(this,"lastDistance");d(this,"totalDistance");d(this,"first");d(this,"second");this.input1=e,this.input2=t,this.lastAngle=ob(e,t),this.lastDistance=Uu(e,t),this.totalDistance=0,this.first=e,this.second=t}update(e,t){let i=Uu(e,t);this.input1=e,this.input2=t;let n=ob(e,t);this.lastAngle=n,this.lastDistance=i,this.totalDistance+=(Uu(this.first,e)+Uu(this.second,t))/2,this.first=ab(this.first,e),this.second=ab(this.second,t)}};c(lb,"InputSet");var Yf=lb;m();var cb=class cb{constructor(e,t,i){d(this,"touch");d(this,"camera");d(this,"cameraPlane");d(this,"viewCoordinate");d(this,"snapHolderMatrix");d(this,"snapCamera");d(this,"cameraPosition");d(this,"raycaster");d(this,"worldCoordinate");d(this,"snapshotted",!1);this.touch=e,this.camera=t,this.cameraPlane=i,this.viewCoordinate={x:e.x,y:e.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 e=new te(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new ei,this.raycaster.setFromCamera(e,this.snapCamera);let t=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=t&&t.length>0?t[0].point:null,this.snapshotted=!0}updateAnchorState(e,t){this.camera=e,this.snapCamera=e.clone(),this.snapHolderMatrix=e.matrixWorld.clone(),this.updateViewCoordinate(t),this.snapshotCameraState()}updateViewCoordinate(e){this.viewCoordinate={x:e.x,y:e.y}}reUnproject(){var i,n;let e=new te(this.viewCoordinate.x,this.viewCoordinate.y);(i=this.raycaster)==null||i.setFromCamera(e,this.snapCamera);let t=(n=this.raycaster)==null?void 0:n.intersectObject(this.cameraPlane,!0)[0];return t?t.point:void 0}};c(cb,"TouchAnchor");var Wu=cb;var jr={};R8(jr,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>Ck,CLIPPING_RADIUS:()=>Xu,CONTROL_OPTIONS:()=>zf,DEFAULT_BEARING:()=>Pk,DEFAULT_MAX_ZOOM_LEVEL:()=>Mk,DEFAULT_MIN_ZOOM_LEVEL:()=>fb,DEFAULT_PITCH:()=>Tk,DEFAULT_ZOOM_LEVEL:()=>Sk,EVENTS:()=>Jf,MAPLIBRE_TILE_SIZE:()=>Zf,MAX_LAT:()=>pb,MAX_MERCATOR_ZOOM_LEVEL:()=>$f,MIN_LAT:()=>ub,MIN_MERCATOR_ZOOM_LEVEL:()=>qf,ROOM_MERCATOR_ZOOM_LEVEL:()=>xk,TWO_PI:()=>db,WHEEL_ZOOM_MULTIPLIER:()=>hb,ZRANGE:()=>vl});m();var Zf=512,ub=-85.051129,pb=85.051129,Xu=1e4,zf={chain:"chain",cancel:"cancel"},db=Math.PI*2,vl=100,hb=1e4,qf=0,$f=24,Ck=17,xk=20,Jf=["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"],Sk=18,fb=12,Mk=22,Tk=0,Pk=0;var Kf=!1,Ik=!1;var Qf,em=class em extends ${constructor(t,i,n,o,a){super();d(this,"dirty",!1);d(this,"zoomDirty",!1);d(this,"rotationDirty",!1);M(this,Qf,fb);d(this,"zoomSpeed",5);d(this,"rotateSpeed",100);d(this,"enabled",!0);d(this,"enableZoom",!0);d(this,"enablePan",!0);d(this,"enablePedestal",!1);d(this,"maxPedestal",1/0);d(this,"minPedestal",0);d(this,"enableRotate",!0);d(this,"minZoomAltitude",0);d(this,"maxZoomAltitude",1/0);d(this,"ignoreZoomLimits",!1);d(this,"zoomFactor",1);d(this,"panBounds",{min:new q(1/0,1/0),max:new q(-1/0,-1/0),center:new q(0,0,0),radius:1/0});d(this,"minTilt",0);d(this,"maxTilt",1.2);d(this,"MOUSE_BUTTONS",{ORBIT:Kp.RIGHT,ZOOM:Kp.MIDDLE,PAN:Kp.LEFT});d(this,"camera");d(this,"scene");d(this,"renderer");d(this,"elevation");d(this,"orbit");d(this,"cameraPlane");d(this,"raycaster",new ei);d(this,"rendererState");d(this,"options");d(this,"state",-1);d(this,"intersection");d(this,"viewState",null);d(this,"tweens",new Map);d(this,"clock",new V2(!0));d(this,"coords",{mouse:new te,rotateStart:new te,rotateEnd:new te,rotateDelta:new te,panStart:new q,panCameraStart:new q,panEnd:new q,panDelta:new q,initialShiftPos:new te,initialPedestal:0,floorAnchor:new q});d(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});d(this,"scrollTimer",null);d(this,"lastWheelTime",0);d(this,"resetZoom",!1);d(this,"zoomStart");d(this,"pedestalScaleFactor",1);d(this,"isUserZooming",!1);d(this,"stayInsideBounds",!0);d(this,"userInteracting",!1);d(this,"raycastToFloor",c(t=>{this.raycaster.setFromCamera(t,this.camera);let i=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return i?i.point:new q},"raycastToFloor"));d(this,"isUserInteracting",c(()=>this.userInteracting,"isUserInteracting"));d(this,"getPosition",c(()=>new q(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));d(this,"getPedestal",c(()=>this.orbit.position.z,"getPedestal"));d(this,"pan",c((t,i)=>{isNaN(t)||isNaN(i)||(this.setPosition(this.orbit.position.x+t,this.orbit.position.y+i),this.publish("position-updated"))},"pan"));d(this,"postRender",c(()=>{(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"))},"postRender"));d(this,"isCameraMoving",c(()=>this.state!==-1,"isCameraMoving"));d(this,"setPosition",c((t,i)=>{t===void 0||i===void 0||isNaN(t)||isNaN(i)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(t,i),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));d(this,"updateCameraPosition",c((t,i)=>{let n=t-this.panBounds.center.x,o=i-this.panBounds.center.y,a=Math.sqrt(n*n+o*o);if(this.stayInsideBounds&&a>this.panBounds.radius){let u=Math.atan2(o,n),l={x:Math.cos(u)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(u)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=l.x,this.orbit.position.y=l.y}else this.orbit.position.x=t,this.orbit.position.y=i},"updateCameraPosition"));d(this,"tilt",c(t=>{if(isNaN(t))return;this.state===-1&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(t+this.getTilt(),this.maxTilt),this.minTilt):t+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")},"tilt"));d(this,"zoomIn",c((t,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o/1.5},t,i,n)},"zoomIn"));d(this,"zoomOut",c((t,i,n)=>{let o=this.getZoomAltitude();this.animateCamera({zoom:o*1.5},t,i,n)},"zoomOut"));d(this,"getRotation",c(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));d(this,"cancelAnimation",c(()=>{let t=Array.from(this.tweens.keys()),i=t[t.length-1];i.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(i)},"cancelAnimation"));d(this,"animateCamera",c((t,i,n,o,a,u)=>{let l={mode:zf.cancel,...u},p={},h={},y=this.getPosition();if(t.position!=null&&(t.position.x!==void 0&&(p.x=y.x,h.x=t.position.x),t.position.y!==void 0&&(p.y=y.y,h.y=t.position.y),t.position.z!==void 0&&(p.z=y.z,h.z=t.position.z)),t.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=t.zoom:h.zoom=Math.min(Math.max(t.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),t.rotation!==void 0){let E=p.rotation=this.getRotation(),w=t.rotation%(2*Math.PI),_=w-E;if(Math.abs(_)>Math.PI){let D=_<0?1:-1;h.rotation=w+2*Math.PI*D}else h.rotation=w}t.tilt!==void 0&&(p.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?h.tilt=t.tilt:h.tilt=Math.max(Math.min(t.tilt,this.maxTilt),this.minTilt));let g=p.zoom!==h.zoom,v=p.rotation!==h.rotation,S=p.tilt!==h.tilt,T=new dt(p).to(h,C.env.TESTING?0:i).onUpdate(E=>{this.setMulti({x:E.x,y:E.y,z:E.z},E.zoom,E.rotation,E.tilt)}).onComplete(()=>{this.completeTween(T),this.publish("multi-end",{zooming:g,rotating:v,tilting:S}),o&&o()}).onStart(()=>{this.state!==7&&(this.state=7,T.state=7,this.publish("multi-start",{zooming:g,rotating:v,tilting:S})),this.publish("change")});this.rendererState.tweenGroup.add(T);let b=Array.from(this.tweens.entries()),x=b[b.length-1],I=!1;return x!=null&&(l.mode===zf.chain?(I=!0,x[0].chain(T)):(typeof x[1]=="function"&&x[1](),this.completeTween(x[0]))),this.tweens.set(T,a),n?T.easing(n):T.easing(Ne.Quadratic.In),!t.doNotAutoStart&&!I&&(T.start(),this.publish("change")),T.cameraAnimation=!0,T},"animateCamera"));d(this,"setMulti",c((t,i,n,o,a=!0)=>{this.state===-1&&this.publish("multi-start");let u=!1;t!=null&&(t.x!==void 0&&!isNaN(t.x)&&t.y!==void 0&&!isNaN(t.y)&&(this.updateCameraPosition(t.x,t.y),u=!0),t.z!==void 0&&!isNaN(t.z)&&(this.setPedestal(t.z,!0),u=!0)),u&&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>Xu&&(this.camera.near=i-Xu,this.camera.far=i+Xu):(this.camera.near=i/vl,this.camera.far=i*vl),this.camera.updateProjectionMatrix())}if(n!==void 0&&!isNaN(n)&&n!==this.getRotation()&&(l.rotating=!0,this.orbit.rotation.z=-n,this.publish("rotation-updated")),o!==void 0&&!isNaN(o)){let p=this.stayInsideBounds?Math.max(Math.min(o,this.maxTilt),this.minTilt):o;p!==this.elevation.rotation.x&&(l.tilting=!0,this.elevation.rotation.x=p,this.publish("tilt-updated"))}a&&this.publish("change"),this.state===-1&&this.publish("multi-end",l)},"setMulti"));d(this,"getZoomScaledMin",c(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));d(this,"getZoomScaledMax",c(()=>{let t=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,t)},"getZoomScaledMax"));d(this,"setRotation",c((t,i)=>{if(isNaN(t))return;this.state===-1&&!i&&this.publish("rotate-start");let n=-(t%db);n!==this.orbit.rotation.z&&(this.orbit.rotation.z=n,i||this.publish("rotation-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0},"setRotation"));d(this,"setZoomAltitude",c(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let i=this.stayInsideBounds?Math.min(Math.max(t,this.getZoomScaledMin()),this.getZoomScaledMax()):t;i!==this.camera.position.z&&(this.camera.position.z=i,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=i/vl,this.camera.far=i*vl,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));d(this,"setZoomLevel",c(t=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(t))},"setZoomLevel"));d(this,"getZoomAltitude",c(()=>this.camera.position.z,"getZoomAltitude"));d(this,"getZoomLevel",c(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));d(this,"setTilt",c((t,i)=>{if(isNaN(t))return;this.state===-1&&!i&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(t,this.maxTilt),this.minTilt):t;n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,i||this.publish("tilt-updated")),i||this.publish("change"),this.state===-1&&!i&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));d(this,"getTilt",c(()=>this.elevation.rotation.x,"getTilt"));d(this,"setCameraPlaneElevation",c(t=>{this.cameraPlane.position.z=t},"setCameraPlaneElevation"));d(this,"zoom",c(t=>{if(isNaN(t))return;this.state===-1&&this.publish("zoom-start");let i=this.getZoomAltitude()-t;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")},"zoom"));d(this,"getProjectionScaleFactor",c((t,i,n)=>ev(t,i,n),"getProjectionScaleFactor"));d(this,"update",c(()=>{this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));d(this,"setPedestal",c((t,i=!1)=>{typeof t=="number"&&!isNaN(t)&&(this.orbit.position.z=t,i&&(this.publishPedestalChangeEvent(t),this.publish("pedestal-change",{pedestal:t})),this.publish("change"),this.dirty=!0)},"setPedestal"));d(this,"dispose",c(()=>{for(let t of Jf)t.endsWith("start")?this.off(t,this.setUserInteracting):t.endsWith("end")&&this.off(t,this.unsetUserInteracting);this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));d(this,"createCameraPlane",c(()=>{let t=Kf?2e3:1e10,i=Kf?100:1,n=new Mr(t,t,i,i),o=new Zt({color:0,wireframe:Kf,visible:Kf}),a=new Te(n,o);return this.scene.add(a),a},"createCameraPlane"));d(this,"addEventListeners",c(()=>{let{domElement:t}=this.renderer;for(let i of Jf)i.endsWith("start")?this.on(i,this.setUserInteracting):i.endsWith("end")&&this.on(i,this.unsetUserInteracting);t.addEventListener("contextmenu",this.onContextMenu,!1),t.addEventListener("mousedown",this.onMouseDown,!1),t.addEventListener("wheel",this.onMouseWheel,{passive:!1}),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));d(this,"addMouseEventListeners",c(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));d(this,"addMouseMoveEventListeners",c(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));d(this,"removeMouseMoveEventListeners",c(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));d(this,"removeEventListeners",c(()=>{let{domElement:t}=this.renderer;t.removeEventListener("contextmenu",this.onContextMenu,!1),t.removeEventListener("mousedown",this.onMouseDown,!1),t.removeEventListener("wheel",this.onMouseWheel,!1),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));d(this,"removeMouseUpEventListeners",c(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));d(this,"onContextMenu",c(t=>{t.preventDefault()},"onContextMenu"));d(this,"onMouseUp",c(()=>{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}},"onMouseUp"));d(this,"onMouseMove",c(t=>{if(this.enabled!==!1)if(t.preventDefault(),this.mouseToScene(t),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t)}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(t)},"onMouseMove"));d(this,"onTouchStart",c(t=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(t),t.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(t),this.state=9):this.enablePan&&(this.handleTouchStartPan(t),this.state=6);break;case 2:this.touch.inputs=new Yf(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));d(this,"onTouchMove",c(t=>{if(this.enabled!==!1)switch(this.touchToScene(t),t.touches.length){case 2:t.preventDefault(),t.stopPropagation();let i={...this.touch.inputs.first},n={...this.touch.inputs.second},o=new te(this.touch.touches[0].x,this.touch.touches[0].y),a=new te(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(t);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let u=i.y<o.y&&n.y<a.y,l=i.y>o.y&&n.y>a.y;this.enableRotate&&this.state!==4&&(l||u)?(this.handleTouchStartTilt(t),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(t.preventDefault(),t.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(t):this.enablePan&&this.state===6&&this.handleTouchMovePan(t);break;default:this.state=-1}},"onTouchMove"));d(this,"onTouchEnd",c(t=>{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}t.touches.length?this.onTouchStart(t):this.state=-1}},"onTouchEnd"));d(this,"handleTouchMovePan",c(t=>{let i=Object.hasOwn(t,"x")?new te(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panEnd.set(n.x,n.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")},"handleTouchMovePan"));d(this,"handleTouchStartDolly",c(()=>{let t=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 n=new te(this.touch.touches[0].x-t/2,this.touch.touches[0].y-i/2);this.coords.floorAnchor=this.raycastToFloor(n),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Wu(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Wu(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")},"handleTouchStartDolly"));d(this,"handleMouseMovePan",c(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(t.x,t.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")},"handleMouseMovePan"));d(this,"handleTouchStartTilt",c(t=>{this.coords.rotateStart.set(t.touches[1].clientX,t.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));d(this,"handleTouchMovePedestal",c(t=>{this.handleMouseMovePedestal(t.touches[0])},"handleTouchMovePedestal"));d(this,"handleTouchMoveTilt",c(t=>{this.coords.rotateEnd.set(t.touches[1].clientX,t.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)},"handleTouchMoveTilt"));d(this,"handleTouchMoveDolly",c(()=>{let t=this.touch.inputs.first,i=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:t.x,y:t.y},this.touch.anchor2.viewCoordinate={x:i.x,y:i.y};let n=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);n&&this.setCameraFromTransformMatrix(n),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,t),this.touch.anchor2.updateAnchorState(this.camera,i)},"handleTouchMoveDolly"));d(this,"handleTouchEnd",c(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end")},"handleTouchEnd"));d(this,"handleTouchStartPan",c(t=>{let i=Object.hasOwn(t,"x")?new te(t.x,t.y):this.touch.touches[0],n=this.raycastToFloor(i);this.coords.panStart.set(n.x,n.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));d(this,"handleTouchStartPedestal",c(t=>{this.handleMouseDownPedestal(t.touches[0])},"handleTouchStartPedestal"));d(this,"onMouseDown",c(t=>{if(this.enabled!==!1){if(this.mouseToScene(t),t.preventDefault(),this.state===3&&this.publish("zoom-end"),t.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else t.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(t),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));d(this,"onMouseWheel",c(t=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(t.preventDefault(),t.stopPropagation(),this.mouseToScene(t),this.canScrollZoom(t)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(t)&&(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(t))},"onMouseWheel"));d(this,"handleMouseWheel",c(t=>{if(this.publish("zoom-start"),!this.canScrollZoom(t)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let i=this.getZoomAltitude(),n=i-sb(t)*i/hb*this.zoomSpeed;if(this.setZoomAltitude(n),this.enablePan){let o=n/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-o),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));d(this,"setCameraFromTransformMatrix",c(t=>{this.orbit.updateMatrixWorld();let i=new Ya;i.setFromRotationMatrix(t,"ZYX");let n=(t.elements[14]-this.cameraPlane.position.z)/Math.cos(i.x),o=i.z,a=new q(0,0,1);a.applyEuler(i),a.setLength(n);let u=new q;u.setFromMatrixPosition(t),u.sub(a),this.enablePan&&this.setPosition(u.x,u.y),this.enableZoom&&this.setZoomAltitude(n),this.enableRotate&&this.setRotation(-o)},"setCameraFromTransformMatrix"));d(this,"makeTransformFromTouchAnchors",c((t,i)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let n=this.camera.projectionMatrix.clone(),o=t.worldCoordinate,a=i.worldCoordinate,u=t.reUnproject(),l=i.reUnproject();if(!u||!l||!o||!a)return null;let p=t.viewCoordinate,h=i.viewCoordinate,y=a.x-o.x,g=a.y-o.y,v=Math.atan2(g,y),S=l.x-u.x,T=l.y-u.y,b=Math.atan2(T,S),x=RM(v,b),I=new ji;I.makeRotationZ(-x);let E=I.clone();E.multiply(t.snapHolderMatrix);let w=c((k8,F8,B8)=>k8.elements[(F8-1)*4+B8-1],"m"),_=w(n,1,1)*w(E,1,1)-p.x*w(n,3,4)*w(E,3,1),D=w(n,1,1)*w(E,1,2)-p.x*w(n,3,4)*w(E,3,2),B=w(n,1,1)*w(E,1,3)-p.x*w(n,3,4)*w(E,3,3),U=o.x*_+o.y*D+o.z*B,G=w(n,2,2)*w(E,2,1)-p.y*w(n,3,4)*w(E,3,1),j=w(n,2,2)*w(E,2,2)-p.y*w(n,3,4)*w(E,3,2),Y=w(n,2,2)*w(E,2,3)-p.y*w(n,3,4)*w(E,3,3),ce=o.x*G+o.y*j+o.z*Y,ge=w(n,1,1)*w(E,1,1)-h.x*w(n,3,4)*w(E,3,1),we=w(n,1,1)*w(E,1,2)-h.x*w(n,3,4)*w(E,3,2),Le=w(n,1,1)*w(E,1,3)-h.x*w(n,3,4)*w(E,3,3),qe=a.x*ge+a.y*we+a.z*Le,Wt=w(n,2,2)*w(E,2,1)-h.y*w(n,3,4)*w(E,3,1),Ae=w(n,2,2)*w(E,2,2)-h.y*w(n,3,4)*w(E,3,2),$e=w(n,2,2)*w(E,2,3)-h.y*w(n,3,4)*w(E,3,3),je=a.x*Wt+a.y*Ae+a.z*$e,Xt=Math.abs(ge-_),Ri=Math.abs(we-D),kt=Math.abs(Le-B),Yt=Math.abs(ge-G),So=Math.abs(we-j),Wa=Math.abs(Le-Y),de=Math.abs(Wt-_),be=Math.abs(Ae-D),ke=Math.abs($e-B),pr=Math.abs(Wt-G),Xa=Math.abs(Ae-j),jl=Math.abs($e-Y),qr=Math.min(Xt+Ri+kt,Yt+So+Wa),_n=Math.min(de+be+ke,pr+Xa+jl);qr<_n&&(ge=Wt,we=Ae,Le=$e,qe=je);let Hl=G*B-_*Y,Om=j*B-D*Y,y2=ce*B-U*Y,Lm=ge*Y-G*Le,Am=we*Y-j*Le,g2=qe*Y-ce*Le,_8=(g2*Om-y2*Am)/(Lm*Om-Hl*Am),D8=(g2*Hl-y2*Lm)/(Am*Hl-Om*Lm),v2=j*_-D*G,O8=Y*_-B*G,L8=ce*_-U*G,b2=we*G-j*ge,A8=Le*G-Y*ge,C2=((qe*G-ce*ge)*v2-L8*b2)/(A8*v2-O8*b2),Jp=E.clone();return Jp.elements[12]=_8,Jp.elements[13]=D8,Jp.elements[14]=C2,C2>0?Jp:null},"makeTransformFromTouchAnchors"));d(this,"updateTouchOrigin",c(()=>{let t=this.renderer.domElement;this.touch.origin.offsetLeft=t.getBoundingClientRect().left,this.touch.origin.offsetTop=t.getBoundingClientRect().top},"updateTouchOrigin"));d(this,"touchToScene",c(t=>{this.touch.touches=[];for(let i=0,n=t.touches.length;i<n;i++){let o=t.touches[i],a=NM(o,this.touch.origin);this.touch.touches.push(new te(a.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(a.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));d(this,"canScrollZoom",c(t=>{let i=sb(t),n=this.getZoomAltitude();return!(i<0&&n===this.getZoomScaledMax()||i>0&&n===this.getZoomScaledMin())},"canScrollZoom"));d(this,"mouseToScene",c(t=>{let i=this.getMousePos(t);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},"mouseToScene"));d(this,"getMousePos",c(t=>({x:t.offsetX,y:t.offsetY}),"getMousePos"));d(this,"handleMouseDownRotate",c(t=>{this.coords.rotateStart.set(t.clientX,t.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));d(this,"handleMouseDownPan",c(()=>{let t=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(t.x,t.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));d(this,"handleMouseDownPedestal",c(t=>{let i=new te(t.clientX,t.clientY);this.coords.initialShiftPos=i,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=ev(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));d(this,"handleMouseMovePedestal",c(t=>{let i={x:t.clientX,y:t.clientY},n=this.coords.initialPedestal+this.pedestalScaleFactor*(i.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(n<this.minPedestal?n=Math.max(n,this.minPedestal):n>this.maxPedestal&&(n=Math.min(n,this.maxPedestal))),n!==this.getPedestal()&&this.setPedestal(n,!0)},"handleMouseMovePedestal"));d(this,"handleMouseMoveRotate",c(t=>{this.coords.rotateEnd.set(t.clientX,t.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")},"handleMouseMoveRotate"));d(this,"publishUserZoomDebounced",so(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));d(this,"publishUserZoomEvent",c(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));d(this,"setUserInteracting",c(()=>{this.userInteracting=!0},"setUserInteracting"));d(this,"unsetUserInteracting",c(()=>{this.userInteracting=!1},"unsetUserInteracting"));d(this,"publishPedestalChangeEvent",c(t=>{this.publish("pedestal-change",{pedestal:t,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));d(this,"convertAltitudeToZoomLevel",c(t=>{let[,i]=this.center,o=t*2*Math.tan(ye.degToRad(this.camera.fov)/2)/this.options.canvasHeight,a=Math.cos(ye.degToRad(i))*2*Math.PI*ri/o;return ye.clamp(Math.log2(a/512),qf,$f)},"convertAltitudeToZoomLevel"));d(this,"convertZoomLevelToAltitude",c(t=>{let[,i]=this.center,n=ye.clamp(t,qf,$f),o=Math.pow(2,n),a=ye.clamp(i,ub,pb),u=o*512;return Math.cos(ye.degToRad(a))*Math.PI*2*ri/u*this.options.canvasHeight/2/Math.tan(ye.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));d(this,"completeTween",c(t=>{t.isPlaying()?t.stop():t.end(),this.rendererState.tweenGroup.remove(t),this.tweens.delete(t)},"completeTween"));d(this,"debugContainer",new mt);this.camera=t,this.renderer=n,this.rendererState=o,this.scene=i,this.options=a,this.elevation=t.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=t.position.z,a.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(t){this.minZoomAltitude=this.convertZoomLevelToAltitude(t)}get defaultMinZoomLevel(){return s(this,Qf)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(t){this.maxZoomAltitude=this.convertZoomLevelToAltitude(t)}get scrollPercent(){let t=this.minPedestal,i=this.maxPedestal,n=this.getPedestal();return n=Math.min(n,i),n=Math.max(n,t),(n-t)/(i-t)*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 o,a,u,l;let t=this.getPosition(),{lat:i,lon:n}=sf((a=(o=this.rendererState.center)==null?void 0:o[1])!=null?a:0,(l=(u=this.rendererState.center)==null?void 0:u[0])!=null?l:0,t.x,t.y);return[n,i]}setCenter(t,i){var a,u,l,p;let{x:n,y:o}=lf((u=(a=this.rendererState.center)==null?void 0:a[1])!=null?u:0,(p=(l=this.rendererState.center)==null?void 0:l[0])!=null?p:0,i,t);this.setPosition(n,o)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(t=>t.cameraAnimation)}focusOn(t,i){Ik&&(this.debugContainer&&Ye(this.debugContainer),t.forEach(b=>{let x=new Te(new Qp(2,2,2),new Zt({color:65280}));x.position.copy(b),this.debugContainer.add(x),this.scene.add(this.debugContainer)}));let n=i.curve,o=i.callback,a=i.cancelledCallback,u=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,y;i.duration!==void 0?y=i.duration:C.env.TESTING==="true"?y=0:y=200;let g=i.padding,v=this.getRotation(),S=this.getTilt();i.rotation!=null&&this.setRotation(i.rotation),i.tilt!=null&&this.setTilt(i.tilt);let T=wk(t,{canvasHeight:h,paddingOption:g,canvasWidth:p,minZoom:u,maxZoom:l,camera:this.camera,orbit:this.orbit,position:this.getPosition()});this.setRotation(v),this.setTilt(S),this.animateCamera({position:T.position,tilt:i.tilt,rotation:i.rotation,zoom:T.zoom},y,n,o,a)}resize(t,i){this.options.canvasWidth=t,this.options.canvasHeight=i}};Qf=new WeakMap,c(em,"CameraSystem"),d(em,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var bl=em;function wk(r,{canvasWidth:e,orbit:t,paddingOption:i,canvasHeight:n,minZoom:o,maxZoom:a,camera:u,position:l}){let p={zoom:o,position:l};if(r.length===0)return p;for(let _n of bl.CAMERA_FRAME_PADDING_SIDES)typeof i[_n]!="number"&&(i[_n]=0);let h=i.type==="portion"?{top:i.top*n,bottom:i.bottom*n,left:i.left*e,right:i.right*e,type:"pixel"}:i;if(h.left+h.right>=e||h.top+h.bottom>=n)return p;t.updateMatrixWorld();let y=u.matrixWorldInverse,g=u.fov*(Math.PI/180)/2,v=g,T=Math.atan(Math.tan(g)*(e/n)),b=new q(1/0,1/0,1/0),x=new q(-1/0,-1/0,-1/0),I=new Vi().setFromPoints(r),E;for(let _n=0,Hl=r.length;_n<Hl;_n++)E=r[_n].clone(),E.applyMatrix4(y),b.min(E),x.max(E);let w=x.x-b.x,_=x.y-b.y,D=e-h.left-h.right,B=n-h.top-h.bottom,U=(x.x+b.x)/2,G=(x.y+b.y)/2,j=w/D,Y=_/B,ce=o,ge=a,we=ce*Math.tan(T)*2,Le=ge*Math.tan(T)*2,qe=we/e,Wt=Le/e,Ae=Math.max(j,Y);Ae=ye.clamp(Ae,qe,Wt);let $e=D*Ae,je=B*Ae,Xt={min:{x:U-$e/2-h.left*Ae,y:G-je/2-h.bottom*Ae},max:{x:U+$e/2+h.right*Ae,y:G+je/2+h.top*Ae}},Ri=(Xt.min.x+Xt.max.x)/2,kt=(Xt.min.y+Xt.max.y)/2,Yt=I.getCenter(new q),So=Math.abs(Ri-Xt.min.x),Wa=Math.abs(kt-Xt.min.y),de=So/Math.tan(T),be=Wa/Math.tan(v),ke=new q;ke.set(Ri,kt,x.z+Math.max(de,be)),ke.applyMatrix4(u.matrixWorld);let pr=new q;pr.set(Ri,kt,x.z),pr.applyMatrix4(u.matrixWorld);let Xa=new q().subVectors(pr,ke),jl=(Yt.z-ke.z)/Xa.z,qr=new q().copy(ke).add(Xa.clone().multiplyScalar(jl));return pr.set(qr.x,qr.y,qr.z),ke.sub(pr),{position:qr,zoom:ke.length()}}c(wk,"getCameraFrameForPoints");m();var Ek=300,Yu,Zu,mb=class mb{constructor(e){d(this,"state");M(this,Yu,new q);M(this,Zu,new q);this.state=e}update(e){var n;let t,i;this.state.cameraObject.getWorldPosition(s(this,Zu));for(let o of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(o),t&&(i=t.components[0],i&&"containerEl"in i&&i.containerEl!=null)){if((i.visible===!0||((n=i.animation)==null?void 0:n.pending)===!0)&&!i.offscreen){t.object3d.getWorldPosition(s(this,Yu));let a=s(this,Zu).distanceTo(s(this,Yu));i.containerEl.style.transform="translate3D(".concat(i.projection.x,"px, ").concat(i.projection.y,"px, ").concat(-a,"px)")}i.visible===!0?i.containerEl.style.pointerEvents=e?"none":i.pointerEvents:i.containerEl.style.pointerEvents="none",i.visibilityNeedsUpdate!==!1&&!i.offscreen&&(i.animation&&i.animation.cancel(),i.visibilityNeedsUpdate==="show"?(i.containerEl.style.opacity="0",i.visible=!0):i.visible=!1,i.animation=i.containerEl.animate([{opacity:i.visible?"1":"0"}],{duration:Ek,easing:"ease-in-out",fill:"forwards"}),i.visibilityNeedsUpdate=!1)}}};Yu=new WeakMap,Zu=new WeakMap,c(mb,"DOMDrawSystem");var tm=mb;m();var yb=class yb{constructor(){d(this,"percentExpanded",0);d(this,"activeId","");d(this,"gap",20);d(this,"dirty",!0)}};c(yb,"StackComponent");var rm=yb;m();var gb=class gb extends ${constructor(t,i){super();d(this,"state");d(this,"dirty",!0);d(this,"domTree");d(this,"observers",new Map);d(this,"updateDimensions",c(t=>{t.forEach(i=>{let n=i.target,o=n.getAttribute("data-marker-id");if(o){let a=this.state.geometry2DMap.get(o);if(a&&a.components[0]instanceof Si&&n.firstElementChild){let{width:u,height:l}=n.firstElementChild.getBoundingClientRect();a.components[0].updateDimensions(u,l)}}}),this.publish("dimensions-update")},"updateDimensions"));this.state=t,this.domTree=i}setupObserver(){var i;if(this.observers){for(let n of this.observers.values())n.disconnect();this.observers.clear()}let t;for(let n of this.domTree.children){let o=n.getAttribute("data-marker-id");if(o!=null&&(t=this.state.geometry2DMap.get(o),(i=t.components[0].options)!=null&&i.dynamicResize)){let a=new ResizeObserver(this.updateDimensions);a.observe(n),this.observers.set(n.userData.entityId,a)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let t of this.observers.values())t.disconnect();this.observers.clear()}};c(gb,"DOMResizeSystem");var im=gb;m();var _k=0,Dk=90;function bn(r,e,t,i){return(r<e||r>t)&&L.warn(i),Math.min(t,Math.max(e,r))}c(bn,"clampWithWarning");var Cl={linear:Ne.Linear.None,"ease-in":Ne.Quadratic.In,"ease-out":Ne.Quadratic.Out,"ease-in-out":Ne.Quadratic.InOut},Z,re,xl,zu,Ei,vb=class vb{constructor(e,t,i,n){M(this,Z,void 0);M(this,re,void 0);M(this,xl,void 0);M(this,zu,void 0);M(this,Ei,void 0);P(this,Z,e),P(this,re,t),P(this,xl,i),P(this,zu,n),s(this,re).cameraSystem.on("pedestal-change",({pedestal:o})=>{s(this,Z).map&&(s(this,Z).map.transform.elevation=o,s(this,Z).map.transform.minElevationForCurrentTile=o,s(this,Z).map.triggerRepaint()),s(this,re).cameraSystem.setCameraPlaneElevation(o),s(this,zu).position.z=o})}get center(){return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?s(this,Z).map.getCenter().toArray():s(this,re).cameraSystem.center}setCenter(e){var t;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map){(t=s(this,Z).map)==null||t.setCenter(e),s(this,re).interactionSystem.handleHover();return}s(this,re).cameraSystem.setCenter(e[0],e[1]),s(this,re).interactionSystem.handleHover()}get zoomLevel(){var e;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(e=s(this,Z).map)==null?void 0:e.getZoom():s(this,re).cameraSystem.getZoomLevel()}setZoomLevel(e){var t;s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map&&((t=s(this,Z).map)==null||t.setZoom(e)),s(this,re).cameraSystem.setZoomLevel(bn(e,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 s(this,re).cameraSystem.isAnimating}cancelAnimation(){s(this,re).cameraSystem.cancelAnimation()}get maxZoomLevel(){return s(this,re).cameraSystem.maxZoomLevel}get minZoomLevel(){return s(this,re).cameraSystem.minZoomLevel}setAutoMinZoomLevel(e){s(this,re).panBoundsSystem.autoMinZoomLevel=e,e&&(s(this,re).panBoundsSystem.dirty=!0,s(this,re).panBoundsSystem.update())}get autoMinZoomLevel(){return s(this,re).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(e,t=!1){var n;t&&this.setAutoMinZoomLevel(!1);let i=bn(e,jr.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(jr.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));s(this,re).cameraSystem.setMinZoomLevel(i),this.zoomLevel<i&&this.setZoomLevel(i),(n=s(this,Z).map)==null||n.setMinZoom(i)}setMaxZoomLevel(e){var i;let t=bn(e,this.minZoomLevel,jr.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(jr.MAX_MERCATOR_ZOOM_LEVEL,"."));s(this,re).cameraSystem.setMaxZoomLevel(t),this.zoomLevel>t&&this.setZoomLevel(t),(i=s(this,Z).map)==null||i.setMaxZoom(t)}get maxPitch(){var e;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(e=s(this,Z).map)==null?void 0:e.getMaxPitch():ye.radToDeg(s(this,re).cameraSystem.maxTilt)}get minPitch(){var e;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(e=s(this,Z).map)==null?void 0:e.getMinPitch():ye.radToDeg(s(this,re).cameraSystem.minTilt)}setMinPitch(e){var i;let t=Math.max(_k,e);(i=s(this,Z).map)==null||i.setMinPitch(t),s(this,re).cameraSystem.minTilt=ye.degToRad(t)}setMaxPitch(e){var i;let t=Math.min(Dk,e);(i=s(this,Z).map)==null||i.setMaxPitch(t),s(this,re).cameraSystem.maxTilt=ye.degToRad(t)}get bearing(){var e;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(e=s(this,Z).map)==null?void 0:e.getBearing():ye.radToDeg(s(this,re).cameraSystem.getRotation())}setBearing(e){var t;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map){(t=s(this,Z).map)==null||t.setBearing(e);return}s(this,re).cameraSystem.setRotation(ye.degToRad(e))}get pitch(){var e;return s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(e=s(this,Z).map)==null?void 0:e.getPitch():ye.radToDeg(s(this,re).cameraSystem.getTilt())}setPitch(e){var t;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map){(t=s(this,Z).map)==null||t.setPitch(e);return}s(this,re).cameraSystem.setTilt(ye.degToRad(bn(e,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 s(this,re).cameraSystem.getPedestal()}setElevation(e){s(this,re).cameraSystem.setPedestal(e,!0)}animateElevation(e,t){return s(this,Ei)&&s(this,Ei).stop(),new Promise(i=>{P(this,Ei,new dt({elevation:this.elevation}).to({elevation:e},(t==null?void 0:t.duration)||300).easing(Cl[(t==null?void 0:t.easing)||"ease-in-out"]).onUpdate(({elevation:n})=>{this.setElevation(n)}).onComplete(()=>{s(this,Ei)&&s(this,Z).getTweenGroup().remove(s(this,Ei)),i()}).start()),s(this,Ei).cameraAnimation=!0,s(this,Z).getTweenGroup().add(s(this,Ei)),s(this,Z).render()})}get insetsPadding(){return s(this,xl).insetsPadding}get panMode(){return s(this,re).cameraSystem.enablePan===!1&&s(this,re).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&(e==="default"?(s(this,re).cameraSystem.enablePan=!0,s(this,re).cameraSystem.enablePedestal=!1):(s(this,re).cameraSystem.enablePan=!1,s(this,re).cameraSystem.enablePedestal=!0))}setInsetPadding(e){s(this,xl).insetsPadding=Object.assign({},Fu,e)}animateTo(e){var a;if(s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map)return(a=s(this,Z).map)==null||a.flyTo({center:e.center,zoom:e.zoomLevel,bearing:e.bearing,pitch:e.pitch,duration:e.duration}),Promise.resolve();let t=e.center?s(this,Z).convertTo3DMapPosition(e.center[1],e.center[0],e.center[2]||this.elevation):void 0,i=e.zoomLevel!==void 0?s(this,re).cameraSystem.convertZoomLevelToAltitude(bn(e.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,n=e.bearing!==void 0?ye.degToRad(e.bearing):void 0,o=e.pitch!==void 0?ye.degToRad(bn(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;return new Promise(u=>{s(this,re).cameraSystem.animateCamera({position:t,zoom:i,rotation:n,tilt:o},e.duration||0,Cl[e.easing||"ease-in-out"],()=>{s(this,re).interactionSystem.handleHover(),u()},u)})}focusOn(e,t){var i,n;return e==null||!Array.isArray(e)||e.length<=0?(L.error("focusOn coordinates are invalid:",e),Promise.resolve()):s(this,Z).mode==="outdoors-overlay"&&s(this,Z).map?(e.length===1?(i=s(this,Z).map)==null||i.flyTo({center:e[0],duration:(t==null?void 0:t.duration)||s(this,Z).map.getBearing(),animate:!0,bearing:(t==null?void 0:t.bearing)===void 0?s(this,Z).map.getBearing():t==null?void 0:t.bearing,pitch:(t==null?void 0:t.pitch)===void 0?s(this,Z).map.getPitch():t==null?void 0:t.pitch,zoom:(t==null?void 0:t.maxZoomLevel)||s(this,Z).map.getMaxZoom()}):(n=s(this,Z).map)==null||n.fitBounds(e,{duration:t==null?void 0:t.duration,animate:!0,bearing:(t==null?void 0:t.bearing)===void 0?s(this,Z).map.getBearing():t==null?void 0:t.bearing,pitch:(t==null?void 0:t.pitch)===void 0?s(this,Z).map.getPitch():t==null?void 0:t.pitch,zoom:(t==null?void 0:t.maxZoomLevel)||s(this,Z).map.getMaxZoom()}),s(this,re).interactionSystem.handleHover(),Promise.resolve()):new Promise(o=>{s(this,re).cameraSystem.focusOn(e.map(a=>s(this,Z).convertTo3DMapPosition(a[1],a[0],a[2]||0)),{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:s(this,re).cameraSystem.convertZoomLevelToAltitude(bn(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:s(this,re).cameraSystem.convertZoomLevelToAltitude(bn(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},Fu,t==null?void 0:t.padding):this.insetsPadding,curve:Cl[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:ye.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?ye.degToRad(bn(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,duration:t==null?void 0:t.duration,callback:()=>{s(this,re).interactionSystem.handleHover(),o()},cancelledCallback:o})})}};Z=new WeakMap,re=new WeakMap,xl=new WeakMap,zu=new WeakMap,Ei=new WeakMap,c(vb,"Camera");var nm=vb;m();var GM="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 VM="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}";m();var jM=4.291666666666667,HM=15,UM=25,WM=43/60;m();var XM=["horizontal","icon"],Ak=new Map([[XM[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>'],[XM[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>']]),kk=/<svg([^>]*)>/g;function YM(r,e,t,i){let n=Ak.get(r);return n?n.replace(kk,'<svg$1 width="'.concat(t,'" height="').concat(i,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(e,';">')):""}c(YM,"getLogoIcon");var ZM=!1,Se,Sl,Ml,ht,_t,Ea,Hr,_i,Ur,Di,bb=class bb extends ${constructor(t,i,n){super();M(this,Se,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:()=>{window!=null&&window.open("https://www.mappedin.com")},visible:!0});M(this,Sl,void 0);M(this,Ml,void 0);M(this,ht,void 0);M(this,_t,void 0);M(this,Ea,void 0);M(this,Hr,0);M(this,_i,0);M(this,Ur,0);M(this,Di,0);d(this,"dirty",!0);d(this,"getPositionAlignedCanvasCoordinates",c((t,i)=>({"top-left":{x:0,y:0},"top-right":{x:t,y:0},"bottom-left":{x:0,y:i},"bottom-right":{x:t,y:i},center:{x:t/2,y:i/2},top:{x:t/2,y:0},bottom:{x:t/2,y:i},left:{x:0,y:i/2},right:{x:t,y:i/2}})[s(this,Se).position],"getPositionAlignedCanvasCoordinates"));d(this,"getPositionAlignedPadding",c(()=>{var n,o,a,u;let t=s(this,Se).padding;if(typeof t=="number")return{"top-left":{x:t,y:t},"top-right":{x:-t,y:t},"bottom-left":{x:t,y:-t},"bottom-right":{x:-t,y:-t},center:{x:0,y:0},top:{x:0,y:t},bottom:{x:0,y:-t},left:{x:t,y:0},right:{x:-t,y:0}}[s(this,Se).position];let i={top:(n=t.top)!=null?n:0,right:(o=t.right)!=null?o:0,bottom:(a=t.bottom)!=null?a:0,left:(u=t.left)!=null?u:0};return{x:i.left-i.right,y:i.top-i.bottom}},"getPositionAlignedPadding"));P(this,Se,Object.assign({},s(this,Se),n)),P(this,Ml,t),P(this,Sl,i),P(this,Ur,i.canvasWidth),P(this,Di,i.canvasHeight)}get color(){return s(this,Se).color==="light"?"white":"#293136"}get iconName(){return s(this,Se).iconOnly?"icon":"horizontal"}get minWidth(){return s(this,Se).iconOnly?HM:75}get defaultWidth(){return s(this,Se).iconOnly?UM:150}get aspectRatio(){return s(this,Se).iconOnly?WM:jM}get options(){return{...s(this,Se)}}set options(t){P(this,Se,{padding:t.padding||s(this,Se).padding,position:t.position||s(this,Se).position,iconOnly:t.iconOnly||s(this,Se).iconOnly,color:t.color||s(this,Se).color,scale:t.scale||s(this,Se).scale,onClick:s(this,Se).onClick,visible:s(this,Se).visible})}get icon(){return YM(this.iconName,this.color,s(this,Hr)*s(this,Sl).pixelRatio,s(this,_i)*s(this,Sl).pixelRatio)}setSize(t,i){s(this,_t)&&(s(this,_t).uniforms.uSize.value.x=t,s(this,_t).uniforms.uSize.value.y=i)}setXY(t,i){s(this,_t)&&(s(this,_t).uniforms.uSize.value.w=t,s(this,_t).uniforms.uSize.value.z=i)}get width(){return s(this,Hr)}get height(){return s(this,_i)}getPositionAlignedOffset(t,i){return{"top-left":{x:0,y:0},"top-right":{x:-t,y:0},"bottom-left":{x:0,y:-i},"bottom-right":{x:-t,y:-i},center:{x:-(t/2),y:-(i/2)},top:{x:-(t/2),y:0},bottom:{x:-(t/2),y:-i},left:{x:0,y:-(i/2)},right:{x:-t,y:-(i/2)}}[s(this,Se).position]}show(){s(this,Se).visible=!0,this.dirty=!0}hide(){s(this,Se).visible=!1,s(this,ht)&&(s(this,Ml).remove(s(this,ht)),Ye(s(this,ht))),P(this,ht,void 0),s(this,_t)&&s(this,_t).dispose(),P(this,_t,void 0),P(this,Ea,void 0)}insertIntoQuadTree(t){s(this,Ea)!=null&&typeof s(this,Se).onClick=="function"&&t.insert(s(this,Ea))}resize(t,i){if(s(this,Se).visible!==!0)return;P(this,Ur,t),P(this,Di,i);let n=this.getPositionAlignedCanvasCoordinates(s(this,Ur),s(this,Di)),o=this.getPositionAlignedPadding(),a=this.getPositionAlignedOffset(s(this,Hr),s(this,_i)),u=Math.min(s(this,Ur)-s(this,Hr),Math.max(0,n.x+o.x+a.x)),l=Math.min(s(this,Di)-s(this,_i),Math.max(0,n.y+o.y+a.y));this.setSize(s(this,Hr)/s(this,Ur),s(this,_i)/s(this,Di)),this.setXY(u/s(this,Ur),l/s(this,Di)),P(this,Ea,new it(u,l,s(this,Hr),s(this,_i),{entityId:"watermark"}))}update(){this.dirty&&s(this,Se).visible===!0&&(P(this,Hr,Math.min(s(this,Ur),Math.max(this.minWidth,this.defaultWidth*s(this,Se).scale))),P(this,_i,s(this,Hr)/this.aspectRatio),ho.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),t=>{if(P(this,_t,new Xl({uniforms:{uTexture:{value:t},uSize:{value:new I2(0,0,0,0)},uOpacity:{value:.7}},vertexShader:GM,fragmentShader:VM,depthWrite:!1,depthTest:!1,defines:{debug:ZM},wireframe:ZM,transparent:!0,visible:!0})),s(this,ht))s(this,ht).material=s(this,_t),s(this,ht).material.needsUpdate=!0;else{let i=new Mr(2,2,1,1);P(this,ht,new Te(i,s(this,_t))),s(this,ht).position.set(0,0,-1),s(this,ht).frustumCulled=!1,s(this,ht).renderOrder=999;let n=new Qp(1,1,1),o=new Te(n,new Zt({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));o.layers.set(1),s(this,ht).add(o),s(this,Ml).add(s(this,ht))}this.resize(s(this,Ur),s(this,Di)),this.publish("texture-loaded")})),this.dirty=!1}destroy(){this.hide()}};Se=new WeakMap,Sl=new WeakMap,Ml=new WeakMap,ht=new WeakMap,_t=new WeakMap,Ea=new WeakMap,Hr=new WeakMap,_i=new WeakMap,Ur=new WeakMap,Di=new WeakMap,c(bb,"WatermarkSystem");var om=bb;m();var Cb=100,Rk=!1,xb=class xb extends ${constructor(t,i){super();d(this,"currentTotalBoundingBox");d(this,"state");d(this,"cameraSystem");d(this,"debugMesh",null);d(this,"dirty",!1);d(this,"autoMinZoomLevel",!0);this.state=t,this.cameraSystem=i}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new Vi,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new q(0,0,0),new q(Cb*2,Cb*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(Cb))),this.currentTotalBoundingBox.expandByObject(this.state.entityScene);for(let t of this.state.geometry2DMap.values())t.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(t.position),t.positionDirty=!1);this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new q),min:this.currentTotalBoundingBox.min,max:this.currentTotalBoundingBox.max,radius:this.currentTotalBoundingBox.getBoundingSphere(new E2).radius},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,Rk&&this.state.entityScene.parent instanceof Za&&(this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Te(new B2(this.cameraSystem.panBounds.radius),new Zt({color:16711680,transparent:!0,opacity:.5})),this.state.entityScene.parent.add(this.debugMesh))}}};c(xb,"PanBoundsSystem");var am=xb;m();var zM="\xA9 Mappedin",Nk="https://info.mappedin.com/feedback",Sb=["top-left","top-right","bottom-left","bottom-right"],Gk=640,Vk=c(()=>"<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>","getAttributionButtonIcon"),qM={custom:[],position:"bottom-right"},Mb=class Mb{constructor(e){d(this,"controlContainerEl");d(this,"controlPositions");d(this,"compact");d(this,"attribContainerEl");d(this,"attribInnerEl");d(this,"attribButtonEl");d(this,"feedbackLinkEl");d(this,"attribHTML",zM);d(this,"customAttributions",[]);d(this,"toggleAttribution",c(e=>{this.attribContainerEl!=null&&(e.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",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),e.appendChild(this.controlContainerEl),this.controlPositions=Sb.reduce((t,i)=>{let n=document.createElement("div");return n.classList.add("mappedin-ctrl-".concat(i)),this.controlContainerEl.appendChild(n),t[i]=n,t},{})}addAttributionControl(e=qM){let t=e.position&&Sb.includes(e.position)?e.position:qM.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(t)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[t].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=Vk(),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),this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=Nk,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),e.custom&&(this.customAttributions=e.custom),this.updateAttributionDisplay()}updateAttribution(e){if(!e.style||!this.attribInnerEl||!this.attribContainerEl)return;let t=[zM],i=e.style.sourceCaches;for(let n in i){let o=i[n];if(o.used||o.usedForTerrain){let a=o.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t=t.filter(n=>String(n).trim()),t=t.filter((n,o)=>{for(let a=o+1;a<t.length;a++)if(t[a].indexOf(n)>=0)return!1;return!0}),this.attribHTML=t.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let e=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=e)}resizeAttribution(e){this.attribContainerEl&&(e<=Gk||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(e){this.resizeAttribution(e)}updateData(e){this.updateAttribution(e)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};c(Mb,"HTMLControlsSystem");var sm=Mb;m();var qu,Tb=class Tb{constructor(e,t){d(this,"mesh");d(this,"type","custom-geometry");d(this,"dirty",!0);d(this,"feature");d(this,"builder");d(this,"outline");d(this,"color",new Ee);M(this,qu,0);this.mesh=new br,this.feature=e,this.builder=t}get visible(){return this.mesh.visible}set visible(e){this.mesh.visible=e}setOpacity(){}setColor(){}get position(){var e;return(e=this.mesh)==null?void 0:e.position}get altitude(){return s(this,qu)}set altitude(e){this.mesh&&(this.mesh.position.z=e,P(this,qu,e))}};qu=new WeakMap,c(Tb,"CustomGeometryComponent");var Tl=Tb;m();var Pb=class Pb{constructor(e,t){d(this,"state");d(this,"convertTo3DMapPosition");this.state=e,this.convertTo3DMapPosition=t}update(){let e,t;for(let i of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(i);(n==null?void 0:n.type)==="custom-geometry"&&(e=n.components[0],t=n.components[1],e.dirty&&t.visible!==!1&&(e.position.copy(this.convertTo3DMapPosition(e.feature.geometry.coordinates[1],e.feature.geometry.coordinates[0],t.altitude)),e.builder.setup(e.mesh),e.mesh.traverse(o=>{o.userData={entityId:i,type:"custom-geometry"}}),e.dirty=!1),t.visible!==!1&&e.builder.update(e.mesh))}}};c(Pb,"CustomGeometrySystem");var lm=Pb;m();m();var Ib=class Ib extends Te{constructor(){super(...arguments);d(this,"userData",{entityId:""})}};c(Ib,"EntityMesh");var cm=Ib,jk=A.object({flipImageToFaceCamera:A.boolean().optional(),url:A.string()}),Hk=A.object({type:A.enum(["Feature"]),properties:A.object({width:A.number(),height:A.number(),rotation:A.number().min(0).max(360).optional(),verticalOffset:A.number().optional()}),geometry:ll});function $M(r,e,t){A.union([A.number(),A.string()]).parse(r),Hk.parse(e),jk.parse(t)}c($M,"validateImage");var wb=class wb{constructor(e){d(this,"mesh",new br);d(this,"imageMesh");d(this,"outline");d(this,"type","image");d(this,"instanceIndex",-1);d(this,"geometry");d(this,"material");d(this,"feature");d(this,"position",new q);this.feature=e}get visible(){var e,t;return(t=(e=this.mesh)==null?void 0:e.visible)!=null?t:!1}set visible(e){this.mesh&&(this.mesh.visible=e)}};c(wb,"ImageComponent");var um=wb;var JM=Math.PI*2,KM=Math.PI/2,QM=Math.PI*1.5,Uk=.01,Wk=!1,Eb=class Eb extends ${constructor(t,i){super();d(this,"rendererState");d(this,"convertTo3DMapPosition");d(this,"imageLoadingCache",new Map);this.rendererState=t,this.convertTo3DMapPosition=i}createImageMesh(t,i,n,o=0,a){var y,g;let u=new Qr({transparent:!0,depthWrite:!1,side:Ni}),l=new Mr(n.width,n.height),p=new cm(l);p.visible=!1,(y=this.getOrDownloadImage(i))==null||y.then(v=>{u.map=v,u.needsUpdate=!0,u.map.colorSpace=Gi,p.visible=!0,this.publish("image-loaded")}),p.userData.entityId=t,p.material=u;let h=this.convertTo3DMapPosition(a);if(Wk){let v=new Te(new Mr(n.width,n.height),new Qr({color:"gray"}));p.add(v);let S=new nd;p.add(S),S.scale.set(10,10,10)}return p.renderOrder=1,p.position.set(h.x,h.y,o+Uk),p.rotation.z=-ye.degToRad((g=n.rotation)!=null?g:0),p}getOrDownloadImage(t){if(this.imageLoadingCache.has(t))return this.imageLoadingCache.get(t);{let i=new Promise(n=>{ho.getLoader().load(t,o=>{n(o)})});return this.imageLoadingCache.set(t,i),i}}flipIfNeeded(t,i){let o=(t.imageMesh.rotation.z-i+JM)%JM;(o>KM&&o<QM||o<-KM&&o>-QM)&&(t.imageMesh.rotation.z=t.imageMesh.rotation.z-Math.PI)}update(t){var a,u,l,p,h;let i,n,o;for(let y of this.rendererState.geometry3DIdsInScene)if(i=this.rendererState.geometry3DMap.get(y),(i==null?void 0:i.type)==="image")n=i.components[0],o=i.components[1],o.url&&n.imageMesh==null&&(n.imageMesh=this.createImageMesh(i.id,o.url,n.feature.properties,n.feature.properties.verticalOffset,n.feature.geometry.coordinates),n.mesh.add(n.imageMesh),n.position.copy(n.imageMesh.position)),n.imageMesh&&o.flipImageToFaceCamera&&this.flipIfNeeded(n,t);else if((i==null?void 0:i.type)==="geometry"){if(n=i.components[0],o=i.components[1],o.showImage&&((a=n.feature.properties)!=null&&a.image)&&n.imageMesh==null&&n.mesh!=null&&n.mesh.parent!=null&&((u=n.feature.properties)==null?void 0:u.image.position)!=null){let g=this.createImageMesh(y,(l=n.feature.properties)==null?void 0:l.image.path,(p=n.feature.properties)==null?void 0:p.image,o.height,(h=n.feature.properties)==null?void 0:h.image.position);n.mesh.parent.add(g),n.imageMesh=g}n.imageMesh&&(o.showImage&&!n.imageMesh.visible?n.imageMesh.visible=!0:!o.showImage&&n.imageMesh.visible&&(n.imageMesh.visible=!1),o.flipImageToFaceCamera&&this.flipIfNeeded(n,t))}}};c(Eb,"ImageSystem");var pm=Eb;m();var Xk=!1,fo,_b=class _b extends ${constructor(t,i){super();d(this,"cameraDirty",!0);d(this,"focusablesDirty",!0);d(this,"state");d(this,"camera");d(this,"debugEl",null);d(this,"raycasters",[]);d(this,"collisions",new Map);d(this,"focusableEntities",new Set);M(this,fo,void 0);d(this,"update",c(()=>{s(this,fo)&&cancelAnimationFrame(s(this,fo)),P(this,fo,requestAnimationFrame(()=>{this.updateRaf()}))},"update"));this.state=t,this.camera=i,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let t=new te(this.state.canvasWidth/2,this.state.canvasHeight/2),i=new te(t.x/1.2,t.y/1.2),n=new te(t.x+(t.x-i.x),i.y),o=new te(i.x,t.y+(t.y-i.y)),a=new te(n.x,o.y),u=new te(t.x,t.y/1.5),l=new te(t.x,t.y+(t.y-u.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=[t,u,l,i,n,o,a].map((p,h)=>{if(Xk){let T=document.createElement("div");T.style.position="absolute",T.style.top=p.y+"px",T.style.left=p.x+"px",T.style.width="10px",T.style.height="10px",T.style.backgroundColor="red",this.debugEl.append(T)}let y=p.x/this.state.canvasWidth*2-1,g=-(p.y/this.state.canvasHeight)*2+1,v=new te(y,g),S=new ei;return S.setFromCamera(v,this.camera),[S,v,h===0?10:h<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let t,i;for(let n of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(n),i!=null&&(t=i.components[0],t instanceof Ie&&t.focusable&&t.geometry!=null)){if(t.focusMesh==null){let o=new Te(t.geometry);o.userData={entityId:i.id},t.focusMesh=o}this.focusableEntities.add(t.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,n]of this.raycasters)i.setFromCamera(n,this.camera);for(let[i,n,o]of this.raycasters)i.intersectObjects(Array.from(this.focusableEntities.values())).forEach(u=>{var l;if((u==null?void 0:u.object)!=null&&"isMesh"in u.object&&(u!=null&&u.object.isMesh)){let p=u.object.userData.entityId,h=(l=this.collisions.get(p))!=null?l:0;this.collisions.set(p,h+o)}});let t=Array.from(this.collisions,([i,n])=>({entityId:i,weight:n})).sort((i,n)=>n.weight-i.weight).map(({entityId:i})=>i);this.publish("geometry-in-focus",t),this.cameraDirty=!1}destroy(){s(this,fo)&&cancelAnimationFrame(s(this,fo)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};fo=new WeakMap,c(_b,"GeometryInFocusSystem");var dm=_b;m();var Db=class Db{constructor(e){d(this,"dirty",!0);d(this,"map");d(this,"stylesheetId","");d(this,"userHiddenLayers",new Set);d(this,"hiddenLayersInStyle",new Set);d(this,"centerPoint");d(this,"handleRender",c(async()=>{if(!this.map||!this.dirty||!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)return;let e=[],t=this.map.project(this.centerPoint),i=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});for(var n of i)e.push(["!=",["id"],n.id]);e.length>0&&(this.hiddenLayersInStyle.forEach(o=>{this.map.setFilter(o,["all",...e])}),this.dirty=!1)},"handleRender"));d(this,"handleStyleChange",c(e=>{var t,i;if(this.map&&e&&e.dataType==="style"&&e.type==="styledata"&&this.userHiddenLayers.size>0){let n=(i=(t=e==null?void 0:e.style)==null?void 0:t.stylesheet)==null?void 0:i.id;(!n||n!==this.stylesheetId)&&(this.stylesheetId=n,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));e&&(this.map=e,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(e,t){this.centerPoint=e;for(let i of t)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let e of this.userHiddenLayers)this.map.getLayer(e)&&this.hiddenLayersInStyle.add(e)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};c(Db,"OutdoorLayers");var hm=Db;m();m();m();var Ob="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 Lb='#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 e8="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 qk=new qa;function t8(r,e,t){let{nearRadius:i,farRadius:n,accentColor:o,completeFraction:a,isVertical:u}=e,{color:l}=t,p=!0,h=0,y=1/0,g=e.displayArrowsOnPath,v=!u,S=!0,T=g,b=i/2+$k,x=0;r[0].z+=b;for(let de=1;de<r.length;++de){r[de].z+=b;let be=r[de].x-r[de-1].x,ke=r[de].z-r[de-1].z;if(u)x+=Math.sqrt(be*be+ke*ke);else{let pr=r[de].y-r[de-1].y;x+=Math.sqrt(be*be+pr*pr+ke*ke)}}if(!u){let de=b-.01;r.push(r[r.length-1].clone().setZ(de)),r.unshift(r[0].clone().setZ(de))}let I=new P2;T&&(I=qk.load(e8),I.colorSpace=Gi);let E=new Ee(l),w=new Ee(o),_={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new te(1,1)},cameraParameters:{type:"v2",value:new te(h,0)},complete:{type:"f",value:p?0:1},color:{type:"c",value:E},pathLength:{type:"f",value:x},nearRadius:{type:"f",value:i},farRadius:{type:"f",value:n},nearZoom:{type:"f",value:h},farZoom:{type:"f",value:y},pulseColor:{type:"c",value:w},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:u},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:I},displayArrowsOnPath:{type:"b",value:g},flattenFactor:{type:"f",value:v?.05:1},showPulse:{type:"b",value:S},opacityMultiplier:{type:"f",value:1}},D=new k2(r);D.curveType="catmullrom",D.tension=0;let B=30,U=8,G=B*r.length,j=new R2(D,G,i,U,!1),Y=new Float32Array(j.attributes.position.count);for(let de=r.length;de<Y.length;de++)Y[de]=de;j.setAttribute("vertexIndex",new Wl(Y,1));let ce=new Float32Array(j.attributes.position.count),ge=new Wl(ce,1);for(let de=0;de<=G;de++)for(let be=0;be<=U;++be)ge.setX(de*(U+1)+be,de/G);j.setAttribute("pathDistance",ge);let we=new Float32Array(j.attributes.normal.count*3),Le=new Wl(we,3);for(let de=0;de<G;de++){let be=j.tangents[de];for(let ke=0;ke<=U;++ke)Le.setXYZ(de*(U+1)+ke,be.x,be.y,be.z)}j.setAttribute("pathTangent",Le);let qe=new Float32Array(j.attributes.normal.count*3),Wt=new Wl(qe,3);for(let de=0;de<G;de++){let be=j.tangents[de];var Ae,$e,je;u?(Ae=be.x*be.y,$e=-1+be.y*be.y,je=be.z*be.y):(Ae=-be.x*be.z,$e=-be.y*be.z,je=1-be.z*be.z);let ke=Math.sqrt(Ae*Ae+$e*$e+je*je);ke===0&&(ke=1);let pr=Ae/ke,Xa=$e/ke,jl=je/ke;for(let qr=0;qr<=U;++qr)Wt.setXYZ(de*(U+1)+qr,pr,Xa,jl)}j.setAttribute("pathNormal",Wt);let Xt=new Xl({uniforms:_,vertexShader:Ob,fragmentShader:Lb});Xt.transparent=!0,Xt.alphaTest=.5,_.resolution.value.x=1,_.resolution.value.y=1,_.vertexes.value=Y.length,_.arrowTexture.value.wrapS=$r,_.arrowTexture.value.wrapT=$r,_.arrowTexture.value.anisotropy=16,_.complete.value=a;let Ri=new Te(j,Xt),kt=Ri.clone(),Yt={..._,opacityMultiplier:{type:"f",value:.25}};Yt.complete.value=1,kt.material=new Xl({uniforms:Yt,vertexShader:Ob,fragmentShader:Lb}),kt.material.transparent=!0,kt.material.alphaTest=.5,kt.material.depthWrite=!1,kt.material.depthTest=!1,kt.renderOrder=1,Yt.resolution.value.x=1,Yt.resolution.value.y=1,Yt.vertexes.value=Y.length,Yt.arrowTexture.value.wrapS=$r,Yt.arrowTexture.value.wrapT=$r,Yt.arrowTexture.value.anisotropy=16,Yt.complete.value=a,Ri.userData=kt.userData=e.mesh.userData;let So=e.mesh;So.add(Ri),So.add(kt),j.computeBoundingBox();let Wa=new q;return j.boundingBox.getCenter(Wa),{mesh:So,material:Xt,center:Wa}}c(t8,"buildPath");var $k=.15;var Ab=class Ab extends ${constructor(t,i,n){super();d(this,"rendererState");d(this,"altitudeDirty",!0);d(this,"convertTo3DMapPosition");d(this,"getParentContainer");this.rendererState=t,this.convertTo3DMapPosition=i,this.getParentContainer=n}update(t,i,n){let o,a=!1;for(let u of this.rendererState.geometry3DIdsInScene)if(o=this.rendererState.geometry3DMap.get(u),o&&o.type==="path"&&o.components[0].type==="path"){let l=o.components[0],p=o.components[1],h=l.isVertical&&this.altitudeDirty;if(!(l instanceof Mi))continue;if(l.dirty||h){if(l.mesh.parent!=null)for(let g=l.mesh.children.length-1;g>=0;g--)Ye(l.mesh.children[0]);let y=[];if(l.feature.features.forEach(g=>{let v=g.geometry.coordinates[2]||0,S;if(g.properties.parentId&&(S=this.getParentContainer(g.properties.parentId,!0),S!=null&&S.altitude!=null&&(v+=S.altitude,l.isVertical=!0)),!g.properties.parentId||S!=null&&S.visible){let T=this.convertTo3DMapPosition(g.geometry.coordinates[1],g.geometry.coordinates[0],v);y.push(T)}}),y.length>1){let{mesh:g,material:v,center:S}=t8(y,l,{color:p.color});l.mesh=g,l.material=v,l.position=S}l.dirty=!1}p.dirty&&(l.mesh.children.forEach(y=>{y.material.uniforms.color.value.set(p.color),y.material.needsUpdate=!0}),l.mesh.position.z=p.altitude,p.dirty=!1),l.material&&(l.mesh.children.forEach(y=>{let g=y.material.uniforms;g.nearZoom.value=t,g.farZoom.value=i,g.cameraParameters.value.x=n,l.materialDirty&&(g.nearRadius.value=l.nearRadius,g.displayArrowsOnPath.value=l.displayArrowsOnPath,g.farRadius.value=l.farRadius,g.pulseColor.value.set(l.accentColor),g.complete.value=l.completeFraction),y.material.needsUpdate=!0}),l.displayArrowsOnPath&&l.animateArrowsOnPath&&(l.mesh.children.forEach(y=>{y.material.uniforms.arrowAnimationTimer.value=performance.now()/1e3,y.material.needsUpdate=!0}),a=!0),l.materialDirty=!1)}this.altitudeDirty=!1,a&&this.publish("animate:path")}};c(Ab,"PathSystem");var $u=Ab;m();var Ze,Pl,Wr,kb=class kb{constructor(e){d(this,"rendererState");d(this,"dirty",!1);M(this,Ze,void 0);M(this,Pl,void 0);M(this,Wr,void 0);this.rendererState=e}updateOne(e){var t;if(e instanceof xe&&e.components[0]instanceof Ie&&e.components[1]instanceof Nr&&e.parent instanceof rt&&(P(this,Ze,e.components[0]),P(this,Wr,e.components[1]),s(this,Ze).detached&&s(this,Ze).dirty&&s(this,Ze).geometry!=null&&s(this,Ze).material!=null)){P(this,Pl,e.parent),(t=s(this,Ze).mesh)==null||t.setVisibleAt(s(this,Ze).instanceIndex,!1);let i=new Ee(s(this,Wr).color),n=new xa({color:i,side:Ni,opacity:s(this,Wr).opacity||1,transparent:s(this,Wr).opacity!==void 0?s(this,Wr).opacity<1:!1},1,s(this,Ze).material.repeatYFactor),o=new xi(1,s(this,Ze).geometry.attributes.position.count||0,0,n);o.addGeometry(s(this,Ze).geometry),o.userData={entities:{0:e.id},detached:!0},s(this,Ze).instanceIndex=0,s(this,Ze).material.setColor(s(this,Ze).instanceIndex,i,s(this,Wr).topColor?new Ee(s(this,Wr).topColor):i),s(this,Ze).mesh=o,s(this,Ze).material=n,s(this,Pl).add(o),s(this,Ze).dirty=!1}}update(){if(!this.dirty)return;let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.dirty=!1,this.cleanup()}cleanup(){P(this,Ze,void 0),P(this,Pl,void 0),P(this,Wr,void 0)}};Ze=new WeakMap,Pl=new WeakMap,Wr=new WeakMap,c(kb,"MeshDetachmentSystem");var fm=kb;m();m();function r8(r,e,t){var i;if(r.geometry!=null){let n=e||1e-4,o=n/r.currentHeight,a=n/t;r.geometry.scale(1,1,o),r.material&&(r.material.repeatYFactor=a),(i=r.mesh)==null||i.setGeometryAt(r.instanceIndex,r.geometry),r.currentHeight=n}}c(r8,"updateHeight");var _a,mo,Fb=class Fb{constructor(e){d(this,"rendererState");d(this,"dirty",!1);M(this,_a,void 0);M(this,mo,void 0);this.rendererState=e}updateOne(e){var t;e instanceof xe&&e.type==="geometry"&&((t=e.components[1])!=null&&t.dirty)&&(P(this,_a,e.components[0]),P(this,mo,e.components[1]),e.type==="geometry"&&s(this,mo).height!==s(this,_a).currentHeight&&r8(s(this,_a),s(this,mo).height,s(this,mo).initialHeight))}update(){let e;for(let t of this.rendererState.geometry3DIdsInScene)e=this.rendererState.geometry3DMap.get(t),this.updateOne(e);this.cleanup()}cleanup(){P(this,_a,void 0),P(this,mo,void 0)}};_a=new WeakMap,mo=new WeakMap,c(Fb,"MeshModificationSystem");var mm=Fb;m();var Ju,Bb=class Bb{constructor(e){M(this,Ju,void 0);P(this,Ju,e)}update(){var e;(e=s(this,Ju)._subscribers["pre-render"])==null||e.forEach(t=>t())}};Ju=new WeakMap,c(Bb,"PreRenderSystem");var ym=Bb;m();var Jk=!1,Kk=.01,Rb=class Rb{constructor(e,t){d(this,"rendererState");d(this,"convertTo3DMapPosition");this.rendererState=e,this.convertTo3DMapPosition=t}createTextAreaMesh(e,t,i){var l;let n=new Mr(t.maxWidth,t.maxHeight),o=new Zt({color:void 0,transparent:!0}),a=new Te(n,o),u=new mt;if(u.position.copy(this.convertTo3DMapPosition(t.position)),u.add(a),a.position.x=-t.maxWidth/2,a.position.z=i+Kk,a.visible=!1,Jk){let p=ho.getLoader().load("https://wwr-pro.s3.amazonaws.com/logos/0066/7413/logo.gif",y=>{let g=t.maxWidth/t.maxHeight,S=y.image.width/y.image.height/g;y.wrapS=km,y.wrapT=km,a.scale.set(1,1/S,1);let T=(a.rotation.z+Math.PI)%(Math.PI*2)-Math.PI;Math.abs(T)>Math.PI/2&&(a.rotation.z+=Math.PI,a.scale.x*=-1),a.visible=!0});o.map=p;let h=new nd;u.add(h),h.scale.set(10,10,10)}return u.rotation.z=Math.PI/2,u.rotation.z-=ye.degToRad((l=t.rotation)!=null?l:0),u.userData.entityId=e,u}flipIfNeeded(e,t){}update(e){var o,a,u;let t,i,n;for(let l of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(l),(t==null?void 0:t.type)==="geometry"){if(i=t.components[0],n=t.components[1],(o=i.feature.properties)!=null&&o.textArea&&n.showTextLabel&&i.textAreaMesh==null&&i.mesh!=null&&i.mesh.parent!=null&&((a=i.feature.properties)==null?void 0:a.textArea.position)!=null){let p=this.createTextAreaMesh(l,(u=i.feature.properties)==null?void 0:u.textArea,n.height+n.altitude);i.mesh.add(p),i.textAreaMesh=p}i.textAreaMesh&&(n.showTextLabel&&!i.textAreaMesh.visible?i.textAreaMesh.visible=!0:!n.showTextLabel&&i.textAreaMesh.visible&&(i.textAreaMesh.visible=!1),n.flipTextToFaceCamera&&this.flipIfNeeded(i,e))}}};c(Rb,"PolygonLabelSystem");var gm=Rb;var i8=new ei;var{DEFAULT_PITCH:jb,DEFAULT_BEARING:Hb,DEFAULT_ZOOM_LEVEL:Ub,DEFAULT_MIN_ZOOM_LEVEL:Qk,DEFAULT_MAX_ZOOM_LEVEL:eF}=jr,tF=ye.radToDeg(.698132),Ht,Ue,Ku,Il,yo,Da,wl,Qu,Gb,k,Me,Xr,Ge,Oi,or,O,ep,ze,Oe,vm,n8,bm,o8,Cm,a8,go,tp,rp,El,xm,ip,np,op,_l,ap,Vb,Oa,sp,Dt,Ot,Wb=class Wb extends ${constructor(t,i={}){var g,v,S,T,b,x,I,E,w,_;super();M(this,Qu);M(this,vm);M(this,bm);M(this,Cm);M(this,ap);d(this,"options");d(this,"container");M(this,Ht,void 0);M(this,Ue,void 0);M(this,Ku,void 0);M(this,Il,void 0);M(this,yo,void 0);M(this,Da,void 0);M(this,wl,void 0);d(this,"rendererDomElement");M(this,k,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Xe("__scene"),hoverColor:"red",insetsPadding:Fu,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new nb,cameraObject:new Fm});d(this,"camera");M(this,Me,void 0);M(this,Xr,void 0);M(this,Ge,void 0);M(this,Oi,void 0);M(this,or,void 0);M(this,O,{});M(this,ep,window.matchMedia("screen and (min-resolution: 2dppx)"));d(this,"map");M(this,ze,c(()=>{s(this,O).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));M(this,Oe,c(()=>{s(this,O).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));M(this,go,"standalone");M(this,tp,c(t=>Math.trunc(t*10)/10,"#round10"));M(this,rp,c(()=>{s(this,O).twoDDrawSystem.dirty=!0,V(this,Qu,Gb).call(this,ya()),s(this,O).watermarkSystem.dirty=!0,this.render()},"#handlePixelRatioChange"));M(this,El,c(()=>{s(this,k).canvasWidth=this.rendererDomElement.clientWidth,s(this,k).canvasHeight=this.rendererDomElement.clientHeight,V(this,Qu,Gb).call(this,ya()),s(this,_l).call(this),V(this,Cm,a8).call(this),s(this,O).cameraSystem.resize(this.canvasWidth,this.canvasHeight),s(this,O).cameraSystem.dirty=!0,s(this,O).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),s(this,O).htmlControlsSystem.resize(this.canvasWidth),s(this,O).geometryInFocusSystem.resize(),s(this,O).interactionSystem.resize(),this.render()},"#handleWindowResize"));M(this,xm,c(()=>{this.renderSync()},"#renderFull"));M(this,ip,new q);M(this,np,c((t,i)=>{let n=this.mode==="standalone"?s(this,Ue):this.viewCamera;if(s(this,Ue).position.z+this.camera.elevation>i.z){s(this,ip).copy(i);let o=s(this,ip).project(n),a=(o.x+1)/2*this.canvasWidth-0/2,u=(-o.y+1)/2*this.canvasHeight-0/2,l=s(this,tp).call(this,a),p=s(this,tp).call(this,u);t.x=l,t.y=p}else t.x=-1e3,t.y=-1e3},"#project"));M(this,op,c((t,i)=>{s(this,or).setBufferSize(t,i),s(this,Ue).aspect=t/i,s(this,Ue).updateProjectionMatrix(),s(this,Ue).updateMatrixWorld(!0),s(this,Il).x=t,s(this,Il).y=i},"#setBufferSize"));M(this,_l,c(()=>{var a;let t=s(this,k).canvasWidth=this.rendererDomElement.clientWidth,i=s(this,k).canvasHeight=this.rendererDomElement.clientHeight,n=Math.floor(t*this.resolutionScale),o=Math.floor(i*this.resolutionScale);s(this,op).call(this,n,o),(a=this.map)==null||a.resize(),s(this,k).shouldMeasureCanvas=!1},"#measureCanvas"));d(this,"getParentContainer",c((t,i=!0)=>{if(!t)return i?s(this,k).entityScene:void 0;if(typeof t=="string"||typeof t=="number"){let n=s(this,k).geometry3DMap.get(t);return n instanceof Xe?n:(L.warn("Parent (".concat(typeof t=="object"?t.id:t,") is not a valid container, adding to scene")),i?s(this,k).entityScene:void 0)}else if(t.type==="group-container"){let n=s(this,k).geometry3DMap.get(t.id);if(n instanceof Xe)return n}return i?s(this,k).entityScene:void 0},"getParentContainer"));d(this,"showCollisionBoxes",c(()=>{s(this,O).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));d(this,"hideCollisionBoxes",c(()=>{s(this,O).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));d(this,"projectScreenXYToCoordinate",c((t,i)=>{var l;let n=t/this.canvasWidth*2-1,o=-(i/this.canvasHeight)*2+1,a=new te(n,o);i8.setFromCamera(a,s(this,Ue).clone());let u=(l=i8.intersectObject(s(this,yo),!1)[0])==null?void 0:l.point;return u!=null?this.convert3DMapPositionToCoordinate(u):void 0},"projectScreenXYToCoordinate"));d(this,"projectCoordinateToScreenXY",c(t=>{let i=this.convertTo3DMapPosition(t[1],t[0],t[2]||0),n=new te;return s(this,np).call(this,n,i),{x:n.x,y:n.y}},"projectCoordinateToScreenXY"));d(this,"convert3DMapPositionToCoordinate",c(t=>{var o,a,u,l;let{lat:i,lon:n}=sf((a=(o=s(this,k).center)==null?void 0:o[1])!=null?a:0,(l=(u=s(this,k).center)==null?void 0:u[0])!=null?l:0,t.x,t.y);return[n,i,t.z]},"convert3DMapPositionToCoordinate"));d(this,"setBackgroundColor",c((t,i)=>{s(this,or).setBackgroundColor(t,i)},"setBackgroundColor"));d(this,"getMetresPerPixel",c(()=>{let t=this.container.clientWidth,i=this.container.clientHeight/2,n=this.projectScreenXYToCoordinate(0,i),o=this.projectScreenXYToCoordinate(t,i);return n==null||o==null?void 0:ld(n,o)/t},"getMetresPerPixel"));d(this,"hideOutdoorLayersUnderPoint",c((t,i)=>{!this.map||(i==null?void 0:i.length)===0||(s(this,O).outdoorLayersSystem.hideLayersUnderPoint(t,i),this.render())},"hideOutdoorLayersUnderPoint"));M(this,Oa,new D2);M(this,sp,new ji);d(this,"render",c(()=>{s(this,O).renderSystem!=null&&(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay")?this.map.triggerRepaint():s(this,O).renderSystem.update())},"render"));d(this,"renderSync",c(()=>{s(this,O).renderSystem.update(!0)},"renderSync"));M(this,Dt,so(()=>{this.publish("user-interaction-start",void 0)},0,!0));M(this,Ot,so(()=>{this.publish("user-interaction-end",void 0)},0,!0));d(this,"on",c((t,i)=>{super.on(t,i),["outdoor-view-loaded","outdoor-style-loaded"].includes(t)&&this.mode==="standalone"&&C.env.NODE_ENV!=="test"&&(L.warn('"'.concat(t,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(t))},"on"));d(this,"off",c((t,i)=>{super.off(t,i)},"off"));d(this,"getCursor",c(()=>s(this,O).interactionSystem.getCursor(),"getCursor"));d(this,"destroy",c(()=>{s(this,O).cameraSystem.off("user-dolly-start",s(this,Dt)),s(this,O).cameraSystem.off("user-pan-start",s(this,Dt)),s(this,O).cameraSystem.off("user-rotate-start",s(this,Dt)),s(this,O).cameraSystem.off("user-zoom-start",s(this,Dt)),s(this,O).cameraSystem.off("user-tilt-start",s(this,Dt)),s(this,O).cameraSystem.off("user-pedestal-start",s(this,Dt)),s(this,O).cameraSystem.off("user-dolly-end",s(this,Ot)),s(this,O).cameraSystem.off("user-pan-end",s(this,Ot)),s(this,O).cameraSystem.off("user-rotate-end",s(this,Ot)),s(this,O).cameraSystem.off("user-zoom-end",s(this,Ot)),s(this,O).cameraSystem.off("user-tilt-end",s(this,Ot)),s(this,O).cameraSystem.off("user-pedestal-end",s(this,Ot)),s(this,O).renderSystem.off("measure-canvas",s(this,_l)),this.remove("__scene"),s(this,ze).call(this),s(this,Oe).call(this),this.renderSync(),s(this,O).renderSystem.destroy(),s(this,O).zoomInterpolationSystem.destroy(),s(this,O).cameraSystem.off("change",this.render),s(this,O).pathSystem.off("animate:path",this.render),s(this,O).cameraSystem.dispose(),s(this,O).exporterSystem.destroy(),s(this,O).outdoorLayersSystem.destroy(),s(this,O).drawSystem.destroy(),window.removeEventListener("resize",s(this,El),!1),s(this,ep).removeEventListener("change",s(this,rp)),s(this,Da)&&s(this,Da).disconnect(),this._subscribers={},s(this,or).destroy(),s(this,Ht).traverse(t=>{Ye(t),"dispose"in t&&typeof t.dispose=="function"&&t.dispose()}),P(this,Ht,void 0),s(this,O).htmlControlsSystem.destroy(),s(this,O).collisionSystem.destroy(),s(this,O).domMutationSystem.destroy(),s(this,O).geometryInFocusSystem.destroy(),P(this,O,void 0),s(this,go)!=="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(s(this,Oi)),this.container.removeChild(s(this,Me)),P(this,or,void 0)},"destroy"));if(this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!t.clientWidth||!t.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&&(P(this,go,i.mode),this.map=i.map),s(this,k).entityScene.addEventListener("childadded",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),s(this,k).entityScene.addEventListener("childremoved",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),s(this,k).geometry3DMap.set(s(this,k).entityScene.userData.entityId,s(this,k).entityScene),i.center&&(s(this,k).center=i.center?[...i.center]:[0,0]),this.options=i,this.container=t,V(this,vm,n8).call(this),V(this,bm,o8).call(this),s(this,O).htmlControlsSystem=new sm(this.container),s(this,go)!=="outdoors-overlay"&&s(this,O).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),C.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),P(this,or,new Sf({antialias:typeof i.antialias=="boolean"?i.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(g=i.gl)==null?void 0:g.canvas:void 0,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:()=>{typeof i.onWebGLContextLost=="function"&&i.onWebGLContextLost()},onWebGLContextRestored:()=>{i.onWebGLContextRestored&&i.onWebGLContextRestored(),s(this,ze).call(this),s(this,Oe).call(this),this.render()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:i.backgroundColor||"#ffffff",backgroundAlpha:(v=i.backgroundAlpha)!=null?v:1})),P(this,Ht,new Za),s(this,Ht).add(s(this,k).entityScene);let n=window.__THREE_DEVTOOLS__;C.env.NODE_ENV==="dev"&&typeof n<"u"&&(n.dispatchEvent(new CustomEvent("observe",{detail:s(this,Ht)})),n.dispatchEvent(new CustomEvent("observe",{detail:s(this,or)}))),P(this,Ue,new Fm(tF,this.aspect,50,1e5)),s(this,k).cameraObject=s(this,Ue),P(this,Ku,new _2),s(this,Ue).renderOrder=999;let o=new mt;o.add(s(this,Ue)),P(this,wl,new mt),s(this,wl).add(o),s(this,Ht).add(s(this,wl)),s(this,Ue).updateProjectionMatrix(),s(this,Ue).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=s(this,or).domElement(),P(this,Il,new te);let a=new Mr(1e6,1e6),u=new Zt({color:0,visible:!1});P(this,yo,new Te(a,u)),s(this,Ht).add(s(this,yo)),(S=i.gl)!=null&&S.canvas||t.appendChild(this.rendererDomElement),window.addEventListener("resize",s(this,El),!1),s(this,ep).addEventListener("change",s(this,rp)),typeof ResizeObserver=="function"&&((T=C.env)==null?void 0:T.NODE_ENV)!=="test"&&(P(this,Da,new ResizeObserver(so(()=>{s(this,El).call(this)},0))),(b=s(this,Da))==null||b.observe(t)),t.classList.add("mappedin-map"),this.rendererDomElement.style.width=(x=globalThis.MappedinDebug)!=null&&x.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(I=globalThis.MappedinDebug)!=null&&I.TEST_IOS?"1920px":"100%",C.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),s(this,k).canvasWidth=this.rendererDomElement.clientWidth,s(this,k).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let l=this.canvasWidth,p=this.canvasHeight;s(this,O).watermarkSystem=new om(s(this,Ue),s(this,k),i==null?void 0:i.watermark),s(this,O).watermarkSystem.on("texture-loaded",this.render),s(this,k).shouldMeasureCanvas=!0,s(this,k).pixelRatio=this.resolutionScale,s(this,op).call(this,Math.floor(l*this.resolutionScale),Math.floor(p*this.resolutionScale));let h=new id(16777215,.3*Math.PI);h.position.set(-150,-150,350),s(this,Ht).add(h);let y=new G2(16777215,.741*Math.PI);s(this,Ht).add(y),s(this,O).cameraSystem=new bl(s(this,Ue),s(this,Ht),s(this,or).renderer,s(this,k),{mode:this.mode,canvasHeight:p,canvasWidth:l}),s(this,O).cameraSystem.on("user-dolly-start",s(this,Dt)),s(this,O).cameraSystem.on("user-pan-start",s(this,Dt)),s(this,O).cameraSystem.on("user-rotate-start",s(this,Dt)),s(this,O).cameraSystem.on("user-zoom-start",s(this,Dt)),s(this,O).cameraSystem.on("user-tilt-start",s(this,Dt)),s(this,O).cameraSystem.on("user-pedestal-start",s(this,Dt)),s(this,O).cameraSystem.on("user-dolly-end",s(this,Ot)),s(this,O).cameraSystem.on("user-pan-end",s(this,Ot)),s(this,O).cameraSystem.on("user-rotate-end",s(this,Ot)),s(this,O).cameraSystem.on("user-zoom-end",s(this,Ot)),s(this,O).cameraSystem.on("user-tilt-end",s(this,Ot)),s(this,O).cameraSystem.on("user-pedestal-end",s(this,Ot)),s(this,O).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),s(this,O).geometryInFocusSystem&&(s(this,O).geometryInFocusSystem.cameraDirty=!0),this.render()}),s(this,O).pathSystem=new $u(s(this,k),this.convertTo3DMapPosition,this.getParentContainer),s(this,O).pathSystem.on("animate:path",this.render),s(this,O).panBoundsSystem=new am(s(this,k),s(this,O).cameraSystem),s(this,O).panBoundsSystem.on("update",()=>{let{panBounds:D,fov:B,convertAltitudeToZoomLevel:U}=s(this,O).cameraSystem;if(s(this,O).panBoundsSystem.autoMinZoomLevel){let G=B*Math.PI/180,j=Math.tan(G/2),Y=U(D.radius/j);this.camera.setMinZoomLevel(Y)}}),this.camera=new nm(this,s(this,O),s(this,k),s(this,yo)),this.camera.setZoomLevel((E=i.zoomLevel)!=null?E:Ub),this.camera.setBearing((w=i.bearing)!=null?w:Hb),this.camera.setPitch((_=i.pitch)!=null?_:jb),this.camera.setMaxZoomLevel(eF),this.camera.setMinZoomLevel(Qk),s(this,O).domVisiblitySystem=new Gf(s(this,k),s(this,Oi)),s(this,O).domMutationSystem=new im(s(this,k),s(this,Oi)),s(this,O).domMutationSystem.on("dimensions-update",()=>{s(this,O).collisionSystem.collidersDirty=!0,this.render()}),s(this,O).domDrawSystem=new tm(s(this,k)),s(this,O).collisionSystem=new Mf(s(this,Xr),s(this,k)),s(this,O).twoDDrawSystem=new jf(s(this,k),s(this,Ge)),s(this,O).interactionSystem=new _u(this.rendererDomElement,s(this,k),s(this,Ue),s(this,yo),s(this,O).cameraSystem.isUserInteracting),s(this,O).interactionSystem.on("hover",this.render),s(this,O).interactionSystem.on("click",D=>{var B,U,G,j,Y,ce;if(((B=D.entity2D)==null?void 0:B.id)==="watermark"&&typeof s(this,O).watermarkSystem.options.onClick=="function"){s(this,O).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(U=D.entity3D)==null?void 0:U.id]:[],paths:((G=D.entity3D)==null?void 0:G.components[0])instanceof Mi?[D.entity3D.id]:[],markers:((j=D.entity2D)==null?void 0:j.components[0])instanceof Si?[D.entity2D.id]:[],models:((Y=D.entity3D)==null?void 0:Y.components[0])instanceof uo?[D.entity3D.id]:[],labels:((ce=D.entity2D)==null?void 0:ce.components[0])instanceof Ti?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(ge=>ge.userData.entityId):[],pointerEvent:D.pointerEvent})}),s(this,O).interactionSystem.on("hover",D=>{var B,U,G,j,Y,ce;D.position&&((B=D.entity2D)==null?void 0:B.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(D.position),geometry:D.entity3D?[(U=D.entity3D)==null?void 0:U.id]:[],paths:((G=D.entity3D)==null?void 0:G.components[0])instanceof Mi?[D.entity3D.id]:[],markers:((j=D.entity2D)==null?void 0:j.components[0])instanceof Si?[D.entity2D.id]:[],models:((Y=D.entity3D)==null?void 0:Y.components[0])instanceof uo?[D.entity3D.id]:[],labels:((ce=D.entity2D)==null?void 0:ce.components[0])instanceof Ti?[D.entity2D.id]:[],containers:Array.isArray(D.groupContainers)?D.groupContainers.map(ge=>ge.userData.entityId):[]})}),s(this,O).geometryInFocusSystem=new dm(s(this,k),s(this,Ue)),s(this,O).geometryInFocusSystem.on("geometry-in-focus",D=>{this.publish("geometry-in-focus",D)}),s(this,O).twoDVisiblitySystem=new Uf(s(this,k)),s(this,O).drawSystem=new Hf(s(this,k)),s(this,O).drawSystem.on("texture-loaded",this.render),s(this,O).stackSystem=new Xf(s(this,k)),s(this,O).twoDProjectionSystem=new Vf(s(this,k),s(this,np)),s(this,O).zoomInterpolationSystem=new If,s(this,O).exporterSystem=new Du(s(this,k)),s(this,O).meshOptimizationSystem=new Nf(s(this,k),this.convertTo3DMapPosition),s(this,O).meshOptimizationSystem.on("model-loaded",this.render),s(this,O).meshDetachmentSystem=new fm(s(this,k)),s(this,O).meshModificationSystem=new mm(s(this,k)),s(this,O).customGeometrySystem=new lm(s(this,k),this.convertTo3DMapPosition),s(this,O).outlineInterpolationSystem=new Iu(s(this,k)),s(this,O).renderSystem=new Wf(s(this,or),s(this,k),this.mode,s(this,Ht),s(this,Ue),this.viewCamera,s(this,O)),s(this,O).preRenderSystem=new ym(this),s(this,O).imageSystem=new pm(s(this,k),this.convertTo3DMapPosition),s(this,O).polygonLabelSystem=new gm(s(this,k),this.convertTo3DMapPosition),s(this,O).imageSystem.on("image-loaded",this.render),s(this,O).renderSystem.on("measure-canvas",s(this,_l)),s(this,O).outdoorLayersSystem=new hm(this.map),s(this,xm).call(this)}get viewCamera(){return s(this,Ku)}get canvasWidth(){return s(this,k).canvasWidth}get canvasHeight(){return s(this,k).canvasHeight}get resolutionScale(){var t,i;return(i=(t=this.map)==null?void 0:t._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?i:ya()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return s(this,go)}addGroupContainer(t,i,n){var o;if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let a=new Xe(t);a.addEventListener("childadded",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),a.addEventListener("childremoved",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),(i==null?void 0:i.altitude)!==void 0&&a.setAltitude(i.altitude),(i==null?void 0:i.interactive)!==void 0&&Tt(a,i.interactive,s(this,k)),s(this,k).geometry3DMap.set(t,a),(o=this.getParentContainer(n))==null||o.addEntity(a),s(this,Oe).call(this),this.render()}else L.error("Group container with ID '".concat(t,"' already exists. The group container cannot be added."));return{id:t,type:"group-container"}}addStackContainer(t,i,n){var o;if(s(this,k).geometry3DMap.has(t))L.error("Stack container with ID '".concat(t,"' already exists. The stack container cannot be added."));else{let a=new Xe(t);a.addEventListener("childadded",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),a.addEventListener("childremoved",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),a.components[0]=new rm,(i==null?void 0:i.visible)!==void 0&&(a.visible=i.visible),s(this,k).geometry3DMap.set(t,a),(o=this.getParentContainer(n))==null||o.addEntity(a)}return{id:t,type:"stack-container"}}addCustomGeometry(t,i,n,o,a){var u;if(s(this,k).geometry3DMap.has(t))L.error("Custom geometry with ID '".concat(t,"' already exists. The custom geometry cannot be added."));else{let l=new Tl(i,n),p=new xe(l,new Nr(o));p.id=t,l.mesh.userData={entityId:t,type:"custom-geometry"},s(this,k).geometry3DMap.set(p.id,p),(u=this.getParentContainer(a))==null||u.addEntity(p),this.render()}return{id:t,type:"custom-geometry"}}addGeometryGroup(t,i,n,o){var a,u;if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let l=new rt(t,new fa(n));l.addEventListener("childadded",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),l.addEventListener("childremoved",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),l.userData.dirty=!0,s(this,k).geometry3DMap.set(t,l);for(let p of i.features){if(p.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(p.geometry.type))continue;let h=p.id||p.properties.id||le(),{visible:y,...g}=n||{color:of},v=s(this,O).meshOptimizationSystem.createEntityFromFeature(h,p,g);s(this,k).geometry3DMap.set(h,v),l.userData.entities3D.add(h)}l.setVisible((a=n==null?void 0:n.visible)!=null?a:!0),(n==null?void 0:n.altitude)!=null&&l.setAltitude(n.altitude),(u=this.getParentContainer(o))==null||u.addEntity(l),s(this,Oe).call(this),this.render()}else L.error("Geometry group with ID '".concat(t,"' already exists. The geometry group cannot be added."));return s(this,O).outlineInterpolationSystem.dirty=!0,{id:t,type:"geometry-group"}}addImage(t,i,n,o){var a;try{$M(t,i,n)}catch(u){L.error(u);return}if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let u=new um(i),l=new xe(u,new Nr(n));l.id=t||le(),u.mesh.userData={entityId:l.id,type:"path"},s(this,k).geometry3DMap.set(l.id,l),(a=this.getParentContainer(o))==null||a.addEntity(l),s(this,Oe).call(this),this.render()}else L.error("Image with ID '".concat(t,"' already exists. The image cannot be added."));return{id:t,type:"image"}}addModelGroup(t,i,n,o){var a;try{AM(t,i,n)}catch(u){L.error(u);return}if(!s(this,k).geometry3DMap.has(t)&&!s(this,k).geometry2DMap.has(t)){let u=new rt(t,new fa(n));u.addEventListener("childadded",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),u.addEventListener("childremoved",()=>{s(this,Oe).call(this),s(this,ze).call(this)}),s(this,k).geometry3DMap.set(t,u),u.userData.dirty=!0,u.userData.modelURL=n.url;for(let l of i.features){let p=l.id||l.properties.id||le(),h=s(this,O).meshOptimizationSystem.createModelFromFeature(p,l,n);l.properties.interactive!==void 0&&Tt(h,l.properties.interactive,s(this,k)),s(this,k).geometry3DMap.set(p,h),u.userData.entities3D.add(p)}(a=this.getParentContainer(o))==null||a.addEntity(u),s(this,Oe).call(this),this.render()}else L.error("Model group with ID '".concat(t,"' already exists. The model group cannot be added."));return{id:t,type:"geometry-group"}}addMarker2D(t,i,n,o){var u;let a=n==null?void 0:n.id;try{V7(t,i,n||{})}catch(l){L.error(l);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let l=V(this,ap,Vb).call(this,t,new Si(i,n));l.id=a||String(l.id),a=l.id,(n==null?void 0:n.interactive)!=null&&n.interactive!=="pointer-events-auto"&&Tt(l,n==null?void 0:n.interactive,s(this,k)),(u=this.getParentContainer(o))==null||u.addEntity(l),this.render()}else L.error("Marker2D with ID '".concat(a,"' already exists. The marker cannot be added."));return{id:a,type:"marker"}}addLabel2D(t,i,n,o){var u;let a=n==null?void 0:n.id;try{R6(t,i,n||{})}catch(l){L.error(l);return}if(a===void 0||!s(this,k).geometry2DMap.has(a)&&!s(this,k).geometry3DMap.has(a)){let l=V(this,ap,Vb).call(this,t,new Ti(i,n||{},s(this,k)));l.id=a||String(l.id),a=l.id,(n==null?void 0:n.interactive)!=null&&Tt(l,n==null?void 0:n.interactive,s(this,k)),(u=this.getParentContainer(o))==null||u.addEntity(l),s(this,ze).call(this),this.render()}else L.error("Label2D with ID '".concat(a,"' already exists. The label cannot be added."));return{id:a,type:"label"}}addPath(t,i={},n){var u,l;try{j7(t,i||{})}catch(p){L.error(p);return}let o=new Mi(t,Mv(i)),a=new xe(o,new Nr({color:(u=i==null?void 0:i.color)!=null?u:"#ff834c"}));return a.id=(i==null?void 0:i.id)||le(),o.mesh.userData={entityId:a.id,type:"path"},s(this,k).geometry3DMap.set(a.id,a),(i==null?void 0:i.interactive)!=null&&Tt(a,i==null?void 0:i.interactive,s(this,k)),(l=this.getParentContainer(n))==null||l.addEntity(a),s(this,Oe).call(this),this.render(),{id:a.id,type:"path"}}updateWatermark(t){s(this,O).watermarkSystem.options=t,s(this,O).watermarkSystem.dirty=!0,s(this,O).collisionSystem.collidersDirty=!0,this.render()}remove(t){var n;let i;if(typeof t=="string"||typeof t=="number"?(i=s(this,k).geometry2DMap.get(t),i==null&&(i=s(this,k).geometry3DMap.get(t))):typeof t.id=="string"||typeof t.id=="number"?(i=s(this,k).geometry2DMap.get(t.id),i==null&&(i=s(this,k).geometry3DMap.get(t.id))):i=t,i!=null){if(i.type==="custom-geometry")s(this,k).geometry3DMap.delete(i.id),i.object3d&&Ye(i.object3d);else if(i.type==="group-container"){s(this,k).geometry3DMap.delete(i.userData.entityId);for(let o of i.childrenIds.values())this.remove(o),i.userData.entities2D.delete(o);Ye(i)}else if(i.type==="geometry-group"){s(this,k).geometry3DMap.delete(i.userData.entityId);for(let o of i.userData.entities3D.values())this.remove(o),i.userData.entities3D.delete(o);Ye(i)}else if(i.type==="geometry"||i.type==="model"||i.type==="path"){let o=i.components[0];i.object3d&&(((n=i.parent)==null?void 0:n.type)==="geometry-group"&&i.parent.userData.entities3D.delete(i.id),Ye(i.object3d)),o.outline&&Ye(o.outline),"focusMesh"in o&&o.focusMesh!=null&&Ye(o.focusMesh),s(this,k).geometry3DMap.delete(i.id)}else i.type==="marker"||i.type==="label"?(i.object3d&&Ye(i.object3d),i.type==="label"&&delete s(this,O).twoDDrawSystem.textCache[i.id],s(this,k).geometry2DMap.delete(i.id)):i.type==="image"&&(i.object3d&&Ye(i.object3d),s(this,k).geometry3DMap.delete(i.id));s(this,Oe).call(this),s(this,ze).call(this),this.render()}}getScene(){return this.getState("__scene")}getCurrentSceneGLTF(t){return s(this,O).exporterSystem.getCurrentSceneGLTF(t)}getBoundingArea(t){(s(this,O).renderSystem.threeDdirty||s(this,O).renderSystem.twoDdirty)&&this.renderSync();let i=new Vi;if(t==null)i.setFromObject(s(this,k).entityScene);else{let n=bu(s(this,k),t);if((n==null?void 0:n.type)==="geometry"&&(n==null?void 0:n.object3d)!=null){let o=n.components[0],a=o instanceof Ie?o.geometry:void 0;o.mesh instanceof za&&a?(a.computeBoundingBox(),a.boundingBox&&i.union(a.boundingBox)):i.setFromObject(n.object3d)}else((n==null?void 0:n.type)==="geometry-group"||(n==null?void 0:n.type)==="group-container")&&(n==null?void 0:n.userData.entityId)!=null&&i.setFromObject(n)}if(z7(i))return Y0(i).map(this.convert3DMapPositionToCoordinate)}getState(t){var n;if(t==null)return{type:"map-view",hoverColor:s(this,k).hoverColor};let i=bu(s(this,k),t);if((i==null?void 0:i.type)==="custom-geometry"){let o=i.components[0],a=i.components[1];return{id:i.id,type:"custom-geometry",visible:a.visible,altitude:a.altitude,parent:(n=i.parent)==null?void 0:n.userData.entityId,position:this.convert3DMapPositionToCoordinate(o.position)}}else if((i==null?void 0:i.type)==="geometry-group"){let o=[];for(let u of i.userData.entities3D.values()){let l=this.getState(u);((l==null?void 0:l.type)==="geometry"||(l==null?void 0:l.type)==="model")&&o.push(l)}let a=i.components[0];return{id:i.userData.entityId,type:"geometry-group",visible:i.visible,opacity:a.opacity,color:a.color,altitude:i.altitude,topColor:a.topColor,outline:a.outline,shading:a.shading,texture:a.texture,topTexture:a.topTexture,interactive:Array.from(i.userData.entities3D.values()).map(u=>s(this,k).geometry3DMap.get(u)).every(u=>u&&u.components[2]!=null),children:Array.from(i.userData.entities3D.values()).map(u=>this.getState(u)).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(o=>this.getState(o)).filter(Boolean)};if((i==null?void 0:i.type)==="label"){let o=i.components[0],a=i.object3d.parent,u=a==null?void 0:a.userData.entityId;return{id:i.id,type:"label",text:o.text||"",parent:{id:u,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),enabled:o.enabled,initialRank:mu(o.initialRank),options:{rank:mu(o.rank),appearance:o.appearance,interactive:i.components[1]!=null}}}else if((i==null?void 0:i.type)==="marker"){let o=i.components[0],a=i.object3d.parent,u=a==null?void 0:a.userData.entityId;return{id:i.id,type:"marker",enabled:o.enabled,parent:{id:u,type:a==null?void 0:a.type},position:this.convert3DMapPositionToCoordinate(i.position),element:o.containerEl,initialRank:mu(o.initialRank),options:{rank:mu(o.rank),interactive:i.components[1]!=null||!1}}}else if((i==null?void 0:i.type)==="geometry"){let{color:o,hoverColor:a,initialColor:u,topColor:l}=i.components[1],p=i.components[0],h=i.components[1];return{id:i.id,type:"geometry",opacity:h.opacity,color:o,focusable:p.focusable,topColor:l,initialColor:u,hoverColor:a,height:h.height,visible:h.visible,outline:h.outline,showImage:h.showImage,texture:h.texture,topTexture:h.topTexture,flipImageToFaceCamera:h.flipImageToFaceCamera,position:this.convert3DMapPositionToCoordinate(p.position),interactive:i.components[2]!=null}}else if((i==null?void 0:i.type)==="model"){let o=i.components[0],a=i.components[2];return{id:i.id,type:"model",position:this.convert3DMapPositionToCoordinate(o.position),interactive:a!=null}}else if((i==null?void 0:i.type)==="path"){let o=i.components[0],a=i.components[2],u=i.components[1];return{id:i.id,type:"path",position:this.convert3DMapPositionToCoordinate(o.position),visible:u.visible,interactive:a!=null,completeFraction:o.completeFraction,color:u.color,accentColor:o.accentColor,nearRadius:o.nearRadius,farRadius:o.farRadius,animateArrowsOnPath:o.animateArrowsOnPath,displayArrowsOnPath:o.displayArrowsOnPath}}else if((i==null?void 0:i.type)==="image"){let o=i.components[0];return{id:i.id,type:"image",position:this.convert3DMapPositionToCoordinate(o.position),visible:i.components[1].visible,flipImageToFaceCamera:i.components[1].flipImageToFaceCamera}}else return}}setState(t,i){var o;if(typeof t=="object"&&"hoverColor"in t&&i==null){s(this,k).hoverColor=(o=t.hoverColor)!=null?o:s(this,k).hoverColor;return}let n=bu(s(this,k),t);if(n!=null){if(n.type==="custom-geometry"){let a=s(this,k).geometry3DMap.get(n.id);if(a instanceof xe&&a.components[0]instanceof Tl){let u=i;Ca(n,u.visible),Cf(n,u.altitude),bv(n,u.position,this.convertTo3DMapPosition),Cv(n,this.getParentContainer(u.parent,!1))}}else if(n.type==="model"||n.type==="path"){let a=i;Tt(n,a.interactive,s(this,k))&&s(this,Oe).call(this),n.type==="path"&&(Cf(n,a.altitude),$6(n,a))}else if(n.type==="group-container"){let a=i;Ca(n,a.visible)&&(s(this,O).outlineInterpolationSystem.dirty=!0,s(this,O).pathSystem.altitudeDirty=!0),Cf(n,a.altitude)&&(s(this,O).pathSystem.altitudeDirty=!0),Tt(n,a.interactive,s(this,k))&&s(this,Oe).call(this)}else if(n.type==="geometry-group"){let a=i;Ca(n,a.visible)&&(s(this,O).outlineInterpolationSystem.dirty=!0),N6(n,s(this,k),a)&&(s(this,O).outlineInterpolationSystem.dirty=!0),Sv(n,a.outline)&&(s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),a.height!=null&&(gv(n,s(this,k),a.height),s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),a.altitude!=null&&(n.setAltitude(a.altitude),n.userData.outlineDirty=!0),Z6(n,a),G6(n,a.shading),Y6(n,s(this,k),a.opacity)&&(n.userData.outlineDirty=!0,s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),Tt(n,a.interactive,s(this,k))&&(s(this,Oe).call(this),s(this,ze).call(this))}else if(n.type==="geometry"){if(n.components[0]instanceof Ie){let a=i;Ca(n,a.visible)&&(s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),Sv(n,a.outline)&&(s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),V6(n,a),a.focusable!=null&&(n.components[0].focusable=a.focusable,s(this,O).geometryInFocusSystem.focusablesDirty=!0),q6(n,a.opacity)&&(s(this,O).meshDetachmentSystem.dirty=!0,s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),xv(n,a.flipImageToFaceCamera),a.height!=null&&(gv(n,s(this,k),a.height),s(this,O).outlineInterpolationSystem.geometries3DDirty=!0),z6(n,a)&&(s(this,O).meshDetachmentSystem.dirty=!0),vv(n,a),X6(n,a.hoverColor),Tt(n,a.interactive,s(this,k))}s(this,Oe).call(this)}else if(n.type==="label"||n.type==="marker"){let a=i;W6(n,i,s(this,k)),H6(n,i,s(this,k))&&s(this,ze).call(this),bv(n,a.position,this.convertTo3DMapPosition),Cv(n,this.getParentContainer(a.parent,!1))&&(s(this,ze).call(this),s(this,O).panBoundsSystem.dirty=!0),j6(n,a.enabled)}else if(n.type==="image"){let a=i;Ca(n,a.visible),xv(n,a.flipImageToFaceCamera)}this.render()}}convertTo3DMapPosition(t,i,n=0,o){var l,p,h,y,g;if(Array.isArray(t))return this.convertTo3DMapPosition(t[1],t[0],(l=t[2])!=null?l:n,typeof i=="function"?i:void 0);if(typeof i!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:a,y:u}=lf((h=(p=s(this,k).center)==null?void 0:p[1])!=null?h:0,(g=(y=s(this,k).center)==null?void 0:y[0])!=null?g:0,t,i);return o?(o.set(a,u,n),o):new q(a,u,n)}get backgroundColor(){return s(this,or).backgroundColor}getCenter(t){let i=Array.isArray(t)?t:this.getBoundingArea(t);return i?Z7(i):void 0}isInView(t){let i=bu(s(this,k),t);if(s(this,sp).identity().multiply(s(this,Ue).projectionMatrix).multiply(s(this,Ue).matrixWorldInverse),s(this,Oa).setFromProjectionMatrix(s(this,sp)),i instanceof Cr)return s(this,Oa).containsPoint(i.position);if(i instanceof xe){let n=i==null?void 0:i.components[0];if(n instanceof Tl||n instanceof uo)return s(this,Oa).containsPoint(this.convertTo3DMapPosition(n.feature.geometry.coordinates));if(n instanceof Ie){let o=new Vi(this.convertTo3DMapPosition(n.featureBbox[1],n.featureBbox[0],0),this.convertTo3DMapPosition(n.featureBbox[3],n.featureBbox[2],0));return s(this,Oa).intersectsBox(o)}}return!1}getSystems(){return s(this,O)}getInternalState(){return s(this,k)}getTweenGroup(){return s(this,k).tweenGroup}};Ht=new WeakMap,Ue=new WeakMap,Ku=new WeakMap,Il=new WeakMap,yo=new WeakMap,Da=new WeakMap,wl=new WeakMap,Qu=new WeakSet,Gb=c(function(t){var i;s(this,go)!=="outdoors-overlay"&&((i=this.map)==null||i.setPixelRatio(t)),s(this,k).pixelRatio=this.resolutionScale},"#setResolutionScale"),k=new WeakMap,Me=new WeakMap,Xr=new WeakMap,Ge=new WeakMap,Oi=new WeakMap,or=new WeakMap,O=new WeakMap,ep=new WeakMap,ze=new WeakMap,Oe=new WeakMap,vm=new WeakSet,n8=c(function(){P(this,Me,document.createElement("div")),s(this,Me).classList.add("mappedin__smart-collision-engine__container"),P(this,Xr,document.createElement("canvas")),s(this,Xr).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(s(this,Me)),P(this,Ge,document.createElement("canvas")),s(this,Ge).classList.add("mappedin__smart-collision-engine__container"),s(this,Ge).width=s(this,Me).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Me).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Me).clientWidth+"px",s(this,Ge).style.height=s(this,Me).clientHeight+"px",s(this,Me).appendChild(s(this,Xr)),s(this,Me).appendChild(s(this,Ge)),s(this,Xr).width=s(this,Me).clientWidth,s(this,Xr).height=s(this,Me).clientHeight,s(this,Ge).width=s(this,Me).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Me).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Me).clientWidth+"px",s(this,Ge).style.height=s(this,Me).clientHeight+"px"},"#renderEntity2DContainer"),bm=new WeakSet,o8=c(function(){P(this,Oi,document.createElement("div")),s(this,Oi).classList.add("mappedin-2d-entities"),Object.assign(s(this,Oi).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(s(this,Oi))},"#renderEntityDOMContainer"),Cm=new WeakSet,a8=c(function(){s(this,Ge).width=s(this,Me).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Me).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Me).clientWidth+"px",s(this,Ge).style.height=s(this,Me).clientHeight+"px",s(this,Xr).width=s(this,Me).clientWidth,s(this,Xr).height=s(this,Me).clientHeight,s(this,Ge).width=s(this,Me).clientWidth*this.resolutionScale,s(this,Ge).height=s(this,Me).clientHeight*this.resolutionScale,s(this,Ge).style.width=s(this,Me).clientWidth+"px",s(this,Ge).style.height=s(this,Me).clientHeight+"px",s(this,O).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),go=new WeakMap,tp=new WeakMap,rp=new WeakMap,El=new WeakMap,xm=new WeakMap,ip=new WeakMap,np=new WeakMap,op=new WeakMap,_l=new WeakMap,ap=new WeakSet,Vb=c(function(t,i,n){let o=new Cr(i,this.convertTo3DMapPosition(t[1],t[0],t[2]||n||0));return s(this,k).geometry2DMap.set(o.id,o),o},"#createEntity2D"),Oa=new WeakMap,sp=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,c(Wb,"Core");var Nb=Wb,lp=Nb;m();function rF(r,e){iF(r,e)(r.getScene(),e),nF(r,e),e.addFolder("Export").add({export:async()=>{let a=await r.getCurrentSceneGLTF({binary:!0}),u=new Blob([a],{type:"application/octet-stream"});var l=document.createElement("a");document.body.appendChild(l),l.style.display="none";let p=window.URL.createObjectURL(u);l.href=p,l.download="scene.glb",l.click(),window.URL.revokeObjectURL(p)}},"export");let n=e.addFolder("Camera"),o={get bearing(){return r.camera.bearing},set bearing(a){r.camera.setBearing(a)},get pitch(){return r.camera.pitch},set pitch(a){r.camera.setPitch(a)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(a){r.camera.setZoomLevel(a)}};n.add(o,"bearing",-359,359,1),n.add(o,"pitch",r.camera.minPitch,r.camera.maxPitch,1),n.add(o,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}c(rF,"mountSceneGraphVisualizer");function iF(r,e){let t=e;return c(function i(n,o){let a=o.addFolder("".concat([n.type]," ").concat(n.id.slice(0,16)));if(o.close(),n.type==="geometry"||n.type==="model"||n.type==="path"||n.type==="image"){let u={get height(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.height:0},set height(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{height:l})},set flipImageToFaceCamera(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="image"&&r.setState(n,{flipImageToFaceCamera:l})},get flipImageToFaceCamera(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="image"?l.flipImageToFaceCamera:!1},set visible(l){let p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image")&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(n,{outline:l})},get outline(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.outline:!1},get opacity(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"?l.opacity:1},set opacity(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{opacity:l})},get color(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry"&&l.color?X(l.color).toHexString():"#ffffff"},set color(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry"&&r.setState(p,{color:l})},set interactive(l){let p=r.getState(n.id);((p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path")&&(r.setState(n,{interactive:l}),t.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(n.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(n.id);return(l==null?void 0:l.type)==="path"?l.completeFraction:1},set completeFraction(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="path"&&r.setState(p,{completeFraction:l})},focus:()=>{}};a.add(u,"focus").onChange(()=>{let l=r.getState(n.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))}),a.add(u,"visible"),n.type==="image"?a.add(u,"flipImageToFaceCamera"):(a.add(u,"interactive"),n.type==="path"&&a.add(u,"completeFraction",0,1,.1),n.type!=="model"&&(a.addColor(u,"color"),a.add(u,"outline"))),n.type==="geometry"&&(a.add(u,"height"),a.add(u,"opacity",0,1,.1))}else if(n.type==="marker"){let u={get interactive(){var p;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="marker"&&(r.setState(p,{options:{interactive:l}}),t.controllersRecursive().forEach(h=>h.updateDisplay()))},focus:()=>{}};a.add(u,"focus").onChange(()=>{let l=r.getState(n.id);(l==null?void 0:l.type)==="marker"&&r.camera.focusOn([l.position])}),a.add(u,"interactive")}else if(n.type==="label"){let u={get interactive(){var p;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="label"&&(r.setState(p,{options:{interactive:l}}),t.controllersRecursive().forEach(h=>h.updateDisplay()))},get text(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?l.text:""},set text(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:l})},get"Text Color"(){var p,h;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="label"&&r.setState(n.id,{text:u.text,options:{appearance:{text:{foregroundColor:l}}}})},get"Text Size"(){var p,h;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{text:{size:l}}}})},get"Icon Size"(){var p,h;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{iconSize:l}}}})},get"Active Foreground Color"(){var p,h,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.foregroundColor)==null?void 0:y.active:"#000000"},set"Active Foreground Color"(l){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{foregroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor,active:l}}}}})},get"Inactive Foreground Color"(){var p,h,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.foregroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Foreground Color"(l){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{foregroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor,inactive:l}}}}})},get"Active Background Color"(){var p,h,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.backgroundColor)==null?void 0:y.active:"#000000"},set"Active Background Color"(l){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{backgroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor,active:l}}}}})},get"Inactive Background Color"(){var p,h,y;let l=r.getState(n.id);return(l==null?void 0:l.type)==="label"?(y=(h=(p=l.options.appearance)==null?void 0:p.marker)==null?void 0:h.backgroundColor)==null?void 0:y.inactive:"#000000"},set"Inactive Background Color"(l){var h,y;let p=r.getState(n.id);(p==null?void 0:p.type)==="label"&&r.setState(p,{text:u.text,options:{appearance:{marker:{backgroundColor:{...(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor,inactive:l}}}}})},focus:()=>{}};a.add(u,"focus").onChange(()=>{let l=r.getState(n.id);(l==null?void 0:l.type)==="label"&&r.camera.focusOn([l.position])}),a.add(u,"interactive"),a.add(u,"text"),a.add(u,"Text Size",10,50),a.add(u,"Icon Size",10,50),a.addColor(u,"Text Color"),a.addColor(u,"Active Background Color"),a.addColor(u,"Inactive Background Color"),a.addColor(u,"Active Foreground Color"),a.addColor(u,"Inactive Foreground Color")}else if(n.type==="geometry-group"){let u={get opacity(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.opacity:1},set opacity(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{opacity:l})},set visible(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.visible:!1},set outline(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(n,{outline:l})},get outline(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.outline:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="geometry-group"&&(r.setState(n,{interactive:l}),t.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="geometry-group"?l.interactive:!1},get shadingStart(){var p,h;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{start:l}})},get shadingEnd(){var p,h;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{end:l}})},get shadingIntensity(){var p,h;let l=r.getState(n.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(n.id);(p==null?void 0:p.type)==="geometry-group"&&r.setState(p,{shading:{intensity:l}})}};a.add(u,"visible"),a.add(u,"opacity",0,1,.1),a.add(u,"interactive"),a.add(u,"outline"),a.add(u,"shadingStart",0,1,.1),a.add(u,"shadingEnd",0,1,.1),a.add(u,"shadingIntensity",0,1,.1)}else if(n.type==="group-container"){let u={set visible(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&r.setState(n,{visible:l})},get visible(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="group-container"?l.visible:!1},set interactive(l){let p=r.getState(n.id);(p==null?void 0:p.type)==="group-container"&&(r.setState(p,{interactive:l}),t.controllersRecursive().forEach(h=>h.updateDisplay()))},get interactive(){let l=r.getState(n.id);return(l==null?void 0:l.type)==="group-container"?l.interactive:!1}};a.add(u,"visible"),a.add(u,"interactive")}if(a.close(),n.children)for(let u of n.children.values())i(u,a)},"parseChild")}c(iF,"createParseChild");function nF(r,e){let t=e.addFolder("Watermark"),i={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};t.add(i,"padding",0,100,1),t.add(i,"scale",.5,1.5,.1),t.add(i,"color",["dark","light"]),t.add(i,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),t.add(i,"iconOnly"),t.onChange(()=>{r.updateWatermark(i)})}c(nF,"createWatermarkChild");var s8="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",oF="https://auth.mappedin.com/oauth2/token";async function l8(r,e){var t,i,n,o,a;if((t=e==null?void 0:e.outdoorView)!=null&&t.enabled&&((i=e==null?void 0:e.outdoorView)!=null&&i.headers)){let{Map:u,MercatorCoordinate:l}=await import("./outdoor-context-v4-B4BXJOPD.js"),p=e.outdoorView.headers;p==null&&(p=await W7(oF));let h=e.center||[0,0],y=new u({container:r,style:e.outdoorView.style||s8,center:h,attributionControl:!1,zoom:(n=e.zoomLevel)!=null?n:Ub,pitch:(o=e.pitch)!=null?o:jb,bearing:(a=e.bearing)!=null?a:Hb,transformRequest:q0(p),trackResize:!1,pixelRatio:ya(),antialias:typeof e.antialias=="boolean"?e.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),g=y.painter.context.gl,v=new lp(r,{center:h,zoomLevel:y.getZoom(),pitch:y.getPitch(),bearing:y.getBearing(),gl:g,map:y,mode:"outdoors-interleaved",watermark:e.watermark,attribution:e.attribution,antialias:e.antialias}),S={center:y.getCenter().toArray(),zoom:y.getZoom(),bearing:y.getBearing(),pitch:y.getPitch()};y.setMinZoom(v.camera.minZoomLevel),y.setMaxZoom(v.camera.maxZoomLevel),v.on("camera-change",w=>{S.center=w.center,S.zoom=w.zoomLevel,S.bearing=w.bearing,S.pitch=w.pitch,y.jumpTo(S)});let T=l.fromLngLat(h,0),b=cf(T,v.viewCamera,v.camera,()=>{v.renderSync()});y.on("style.load",async()=>{y&&(y.addLayer(b),v.renderSync())});let x=!1,I=!1;y.on("idle",()=>{y&&(x||(v.publish("outdoor-view-loaded"),x=!0),I||(I=!0,v.publish("outdoor-style-loaded")))});let E=c(w=>{w&&(w.sourceDataType==="metadata"||w.sourceDataType==="visibility"||w.dataType==="style"||w.type==="terrain")&&v.getSystems().htmlControlsSystem.updateData(y)},"updateData");return y.on("styledata",w=>{y&&w&&w.dataType==="style"&&w.type==="styledata"&&(I=!1),E(w)}),y.on("sourcedata",E),y.on("terrain",E),y.on("error",w=>{var _;if(((_=w.error)==null?void 0:_.url)===s8){L.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(p["x-mappedin-tiles-key"],'"'));return}L.warn(w)}),v}else return new lp(r,e)}c(l8,"createRenderer");var c8=50,aF=1e3,Ve,Yr,Dl,Li,Zr,Lt,up,Ol,La,pp,Xb,Aa,dp,hp,fp,mp,Cn,Sm,u8,yp,vo,gp,Yb,Zb=class Zb extends ${constructor({currentMapGetter:t}){super();M(this,pp);M(this,Sm);M(this,gp);M(this,Ve,void 0);M(this,Yr,c8);M(this,Dl,0);M(this,Li,void 0);M(this,Zr,!1);M(this,Lt,[]);M(this,up,0);M(this,Ol,!1);M(this,La,"collapsed");d(this,"expandedFactor",0);M(this,Aa,"all-floors");M(this,dp,c(()=>{let t=s(this,Ve).call(this);if(s(this,up)===this.expandedFactor||t==null||!s(this,Zr))return;P(this,up,this.expandedFactor);let i=xr(this.expandedFactor,0,1,0,s(this,Yr)),o=xr(this.expandedFactor,0,.1,0,1)===0;s(this,Lt).forEach((a,u)=>{t.renderer.setState(a.containerId,{visible:o?a.id===t.currentFloorId:!0,altitude:i*u})}),this.expandedFactor===0?(P(this,Zr,!1),t.renderer.camera.setPanMode("default"),s(this,vo)&&s(this,vo).call(this)):this.expandedFactor===1&&(P(this,Zr,!1),s(this,vo)&&s(this,vo).call(this))},"#handlePreRender"));M(this,hp,c(()=>{var t,i,n;this.expanded&&P(this,Dl,(i=(t=s(this,Ve).call(this))==null?void 0:t.renderer.camera.elevation)!=null?i:0),(n=s(this,Ve).call(this))==null||n.renderer.on("user-interaction-end",s(this,mp))},"#handleUserInteractionStart"));M(this,fp,c(()=>{var i;let t=s(this,Ve).call(this);if(t!=null&&this.expanded&&s(this,Ol)&&!s(this,Zr)){let n=[1/0,t.currentFloorId];for(let o=0;o<s(this,Lt).length;o++){let a=s(this,Lt)[o],u=Math.abs(((i=t.renderer.camera.elevation)!=null?i:0)-o*s(this,Yr));u<s(this,Yr)/3&&(n[0]=u,n[1]=a.id)}n[1]!==t.currentFloorId&&(t.currentFloorId=n[1],s(this,Lt).forEach(o=>{t.renderer.setState(o.containerId,{visible:s(this,Aa)==="all-floors"?!0:t.currentFloor.id===o.id})}),t.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:t.currentFloorId}))}},"#determineCurrentMapBasedOnElevation"));M(this,mp,c(()=>{var i,n;let t=s(this,Ve).call(this);if(this.expanded&&t&&s(this,Dl)!==((i=t.renderer.camera.elevation)!=null?i:0)){let o=[1/0,t.currentFloorId,0];for(let a=0;a<s(this,Lt).length;a++){let u=s(this,Lt)[a],l=Math.abs(((n=t.renderer.camera.elevation)!=null?n:0)-a*s(this,Yr));l<o[0]&&(o[0]=l,o[1]=u.id,o[2]=a*s(this,Yr))}s(this,Ol)&&V(this,Sm,u8).call(this,o[2]),P(this,Dl,0),t.renderer.off("user-interaction-end",s(this,mp))}},"#handleUserInteractionEnd"));M(this,Cn,null);M(this,yp,null);M(this,vo,void 0);P(this,Ve,t);let i=s(this,Ve).call(this);i!=null&&i.id!=="outdoors"&&(i.renderer.on("user-interaction-start",s(this,hp)),i.renderer.on("camera-change",s(this,fp)),i.renderer.on("pre-render",s(this,dp)))}get state(){return s(this,La)}get expanded(){return s(this,La)!=="collapsed"}get gapBelowFloors(){return s(this,Yr)}get includedFloors(){var t;return(t=s(this,pp,Xb))!=null&&t.api.mapData?s(this,Lt).map(i=>{var n,o;return(o=(n=s(this,pp,Xb))==null?void 0:n.api.mapData)==null?void 0:o.getById("floor",i.id)}).filter(Boolean):[]}get floorVisibilityMode(){return s(this,Aa)}setFloorVisiblityMode(t){P(this,Aa,t);let i=s(this,Ve).call(this);i!=null&&s(this,Lt).forEach(n=>{i.renderer.setState(n.containerId,{visible:s(this,Aa)==="all-floors"?!0:i.currentFloor.id===n.id})})}changeFloorOnElevationChanges(t){P(this,Ol,t)}async expand(t){var n,o,a;let i=s(this,Ve).call(this);if(i!=null)return P(this,Yr,(n=t==null?void 0:t.distanceBetweenFloors)!=null?n:c8),P(this,Lt,(t==null?void 0:t.includedFloors)!=null&&(t==null?void 0:t.includedFloors.length)>0?t==null?void 0:t.includedFloors.map(u=>i.floorsById.get(u.id)).filter(Boolean):i.currentFloorStack.floorObjects),s(this,Lt).sort((u,l)=>u.elevation-l.elevation),s(this,Lt).length<=1||this.expanded===!0?Promise.resolve():(P(this,Zr,!0),i.api.Camera.setPanMode((o=t==null?void 0:t.cameraPanMode)!=null?o:"elevation"),this.changeFloorOnElevationChanges((a=t==null?void 0:t.changeFloorOnElevationChanges)!=null?a:!0),V(this,gp,Yb).call(this,"expand",t).then(()=>{P(this,La,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{P(this,Zr,!1)}))}async collapse(t){let i=s(this,Ve).call(this);if(i!=null)return this.expanded===!0?(P(this,Zr,!0),i.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),V(this,gp,Yb).call(this,"collapse",t).then(()=>{P(this,La,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{P(this,Zr,!1)})):Promise.resolve()}destroy(){let t=s(this,Ve).call(this);t!=null&&(t.renderer.off("user-interaction-start",s(this,hp)),t.renderer.off("camera-change",s(this,fp)),t.renderer.off("pre-render",s(this,dp)))}};Ve=new WeakMap,Yr=new WeakMap,Dl=new WeakMap,Li=new WeakMap,Zr=new WeakMap,Lt=new WeakMap,up=new WeakMap,Ol=new WeakMap,La=new WeakMap,pp=new WeakSet,Xb=c(function(){return s(this,Ve).call(this)},"#currentMap"),Aa=new WeakMap,dp=new WeakMap,hp=new WeakMap,fp=new WeakMap,mp=new WeakMap,Cn=new WeakMap,Sm=new WeakSet,u8=c(function(t){var n,o,a;s(this,Cn)&&s(this,Cn).stop();let i=s(this,Ve).call(this);i!=null&&(P(this,Cn,new dt({elevation:(n=i.renderer.camera.elevation)!=null?n:0}).to({elevation:t},150).easing(Ne.Quadratic.Out).onComplete(()=>{var u;s(this,Cn)&&((u=s(this,Ve).call(this))==null||u.renderer.getTweenGroup().remove(s(this,Cn)))}).onUpdate(({elevation:u})=>{i.renderer.camera.setElevation(u)}).start()),(o=s(this,Ve).call(this))==null||o.renderer.getTweenGroup().add(s(this,Cn)),(a=s(this,Ve).call(this))==null||a.renderer.render())},"#animateElevationTo"),yp=new WeakMap,vo=new WeakMap,gp=new WeakSet,Yb=c(function(t,i){var u,l,p,h;s(this,Li)&&s(this,Li).stop();let n=s(this,Ve).call(this);if(n==null)return Promise.reject(new Error("No current map"));let o=s(this,Lt).indexOf(n.currentFloor)*s(this,Yr),a=(u=n.renderer.camera.elevation)!=null?u:0;return P(this,yp,new Promise(y=>{P(this,vo,y)})),P(this,Li,new dt({percentExpanded:this.expandedFactor}).to({percentExpanded:t==="expand"?1:0},(l=i==null?void 0:i.duration)!=null?l:aF).easing(Cl[(i==null?void 0:i.easing)||"ease-in-out"]).onUpdate(({percentExpanded:y})=>{this.expandedFactor=y,n.renderer.camera.setElevation(t==="expand"?o*y:a*y)}).onComplete(()=>{var y;s(this,Li)&&((y=s(this,Ve).call(this))==null||y.renderer.getTweenGroup().remove(s(this,Li)))}).start()),s(this,Li).cameraAnimation=!0,(p=s(this,Ve).call(this))==null||p.renderer.getTweenGroup().add(s(this,Li)),(h=s(this,Ve).call(this))==null||h.renderer.render(),s(this,yp)},"#animate"),c(Zb,"StackedMaps");var cp=Zb;m();var Ll,zb=class zb{constructor(e,t,i,n){d(this,"id");d(this,"externalId");d(this,"name");d(this,"type");d(this,"floorIds");d(this,"defaultFloorId");d(this,"floorObjects",[]);d(this,"floorObjectsByElevation",new Map);d(this,"metadata");d(this,"footprint");d(this,"containerId");d(this,"facade");d(this,"renderer");M(this,Ll,void 0);var a;this.id=e.id,this.externalId=e.externalId,this.name=e.name,this.type=e.type,this.metadata=e.metadata,this.footprint=e.footprint,this.floorIds=(a=e.floors)!=null?a:e.maps,this.defaultFloorId=e.defaultFloor,this.renderer=i;let o=i.addGroupContainer(this.id,{visible:!0,interactive:!0},t);this.containerId=o.id.toString(),this.facade=n}get defaultFloor(){if(s(this,Ll)==null){this.floorObjects.length===0&&L.throw("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let e;this.defaultFloorId&&(e=this.floorObjects.find(t=>t.id===this.defaultFloorId)),e||(e=this.floorObjects.reduce((t,i)=>Math.abs(i.elevation)<Math.abs(t.elevation)?i:t)),P(this,Ll,e)}return s(this,Ll)}addFloor(e){if(this.floorObjectsByElevation.has(e.elevation)){L.error("Floor with same elevation ".concat(e.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(e.id,") will not be added."));return}e.load(),this.floorObjects.push(e),this.floorObjectsByElevation.set(e.elevation,e)}setFacadeVisible(e){var t,i;(i=(t=this.facade)==null?void 0:t.spaces)==null||i.forEach(n=>{this.renderer.setState(n.spaceId,{visible:e})})}};Ll=new WeakMap,c(zb,"FloorStackObject");var vp=zb;m();function p8(r,e,t){let i=[];for(let n of r){let o={floor:n,visible:!1,visibleLayers:[],expandFootprint:!1};n.id===e.id?(o.visible=!0,o.visibleLayers=[pi,He,Xn],n.elevation<0&&(o.expandFootprint=!0,o.visibleLayers.push(xs))):t.includes(n.id)&&n.elevation<e.elevation?(o.visible=!0,o.visibleLayers=[xs,pi,He],n.elevation<0&&(o.expandFootprint=!0)):e.elevation>0&&n.elevation<e.elevation&&n.elevation>=0&&(o.visible=!0,o.visibleLayers=[xs]),i.push(o)}return i}c(p8,"getVisiblityState");m();m();var sF=300,d8=17,sr,ka,Cp,Al,xp,Fa,At,ar,Sp,qb,Mp,$b,Tm,h8,kl,Mm,xn,Tp,Jb,Pp,Kb,Qb=class Qb extends ${constructor(t,i,{currentMapGetter:n}){super();M(this,At);M(this,Sp);M(this,Mp);M(this,Tm);M(this,kl);M(this,Tp);M(this,Pp);M(this,sr,void 0);M(this,ka,!1);M(this,Cp,d8);M(this,Al,{});M(this,xp,void 0);M(this,Fa,void 0);M(this,xn,new Set);P(this,sr,t),P(this,xp,n),P(this,Fa,i)}enable(t){var i;P(this,Cp,(i=t==null?void 0:t.minZoomLevel)!=null?i:d8),this.enabled||(s(this,sr).on("geometry-in-focus",n=>V(this,Tp,Jb).call(this,n)),V(this,Pp,Kb).call(this,!0),P(this,ka,!0))}disable(){P(this,ka,!1),s(this,sr).off("geometry-in-focus",t=>V(this,Tp,Jb).call(this,t)),V(this,Pp,Kb).call(this,!1)}get enabled(){return s(this,ka)}setDefaultFloorForStack(t,i){s(this,At,ar)==null&&L.throw("Current map does not exist.");let n=s(this,At,ar).floorsById.get(i.id);if(n==null){L.warn("Floor (".concat(i.id,") does not exist. Default floor will not be set."));return}if(n.floorStackId!==t.id){L.warn("Floor (".concat(i.id,") does not belong to floor stack (").concat(t.id,"). Default floor will not be set."));return}s(this,Al)[t.id]=i.id}resetDefaultFloorForStack(t){delete s(this,Al)[t.id]}};sr=new WeakMap,ka=new WeakMap,Cp=new WeakMap,Al=new WeakMap,xp=new WeakMap,Fa=new WeakMap,At=new WeakSet,ar=c(function(){return s(this,xp).call(this)},"#currentMap"),Sp=new WeakSet,qb=c(function(t){var a;let i=s(this,At,ar).floorStacksById.get(t);if(!i)return;let n=(a=s(this,Al)[i.id])!=null?a:i.defaultFloor.id,o=s(this,At,ar).floorsById.get(n);if(o)return o},"#getDefaultFloorForStack"),Mp=new WeakSet,$b=c(function(t){let i=s(this,At,ar).floorStacksById.get(t);if(!i)return;let n=V(this,Sp,qb).call(this,i.id);n&&s(this,At,ar).setFloor(n.id)},"#setFloorStack"),Tm=new WeakSet,h8=c(function(t){var i;return(i=s(this,Fa).getMapDataInternal())==null?void 0:i.facadesBySpaceId[t]},"#getFacadeBySpaceId"),kl=new WeakSet,Mm=c(function(t,i,n=sF){var l;let o=(l=s(this,Fa).getMapDataInternal())==null?void 0:l.getById("facade",t);if(!o)return;let a=s(this,At,ar).floorStacksById.get(o.floorStack.id);if(!a)return;if(i==="open"){let p=V(this,Sp,qb).call(this,o.floorStack.id);if(!p)return;p.setVisible(!0)}let u=new dt({opacity:i==="open"?1:0}).easing(Ne.Quadratic.In).to({opacity:i==="open"?0:1},n).onUpdate(({opacity:p})=>{o.spaces.forEach(h=>{let y=s(this,sr).getState(h.id);y&&s(this,sr).setState(y,{opacity:p})})}).onComplete(()=>{s(this,sr).getTweenGroup().remove(u),i==="close"&&a.floorObjects.forEach(p=>{p.setVisible(!1)})});u.start(),s(this,sr).getTweenGroup().add(u)},"#animate"),xn=new WeakMap,Tp=new WeakSet,Jb=c(function(t){if(!s(this,ka)||t.length===0)return;if(s(this,sr).camera.zoomLevel<s(this,Cp)){for(let u of s(this,xn))V(this,kl,Mm).call(this,u,"close");s(this,xn).clear(),s(this,At,ar).outdoorFloorStacks.size>0&&!s(this,At,ar).outdoorFloorStacks.has(s(this,At,ar).currentFloorStackId)&&(V(this,Mp,$b).call(this,s(this,At,ar).outdoorFloorStacks.values().next().value),this.publish("focus-change",{facades:[],spaces:[]}));return}let i=-1/0,n,o=!1,a=new Set;t.forEach((u,l)=>{let p=V(this,Tm,h8).call(this,u);if(!p)return;let h=(t.length-l)/t.length,g=(p.id===(n==null?void 0:n.id)?i:0)+h+1;g>i&&(i=g,n=p),s(this,xn).has(p.id)||(V(this,kl,Mm).call(this,p.id,"open"),o=!0),a.add(p.id)});for(let u of s(this,xn))a.has(u)||(V(this,kl,Mm).call(this,u,"close"),o=!0);n&&s(this,At,ar).currentFloorStackId!==n.floorStack.id&&(V(this,Mp,$b).call(this,n.floorStack.id),o=!0),P(this,xn,a),o&&this.publish("focus-change",{facades:Array.from(s(this,xn)),spaces:t})},"#handleEntitiesInFocus"),Pp=new WeakSet,Kb=c(function(t){var i;(i=s(this,Fa).getMapDataInternal())==null||i.facades.forEach(n=>{n.spaces.forEach(o=>{let a=s(this,sr).getState(o.id);a&&s(this,sr).setState(a,{focusable:t})})})},"#setAllFacadesFocusable"),c(Qb,"DynamicFocus");var bp=Qb;var lF=5,cF={linear:Ne.Linear.None,easeIn:Ne.Quadratic.In,easeOut:Ne.Quadratic.Out,easeInOut:Ne.Quadratic.InOut},lr,e2=class e2 extends ${constructor(t,i,n,o){var p,h,y,g;super();d(this,"floorStacksById",new Map);d(this,"floorsById",new Map);d(this,"currentFloorId","");d(this,"currentFloorStackId","");d(this,"outdoorFloorStacks",new Set);d(this,"id");d(this,"renderer");d(this,"api");d(this,"mvf");d(this,"styleMap");d(this,"StackedMaps");d(this,"DynamicFocus");d(this,"animations",new Map);d(this,"Models",{add:(t,i,n)=>{let{floorId:o,...a}=n,u=o?this.floorsById.get(o):this.currentFloor,l=this.renderer.addModelGroup(t,{type:"FeatureCollection",features:i.map(p=>{var h;return{type:"Feature",properties:{id:le(),rotation:(h=p.rotation)==null?void 0:h.map(y=>y*(Math.PI/180)),scale:p.scale,interactive:p.interactive},geometry:{type:"Point",coordinates:mi(p.target)}}})},{url:a.url},u.id);if(l==null)throw new Error("error creating model");return this.renderer.getState(l).children},remove:(t,i)=>{this.renderer.remove(t),this.renderer.getState(i).children.length===0&&this.renderer.remove(i)}});d(this,"Images",{add:(t,i,n)=>{let{floorId:o,flipImageToFaceCamera:a,...u}=n,l=o?this.floorsById.get(o):this.currentFloor,p={type:"Feature",properties:u,geometry:{type:"Point",coordinates:t}};return this.renderer.addImage(le(),p,{url:i,flipImageToFaceCamera:a!=null?a:!1},l.id)},remove:t=>{this.renderer.remove(t)},removeAll:()=>{}});d(this,"Markers",{add:(t,i,n)=>{var a;let o=t.floorId?this.floorsById.get(t.floorId):this.currentFloor;return this.renderer.addMarker2D(mi(t),i,n,(a=o==null?void 0:o.layers.get(pi))==null?void 0:a.containerId)},remove:t=>{this.renderer.remove(t)},getContentEl:t=>{let i=this.renderer.getState(t);if((i==null?void 0:i.type)==="marker")return i.element},removeAll:()=>{},setPosition:(t,i,n)=>{var u;let o=this.renderer.getState(t),a=n?this.floorsById.get(n):this.currentFloor;if(!o){L.error('Failed to retrieve state for Marker with id "'.concat(t,'".'));return}if(o.type!=="marker"){L.error('Geometry with id "'.concat(t,'" is not of type "marker".'));return}this.renderer.setState(o,{position:i,parent:(u=a==null?void 0:a.layers.get(pi))==null?void 0:u.containerId})},animateTo:(t,i,n,o)=>{let a=this.renderer.getState(t),u=n?this.floorsById.get(n):this.currentFloor;if(!a)return L.error('Failed to retrieve state for Marker with id "'.concat(t,'".')),Promise.resolve();if(a.type!=="marker")return L.error('Geometry with id "'.concat(t,'" is not of type "marker".')),Promise.resolve();let l={duration:1e3,easing:"ease-in-out",...o};this.cancelAnimation(t);let p=new dt({lon:a.position[0],lat:a.position[1]}).to({lon:i[0],lat:i[1]},l.duration).easing(cF[l.easing]).onUpdate(({lon:h,lat:y})=>{var v;if(!this.renderer.getState(t))this.cancelAnimation(t);else{let S=(v=u==null?void 0:u.layers.get(pi))==null?void 0:v.containerId;S&&this.Markers.setPosition(t,[h,y],S)}}).start();return this.renderer.getTweenGroup().add(p),this.renderer.render(),this.animations.set(t,p),I1(p).then(()=>{this.animations.delete(t)})}});d(this,"Exporter",{getCurrentSceneGLTF:async t=>this.renderer.getCurrentSceneGLTF(t)});d(this,"Shapes",{add:(t,i,n)=>{let o=n!=null&&n.floorId?this.floorsById.get(n==null?void 0:n.floorId):this.currentFloor,a=le();return this.renderer.addGeometryGroup(a,t,i,o.id),a},remove:t=>(this.renderer.remove(t.id),t.id)});d(this,"Labels",{all:({onCreate:t})=>{for(let i of Object.entries(this.mvf.space)){let[n,o]=i;o&&o.features.forEach(a=>{var g,v,S,T;let u=(g=this.api.getMapData())==null?void 0:g.getById("space",a.properties.id);if(!u)return;let l=(v=this.styleMap[a.properties.id])==null?void 0:v.showImage,p=(S=a.properties.details)==null?void 0:S.images,h={};l&&p&&p.length>0&&(h={marker:{icon:p[0].url}});let y=n?this.floorsById.get(n):this.currentFloor;if(a.properties.center&&a.properties.externalId!==""){let b=this.renderer.addLabel2D(a.properties.center,a.properties.externalId,{id:a.properties.id+"-label",appearance:h},(T=y.layers.get(Xn))==null?void 0:T.containerId);b&&t(b.id,a.properties.externalId,u)}})}},add:(t,i,n={})=>{var p;let{floorId:o,...a}=n,u=o?this.floorsById.get(o):this.currentFloor,l=this.renderer.addLabel2D(t,i,a,(p=u.layers.get(Xn))==null?void 0:p.containerId);if(!l)throw new Error("label creating failed");return l},remove:t=>{this.renderer.remove(t)},removeAll:()=>{}});d(this,"Paths",{add:(t,i)=>{var p;let n=[],o=t[0].floorId||"root",a=0;for(let h of t){let{floorId:y="root",latitude:g,longitude:v}=h;y!==o&&(a++,o=y),n[a]==null&&n.push({floorId:y,coordinates:[]}),n[a].coordinates.push([v,g])}let u=n.reduce((h,{floorId:y,coordinates:g},v)=>{if(v!==0){let T=n[v-1],b=g[0],x=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:T.floorId},geometry:{type:"Point",coordinates:T.coordinates[T.coordinates.length-1]}},{type:"Feature",properties:{parentId:y},geometry:{type:"Point",coordinates:b}}]},i,this.id);x&&h.push(x)}let S=this.renderer.addPath({type:"FeatureCollection",features:g.map(T=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:T}}))},i,y);return S&&h.push(S),h},[]),l=new dt({fraction:0}).to({fraction:1},(p=i==null?void 0:i.drawDuration)!=null?p:1e3).onUpdate(({fraction:h})=>{u.forEach(y=>{this.renderer.setState(y.id,{completeFraction:h})})}).start();return this.renderer.getTweenGroup().add(l),this.renderer.render(),this.animations.set(u[0].id.toString(),l),{paths:u,animation:I1(l).then(()=>{this.animations.delete(u[0].id.toString())})}},remove:t=>{t.forEach(i=>{this.cancelAnimation(i),this.renderer.remove(i)})}});M(this,lr,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=o.core,this.api=o,this.id=t,this.renderer.addGroupContainer(t,{},"root"),this.StackedMaps=new cp({currentMapGetter:()=>this}),this.DynamicFocus=new bp(this.renderer,this.api,{currentMapGetter:()=>this}),this.mvf=(p=i==null?void 0:i.mvf)!=null?p:{};let a=QS(this.mvf["styles.json"]||{});if(this.styleMap=a,P(this,lr,{enabled:!1,floorHeight:lF,updateCameraElevationOnFloorChange:!0,...n==null?void 0:n.multiFloorView}),!i){this.id!=="outdoors-container"&&L.warn("Map (".concat(this.id,") created with no data."));let v=new vp({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(v.id,v),this.currentFloorStackId=v.id;let S=new du(v.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,s(this,lr),n!=null?n:{});v.addFloor(S),this.floorsById.set(S.id,S),this.setFloor(S.id);return}let u=i.getMVFFeatureByType("floor-stack");(u==null||u.length===0)&&L.throw("MVF does not contain any Floor Stacks.");for(let v of u){let S=new vp(v,this.id,this.renderer,(h=this.mvf.facade)==null?void 0:h[v.id]);if(S.floorIds.length!==0){for(let T of S.floorIds){let b=i.getMVFFeatureById("floor",T);if(b!=null){let x=this.mvf.space[b.id],I=this.mvf.obstruction[b.id];if((x==null||x.features.length===0)&&(I==null||I.features.length===0))continue;let E=new du(S.id,b,this.renderer,s(this,lr),n!=null?n:{},this.mvf,a);S.addFloor(E),this.floorsById.set(E.id,E)}}this.floorStacksById.set(v.id,S),this.currentFloorStackId||(this.currentFloorStackId=v.id)}}for(let[v]of Object.entries(i.facadesBySpaceId)){let S=i.getById("space",v);S&&(this.outdoorFloorStacks.add(S.floor.floorStack.id),(y=this.floorsById.get(S.floor.id))==null||y.setVisible(!0))}let l=(g=this.mvf.enterprise)==null?void 0:g.venue.defaultMap;if(n!=null&&n.initialFloor){let v=Ic(n.initialFloor);v&&this.floorsById.has(v)?l=v:L.error("Invalid initial floor specified (".concat(n.initialFloor,"), using default behavior instead"))}l||(l=this.currentFloorStack.defaultFloor.id),this.setFloor(l)}get currentFloorStack(){let t=this.floorStacksById.get(this.currentFloorStackId);return t||L.throw('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found')),t}setFloorStack(t){if(this.currentFloorStackId===t)return;let i=this.floorStacksById.get(t);if(i==null){L.error("Invalid floor stack passed to setFloorStack (".concat(t,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){L.error("Floor stack (".concat(t,") 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 t=this.floorsById.get(this.currentFloorId);return t||L.throw('Floor with id "'.concat(this.currentFloorId,'" not found')),t}get floors(){return Array.from(this.floorsById.values())}processFloorChange(t){var o,a,u;let i=this.floorsById.get(t),n=this.floorStacksById.get(this.currentFloorStackId);i&&n&&(!((o=s(this,lr))!=null&&o.enabled)||i.floorStackId!==(n==null?void 0:n.id)?this.outdoorFloorStacks.has(n.id)||n==null||n.floorObjects.forEach(l=>{l.id!==t&&l.setVisible(!1)}):(p8(this.currentFloorStack.floorObjects,i,((u=(a=this.api.Navigation)==null?void 0:a.floors)==null?void 0:u.map(p=>p.id))||[]).forEach(p=>{var h,y,g,v;p.floor.setVisible(p.visible),Array.from(p.floor.layers.keys()).forEach(S=>{var b;let T=(b=p.floor.layers.get(S))==null?void 0:b.containerId;T&&this.renderer.setState(T,{visible:p.visibleLayers.includes(S)})}),p.expandFootprint?(this.renderer.setState("Footprint-".concat(p.floor.id),{height:Math.abs(p.floor.elevation)*s(this,lr).floorHeight,altitude:-s(this,lr).floorHeight/2}),(y=(h=this.api)==null?void 0:h.Outdoor)==null||y.setOpacity(.2)):(this.renderer.setState("Footprint-".concat(p.floor.id),{height:-s(this,lr).floorHeight,altitude:s(this,lr).floorHeight/2}),i.elevation>=0&&((v=(g=this.api)==null?void 0:g.Outdoor)==null||v.setOpacity("initial")))}),s(this,lr).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(i.elevation*s(this,lr).floorHeight)))}setFloor(t,i){if(this.currentFloorId!==t){if(!this.floorsById.has(t)){L.error("Invalid floor passed to setFloor (".concat(t,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}if(this.publish("floor-change-start",{floorId:t}),this.DynamicFocus.enabled){let n=this.floorsById.get(t);if(!this.outdoorFloorStacks.has(this.currentFloorStack.id)&&(n==null?void 0:n.floorStackId)===this.currentFloorStack.id){let o=this.floorsById.get(this.currentFloorId);o==null||o.setVisible(!1)}}else!this.StackedMaps.expanded&&this.currentFloorStack&&(this.currentFloorStack.setFacadeVisible(!0),this.processFloorChange(t));this.currentFloorId=t,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.currentFloorStack.setFacadeVisible(!1),this.publish("floor-change",{reason:i,floorId:this.currentFloor.id})}}cancelAnimation(t){let i=this.animations.get(t);i&&(i.stop(),this.animations.delete(t),this.renderer.getTweenGroup().remove(i))}};lr=new WeakMap,c(e2,"GeojsonApiMapObject");var Ip=e2;m();var zr,Ep,t2=class t2{constructor({currentMapGetter:e}){M(this,zr,new Map);M(this,Ep,void 0);P(this,Ep,e)}get currentMap(){return s(this,Ep).call(this)}getById(e){return s(this,zr).get(e)}add(e,t,i){let n=et(e);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Markers.add(n,t,{...i,rank:(i==null?void 0:i.rank)||"medium",dynamicResize:(i==null?void 0:i.dynamicResize)||!1});if(a==null)throw new Error("error creating marker");let u=o.Markers.getContentEl(a.id.toString());if(!u)throw new Error("marker component should exist");let l=new ln(a.id.toString(),u,e);return s(this,zr).set(l.id,{marker:l,entityId:a.id.toString()}),l}remove(e){var i;let t=s(this,zr).get(e.id);t&&((i=this.currentMap)==null||i.Markers.remove(t.entityId),s(this,zr).delete(e.id.toString()))}removeAll(){let e=[];return s(this,zr).forEach(({marker:t})=>{this.remove(t),e.push(t),s(this,zr).delete(t.id.toString())}),e}setPosition(e,t){var a;let i=et(t);if(!i){L.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){L.error("Cannot determine the current map.");return}let o=s(this,zr).get(e.id);if(!o){L.error('Cannot find the Marker with id "'.concat(e.id,'".'));return}n.Markers.setPosition(o.entityId,mi(i),(a=i.floorId)!=null?a:n.currentFloorId),o.marker.updateTarget(t)}animateTo(e,t,i){var u;let n=et(t);if(!n)return L.error("Cannot determine coordinate from target."),Promise.resolve();let o=this.currentMap;if(!o)return L.error("Cannot determine the current map."),Promise.resolve();let a=s(this,zr).get(e.id);return a?(a.marker.updateTarget(t),o.Markers.animateTo(a.entityId,mi(n),(u=n.floorId)!=null?u:o.currentFloorId,i)):(L.error('Cannot find the Marker with id "'.concat(e.id,'".')),Promise.resolve())}};zr=new WeakMap,Ep=new WeakMap,c(t2,"Markers");var wp=t2;m();var Sn,Dp,r2=class r2{constructor({currentMapGetter:e}){M(this,Sn,new Map);M(this,Dp,void 0);P(this,Dp,e)}get currentMap(){return s(this,Dp).call(this)}getById(e){return s(this,Sn).get(e)}add(e,t,i){let n=et(e);if(!n)throw new Error("get coordinate failed");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=o.Images.add(mi(n),t,{...i,floorId:n.floorId});if(!a)throw new Error("image component should exist");let u=new Kc(a.id.toString(),t,e);return s(this,Sn).set(u.id,{image:u,entityId:a.id.toString()}),u}remove(e){var i;let t=s(this,Sn).get(e.id);t&&((i=this.currentMap)==null||i.Images.remove(t.entityId),s(this,Sn).delete(e.id.toString()))}removeAll(){let e=[];return s(this,Sn).forEach(({image:t})=>{this.remove(t),e.push(t),s(this,Sn).delete(t.id.toString())}),e}};Sn=new WeakMap,Dp=new WeakMap,c(r2,"Images");var _p=r2;m();var Ai,Lp,i2=class i2{constructor({currentMapGetter:e}){M(this,Ai,new Map);M(this,Lp,void 0);P(this,Lp,e)}get currentMap(){return s(this,Lp).call(this)}getById(e){return s(this,Ai).get(e)}add(e,t){let i=Array.isArray(e)?e:[e],n=i.reduce((u,l)=>{var h;let p=et(l.target);return p?(u.has(p.floorId)||u.set(p.floorId,[]),(h=u.get(p.floorId))==null||h.push({...l,target:p}),u):(L.error("Cannot determine coordinate from options."),u)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let o=this.currentMap;if(!o)throw new Error("currentMap should exist");let a=[];return n.forEach((u,l)=>{let p=le();o.Models.add(p,u,{...t,floorId:l}).forEach(({id:y})=>{let g=new tu(y.toString(),p);s(this,Ai).set(g.id,{model:g,entityId:y.toString(),groupId:p}),a.push(g)})}),a}remove(e){var i;let t=s(this,Ai).get(e.id);t&&((i=this.currentMap)==null||i.Models.remove(t.entityId,t.groupId),s(this,Ai).delete(e.id.toString()))}removeAll(){let e=[];return s(this,Ai).forEach(({model:t})=>{var n;let i=s(this,Ai).get(t.id);i&&(e.push(t),(n=this.currentMap)==null||n.Models.remove(i.entityId,i.groupId),s(this,Ai).delete(t.id.toString()))}),e}};Ai=new WeakMap,Lp=new WeakMap,c(i2,"Models");var Op=i2;m();var ki,kp,n2=class n2{constructor({currentMapGetter:e}){M(this,ki,new Map);M(this,kp,void 0);P(this,kp,e)}get currentMap(){return s(this,kp).call(this)}getById(e){return s(this,ki).get(e)}add(e,t){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let n=i.Paths.add(e,t),o=n.paths.map(u=>u.id.toString()),a=new ua(le(),n.animation,e);for(let u of o)s(this,ki).set(u,{path:a,entityIds:o});return s(this,ki).set(a.id,{path:a,entityIds:o}),a}remove(e){var i;let t=s(this,ki).get(e.id);t&&((i=this.currentMap)==null||i.Paths.remove(t.entityIds),s(this,ki).delete(e.id),t.entityIds.forEach(n=>s(this,ki).delete(n)))}removeAll(){let e=[];return s(this,ki).forEach(({path:t})=>{this.remove(t),e.push(t)}),e}};ki=new WeakMap,kp=new WeakMap,c(n2,"Paths");var Ap=n2;m();var P8=Ul(hv(),1);m();var o2="#2266ff",uF="#808080",f8="#f5f5f5";var m8={radius:10,color:o2,inactiveColor:uF,heading:{color:o2,opacity:.7},accuracyRing:{color:o2,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};m();var y8="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";m();var g8=c((r,e,t=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let i=t/Math.tan(r/2),n=t/Math.sin(r/2),o=n+e,a=10,u=new Jr;u.moveTo(-n*Math.sin(r/2),n*Math.cos(r/2)-i);for(let l=0;l<a;l++)u.lineTo(-(o*Math.sin(r/2-r/a*l)),o*Math.cos(r/2-r/a*l)-i);for(let l=0;l<a;l++)u.lineTo(-(t*Math.sin(Math.PI/-2+Math.PI/a*l)),t*Math.cos(Math.PI/-2+Math.PI/a*l));return new Kr(u,{depth:.1,bevelEnabled:!1,UVGenerator:dF(e)})},"createSectorGeometry"),a2=c((r,e,t)=>{let n=Math.sqrt(Math.pow(r,2)+Math.pow(e,2))/t;return n>1?n=1:n<0&&(n=0),new te(0,n)},"generateRadialUV"),dF=c(r=>({generateTopUV:(e,t,i,n,o)=>{let a=t[i*3],u=t[i*3+1],l=t[n*3],p=t[n*3+1],h=t[o*3],y=t[o*3+1];return[a2(a,u,r),a2(l,p,r),a2(h,y,r)]},generateSideWallUV:()=>[new te(0,1),new te(0,1),new te(0,1),new te(0,1)]}),"radialUVGenerator");function v8(r,e){if(e==null)return r;let t={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 e&&(t.latitude=(e==null?void 0:e.latitude)==null||e.latitude==="device"?r==null?void 0:r.latitude:e.latitude),"longitude"in e&&(t.longitude=e.longitude==null||e.longitude==="device"?r==null?void 0:r.longitude:e.longitude),"accuracy"in e&&(t.accuracy=e.accuracy==="device"?r==null?void 0:r.accuracy:e.accuracy),"floor"in e&&(t.floor=e.floor==="device"?r==null?void 0:r.floor:e.floor),"heading"in e&&(t.heading=e.heading==="device"?r==null?void 0:r.heading:e.heading),t}c(v8,"getPositionWithOverrides");function hF([r,e],[t,i],[n,o]){let a=t-r,u=i-e,l=a**2+u**2;if(l===0)return;let p=((n-r)*a+(o-e)*u)/l,h;p<=0?h=[r,e]:p>=1?h=[t,i]:h=[r+p*a,e+p*u];let y=ld([n,o],h);return{proportion:Math.max(0,Math.min(1,p)),intersection:h,distance:y}}c(hF,"getPointLineIntersection");function b8(r,e){if(r==null||r.length<2)return;let t=Number.MAX_SAFE_INTEGER,i,n=0,o=0;for(let a=0;a<r.length-1;a++){let u=r[a],l=r[a+1],p=hF(u,l,e);p!=null&&p.distance<t&&(t=p.distance,i=p.intersection,n=a,o=p.proportion)}if(i)return{intersection:i,distance:t,segmentIndex:n,proportion:o}}c(b8,"findBlueDotOnPath");function C8(r,e){let t=new Qr({color:r,opacity:e,transparent:!0,depthTest:!1,depthWrite:!1}),i=.35,n=.35*4,o=g8(Math.PI/6,n,i);new qa().load(y8,u=>{t.alphaMap=u,t.needsUpdate=!0});let a=new Te(o,t);return a.position.z=-.05,a.renderOrder=0,a}c(C8,"createHeadingCone");function x8(r,e){let t=new rd(1,1,.05,32),i=new Qr({transparent:!0,color:r,opacity:e,depthTest:!1,depthWrite:!1}),n=new Te(t,i);return n.scale.set(0,0,.05),n.renderOrder=1,n.rotation.x=Math.PI/2,n}c(x8,"createAccuracyRing");function S8(r){let e=new rd(.35,.35,.07,32),t=new Qr({transparent:!0,color:f8,depthTest:!1,depthWrite:!1}),i=new Te(e,t);i.renderOrder=2;let n=new rd(.35*.8,.35*.8,.01,32),o=new Qr({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),a=new Te(n,o);return a.renderOrder=3,i.rotation.x=Math.PI/2,i.position.z=.07/2,a.rotation.x=Math.PI/2,a.position.z=.07,{outerMesh:i,innerMesh:a}}c(S8,"createBlueDot");var I8=Ul(M8(),1);var Ba,Mn,cr,ur,Tn,Ra,Na,Ga,We,Ut,Fp,Pn,Bp,Rp,Np,Gp,Im,Fi,In,wm,Va,Vp,Bi,s2=class s2 extends ${constructor(t,i){super();this.core=t;this.geoJSONApi=i;M(this,Ba,null);d(this,"geometry");M(this,Mn,void 0);M(this,cr,void 0);M(this,ur,void 0);M(this,Tn,void 0);M(this,Ra,void 0);M(this,Na,void 0);M(this,Ga,void 0);M(this,We,m8);M(this,Ut,1);M(this,Fp,void 0);M(this,Pn,void 0);d(this,"state","disabled");d(this,"following",!1);M(this,Bp,c(t=>{var i;return(i=this.geoJSONApi.getMapData())==null?void 0:i.getById("floor",t)},"#getFloorByFloorId"));M(this,Rp,c(t=>{var n;let i;if(t!=null){let o=(n=this.geoJSONApi.currentMap)==null?void 0:n.currentFloorStack.floorObjectsByElevation.get(t);i=o?s(this,Bp).call(this,o.id):void 0}return i},"#getFloorByFloorLevel"));M(this,Np,c(t=>{if(this.state==="hidden"||this.state==="disabled")return;let[i,n,o,a]=t.children;if(s(this,Im).call(this),n.scale.set(s(this,Ut),s(this,Ut),s(this,Ut)),n.position.z=.07/2*s(this,Ut),o.scale.set(s(this,Ut),s(this,Ut),s(this,Ut)),o.position.z=.07*s(this,Ut),this.state==="active"){o.material.color.set(s(this,We).color);let u=this.accuracy;u!=null?(i.visible=!0,s(this,Na)&&s(this,Na).stop(),P(this,Na,new dt({scale:i.scale.x}).to({scale:u/2},150).onUpdate(({scale:p})=>{i.scale.set(p,1,p)}).start()),this.core.getTweenGroup().add(s(this,Na))):i.visible=!1;let l=this.heading;l!=null?(a.visible=!0,s(this,Ga)&&s(this,Ga).stop(),P(this,Ga,new dt({rotation:a.rotation.z}).to({rotation:-ye.degToRad(l)},150).onUpdate(({rotation:p})=>{a.rotation.z=p}).start()),this.core.getTweenGroup().add(s(this,Ga)),a.scale.set(s(this,Ut),s(this,Ut),1)):a.visible=!1}else this.state==="inactive"&&(o.material.color.set(s(this,We).inactiveColor),a.visible=!1,i.visible=!1)},"#updateGeometryPerFrame"));M(this,Gp,c(t=>{var a,u;let i;try{i=vF.parse(v8(t,s(this,cr)))}catch(l){s(this,Fi).call(this,"error"),L.error("BlueDot: Position parse failed",l instanceof A.ZodError?l.message:String(l)),this.publish("error");return}s(this,We).debug&&L.log("BlueDot: Parsed position",i),P(this,ur,i),s(this,Fi).call(this,"position-update"),s(this,Tn)&&clearTimeout(s(this,Tn)),typeof s(this,We).timeout=="number"&&s(this,We).timeout<1/0&&P(this,Tn,setTimeout(()=>{s(this,We).debug&&L.log("BlueDot: Position timed out after ".concat(s(this,We).timeout,"ms")),s(this,Fi).call(this,"timeout"),this.core.render()},s(this,We).timeout)),(u=this.geoJSONApi.getMapDataInternal())==null||u.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:i.latitude,longitude:i.longitude,floorLevel:(a=i.floor)==null?void 0:a.elevation,accuracy:i.accuracy}});let n=i.floor!=null?i.floor.id:"outdoors-container",o=[i.longitude,i.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry("blue-dot",{type:"Feature",properties:{},geometry:{type:"Point",coordinates:o}},{setup:l=>{let p=x8(s(this,We).accuracyRing.color,s(this,We).accuracyRing.opacity),{outerMesh:h,innerMesh:y}=S8(s(this,We).color),g=C8(s(this,We).heading.color,s(this,We).heading.opacity);l.add(p),p.visible=!1,l.add(h),l.add(y),l.add(g),g.visible=!1,s(this,Np).call(this,l)},update:s(this,Np)},{visible:!0},n);else{let l=this.core.getState(this.geometry);o=[l.position[0],l.position[1]]}s(this,Ra)&&s(this,Ra).stop(),P(this,Ra,new dt(o).to([i.longitude,i.latitude],1e3).easing(Ne.Cubic.Out).onUpdate(l=>{if(this.geometry){let p={position:[l[0],l[1]]};p.parent=n,this.core.setState(this.geometry,p)}}).start()),this.core.getTweenGroup().add(s(this,Ra)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));d(this,"onPositionUpdate",c(t=>{var i,n,o,a,u;if(this.state!=="disabled"){try{gF.parse(t)}catch(l){s(this,Fi).call(this,"error"),L.error("BlueDot: Browser sent invalid position",l instanceof A.ZodError?l.message:String(l)),this.publish("error");return}P(this,Mn,{latitude:(i=t.coords)==null?void 0:i.latitude,longitude:(n=t.coords)==null?void 0:n.longitude,accuracy:(o=t.coords)==null?void 0:o.accuracy,heading:(a=t.coords)==null?void 0:a.heading,floor:s(this,Rp).call(this,(u=t.coords)==null?void 0:u.floorLevel)}),s(this,Gp).call(this,s(this,Mn))}},"onPositionUpdate"));d(this,"onPositionError",c(t=>{var i;switch(s(this,Fi).call(this,"error"),t.code){case t.PERMISSION_DENIED:L.error("Geolocation permission denied by the user.",t),(i=this.geoJSONApi.getMapDataInternal())==null||i.Analytics.sendWatchPositionDenied();break;case t.POSITION_UNAVAILABLE:L.error("Geolocation position unavailable.",t);break;case t.TIMEOUT:L.error("Geolocation request timed out.",t);break;default:L.error("An unknown geolocation error occurred.",t);break}this.publish("error",t)},"onPositionError"));M(this,Im,c(()=>{var i;let t=Math.round(this.core.camera.zoomLevel*1e5);if(t!==s(this,Fp)){P(this,Fp,t);let n=(i=this.core.getMetresPerPixel())!=null?i:1;P(this,Ut,Math.max(s(this,We).radius/(.35/n),1))}},"#updateScale"));M(this,Fi,c(t=>{let i=yF[this.state].actions[t];if(i){switch(s(this,We).debug&&L.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(i," using ").concat(t)),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:t}),this.state=i)}else L.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(i," using ").concat(t))},"#transitionAction"));M(this,In,void 0);M(this,wm,c(()=>{if(s(this,In)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let i=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(n=>n.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(n=>n.floorId===this.geoJSONApi.currentFloor.id);P(this,In,(0,I8.default)(i.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return s(this,In)},"#getSimplifiedDirections"));M(this,Va,c(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),s(this,Bi)&&(this.off("position-update",s(this,Bi)),P(this,Bi,void 0)),this.following=!1,P(this,In,void 0),this.core.off("user-interaction-start",s(this,Va)),this.geoJSONApi.currentMap.off("navigation-active-path-change",s(this,Vp)),this.publish("follow-change",{following:!1})},"#cancelFollow"));M(this,Vp,c(()=>{P(this,In,void 0)},"#pathChangeHandler"));M(this,Bi,void 0);d(this,"follow",c((t,i)=>{var o,a,u,l;if(t===!1){s(this,Va).call(this);return}t!=="position-only"&&(i==null?void 0:i.bearing)!=null&&L.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(t,"'. To control the bearing manually, use mode 'position-only'."));let n={zoomLevel:(o=i==null?void 0:i.zoomLevel)!=null?o:21,bearing:t==="position-only"?i==null?void 0:i.bearing:void 0,pitch:(a=i==null?void 0:i.pitch)!=null?a:45,duration:(u=i==null?void 0:i.duration)!=null?u:1e3,easing:(l=i==null?void 0:i.easing)!=null?l:"ease-in-out"};this.following?s(this,Bi)&&this.off("position-update",s(this,Bi)):(this.following=!0,this.core.on("user-interaction-start",s(this,Va)),this.geoJSONApi.currentMap.on("navigation-active-path-change",s(this,Vp))),P(this,Bi,p=>{let{coordinate:h,heading:y,floor:g}=p;if(n.center=[h.longitude,h.latitude],g!=null&&g.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(g.id),P(this,In,void 0)),t==="position-and-heading")n.bearing=y!=null?y:void 0;else if(t==="position-and-path-direction"){let v=s(this,wm).call(this);if(v!=null){let S=b8(v,[h.longitude,h.latitude]);if(S!=null){let T=v[S.segmentIndex],b=v[S.segmentIndex+1];n.bearing=Y2(T,b)}}}this.core.camera.animateTo(n)}),this.on("position-update",s(this,Bi)),this.publish("follow-change",{following:!0,mode:t})},"follow"))}get heading(){var t;return(t=s(this,ur))==null?void 0:t.heading}get accuracy(){var t;return(t=s(this,ur))==null?void 0:t.accuracy}get coordinate(){var t,i;if(s(this,ur)!=null)return(s(this,Pn)==null||((t=this.floor)==null?void 0:t.id)!==s(this,Pn).floorId||s(this,ur).latitude!==s(this,Pn).latitude||s(this,ur).longitude!==s(this,Pn).longitude)&&P(this,Pn,new se(s(this,ur).latitude,s(this,ur).longitude,(i=this.floor)==null?void 0:i.id)),s(this,Pn)}get floor(){var t;return(t=s(this,ur))==null?void 0:t.floor}enable(t){P(this,We,(0,P8.default)({},t,s(this,We))),s(this,Fi).call(this,"enable"),this.watchDevicePosition(s(this,We).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),s(this,Tn)&&(clearTimeout(s(this,Tn)),P(this,Tn,void 0)),this.following&&s(this,Va).call(this),this.watchDevicePosition(!1),P(this,ur,void 0),P(this,cr,void 0),s(this,Fi).call(this,"disable")}watchDevicePosition(t){if(s(this,Ba)&&(navigator.geolocation.clearWatch(s(this,Ba)),P(this,Ba,null)),s(this,Mn)&&P(this,Mn,void 0),t){if(this.state==="disabled"){L.warn("BlueDot must be enabled before watching browser position.");return}P(this,Ba,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(t){var n,o;t==null?P(this,cr,void 0):"coords"in t?P(this,cr,Object.assign({},s(this,cr),{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy,heading:t.coords.heading,floor:s(this,Rp).call(this,t.coords.floorLevel)})):(P(this,cr,Object.assign({},s(this,cr),t)),"floorOrFloorId"in t&&(s(this,cr).floor=typeof t.floorOrFloorId=="string"&&t.floorOrFloorId!=="device"?s(this,Bp).call(this,t.floorOrFloorId):t.floorOrFloorId)),(((n=s(this,cr))==null?void 0:n.latitude)!=null&&((o=s(this,cr))==null?void 0:o.longitude)!=null||s(this,Mn)!=null)&&s(this,Gp).call(this,s(this,Mn))}};Ba=new WeakMap,Mn=new WeakMap,cr=new WeakMap,ur=new WeakMap,Tn=new WeakMap,Ra=new WeakMap,Na=new WeakMap,Ga=new WeakMap,We=new WeakMap,Ut=new WeakMap,Fp=new WeakMap,Pn=new WeakMap,Bp=new WeakMap,Rp=new WeakMap,Np=new WeakMap,Gp=new WeakMap,Im=new WeakMap,Fi=new WeakMap,In=new WeakMap,wm=new WeakMap,Va=new WeakMap,Vp=new WeakMap,Bi=new WeakMap,c(s2,"BlueDot");var Bl=s2,yF={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"}}},gF=A.object({coords:A.object({latitude:A.number(),longitude:A.number(),accuracy:A.number(),altitude:A.number().optional().nullable(),altitudeAccuracy:A.number().optional().nullable(),heading:A.number().optional().nullable(),speed:A.number().optional().nullable(),floorLevel:A.number().optional().nullable()}),timestamp:A.number()}),vF=A.object({latitude:A.number(),longitude:A.number(),floor:A.custom().optional(),accuracy:A.number().optional(),heading:A.number().optional().nullable()});m();var wn,Hp,l2=class l2{constructor({currentMapGetter:e}){M(this,wn,new Map);M(this,Hp,void 0);P(this,Hp,e)}get currentMap(){return s(this,Hp).call(this)}getById(e){return s(this,wn).get(e)}add(e,t,i){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let o=n.Shapes.add(e,t||{},{floorId:i==null?void 0:i.id}),a=new io(o);return s(this,wn).set(a.id,a),a}remove(e){var i;s(this,wn).get(e.id)&&((i=this.currentMap)==null||i.Shapes.remove(e),s(this,wn).delete(e.id.toString()))}removeAll(){let e=[];return s(this,wn).forEach(t=>{this.remove(t),e.push(t.id),s(this,wn).delete(t.id.toString())}),e}};wn=new WeakMap,Hp=new WeakMap,c(l2,"Shapes");var jp=l2;m();var Wp,c2=class c2{constructor({currentMapGetter:e}){M(this,Wp,void 0);P(this,Wp,e)}get currentMap(){return s(this,Wp).call(this)}setFromStyleCollection(e){var t,i,n;for(let o in e)for(let a of((t=this.currentMap)==null?void 0:t.floors)||[]){if(e[o]==null||!a.layers.has(He))continue;let u=a.layers.get(He);if(u!=null&&u.layers.has(o)&&"color"in e[o]){let l=u.layers.get(o);(i=this.currentMap)==null||i.renderer.setState(l,{color:e[o].color})}if(u&&o===Wn&&!(ui in e)){let l=u.layers.get(ui);l&&"color"in e[o]&&((n=this.currentMap)==null||n.renderer.setState(l,{color:e[o].color}))}}}};Wp=new WeakMap,c(c2,"Style");var Up=c2;m();var u2={opacity:1},ft,Xp,Yp,Co,En,Zp,p2,Em,w8,d2=class d2{constructor(e,t){M(this,Zp);M(this,Em);M(this,ft,void 0);M(this,Xp,void 0);M(this,Yp,{opacity:"initial"});M(this,Co,{opacity:new Map});M(this,En,new Set);P(this,ft,e),P(this,Xp,t||[]);let i=s(this,ft).map;i&&i.on("idle",()=>{s(this,Co).opacity.size||V(this,Zp,p2).call(this,i)})}setStyle(e){var t,i;if(s(this,ft).map){(t=s(this,ft).map)==null||t.setStyle(e),s(this,En).size&&(s(this,En).clear(),this.hide()),V(this,Em,w8).call(this),V(this,Zp,p2).call(this,s(this,ft).map),this.setOpacity(s(this,Yp).opacity),(i=s(this,ft).map)==null||i.moveLayer(gu);for(let[n,o]of s(this,Xp)||[])s(this,ft).hideOutdoorLayersUnderPoint(n,o)}}get map(){return s(this,ft).map}get enabled(){return!!s(this,ft).map}get visible(){return s(this,En).size===0}show(){let e=s(this,ft).map;if(!e)return;let t=e.getStyle().layers;t&&(t.forEach(i=>{s(this,En).has(i.id)&&e.setLayoutProperty(i.id,"visibility","visible")}),s(this,En).clear())}hide(e=[]){let t=s(this,ft).map;if(!t)return;let i=t.getStyle().layers;i&&i.forEach(n=>{let o=t.getLayoutProperty(n.id,"visibility");!e.includes(n.id)&&o!=="none"&&(t.setLayoutProperty(n.id,"visibility","none"),s(this,En).add(n.id))})}setOpacity(e,t=[]){var o,a;let i=s(this,ft).map;if(!i)return;let n=(a=(o=s(this,ft).map)==null?void 0:o.getStyle())==null?void 0:a.layers;n&&i.once("idle",()=>{n.forEach(u=>{let l=i.getLayoutProperty(u.id,"visibility");if(!t.includes(u.id)&&l!=="none")try{let p=s(this,Co).opacity.get(u.id);p!==void 0&&(u.id==="background"||(u.type==="symbol"?(i.setPaintProperty(u.id,"icon-opacity",e==="initial"?p[0]:e),i.setPaintProperty(u.id,"text-opacity",e==="initial"?p[1]:e)):i.setPaintProperty(u.id,"".concat(u.type,"-opacity"),e==="initial"?p[0]:e)),s(this,Yp).opacity=e)}catch(p){L.warn("Error setting opacity:",p)}})})}};ft=new WeakMap,Xp=new WeakMap,Yp=new WeakMap,Co=new WeakMap,En=new WeakMap,Zp=new WeakSet,p2=c(function(e){let t=e.getStyle().layers;t&&t.forEach(i=>{var o,a,u;e.getLayoutProperty(i.id,"visibility")!=="none"&&(i.id==="background"||(i.type==="symbol"?s(this,Co).opacity.set(i.id,[(o=e.getPaintProperty(i.id,"icon-opacity"))!=null?o:u2.opacity,(a=e.getPaintProperty(i.id,"text-opacity"))!=null?a:u2.opacity]):s(this,Co).opacity.set(i.id,[(u=e.getPaintProperty(i.id,"".concat(i.type,"-opacity")))!=null?u:u2.opacity,void 0])))})},"#setInitialStyle"),Em=new WeakSet,w8=c(function(){Object.values(s(this,Co)).forEach(e=>e.clear())},"#clearInitialStyle"),c(d2,"Outdoor");var Rl=d2;var _m=.05,h2=class h2{constructor(e,t){d(this,"core");d(this,"mapObjects",[]);d(this,"id");d(this,"mapDataExternal",{});d(this,"mapsByFloorId",{});d(this,"mapData");d(this,"currentMap");d(this,"hiddenOutdoorGeometries",[]);d(this,"mapView");d(this,"Camera");d(this,"Labels");d(this,"Markers");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"Outdoor");d(this,"BlueDot");d(this,"Shapes");d(this,"Style");d(this,"Images");d(this,"update",c(()=>{this.core.render()},"update"));this.core=e,this.mapView=t,this.Camera=new lu(this.core),this.id=this.core.addGroupContainer("root").id.toString();let i=new Ip("outdoors-container",void 0,void 0,this);this.mapObjects.push(i),this.currentMap=i;let n=new ru(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",n)});let o=c(l=>p=>{var I,E,w;let h=[],y=[],g=[],v=[];p.labels.forEach(_=>{let D=this.Labels.getById(_.toString());D&&h.push(D.label)}),p.markers.forEach(_=>{let D=this.Markers.getById(_.toString())||this.Navigation.getMarkerById(_.toString());D&&y.push(D.marker)}),p.models.forEach(_=>{let D=this.Models.getById(_.toString());D&&g.push(D.model)}),p.paths.forEach(_=>{let D=this.Paths.getById(_.toString())||this.Navigation.getPathById(_.toString());D&&v.push(D.path)});let S=p.geometry[0],T;S&&(T=(I=this.getMapDataInternal())==null?void 0:I.getById("space",S)),T||(T=(E=this.getMapDataInternal())==null?void 0:E.getById("object",S));let b=p.containers.reduce((_,D)=>{var U;let B=(U=this.getMapDataInternal())==null?void 0:U.getById("floor",D);return B&&Qi.is(B)&&_.push(B),_},[]),x={coordinate:new se(p.coordinate[1],p.coordinate[0],(w=b==null?void 0:b[0])==null?void 0:w.id),spaces:T&&Rt.is(T)?[T]:[],objects:T&&Nt.is(T)?[T]:[],markers:y,labels:h,models:g,paths:v,floors:b};"pointerEvent"in p&&(x.pointerEvent=p.pointerEvent),this.mapView.publish(l,x)},"createHandler");this.core.on("hover",o("hover")),this.core.on("click",o("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 a={currentMapGetter:()=>this.currentMap};this.Markers=new wp(a),this.Models=new Op(a),this.Labels=new uu(a),this.Exporter=new cu(a),this.Paths=new Ap(a),this.Navigation=new iu(this.core,this,a.currentMapGetter),this.BlueDot=new Bl(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 Rl(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 _p(a),this.Shapes=new jp(a),this.Style=new Up(a);let u=new rf(t,this.mapDataExternal);this.auto=u.auto}get DynamicFocus(){return this.currentMap.DynamicFocus}get StackedMaps(){return this.currentMap.StackedMaps}updateState(e,t){if(e==="interior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(Wn);a&&this.core.setState(a,T1(t,this.core.getState(a)))}});return}else if(e==="exterior-walls"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(ui);a&&this.core.setState(a,T1(t,this.core.getState(a)))}});return}else if(e==="interior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(bs);a&&this.core.setState(a,Eh(t,this.core.getState(a)))}});return}else if(e==="exterior-doors"){this.currentMap.floors.forEach(n=>{let o=n.layers.get(He);if(o){let a=o.layers.get(Cs);a&&this.core.setState(a,Eh(t,this.core.getState(a)))}});return}let i=typeof e=="string"?this.getMapDataObject(e):e;if(i){if(to.is(i))return this.core.setState(i.id,zS({...t,type:"label"},this.core.getState(i.id)));if(ln.is(i))return this.core.setState(i.id,qS({...t,type:"marker"},this.core.getState(i.id)));(Rt.is(i)||Nt.is(i))&&this.core.setState(i.id,$S({...t,type:"geometry"},this.core.getState(i.id))),fr.is(i)&&this.core.setState(i.id,Eh({...t,type:"doors"},this.core.getState(i.id))),io.is(i)&&this.core.setState(i.id,vu(t,["altitude","color","opacity"]))}}getMapDataObject(e){var t;return(t=this.getMapDataInternal())==null?void 0:t.getMapDataById(e)}getMapDataInternal(){if(this.mapData)return Ka(this.mapData)}getMapData(){return this.mapData}addMap(e,t){return new Promise(i=>{var y,g,v;let n;try{n=Ka(e)}catch(S){L.error("Error adding map",S),i(e);return}this.mapDataExternal[e.mapName]=e;let{mvf:o}=n,a=o["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new se(a[1],a[0])});let u=o["manifest.geojson"].features[0].properties.name,l=new Ip("mapObject-".concat(u),n,t,this),p=this.core.getBoundingArea(l.currentFloor.id);p==null&&L.error("Could not determine bounding box for map:",l.currentFloor.id);let h=(g=(y=t==null?void 0:t.outdoorView)==null?void 0:y.layersHiddenByGeometry)!=null?g:[];if(h.length>0){let S=(v=this.core.getCenter(p))!=null?v:a;this.core.hideOutdoorLayersUnderPoint(S,h),this.hiddenOutdoorGeometries.push([S,h])}this.mapObjects.push(l),n.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=e,(t==null?void 0:t.zoomLevel)!=null?(this.core.camera.setZoomLevel(t.zoomLevel),i(e)):this.core.mode!=="outdoors-overlay"&&p?this.core.camera.focusOn(p,{duration:kS,padding:{top:_m*this.core.canvasHeight,left:_m*this.core.canvasWidth,right:_m*this.core.canvasWidth,bottom:_m*this.core.canvasHeight}}).then(()=>{i(e)}):i(e)})}setFloor(e,t){return this.currentMap.setFloor(Ic(e),t)}setFloorStack(e){return this.currentMap.setFloorStack(Ic(e))}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){var i;let e=this.currentMap.currentFloorStack.id;if(!e)throw L.throw("Missing currentFloorStack.");let t=(i=this.mapData)==null?void 0:i.getById("floor-stack",e);if(!t)throw L.throw("FloorStack was not found in map data.");return t}get currentFloor(){var i;let e=this.currentMap.currentFloor.id;if(!e)throw L.throw("Missing currentFloor object from GeoJsonApi");let t=(i=this.mapData)==null?void 0:i.getById("floor",e);if(!t)throw L.throw("Missing currentFloor");return t}getState(e){var n,o;let t=e7(e,this),i=this.core.getState(t);if(i)if(["interior-walls","exterior-walls"].includes(e)){let{color:a,topColor:u,texture:l,topTexture:p,visible:h}=i;return{type:"walls",visible:h,color:a,topColor:u,texture:l?{url:l}:void 0,topTexture:p?{url:p}:void 0}}else if(["interior-doors","exterior-doors"].includes(e)){let{color:a,topColor:u,texture:l,topTexture:p,visible:h,opacity:y}=i;return{type:"doors",visible:h,color:a,topColor:u,opacity:y,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"&&((n=i.options)==null?void 0:n.rank)!==void 0&&i.options.interactive!==void 0){let a=typeof i.parent=="object"?i.parent.id:i.parent,u=this.Markers.getById(i.id.toString()),l=u!=null&&u.marker.target?et(u==null?void 0:u.marker.target):void 0;return l==null&&(l=new se(i.position[1],i.position[0],a.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,coordinate:l}}else{if(i.type==="model")return{type:"model"};if(i.type==="image")return{type:"image"};if(i.type==="geometry-group"&&e&&typeof e!="string"&&io.is(e)){let[a]=i.children;if(a.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(o=i.altitude)!=null?o:0,visible:i.visible,color:i.color,height:a.height,opacity:a.opacity}}}}}setHoverColor(e){this.core.setState({hoverColor:e})}getHoverColor(){let e=this.core.getState();return(e==null?void 0:e.type)==="map-view"?e.hoverColor:void 0}createCoordinate(e,t,i){return new se(e,t,(i==null?void 0:i.id)||this.currentFloor.id)}createCoordinateFromScreenCoordinate(e,t,i){let n=this.core.projectScreenXYToCoordinate(e,t);return n?new se(n[1],n[0],(i==null?void 0:i.id)||this.currentFloor.id):void 0}isInView(e){return this.core.isInView(typeof e=="string"?e:e.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()}};c(h2,"GeoJsonApi");var zp=h2;m();var qp,ie,ja,f2=class f2 extends ${constructor(t){super();M(this,qp,{});M(this,ie,void 0);M(this,ja,void 0);d(this,"Camera");d(this,"Labels");d(this,"Markers");d(this,"Images");d(this,"Models");d(this,"Paths");d(this,"Exporter");d(this,"Navigation");d(this,"BlueDot");d(this,"Style");d(this,"Shapes");d(this,"Outdoor");d(this,"update",c(()=>{s(this,ie).core.render()},"update"));d(this,"getDirections",c((t,i,n)=>{var o;return(o=s(this,ie).getMapData())==null?void 0:o.getDirections(t,i,n)},"getDirections"));d(this,"getDirectionsMultiDestination",c((t,i,n)=>{var o;return(o=s(this,ie).getMapData())==null?void 0:o.getDirectionsMultiDestination(t,i,n)},"getDirectionsMultiDestination"));d(this,"on",c((t,i)=>{super.on(t,i)},"on"));d(this,"off",c((t,i)=>{super.off(t,i)},"off"));P(this,ja,t);let i=new zp(t,this);P(this,ie,i),this.Camera=s(this,ie).Camera,P(this,qp,s(this,ie).mapDataExternal),this.Markers=s(this,ie).Markers,this.Models=s(this,ie).Models,this.Labels=s(this,ie).Labels,this.Exporter=s(this,ie).Exporter,this.Paths=s(this,ie).Paths,this.Navigation=s(this,ie).Navigation,this.BlueDot=s(this,ie).BlueDot,this.Shapes=s(this,ie).Shapes,this.Style=s(this,ie).Style,this.auto=s(this,ie).auto,this.Outdoor=s(this,ie).Outdoor,this.Images=s(this,ie).Images,s(this,ja).container.dataset.version=C.env.npm_package_version}get StackedMaps(){return s(this,ie).currentMap.StackedMaps}get DynamicFocus(){return s(this,ie).currentMap.DynamicFocus}updateState(t,i){return s(this,ie).updateState(t,i)}getMapData(){return s(this,qp)}getDimensions(){return{width:s(this,ja).canvasWidth,height:s(this,ja).canvasHeight}}expand(t){var i;return(i=s(this,ie).currentMap)==null?void 0:i.StackedMaps.expand(t)}collapse(t){var i;return(i=s(this,ie).currentMap)==null?void 0:i.StackedMaps.collapse(t)}addMap(t,i){return s(this,ie).addMap(t,i)}setFloor(t){return s(this,ie).setFloor(t)}setFloorStack(t){return s(this,ie).setFloorStack(t)}get currentFloorStack(){return s(this,ie).currentFloorStack}get currentFloor(){return s(this,ie).currentFloor}updateWatermark(t){s(this,ie).updateWatermark(t)}getState(t){return s(this,ie).getState(t)}setHoverColor(t){s(this,ie).setHoverColor(t)}getHoverColor(){return s(this,ie).getHoverColor()}convertAltitudeToMercatorZoomLevel(t){return s(this,ie).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(t)}convertMercatorZoomLevelToAltitude(t){return s(this,ie).core.getSystems().cameraSystem.convertZoomLevelToAltitude(t)}isInView(t){return s(this,ie).isInView(t)}getDistance(t,i){var n;return(n=s(this,ie).getMapData())==null?void 0:n.getDistance(t,i)}createCoordinate(t,i,n){return s(this,ie).createCoordinate(t,i,n)}createCoordinateFromScreenCoordinate(t,i,n){return s(this,ie).createCoordinateFromScreenCoordinate(t,i,n)}auto(){this.Labels.all()}get __core(){if(C.env.INTERNAL==="true")return s(this,ie).core;throw new Error("__core is not available.")}clear(){s(this,ie).clear()}destroy(){s(this,ie).destroy()}async enableDebug(t={}){let{Inspector:i}=await import("./inspector-XDGCRPFV.js");await new i(this,s(this,ie)).enable(t)}};qp=new WeakMap,ie=new WeakMap,ja=new WeakMap,c(f2,"MapView");var Nl=f2;m();m();var m2=class m2 extends ${constructor(t){super();d(this,"gl");d(this,"el",document.createElement("div"));d(this,"core");d(this,"origin");d(this,"map");d(this,"layer");d(this,"handleStyleChange",c(()=>{!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()))},"handleStyleChange"));d(this,"handleMove",c(()=>{if(!this.map)return;let[t,i]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(t,i),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(ye.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(ye.degToRad(this.map.getPitch()))},"handleMove"));d(this,"handleError",c(t=>{L.warn(t)},"handleError"));this.origin=t}onAdd(t){this.origin=this.origin||t.getCenter().toArray(),this.gl=t.painter.context.gl,this.core=new lp(t._container,{center:this.origin,zoomLevel:t.getZoom(),pitch:t.getPitch(),bearing:t.getBearing(),gl:this.gl,map:t,mode:"outdoors-overlay"}),this.map=t,this.core.camera.setMinZoomLevel(t.getMinZoom()),this.core.camera.setMaxZoomLevel(t.getMaxZoom()),this.core.camera.setMinPitch(t.getMinPitch()),this.core.camera.setMaxPitch(t.getMaxPitch()),this.map.on("error",this.handleError);let i=od.fromLngLat(this.origin,0);return this.layer=cf(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}};c(m2,"MapLibreOverlay");var Dm=m2;var Ha,Gl,xo,Ua,$p=class $p extends ${constructor(t,i,n){super();M(this,Ha,void 0);M(this,Gl,void 0);M(this,xo,void 0);M(this,Ua,void 0);d(this,"on",c((t,i)=>{super.on(t,i)},"on"));d(this,"off",c((t,i)=>{super.off(t,i)},"off"));P(this,Ua,new Dm(t)),P(this,Ha,i),P(this,Gl,n)}onAdd(t){var o,a;let i=s(this,Ua).onAdd(t),n={...wc,...(o=s(this,Gl))!=null?o:{},outdoorView:{token:s(this,Ha).outdoorViewToken,...(a=s(this,Gl))==null?void 0:a.outdoorView}};return P(this,xo,new Nl(s(this,Ua).core)),s(this,xo).addMap(s(this,Ha),n).then(()=>{this.publish("loaded",{mapView:s(this,xo),mapData:s(this,Ha)})}),i}onRemove(){s(this,xo)&&s(this,xo).clear(),$p.instance=null,s(this,Ua).onRemove()}};Ha=new WeakMap,Gl=new WeakMap,xo=new WeakMap,Ua=new WeakMap,c($p,"MappedinMapLibreOverlay"),d($p,"instance");var Vl=$p;var npe=c(async(r,e)=>{let t,i=Io();e&&i.updateByUserOption(e);try{e&&(t=(await Ql({...e,baseAuthUri:i.getBaseAuthUri()})).accessToken)}catch(a){L.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new Zs(r,{outdoorViewToken:t,languagePacks:e==null?void 0:e.languagePacks,env:i});return new ud(n)},"hydrateMapDataFromMVF"),E8=!1;function ope(r){E8=r}c(ope,"setUseEnterpriseAPI");var ape=c(async(r,e)=>{var p,h,y,g;let t={...e||{}},i,n=Io();n.updateByUserOption(t);let o={};if("type"in r&&typeof r.type=="string"){if(o.enterprise=(p=r.options)==null?void 0:p.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){let v=await dd(r.main);i=pd(v),o.languagePacks=[];for(let S of(h=r.languagePacks)!=null?h:[])S.localePack instanceof Uint8Array&&o.languagePacks.push({language:S.language,localePack:await Qa(S.localePack)})}else if(r.type==="json")i=r.main,o.languagePacks=(y=r.languagePacks)!=null?y:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(o.binaryBundle=r.main)}else i=r,o.enterprise=i.enterprise!=null;let a;if("accessToken"in t)a=t.accessToken;else if("key"in t&&"secret"in t){t.baseAuthUri=n.getBaseAuthUri(o.enterprise);let v=await Ql(t,o.enterprise);a=(v==null?void 0:v.accessToken)||""}if(o.outdoorViewToken=a,o.env=n,a&&!o.enterprise)try{o.sasToken=(await hd(t,a)).token}catch(v){L.error("Failed to fetch SAS token.",v)}let u=new Zs(i,o);a&&u.Analytics.init({accessToken:a,mapId:t.mapId,key:"key"in t?t.key:void 0,secret:"secret"in t?t.secret:void 0,...t.analytics,baseUri:n.getAnalyticsBaseUri(),context:(g=t.analytics)==null?void 0:g.context});let l=new ud(u);if("language"in t)try{await l.changeLanguage(t.language)}catch{}return l},"hydrateMapData"),bF=c(async r=>{var T;let e=E8,t,i=Io();i.updateByUserOption(r);let n={...r};if("accessToken"in n){t=n.accessToken;let{aud:b,sub:x}=sd(t);(BS.some(I=>b.includes(I))||x&&x.startsWith("client"))&&(e=!0)}else if("key"in n&&"secret"in n)n.key.startsWith("mik_")||(e=!0),n.baseAuthUri=i.getBaseAuthUri(e),t=(await Ql(n,e)).accessToken;else throw new Error("Missing key or secret.");n.baseUri=i.getBaseUri(e);let o=performance.now(),a,u;if(e){let b={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0"},x=await qm(b);a=x.compressed,u=x.localePacks}else a=await $m(n,t);let l=performance.now(),p=await dd(a),h=pd(p),y=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(h);let g;if(!e)try{g=(await hd(n,t)).token}catch(b){L.error("Failed to fetch SAS token.",b)}let v=new Zs(h,{env:i,outdoorViewToken:t,sasToken:g,enterprise:e,localePacksUrls:u,binaryBundle:a}),S=new ud(v,{search:r.search});if(v.Analytics.init({accessToken:t,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,...n.analytics,baseUri:i.getAnalyticsBaseUri(),context:(T=n.analytics)==null?void 0:T.context}),v.Analytics.sendGetMapDataEvent({parseDuration:y-l,downloadDuration:l-o,viewId:n.viewId}),"language"in n)try{await S.changeLanguage(n.language)}catch{}return S},"getMapData"),spe=bF,lpe=c((r,e)=>{Vl.instance!=null&&L.warn("Only a single map venue is supported at this time.");let t=new Vl([r.mapCenter.longitude,r.mapCenter.latitude],r,e);return Vl.instance=t,t},"createMapLibreOverlay"),CF=c(async(r,e,t)=>{var p,h,y,g,v,S,T,b,x;let i=performance.now(),n=i1(t,e);try{t&&r1(t)}catch(I){if(I instanceof Error&&I.name==="MissingOutdoorViewToken")L.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`");else throw I}let o=RS((p=e.outdoorViewToken)!=null?p:""),a=Ka(e);(h=n.outdoorView)!=null&&h.style&&a.envControl.updateTileServerBaseUrl((y=n.outdoorView)==null?void 0:y.style);let u=await l8(r,{center:[e.mapCenter.longitude,e.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:(g=n.style)==null?void 0:g.backgroundAlpha,backgroundColor:(v=n.style)==null?void 0:v.backgroundColor,outdoorView:(S=n.outdoorView)!=null&&S.token?{headers:{"x-mappedin-tiles-key":(T=n.outdoorView)==null?void 0:T.token},style:e.getEnv().tileServerUri,enabled:!!((b=n.outdoorView)!=null&&b.enabled)}:void 0,watermark:{...n.watermark,visible:!o.remove_watermark},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!((x=n.antialiasing)!=null&&x.enabled),accessToken:e.outdoorViewToken}),l=new Nl(u);return await l.addMap(e,n),Ka(e).Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-i,dimension:l.getDimensions()}),l},"show3dMap"),cpe=CF;export{U2 as a,N8 as b,Z2 as c,$ as d,se as e,ai as f,mh as g,yh as h,fr as i,Rt as j,Qi as k,tn as l,Nt as m,li as n,Un as o,gh as p,ci as q,Or as r,vh as s,f1 as t,pd as u,dd as v,A as w,hv as x,_h as y,Dh as z,nM as A,rF as B,npe as C,ope as D,ape as E,bF as F,spe as G,lpe as H,CF as I,cpe as J};
|