@mappedin/mappedin-js 6.19.0 → 6.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,660 @@
1
+ import{a as $n,b as Yn,c as Vr,d as Jt,e as Ao,f as Vl,g as bo,h as qo,i as Qo,j as jl,k as Ul,l as ca,m as Hl,n as Wl,o as pa,p as zl,q as Xl,r as $l,s as ya,y as ac}from"./chunk-JTQDGBFM.js";import{A as Ce,B as Gl,E as da,Fa as nc,I as Yl,J as Zl,K as Jl,L as ql,O as ao,P as Ko,Q as ua,R as Ql,S as Kl,T as ec,U as fa,V as ha,W as ga,X as ma,_ as tc,ba as Zn,d as C,e as ee,ea as ba,f as Wn,fa as Ta,g as kl,ga as oc,ha as rc,i as Mt,ja as uh,k as Zo,ka as va,l as zn,m as Br,p as Xn,q as Ll,s as Rl,t as Zt,u as la,w as Nl,x as Bl,y as Jo,zc as ic}from"./chunk-344UV3KW.js";import{a as f,b as S}from"./chunk-S5CGAT7I.js";import{b as Ie,d as Hn}from"./chunk-PWEV3AFA.js";var ns=Ie((os,rs)=>{f();(function(o,e){typeof os=="object"&&typeof rs<"u"?rs.exports=e():typeof define=="function"&&define.amd?define(e):(o=typeof globalThis<"u"?globalThis:o||self,o.polygonClipping=e())})(os,(function(){"use strict";function o(M,d){var u={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},m,b,y,O;return O={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function _(w){return function(W){return F([w,W])}}function F(w){if(m)throw new TypeError("Generator is already executing.");for(;u;)try{if(m=1,b&&(y=w[0]&2?b.return:w[0]?b.throw||((y=b.return)&&y.call(b),0):b.next)&&!(y=y.call(b,w[1])).done)return y;switch(b=0,y&&(w=[w[0]&2,y.value]),w[0]){case 0:case 1:y=w;break;case 4:return u.label++,{value:w[1],done:!1};case 5:u.label++,b=w[1],w=[0];continue;case 7:w=u.ops.pop(),u.trys.pop();continue;default:if(y=u.trys,!(y=y.length>0&&y[y.length-1])&&(w[0]===6||w[0]===2)){u=0;continue}if(w[0]===3&&(!y||w[1]>y[0]&&w[1]<y[3])){u.label=w[1];break}if(w[0]===6&&u.label<y[1]){u.label=y[1],y=w;break}if(y&&u.label<y[2]){u.label=y[2],u.ops.push(w);break}y[2]&&u.ops.pop(),u.trys.pop();continue}w=d.call(M,u)}catch(W){w=[6,W],b=0}finally{m=y=0}if(w[0]&5)throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}}var e=(function(){function M(d,u){this.next=null,this.key=d,this.data=u,this.left=null,this.right=null}return M})();function t(M,d){return M>d?1:M<d?-1:0}function r(M,d,u){for(var m=new e(null,null),b=m,y=m;;){var O=u(M,d.key);if(O<0){if(d.left===null)break;if(u(M,d.left.key)<0){var _=d.left;if(d.left=_.right,_.right=d,d=_,d.left===null)break}y.left=d,y=d,d=d.left}else if(O>0){if(d.right===null)break;if(u(M,d.right.key)>0){var _=d.right;if(d.right=_.left,_.left=d,d=_,d.right===null)break}b.right=d,b=d,d=d.right}else break}return b.right=d.left,y.left=d.right,d.left=m.right,d.right=m.left,d}function n(M,d,u,m){var b=new e(M,d);if(u===null)return b.left=b.right=null,b;u=r(M,u,m);var y=m(M,u.key);return y<0?(b.left=u.left,b.right=u,u.left=null):y>=0&&(b.right=u.right,b.left=u,u.right=null),b}function i(M,d,u){var m=null,b=null;if(d){d=r(M,d,u);var y=u(d.key,M);y===0?(m=d.left,b=d.right):y<0?(b=d.right,d.right=null,m=d):(m=d.left,d.left=null,b=d)}return{left:m,right:b}}function a(M,d,u){return d===null?M:(M===null||(d=r(M.key,d,u),d.left=M),d)}function s(M,d,u,m,b){if(M){m(""+d+(u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+b(M)+`
2
+ `);var y=d+(u?" ":"\u2502 ");M.left&&s(M.left,y,!1,m,b),M.right&&s(M.right,y,!0,m,b)}}var l=(function(){function M(d){d===void 0&&(d=t),this._root=null,this._size=0,this._comparator=d}return M.prototype.insert=function(d,u){return this._size++,this._root=n(d,u,this._root,this._comparator)},M.prototype.add=function(d,u){var m=new e(d,u);this._root===null&&(m.left=m.right=null,this._size++,this._root=m);var b=this._comparator,y=r(d,this._root,b),O=b(d,y.key);return O===0?this._root=y:(O<0?(m.left=y.left,m.right=y,y.left=null):O>0&&(m.right=y.right,m.left=y,y.right=null),this._size++,this._root=m),this._root},M.prototype.remove=function(d){this._root=this._remove(d,this._root,this._comparator)},M.prototype._remove=function(d,u,m){var b;if(u===null)return null;u=r(d,u,m);var y=m(d,u.key);return y===0?(u.left===null?b=u.right:(b=r(d,u.left,m),b.right=u.right),this._size--,b):u},M.prototype.pop=function(){var d=this._root;if(d){for(;d.left;)d=d.left;return this._root=r(d.key,this._root,this._comparator),this._root=this._remove(d.key,this._root,this._comparator),{key:d.key,data:d.data}}return null},M.prototype.findStatic=function(d){for(var u=this._root,m=this._comparator;u;){var b=m(d,u.key);if(b===0)return u;b<0?u=u.left:u=u.right}return null},M.prototype.find=function(d){return this._root&&(this._root=r(d,this._root,this._comparator),this._comparator(d,this._root.key)!==0)?null:this._root},M.prototype.contains=function(d){for(var u=this._root,m=this._comparator;u;){var b=m(d,u.key);if(b===0)return!0;b<0?u=u.left:u=u.right}return!1},M.prototype.forEach=function(d,u){for(var m=this._root,b=[],y=!1;!y;)m!==null?(b.push(m),m=m.left):b.length!==0?(m=b.pop(),d.call(u,m),m=m.right):y=!0;return this},M.prototype.range=function(d,u,m,b){for(var y=[],O=this._comparator,_=this._root,F;y.length!==0||_;)if(_)y.push(_),_=_.left;else{if(_=y.pop(),F=O(_.key,u),F>0)break;if(O(_.key,d)>=0&&m.call(b,_))return this;_=_.right}return this},M.prototype.keys=function(){var d=[];return this.forEach(function(u){var m=u.key;return d.push(m)}),d},M.prototype.values=function(){var d=[];return this.forEach(function(u){var m=u.data;return d.push(m)}),d},M.prototype.min=function(){return this._root?this.minNode(this._root).key:null},M.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},M.prototype.minNode=function(d){if(d===void 0&&(d=this._root),d)for(;d.left;)d=d.left;return d},M.prototype.maxNode=function(d){if(d===void 0&&(d=this._root),d)for(;d.right;)d=d.right;return d},M.prototype.at=function(d){for(var u=this._root,m=!1,b=0,y=[];!m;)if(u)y.push(u),u=u.left;else if(y.length>0){if(u=y.pop(),b===d)return u;b++,u=u.right}else m=!0;return null},M.prototype.next=function(d){var u=this._root,m=null;if(d.right){for(m=d.right;m.left;)m=m.left;return m}for(var b=this._comparator;u;){var y=b(d.key,u.key);if(y===0)break;y<0?(m=u,u=u.left):u=u.right}return m},M.prototype.prev=function(d){var u=this._root,m=null;if(d.left!==null){for(m=d.left;m.right;)m=m.right;return m}for(var b=this._comparator;u;){var y=b(d.key,u.key);if(y===0)break;y<0?u=u.left:(m=u,u=u.right)}return m},M.prototype.clear=function(){return this._root=null,this._size=0,this},M.prototype.toList=function(){return h(this._root)},M.prototype.load=function(d,u,m){u===void 0&&(u=[]),m===void 0&&(m=!1);var b=d.length,y=this._comparator;if(m&&I(d,u,0,b-1,y),this._root===null)this._root=c(d,u,0,b),this._size=b;else{var O=T(this.toList(),p(d,u),y);b=this._size+b,this._root=g({head:O},0,b)}return this},M.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(M.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),M.prototype.toString=function(d){d===void 0&&(d=function(m){return String(m.key)});var u=[];return s(this._root,"",!0,function(m){return u.push(m)},d),u.join("")},M.prototype.update=function(d,u,m){var b=this._comparator,y=i(d,this._root,b),O=y.left,_=y.right;b(d,u)<0?_=n(u,m,_,b):O=n(u,m,O,b),this._root=a(O,_,b)},M.prototype.split=function(d){return i(d,this._root,this._comparator)},M.prototype[Symbol.iterator]=function(){var d,u,m;return o(this,function(b){switch(b.label){case 0:d=this._root,u=[],m=!1,b.label=1;case 1:return m?[3,6]:d===null?[3,2]:(u.push(d),d=d.left,[3,5]);case 2:return u.length===0?[3,4]:(d=u.pop(),[4,d]);case 3:return b.sent(),d=d.right,[3,5];case 4:m=!0,b.label=5;case 5:return[3,1];case 6:return[2]}})},M})();function c(M,d,u,m){var b=m-u;if(b>0){var y=u+Math.floor(b/2),O=M[y],_=d[y],F=new e(O,_);return F.left=c(M,d,u,y),F.right=c(M,d,y+1,m),F}return null}function p(M,d){for(var u=new e(null,null),m=u,b=0;b<M.length;b++)m=m.next=new e(M[b],d[b]);return m.next=null,u.next}function h(M){for(var d=M,u=[],m=!1,b=new e(null,null),y=b;!m;)d?(u.push(d),d=d.left):u.length>0?(d=y=y.next=u.pop(),d=d.right):m=!0;return y.next=null,b.next}function g(M,d,u){var m=u-d;if(m>0){var b=d+Math.floor(m/2),y=g(M,d,b),O=M.head;return O.left=y,M.head=M.head.next,O.right=g(M,b+1,u),O}return null}function T(M,d,u){for(var m=new e(null,null),b=m,y=M,O=d;y!==null&&O!==null;)u(y.key,O.key)<0?(b.next=y,y=y.next):(b.next=O,O=O.next),b=b.next;return y!==null?b.next=y:O!==null&&(b.next=O),m.next}function I(M,d,u,m,b){if(!(u>=m)){for(var y=M[u+m>>1],O=u-1,_=m+1;;){do O++;while(b(M[O],y)<0);do _--;while(b(M[_],y)>0);if(O>=_)break;var F=M[O];M[O]=M[_],M[_]=F,F=d[O],d[O]=d[_],d[_]=F}I(M,d,u,_,b),I(M,d,_+1,m,b)}}let E=(M,d)=>M.ll.x<=d.x&&d.x<=M.ur.x&&M.ll.y<=d.y&&d.y<=M.ur.y,D=(M,d)=>{if(d.ur.x<M.ll.x||M.ur.x<d.ll.x||d.ur.y<M.ll.y||M.ur.y<d.ll.y)return null;let u=M.ll.x<d.ll.x?d.ll.x:M.ll.x,m=M.ur.x<d.ur.x?M.ur.x:d.ur.x,b=M.ll.y<d.ll.y?d.ll.y:M.ll.y,y=M.ur.y<d.ur.y?M.ur.y:d.ur.y;return{ll:{x:u,y:b},ur:{x:m,y}}},x=Number.EPSILON;x===void 0&&(x=Math.pow(2,-52));let A=x*x,V=(M,d)=>{if(-x<M&&M<x&&-x<d&&d<x)return 0;let u=M-d;return u*u<A*M*d?0:M<d?-1:1};class L{constructor(){this.reset()}reset(){this.xRounder=new G,this.yRounder=new G}round(d,u){return{x:this.xRounder.round(d),y:this.yRounder.round(u)}}}class G{constructor(){this.tree=new l,this.round(0)}round(d){let u=this.tree.add(d),m=this.tree.prev(u);if(m!==null&&V(u.key,m.key)===0)return this.tree.remove(d),m.key;let b=this.tree.next(u);return b!==null&&V(u.key,b.key)===0?(this.tree.remove(d),b.key):d}}let U=new L,R=11102230246251565e-32,j=134217729,te=(3+8*R)*R;function fe(M,d,u,m,b){let y,O,_,F,w=d[0],W=m[0],P=0,k=0;W>w==W>-w?(y=w,w=d[++P]):(y=W,W=m[++k]);let B=0;if(P<M&&k<u)for(W>w==W>-w?(O=w+y,_=y-(O-w),w=d[++P]):(O=W+y,_=y-(O-W),W=m[++k]),y=O,_!==0&&(b[B++]=_);P<M&&k<u;)W>w==W>-w?(O=y+w,F=O-y,_=y-(O-F)+(w-F),w=d[++P]):(O=y+W,F=O-y,_=y-(O-F)+(W-F),W=m[++k]),y=O,_!==0&&(b[B++]=_);for(;P<M;)O=y+w,F=O-y,_=y-(O-F)+(w-F),w=d[++P],y=O,_!==0&&(b[B++]=_);for(;k<u;)O=y+W,F=O-y,_=y-(O-F)+(W-F),W=m[++k],y=O,_!==0&&(b[B++]=_);return(y!==0||B===0)&&(b[B++]=y),B}function ce(M,d){let u=d[0];for(let m=1;m<M;m++)u+=d[m];return u}function Pe(M){return new Float64Array(M)}let Oe=(3+16*R)*R,Ge=(2+12*R)*R,De=(9+64*R)*R*R,ve=Pe(4),ft=Pe(8),io=Pe(12),Yt=Pe(16),se=Pe(4);function ue(M,d,u,m,b,y,O){let _,F,w,W,P,k,B,J,z,K,q,le,Me,be,we,Le,he,ge,it=M-b,at=u-b,Qe=d-y,Ke=m-y;be=it*Ke,k=j*it,B=k-(k-it),J=it-B,k=j*Ke,z=k-(k-Ke),K=Ke-z,we=J*K-(be-B*z-J*z-B*K),Le=Qe*at,k=j*Qe,B=k-(k-Qe),J=Qe-B,k=j*at,z=k-(k-at),K=at-z,he=J*K-(Le-B*z-J*z-B*K),q=we-he,P=we-q,ve[0]=we-(q+P)+(P-he),le=be+q,P=le-be,Me=be-(le-P)+(q-P),q=Me-Le,P=Me-q,ve[1]=Me-(q+P)+(P-Le),ge=le+q,P=ge-le,ve[2]=le-(ge-P)+(q-P),ve[3]=ge;let Ae=ce(4,ve),yo=Ge*O;if(Ae>=yo||-Ae>=yo||(P=M-it,_=M-(it+P)+(P-b),P=u-at,w=u-(at+P)+(P-b),P=d-Qe,F=d-(Qe+P)+(P-y),P=m-Ke,W=m-(Ke+P)+(P-y),_===0&&F===0&&w===0&&W===0)||(yo=De*O+te*Math.abs(Ae),Ae+=it*W+Ke*_-(Qe*w+at*F),Ae>=yo||-Ae>=yo))return Ae;be=_*Ke,k=j*_,B=k-(k-_),J=_-B,k=j*Ke,z=k-(k-Ke),K=Ke-z,we=J*K-(be-B*z-J*z-B*K),Le=F*at,k=j*F,B=k-(k-F),J=F-B,k=j*at,z=k-(k-at),K=at-z,he=J*K-(Le-B*z-J*z-B*K),q=we-he,P=we-q,se[0]=we-(q+P)+(P-he),le=be+q,P=le-be,Me=be-(le-P)+(q-P),q=Me-Le,P=Me-q,se[1]=Me-(q+P)+(P-Le),ge=le+q,P=ge-le,se[2]=le-(ge-P)+(q-P),se[3]=ge;let Gn=fe(4,ve,4,se,ft);be=it*W,k=j*it,B=k-(k-it),J=it-B,k=j*W,z=k-(k-W),K=W-z,we=J*K-(be-B*z-J*z-B*K),Le=Qe*w,k=j*Qe,B=k-(k-Qe),J=Qe-B,k=j*w,z=k-(k-w),K=w-z,he=J*K-(Le-B*z-J*z-B*K),q=we-he,P=we-q,se[0]=we-(q+P)+(P-he),le=be+q,P=le-be,Me=be-(le-P)+(q-P),q=Me-Le,P=Me-q,se[1]=Me-(q+P)+(P-Le),ge=le+q,P=ge-le,se[2]=le-(ge-P)+(q-P),se[3]=ge;let aa=fe(Gn,ft,4,se,io);be=_*W,k=j*_,B=k-(k-_),J=_-B,k=j*W,z=k-(k-W),K=W-z,we=J*K-(be-B*z-J*z-B*K),Le=F*w,k=j*F,B=k-(k-F),J=F-B,k=j*w,z=k-(k-w),K=w-z,he=J*K-(Le-B*z-J*z-B*K),q=we-he,P=we-q,se[0]=we-(q+P)+(P-he),le=be+q,P=le-be,Me=be-(le-P)+(q-P),q=Me-Le,P=Me-q,se[1]=Me-(q+P)+(P-Le),ge=le+q,P=ge-le,se[2]=le-(ge-P)+(q-P),se[3]=ge;let Un=fe(aa,io,4,se,Yt);return Yt[Un-1]}function vt(M,d,u,m,b,y){let O=(d-y)*(u-b),_=(M-b)*(m-y),F=O-_,w=Math.abs(O+_);return Math.abs(F)>=Oe*w?F:-ue(M,d,u,m,b,y,w)}let ae=(M,d)=>M.x*d.y-M.y*d.x,It=(M,d)=>M.x*d.x+M.y*d.y,ie=(M,d,u)=>{let m=vt(M.x,M.y,d.x,d.y,u.x,u.y);return m>0?-1:m<0?1:0},Je=M=>Math.sqrt(It(M,M)),Dt=(M,d,u)=>{let m={x:d.x-M.x,y:d.y-M.y},b={x:u.x-M.x,y:u.y-M.y};return ae(b,m)/Je(b)/Je(m)},qe=(M,d,u)=>{let m={x:d.x-M.x,y:d.y-M.y},b={x:u.x-M.x,y:u.y-M.y};return It(b,m)/Je(b)/Je(m)},Oo=(M,d,u)=>d.y===0?null:{x:M.x+d.x/d.y*(u-M.y),y:u},mo=(M,d,u)=>d.x===0?null:{x:u,y:M.y+d.y/d.x*(u-M.x)},Xo=(M,d,u,m)=>{if(d.x===0)return mo(u,m,M.x);if(m.x===0)return mo(M,d,u.x);if(d.y===0)return Oo(u,m,M.y);if(m.y===0)return Oo(M,d,u.y);let b=ae(d,m);if(b==0)return null;let y={x:u.x-M.x,y:u.y-M.y},O=ae(y,d)/b,_=ae(y,m)/b,F=M.x+_*d.x,w=u.x+O*m.x,W=M.y+_*d.y,P=u.y+O*m.y,k=(F+w)/2,B=(W+P)/2;return{x:k,y:B}};class Ue{static compare(d,u){let m=Ue.comparePoints(d.point,u.point);return m!==0?m:(d.point!==u.point&&d.link(u),d.isLeft!==u.isLeft?d.isLeft?1:-1:$e.compare(d.segment,u.segment))}static comparePoints(d,u){return d.x<u.x?-1:d.x>u.x?1:d.y<u.y?-1:d.y>u.y?1:0}constructor(d,u){d.events===void 0?d.events=[this]:d.events.push(this),this.point=d,this.isLeft=u}link(d){if(d.point===this.point)throw new Error("Tried to link already linked events");let u=d.point.events;for(let m=0,b=u.length;m<b;m++){let y=u[m];this.point.events.push(y),y.point=this.point}this.checkForConsuming()}checkForConsuming(){let d=this.point.events.length;for(let u=0;u<d;u++){let m=this.point.events[u];if(m.segment.consumedBy===void 0)for(let b=u+1;b<d;b++){let y=this.point.events[b];y.consumedBy===void 0&&m.otherSE.point.events===y.otherSE.point.events&&m.segment.consume(y.segment)}}}getAvailableLinkedEvents(){let d=[];for(let u=0,m=this.point.events.length;u<m;u++){let b=this.point.events[u];b!==this&&!b.segment.ringOut&&b.segment.isInResult()&&d.push(b)}return d}getLeftmostComparator(d){let u=new Map,m=b=>{let y=b.otherSE;u.set(b,{sine:Dt(this.point,d.point,y.point),cosine:qe(this.point,d.point,y.point)})};return(b,y)=>{u.has(b)||m(b),u.has(y)||m(y);let{sine:O,cosine:_}=u.get(b),{sine:F,cosine:w}=u.get(y);return O>=0&&F>=0?_<w?1:_>w?-1:0:O<0&&F<0?_<w?-1:_>w?1:0:F<O?-1:F>O?1:0}}}let wt=0;class $e{static compare(d,u){let m=d.leftSE.point.x,b=u.leftSE.point.x,y=d.rightSE.point.x,O=u.rightSE.point.x;if(O<m)return 1;if(y<b)return-1;let _=d.leftSE.point.y,F=u.leftSE.point.y,w=d.rightSE.point.y,W=u.rightSE.point.y;if(m<b){if(F<_&&F<w)return 1;if(F>_&&F>w)return-1;let P=d.comparePoint(u.leftSE.point);if(P<0)return 1;if(P>0)return-1;let k=u.comparePoint(d.rightSE.point);return k!==0?k:-1}if(m>b){if(_<F&&_<W)return-1;if(_>F&&_>W)return 1;let P=u.comparePoint(d.leftSE.point);if(P!==0)return P;let k=d.comparePoint(u.rightSE.point);return k<0?1:k>0?-1:1}if(_<F)return-1;if(_>F)return 1;if(y<O){let P=u.comparePoint(d.rightSE.point);if(P!==0)return P}if(y>O){let P=d.comparePoint(u.rightSE.point);if(P<0)return 1;if(P>0)return-1}if(y!==O){let P=w-_,k=y-m,B=W-F,J=O-b;if(P>k&&B<J)return 1;if(P<k&&B>J)return-1}return y>O?1:y<O||w<W?-1:w>W?1:d.id<u.id?-1:d.id>u.id?1:0}constructor(d,u,m,b){this.id=++wt,this.leftSE=d,d.segment=this,d.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=d,this.rings=m,this.windings=b}static fromRing(d,u,m){let b,y,O,_=Ue.comparePoints(d,u);if(_<0)b=d,y=u,O=1;else if(_>0)b=u,y=d,O=-1;else throw new Error(`Tried to create degenerate segment at [${d.x}, ${d.y}]`);let F=new Ue(b,!0),w=new Ue(y,!1);return new $e(F,w,[m],[O])}replaceRightSE(d){this.rightSE=d,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let d=this.leftSE.point.y,u=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:d<u?d:u},ur:{x:this.rightSE.point.x,y:d>u?d:u}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(d){return d.x===this.leftSE.point.x&&d.y===this.leftSE.point.y||d.x===this.rightSE.point.x&&d.y===this.rightSE.point.y}comparePoint(d){if(this.isAnEndpoint(d))return 0;let u=this.leftSE.point,m=this.rightSE.point,b=this.vector();if(u.x===m.x)return d.x===u.x?0:d.x<u.x?1:-1;let y=(d.y-u.y)/b.y,O=u.x+y*b.x;if(d.x===O)return 0;let _=(d.x-u.x)/b.x,F=u.y+_*b.y;return d.y===F?0:d.y<F?-1:1}getIntersection(d){let u=this.bbox(),m=d.bbox(),b=D(u,m);if(b===null)return null;let y=this.leftSE.point,O=this.rightSE.point,_=d.leftSE.point,F=d.rightSE.point,w=E(u,_)&&this.comparePoint(_)===0,W=E(m,y)&&d.comparePoint(y)===0,P=E(u,F)&&this.comparePoint(F)===0,k=E(m,O)&&d.comparePoint(O)===0;if(W&&w)return k&&!P?O:!k&&P?F:null;if(W)return P&&y.x===F.x&&y.y===F.y?null:y;if(w)return k&&O.x===_.x&&O.y===_.y?null:_;if(k&&P)return null;if(k)return O;if(P)return F;let B=Xo(y,this.vector(),_,d.vector());return B===null||!E(b,B)?null:U.round(B.x,B.y)}split(d){let u=[],m=d.events!==void 0,b=new Ue(d,!0),y=new Ue(d,!1),O=this.rightSE;this.replaceRightSE(y),u.push(y),u.push(b);let _=new $e(b,O,this.rings.slice(),this.windings.slice());return Ue.comparePoints(_.leftSE.point,_.rightSE.point)>0&&_.swapEvents(),Ue.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),m&&(b.checkForConsuming(),y.checkForConsuming()),u}swapEvents(){let d=this.rightSE;this.rightSE=this.leftSE,this.leftSE=d,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let u=0,m=this.windings.length;u<m;u++)this.windings[u]*=-1}consume(d){let u=this,m=d;for(;u.consumedBy;)u=u.consumedBy;for(;m.consumedBy;)m=m.consumedBy;let b=$e.compare(u,m);if(b!==0){if(b>0){let y=u;u=m,m=y}if(u.prev===m){let y=u;u=m,m=y}for(let y=0,O=m.rings.length;y<O;y++){let _=m.rings[y],F=m.windings[y],w=u.rings.indexOf(_);w===-1?(u.rings.push(_),u.windings.push(F)):u.windings[w]+=F}m.rings=null,m.windings=null,m.consumedBy=u,m.leftSE.consumedBy=u.leftSE,m.rightSE.consumedBy=u.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let d=this.prev.consumedBy||this.prev;this._beforeState=d.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let d=this.beforeState();this._afterState={rings:d.rings.slice(0),windings:d.windings.slice(0),multiPolys:[]};let u=this._afterState.rings,m=this._afterState.windings,b=this._afterState.multiPolys;for(let _=0,F=this.rings.length;_<F;_++){let w=this.rings[_],W=this.windings[_],P=u.indexOf(w);P===-1?(u.push(w),m.push(W)):m[P]+=W}let y=[],O=[];for(let _=0,F=u.length;_<F;_++){if(m[_]===0)continue;let w=u[_],W=w.poly;if(O.indexOf(W)===-1)if(w.isExterior)y.push(W);else{O.indexOf(W)===-1&&O.push(W);let P=y.indexOf(w.poly);P!==-1&&y.splice(P,1)}}for(let _=0,F=y.length;_<F;_++){let w=y[_].multiPoly;b.indexOf(w)===-1&&b.push(w)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let d=this.beforeState().multiPolys,u=this.afterState().multiPolys;switch(He.type){case"union":{let m=d.length===0,b=u.length===0;this._isInResult=m!==b;break}case"intersection":{let m,b;d.length<u.length?(m=d.length,b=u.length):(m=u.length,b=d.length),this._isInResult=b===He.numMultiPolys&&m<b;break}case"xor":{let m=Math.abs(d.length-u.length);this._isInResult=m%2===1;break}case"difference":{let m=b=>b.length===1&&b[0].isSubject;this._isInResult=m(d)!==m(u);break}default:throw new Error(`Unrecognized operation type found ${He.type}`)}return this._isInResult}}class St{constructor(d,u,m){if(!Array.isArray(d)||d.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=u,this.isExterior=m,this.segments=[],typeof d[0][0]!="number"||typeof d[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let b=U.round(d[0][0],d[0][1]);this.bbox={ll:{x:b.x,y:b.y},ur:{x:b.x,y:b.y}};let y=b;for(let O=1,_=d.length;O<_;O++){if(typeof d[O][0]!="number"||typeof d[O][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let F=U.round(d[O][0],d[O][1]);F.x===y.x&&F.y===y.y||(this.segments.push($e.fromRing(y,F,this)),F.x<this.bbox.ll.x&&(this.bbox.ll.x=F.x),F.y<this.bbox.ll.y&&(this.bbox.ll.y=F.y),F.x>this.bbox.ur.x&&(this.bbox.ur.x=F.x),F.y>this.bbox.ur.y&&(this.bbox.ur.y=F.y),y=F)}(b.x!==y.x||b.y!==y.y)&&this.segments.push($e.fromRing(y,b,this))}getSweepEvents(){let d=[];for(let u=0,m=this.segments.length;u<m;u++){let b=this.segments[u];d.push(b.leftSE),d.push(b.rightSE)}return d}}class Lr{constructor(d,u){if(!Array.isArray(d))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new St(d[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let m=1,b=d.length;m<b;m++){let y=new St(d[m],this,!1);y.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=y.bbox.ll.x),y.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=y.bbox.ll.y),y.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=y.bbox.ur.x),y.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=y.bbox.ur.y),this.interiorRings.push(y)}this.multiPoly=u}getSweepEvents(){let d=this.exteriorRing.getSweepEvents();for(let u=0,m=this.interiorRings.length;u<m;u++){let b=this.interiorRings[u].getSweepEvents();for(let y=0,O=b.length;y<O;y++)d.push(b[y])}return d}}class $o{constructor(d,u){if(!Array.isArray(d))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof d[0][0][0]=="number"&&(d=[d])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let m=0,b=d.length;m<b;m++){let y=new Lr(d[m],this);y.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=y.bbox.ll.x),y.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=y.bbox.ll.y),y.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=y.bbox.ur.x),y.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=y.bbox.ur.y),this.polys.push(y)}this.isSubject=u}getSweepEvents(){let d=[];for(let u=0,m=this.polys.length;u<m;u++){let b=this.polys[u].getSweepEvents();for(let y=0,O=b.length;y<O;y++)d.push(b[y])}return d}}class At{static factory(d){let u=[];for(let m=0,b=d.length;m<b;m++){let y=d[m];if(!y.isInResult()||y.ringOut)continue;let O=null,_=y.leftSE,F=y.rightSE,w=[_],W=_.point,P=[];for(;O=_,_=F,w.push(_),_.point!==W;)for(;;){let k=_.getAvailableLinkedEvents();if(k.length===0){let z=w[0].point,K=w[w.length-1].point;throw new Error(`Unable to complete output ring starting at [${z.x}, ${z.y}]. Last matching segment found ends at [${K.x}, ${K.y}].`)}if(k.length===1){F=k[0].otherSE;break}let B=null;for(let z=0,K=P.length;z<K;z++)if(P[z].point===_.point){B=z;break}if(B!==null){let z=P.splice(B)[0],K=w.splice(z.index);K.unshift(K[0].otherSE),u.push(new At(K.reverse()));continue}P.push({index:w.length,point:_.point});let J=_.getLeftmostComparator(O);F=k.sort(J)[0].otherSE;break}u.push(new At(w))}return u}constructor(d){this.events=d;for(let u=0,m=d.length;u<m;u++)d[u].segment.ringOut=this;this.poly=null}getGeom(){let d=this.events[0].point,u=[d];for(let w=1,W=this.events.length-1;w<W;w++){let P=this.events[w].point,k=this.events[w+1].point;ie(P,d,k)!==0&&(u.push(P),d=P)}if(u.length===1)return null;let m=u[0],b=u[1];ie(m,d,b)===0&&u.shift(),u.push(u[0]);let y=this.isExteriorRing()?1:-1,O=this.isExteriorRing()?0:u.length-1,_=this.isExteriorRing()?u.length:-1,F=[];for(let w=O;w!=_;w+=y)F.push([u[w].x,u[w].y]);return F}isExteriorRing(){if(this._isExteriorRing===void 0){let d=this.enclosingRing();this._isExteriorRing=d?!d.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let d=this.events[0];for(let b=1,y=this.events.length;b<y;b++){let O=this.events[b];Ue.compare(d,O)>0&&(d=O)}let u=d.segment.prevInResult(),m=u?u.prevInResult():null;for(;;){if(!u)return null;if(!m)return u.ringOut;if(m.ringOut!==u.ringOut)return m.ringOut.enclosingRing()!==u.ringOut?u.ringOut:u.ringOut.enclosingRing();u=m.prevInResult(),m=u?u.prevInResult():null}}}class Do{constructor(d){this.exteriorRing=d,d.poly=this,this.interiorRings=[]}addInterior(d){this.interiorRings.push(d),d.poly=this}getGeom(){let d=[this.exteriorRing.getGeom()];if(d[0]===null)return null;for(let u=0,m=this.interiorRings.length;u<m;u++){let b=this.interiorRings[u].getGeom();b!==null&&d.push(b)}return d}}class Yo{constructor(d){this.rings=d,this.polys=this._composePolys(d)}getGeom(){let d=[];for(let u=0,m=this.polys.length;u<m;u++){let b=this.polys[u].getGeom();b!==null&&d.push(b)}return d}_composePolys(d){let u=[];for(let m=0,b=d.length;m<b;m++){let y=d[m];if(!y.poly)if(y.isExteriorRing())u.push(new Do(y));else{let O=y.enclosingRing();O.poly||u.push(new Do(O)),O.poly.addInterior(y)}}return u}}class Nn{constructor(d){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$e.compare;this.queue=d,this.tree=new l(u),this.segments=[]}process(d){let u=d.segment,m=[];if(d.consumedBy)return d.isLeft?this.queue.remove(d.otherSE):this.tree.remove(u),m;let b=d.isLeft?this.tree.add(u):this.tree.find(u);if(!b)throw new Error(`Unable to find segment #${u.id} [${u.leftSE.point.x}, ${u.leftSE.point.y}] -> [${u.rightSE.point.x}, ${u.rightSE.point.y}] in SweepLine tree.`);let y=b,O=b,_,F;for(;_===void 0;)y=this.tree.prev(y),y===null?_=null:y.key.consumedBy===void 0&&(_=y.key);for(;F===void 0;)O=this.tree.next(O),O===null?F=null:O.key.consumedBy===void 0&&(F=O.key);if(d.isLeft){let w=null;if(_){let P=_.getIntersection(u);if(P!==null&&(u.isAnEndpoint(P)||(w=P),!_.isAnEndpoint(P))){let k=this._splitSafely(_,P);for(let B=0,J=k.length;B<J;B++)m.push(k[B])}}let W=null;if(F){let P=F.getIntersection(u);if(P!==null&&(u.isAnEndpoint(P)||(W=P),!F.isAnEndpoint(P))){let k=this._splitSafely(F,P);for(let B=0,J=k.length;B<J;B++)m.push(k[B])}}if(w!==null||W!==null){let P=null;w===null?P=W:W===null?P=w:P=Ue.comparePoints(w,W)<=0?w:W,this.queue.remove(u.rightSE),m.push(u.rightSE);let k=u.split(P);for(let B=0,J=k.length;B<J;B++)m.push(k[B])}m.length>0?(this.tree.remove(u),m.push(d)):(this.segments.push(u),u.prev=_)}else{if(_&&F){let w=_.getIntersection(F);if(w!==null){if(!_.isAnEndpoint(w)){let W=this._splitSafely(_,w);for(let P=0,k=W.length;P<k;P++)m.push(W[P])}if(!F.isAnEndpoint(w)){let W=this._splitSafely(F,w);for(let P=0,k=W.length;P<k;P++)m.push(W[P])}}}this.tree.remove(u)}return m}_splitSafely(d,u){this.tree.remove(d);let m=d.rightSE;this.queue.remove(m);let b=d.split(u);return b.push(m),d.consumedBy===void 0&&this.tree.add(d),b}}let Rr=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Bn=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Nr{run(d,u,m){He.type=d,U.reset();let b=[new $o(u,!0)];for(let P=0,k=m.length;P<k;P++)b.push(new $o(m[P],!1));if(He.numMultiPolys=b.length,He.type==="difference"){let P=b[0],k=1;for(;k<b.length;)D(b[k].bbox,P.bbox)!==null?k++:b.splice(k,1)}if(He.type==="intersection")for(let P=0,k=b.length;P<k;P++){let B=b[P];for(let J=P+1,z=b.length;J<z;J++)if(D(B.bbox,b[J].bbox)===null)return[]}let y=new l(Ue.compare);for(let P=0,k=b.length;P<k;P++){let B=b[P].getSweepEvents();for(let J=0,z=B.length;J<z;J++)if(y.insert(B[J]),y.size>Rr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let O=new Nn(y),_=y.size,F=y.pop();for(;F;){let P=F.key;if(y.size===_){let B=P.segment;throw new Error(`Unable to pop() ${P.isLeft?"left":"right"} SweepEvent [${P.point.x}, ${P.point.y}] from segment #${B.id} [${B.leftSE.point.x}, ${B.leftSE.point.y}] -> [${B.rightSE.point.x}, ${B.rightSE.point.y}] from queue.`)}if(y.size>Rr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(O.segments.length>Bn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let k=O.process(P);for(let B=0,J=k.length;B<J;B++){let z=k[B];z.consumedBy===void 0&&y.insert(z)}_=y.size,F=y.pop()}U.reset();let w=At.factory(O.segments);return new Yo(w).getGeom()}}let He=new Nr;var jn={union:function(M){for(var d=arguments.length,u=new Array(d>1?d-1:0),m=1;m<d;m++)u[m-1]=arguments[m];return He.run("union",M,u)},intersection:function(M){for(var d=arguments.length,u=new Array(d>1?d-1:0),m=1;m<d;m++)u[m-1]=arguments[m];return He.run("intersection",M,u)},xor:function(M){for(var d=arguments.length,u=new Array(d>1?d-1:0),m=1;m<d;m++)u[m-1]=arguments[m];return He.run("xor",M,u)},difference:function(M){for(var d=arguments.length,u=new Array(d>1?d-1:0),m=1;m<d;m++)u[m-1]=arguments[m];return He.run("difference",M,u)}};return jn}))});var $t=Ie(Tt=>{"use strict";f();Tt.__esModule=!0;Tt.extend=Pu;Tt.indexOf=Gm;Tt.escapeExpression=Um;Tt.isEmpty=Hm;Tt.createFrame=Wm;Tt.blockParams=zm;Tt.appendContextPath=Xm;var Nm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},Bm=/[&<>"'`=]/g,Vm=/[&<>"'`=]/;function jm(o){return Nm[o]}function Pu(o){for(var e=1;e<arguments.length;e++)for(var t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&(o[t]=arguments[e][t]);return o}var Qs=Object.prototype.toString;Tt.toString=Qs;var qs=function(e){return typeof e=="function"};qs(/x/)&&(Tt.isFunction=qs=function(o){return typeof o=="function"&&Qs.call(o)==="[object Function]"});Tt.isFunction=qs;var Ou=Array.isArray||function(o){return o&&typeof o=="object"?Qs.call(o)==="[object Array]":!1};Tt.isArray=Ou;function Gm(o,e){for(var t=0,r=o.length;t<r;t++)if(o[t]===e)return t;return-1}function Um(o){if(typeof o!="string"){if(o&&o.toHTML)return o.toHTML();if(o==null)return"";if(!o)return o+"";o=""+o}return Vm.test(o)?o.replace(Bm,jm):o}function Hm(o){return!o&&o!==0?!0:!!(Ou(o)&&o.length===0)}function Wm(o){var e=Pu({},o);return e._parent=o,e}function zm(o,e){return o.path=e,o}function Xm(o,e){return(o?o+".":"")+e}});var _o=Ie((Ni,Du)=>{"use strict";f();Ni.__esModule=!0;var Ks=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function el(o,e){var t=e&&e.loc,r=void 0,n=void 0,i=void 0,a=void 0;t&&(r=t.start.line,n=t.end.line,i=t.start.column,a=t.end.column,o+=" - "+r+":"+i);for(var s=Error.prototype.constructor.call(this,o),l=0;l<Ks.length;l++)this[Ks[l]]=s[Ks[l]];Error.captureStackTrace&&Error.captureStackTrace(this,el);try{t&&(this.lineNumber=r,this.endLineNumber=n,Object.defineProperty?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:a,enumerable:!0})):(this.column=i,this.endColumn=a))}catch{}}el.prototype=new Error;Ni.default=el;Du.exports=Ni.default});var Au=Ie((Bi,wu)=>{"use strict";f();Bi.__esModule=!0;var tl=$t();Bi.default=function(o){o.registerHelper("blockHelperMissing",function(e,t){var r=t.inverse,n=t.fn;if(e===!0)return n(this);if(e===!1||e==null)return r(this);if(tl.isArray(e))return e.length>0?(t.ids&&(t.ids=[t.name]),o.helpers.each(e,t)):r(this);if(t.data&&t.ids){var i=tl.createFrame(t.data);i.contextPath=tl.appendContextPath(t.data.contextPath,t.name),t={data:i}}return n(e,t)})};wu.exports=Bi.default});var ku=Ie((Vi,Fu)=>{"use strict";f();Vi.__esModule=!0;function $m(o){return o&&o.__esModule?o:{default:o}}var xn=$t(),Ym=_o(),Zm=$m(Ym);Vi.default=function(o){o.registerHelper("each",function(e,t){if(!t)throw new Zm.default("Must pass iterator to #each");var r=t.fn,n=t.inverse,i=0,a="",s=void 0,l=void 0;t.data&&t.ids&&(l=xn.appendContextPath(t.data.contextPath,t.ids[0])+"."),xn.isFunction(e)&&(e=e.call(this)),t.data&&(s=xn.createFrame(t.data));function c(I,E,D){s&&(s.key=I,s.index=E,s.first=E===0,s.last=!!D,l&&(s.contextPath=l+I)),a=a+r(e[I],{data:s,blockParams:xn.blockParams([e[I],I],[l+I,null])})}if(e&&typeof e=="object")if(xn.isArray(e))for(var p=e.length;i<p;i++)i in e&&c(i,i,i===e.length-1);else if(typeof Symbol=="function"&&e[Symbol.iterator]){for(var h=[],g=e[Symbol.iterator](),T=g.next();!T.done;T=g.next())h.push(T.value);e=h;for(var p=e.length;i<p;i++)c(i,i,i===e.length-1)}else(function(){var I=void 0;Object.keys(e).forEach(function(E){I!==void 0&&c(I,i-1),I=E,i++}),I!==void 0&&c(I,i-1,!0)})();return i===0&&(a=n(this)),a})};Fu.exports=Vi.default});var Ru=Ie((ji,Lu)=>{"use strict";f();ji.__esModule=!0;function Jm(o){return o&&o.__esModule?o:{default:o}}var qm=_o(),Qm=Jm(qm);ji.default=function(o){o.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new Qm.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};Lu.exports=ji.default});var ju=Ie((Gi,Vu)=>{"use strict";f();Gi.__esModule=!0;function Km(o){return o&&o.__esModule?o:{default:o}}var Nu=$t(),ey=_o(),Bu=Km(ey);Gi.default=function(o){o.registerHelper("if",function(e,t){if(arguments.length!=2)throw new Bu.default("#if requires exactly one argument");return Nu.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||Nu.isEmpty(e)?t.inverse(this):t.fn(this)}),o.registerHelper("unless",function(e,t){if(arguments.length!=2)throw new Bu.default("#unless requires exactly one argument");return o.helpers.if.call(this,e,{fn:t.inverse,inverse:t.fn,hash:t.hash})})};Vu.exports=Gi.default});var Uu=Ie((Ui,Gu)=>{"use strict";f();Ui.__esModule=!0;Ui.default=function(o){o.registerHelper("log",function(){for(var e=[void 0],t=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)e.push(arguments[r]);var n=1;t.hash.level!=null?n=t.hash.level:t.data&&t.data.level!=null&&(n=t.data.level),e[0]=n,o.log.apply(o,e)})};Gu.exports=Ui.default});var Wu=Ie((Hi,Hu)=>{"use strict";f();Hi.__esModule=!0;Hi.default=function(o){o.registerHelper("lookup",function(e,t,r){return e&&r.lookupProperty(e,t)})};Hu.exports=Hi.default});var Xu=Ie((Wi,zu)=>{"use strict";f();Wi.__esModule=!0;function ty(o){return o&&o.__esModule?o:{default:o}}var Cn=$t(),oy=_o(),ry=ty(oy);Wi.default=function(o){o.registerHelper("with",function(e,t){if(arguments.length!=2)throw new ry.default("#with requires exactly one argument");Cn.isFunction(e)&&(e=e.call(this));var r=t.fn;if(Cn.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&(n=Cn.createFrame(t.data),n.contextPath=Cn.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:Cn.blockParams([e],[n&&n.contextPath])})})};zu.exports=Wi.default});var ol=Ie(zi=>{"use strict";f();zi.__esModule=!0;zi.registerDefaultHelpers=by;zi.moveHelperToHooks=Ty;function Ho(o){return o&&o.__esModule?o:{default:o}}var ny=Au(),iy=Ho(ny),ay=ku(),sy=Ho(ay),ly=Ru(),cy=Ho(ly),py=ju(),dy=Ho(py),uy=Uu(),fy=Ho(uy),hy=Wu(),gy=Ho(hy),my=Xu(),yy=Ho(my);function by(o){iy.default(o),sy.default(o),cy.default(o),dy.default(o),fy.default(o),gy.default(o),yy.default(o)}function Ty(o,e,t){o.helpers[e]&&(o.hooks[e]=o.helpers[e],t||(o.helpers[e]=void 0))}});var Yu=Ie((Xi,$u)=>{"use strict";f();Xi.__esModule=!0;var vy=$t();Xi.default=function(o){o.registerDecorator("inline",function(e,t,r,n){var i=e;return t.partials||(t.partials={},i=function(a,s){var l=r.partials;r.partials=vy.extend({},l,t.partials);var c=e(a,s);return r.partials=l,c}),t.partials[n.args[0]]=n.fn,i})};$u.exports=Xi.default});var Zu=Ie(rl=>{"use strict";f();rl.__esModule=!0;rl.registerDefaultDecorators=My;function Iy(o){return o&&o.__esModule?o:{default:o}}var Sy=Yu(),Ey=Iy(Sy);function My(o){Ey.default(o)}});var nl=Ie(($i,Ju)=>{"use strict";f();$i.__esModule=!0;var xy=$t(),_r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var t=xy.indexOf(_r.methodMap,e.toLowerCase());t>=0?e=t:e=parseInt(e,10)}return e},log:function(e){if(e=_r.lookupLevel(e),typeof console<"u"&&_r.lookupLevel(_r.level)<=e){var t=_r.methodMap[e];console[t]||(t="log");for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];console[t].apply(console,n)}}};$i.default=_r;Ju.exports=$i.default});var il=Ie(_n=>{"use strict";f();_n.__esModule=!0;_n.createProtoAccessControl=Oy;_n.resultIsAllowed=Dy;_n.resetLoggedProperties=Ay;function Cy(o){return o&&o.__esModule?o:{default:o}}var qu=$t(),_y=nl(),Py=Cy(_y),Yi=Object.create(null);function Oy(o){var e=Object.create(null);e.__proto__=!1,qu.extend(e,o.allowedProtoProperties);var t=Object.create(null);return t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1,t.__lookupSetter__=!1,qu.extend(t,o.allowedProtoMethods),{properties:{whitelist:e,defaultValue:o.allowProtoPropertiesByDefault},methods:{whitelist:t,defaultValue:o.allowProtoMethodsByDefault}}}function Dy(o,e,t){return Qu(typeof o=="function"?e.methods:e.properties,t)}function Qu(o,e){return o.whitelist[e]!==void 0?o.whitelist[e]===!0:o.defaultValue!==void 0?o.defaultValue:(wy(e),!1)}function wy(o){Yi[o]!==!0&&(Yi[o]=!0,Py.default.log("error",'Handlebars: Access has been denied to resolve the property "'+o+`" because it is not an "own property" of its parent.
3
+ You can add a runtime option to disable the check or this warning:
4
+ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function Ay(){Object.keys(Yi).forEach(function(o){delete Yi[o]})}});var cl=Ie(no=>{"use strict";f();no.__esModule=!0;no.HandlebarsEnvironment=ll;function Ku(o){return o&&o.__esModule?o:{default:o}}var Wo=$t(),Fy=_o(),al=Ku(Fy),ky=ol(),Ly=Zu(),Ry=nl(),Zi=Ku(Ry),Ny=il(),By="4.7.9";no.VERSION=By;var Vy=8;no.COMPILER_REVISION=Vy;var jy=7;no.LAST_COMPATIBLE_COMPILER_REVISION=jy;var Gy={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};no.REVISION_CHANGES=Gy;var sl="[object Object]";function ll(o,e,t){this.helpers=o||{},this.partials=e||{},this.decorators=t||{},ky.registerDefaultHelpers(this),Ly.registerDefaultDecorators(this)}ll.prototype={constructor:ll,logger:Zi.default,log:Zi.default.log,registerHelper:function(e,t){if(Wo.toString.call(e)===sl){if(t)throw new al.default("Arg not supported with multiple helpers");Wo.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(Wo.toString.call(e)===sl)Wo.extend(this.partials,e);else{if(typeof t>"u")throw new al.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(Wo.toString.call(e)===sl){if(t)throw new al.default("Arg not supported with multiple decorators");Wo.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){Ny.resetLoggedProperties()}};var Uy=Zi.default.log;no.log=Uy;no.createFrame=Wo.createFrame;no.logger=Zi.default});var tf=Ie((Ji,ef)=>{"use strict";f();Ji.__esModule=!0;function pl(o){this.string=o}pl.prototype.toString=pl.prototype.toHTML=function(){return""+this.string};Ji.default=pl;ef.exports=Ji.default});var of=Ie(dl=>{"use strict";f();dl.__esModule=!0;dl.wrapHelper=Hy;function Hy(o,e){if(typeof o!="function")return o;var t=function(){var n=arguments[arguments.length-1];return arguments[arguments.length-1]=e(n),o.apply(this,arguments)};return t}});var cf=Ie(Po=>{"use strict";f();Po.__esModule=!0;Po.checkRevision=Zy;Po.template=Jy;Po.wrapProgram=qi;Po.resolvePartial=qy;Po.invokePartial=Qy;Po.noop=sf;function Wy(o){return o&&o.__esModule?o:{default:o}}function zy(o){if(o&&o.__esModule)return o;var e={};if(o!=null)for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e.default=o,e}var Xy=$t(),Pr=zy(Xy),$y=_o(),ho=Wy($y),go=cl(),rf=ol(),Yy=of(),nf=il();function Zy(o){var e=o&&o[0]||1,t=go.COMPILER_REVISION;if(!(e>=go.LAST_COMPATIBLE_COMPILER_REVISION&&e<=go.COMPILER_REVISION))if(e<go.LAST_COMPATIBLE_COMPILER_REVISION){var r=go.REVISION_CHANGES[t],n=go.REVISION_CHANGES[e];throw new ho.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+n+").")}else throw new ho.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+o[1]+").")}function Jy(o,e){if(!e)throw new ho.default("No environment passed to template");if(!o||!o.main)throw new ho.default("Unknown template object: "+typeof o);o.main.decorator=o.main_d,e.VM.checkRevision(o.compiler);var t=o.compiler&&o.compiler[0]===7;function r(a,s,l){l.hash&&(s=Pr.extend({},s,l.hash),l.ids&&(l.ids[0]=!0)),a=e.VM.resolvePartial.call(this,a,s,l),l.hooks=this.hooks,l.protoAccessControl=this.protoAccessControl;var c=e.VM.invokePartial.call(this,a,s,l);if(c==null&&e.compile&&(l.partials[l.name]=e.compile(a,o.compilerOptions,e),c=l.partials[l.name](s,l)),c!=null){if(l.indent){for(var p=c.split(`
5
+ `),h=0,g=p.length;h<g&&!(!p[h]&&h+1===g);h++)p[h]=l.indent+p[h];c=p.join(`
6
+ `)}return c}else throw new ho.default("The partial "+l.name+" could not be compiled when running in runtime-only mode")}var n={strict:function(s,l,c){if(!s||!(l in s))throw new ho.default('"'+l+'" not defined in '+s,{loc:c});return n.lookupProperty(s,l)},lookupProperty:function(s,l){var c=s[l];if(c==null||Object.prototype.hasOwnProperty.call(s,l)||nf.resultIsAllowed(c,n.protoAccessControl,l))return c},lookup:function(s,l){for(var c=s.length,p=0;p<c;p++){var h=s[p]&&n.lookupProperty(s[p],l);if(h!=null)return h}},lambda:function(s,l){return typeof s=="function"?s.call(l):s},escapeExpression:Pr.escapeExpression,invokePartial:r,fn:function(s){var l=o[s];return l.decorator=o[s+"_d"],l},programs:[],program:function(s,l,c,p,h){var g=this.programs[s],T=this.fn(s);return l||h||p||c?g=qi(this,s,T,l,c,p,h):g||(g=this.programs[s]=qi(this,s,T)),g},data:function(s,l){for(;s&&l--;)s=s._parent;return s},mergeIfNeeded:function(s,l){var c=s||l;return s&&l&&s!==l&&(c=Pr.extend({},l,s)),c},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:o.compiler};function i(a){var s=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],l=s.data;i._setup(s),!s.partial&&o.useData&&(l=Ky(a,l));var c=void 0,p=o.useBlockParams?[]:void 0;o.useDepths&&(s.depths?c=a!=s.depths[0]?[a].concat(s.depths):s.depths:c=[a]);function h(g){return""+o.main(n,g,n.helpers,n.partials,l,p,c)}return h=lf(o.main,h,n,s.depths||[],l,p),h(a,s)}return i.isTop=!0,i._setup=function(a){if(a.partial)n.protoAccessControl=a.protoAccessControl,n.helpers=a.helpers,n.partials=a.partials,n.decorators=a.decorators,n.hooks=a.hooks;else{var s={};af(s,e.helpers,n),af(s,a.helpers,n),n.helpers=s,o.usePartial&&(n.partials=n.mergeIfNeeded(a.partials,e.partials)),(o.usePartial||o.useDecorators)&&(n.decorators=Pr.extend({},e.decorators,a.decorators)),n.hooks={},n.protoAccessControl=nf.createProtoAccessControl(a);var l=a.allowCallsToHelperMissing||t;rf.moveHelperToHooks(n,"helperMissing",l),rf.moveHelperToHooks(n,"blockHelperMissing",l)}},i._child=function(a,s,l,c){if(o.useBlockParams&&!l)throw new ho.default("must pass block params");if(o.useDepths&&!c)throw new ho.default("must pass parent depths");return qi(n,a,o[a],s,0,l,c)},i}function qi(o,e,t,r,n,i,a){function s(l){var c=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],p=a;return a&&l!=a[0]&&!(l===o.nullContext&&a[0]===null)&&(p=[l].concat(a)),t(o,l,o.helpers,o.partials,c.data||r,i&&[c.blockParams].concat(i),p)}return s=lf(t,s,o,a,r,i),s.program=e,s.depth=a?a.length:0,s.blockParams=n||0,s}function qy(o,e,t){return o?!o.call&&!t.name&&(t.name=o,o=Qi(t.partials,o)):t.name==="@partial-block"?o=Qi(t.data,"partial-block"):o=Qi(t.partials,t.name),o}function Qy(o,e,t){var r=Qi(t.data,"partial-block");t.partial=!0,t.ids&&(t.data.contextPath=t.ids[0]||t.data.contextPath);var n=void 0;if(t.fn&&t.fn!==sf&&(function(){t.data=go.createFrame(t.data);var i=t.fn;n=t.data["partial-block"]=function(s){var l=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return l.data=go.createFrame(l.data),l.data["partial-block"]=r,i(s,l)},i.partials&&(t.partials=Pr.extend({},t.partials,i.partials))})(),o===void 0&&n&&(o=n),o===void 0)throw new ho.default("The partial "+t.name+" could not be found");if(o instanceof Function)return o(e,t)}function sf(){return""}function Qi(o,e){if(o&&Object.prototype.hasOwnProperty.call(o,e))return o[e]}function Ky(o,e){return(!e||!("root"in e))&&(e=e?go.createFrame(e):{},e.root=o),e}function lf(o,e,t,r,n,i){if(o.decorator){var a={};e=o.decorator(e,a,t,r&&r[0],n,i,r),Pr.extend(e,a)}return e}function af(o,e,t){e&&Object.keys(e).forEach(function(r){var n=e[r];o[r]=e1(n,t)})}function e1(o,e){var t=e.lookupProperty;return Yy.wrapHelper(o,function(r){return r.lookupProperty=t,r})}});var df=Ie((Ki,pf)=>{"use strict";f();Ki.__esModule=!0;Ki.default=function(o){(function(){typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var e=globalThis.Handlebars;o.noConflict=function(){return globalThis.Handlebars===o&&(globalThis.Handlebars=e),o}};pf.exports=Ki.default});var mf=Ie((ea,gf)=>{"use strict";f();ea.__esModule=!0;function fl(o){return o&&o.__esModule?o:{default:o}}function hl(o){if(o&&o.__esModule)return o;var e={};if(o!=null)for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e.default=o,e}var t1=cl(),uf=hl(t1),o1=tf(),r1=fl(o1),n1=_o(),i1=fl(n1),a1=$t(),ul=hl(a1),s1=cf(),ff=hl(s1),l1=df(),c1=fl(l1);function hf(){var o=new uf.HandlebarsEnvironment;return ul.extend(o,uf),o.SafeString=r1.default,o.Exception=i1.default,o.Utils=ul,o.escapeExpression=ul.escapeExpression,o.VM=ff,o.template=function(e){return ff.template(e,o)},o}var Pn=hf();Pn.create=hf;c1.default(Pn);Pn.default=Pn;ea.default=Pn;gf.exports=ea.default});var bf=Ie((s_,yf)=>{f();yf.exports=mf().default});f();f();f();f();f();var sc="mi-session-data",lc="mi-local-data",Jn="id",qn="deviceId",Lt=class o{static#e;#t;#o;constructor(){try{let e=sessionStorage.getItem(sc);e?this.#t=JSON.parse(e):this.#t={[Jn]:ee()}}catch{this.#t={[Jn]:ee()}}try{let e=localStorage.getItem(lc);e?this.#o=JSON.parse(e):this.#o={[qn]:ee()}}catch{this.#o={[qn]:ee()}}this.#t[Jn]||(this.#t[Jn]=ee()),this.#o[qn]||(this.#o[qn]=ee())}static getInstance(){return this.#e||(this.#e=new o),this.#e}static ___clearInstance(){this.#e=void 0}saveSessionData(e,t){this.#t[e]=t;try{return sessionStorage.setItem(sc,JSON.stringify(this.#t)),!0}catch{return!1}}loadSessionData(e){let t=this.#t[e];if(t!=null)return t}saveLocalData(e,t){this.#o[e]=t;try{return localStorage.setItem(lc,JSON.stringify(this.#o)),!0}catch{return!1}}loadLocalData(e){let t=this.#o[e];if(t!=null)return t}};f();f();var er=o=>o!=null;var fh=(function(){let e=globalThis.fetch;return{fetch(...t){if(!er(e))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return e?.(...t)},setFetch(t){e=t}}})(),cc=fh.fetch;var hc=["websdk","web","webv2","kiosk","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk","minimap"],pc=hc[0],gc="https://api-gateway.mappedin.com/track-analytics/a/",mc="deny-watchposition",yc="load-mapview",bc="load-mapdata",Tc="change-language",vc="query-directions";var tr=class{#e=Object.freeze({});#t;oneTimeEventsSent=new Set;constructor(){this.#t=this.#r(this.#e)}init(e){this.reset(),this.updateStateWithOptions(e)}reset(){this.#e={},this.#t=this.#r({}),this.oneTimeEventsSent.clear()}updateStateWithOptions(e){return this.#e=Object.freeze(Object.assign({},this.#e,e)),this.#t=this.#r(e),this.#o(this.#t),this.#t}#o(e){e.sessionId&&Lt.getInstance().saveSessionData("id",e.sessionId),e.deviceId&&Lt.getInstance().saveLocalData("deviceId",e.deviceId)}#r(e){let t=e.baseUri??gc;return{baseUri:t,analyticsBaseUrl:Ia({...e,baseUri:t}),version:e.version||S?.env?.npm_package_version||"v6",deviceId:e.deviceId||dc(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||uc(),platformString:e.platformString||"",context:fc(e.context)||pc,geolocationMode:!1,sendEvents:e.sendEvents??!0,logEvents:e.logEvents??!1,noAuth:e.noAuth||!1,key:e.key,secret:e.secret,enterprise:e.enterprise??!1,externalId:e.externalId}}updateState(e){let t={...e};t.mapId&&(t.analyticsBaseUrl=Ia({...this.#t,mapId:t.mapId})),t.context&&(t.context=fc(t.context)),t.baseUri&&(t.analyticsBaseUrl=Ia({baseUri:t.baseUri,mapId:this.#t.mapId})),Object.assign(this.#t,t),this.handleStateUpdate(e),this.#o(t)}handleStateUpdate(e){e.userPosition?.floorLevel?this.sendBlueDotEvents("found-floor"):e.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:e,secret:t,accessToken:r}=this.getState();return!!(e&&t)||!!r}getState(){return this.#t}getContext(){return this.getState().context||this.#e.context||pc}getSessionId(){return this.getState().sessionId||this.#e.sessionId||uc()}getDeviceId(){return this.getState().deviceId||this.#e.deviceId||dc()}sendAnalyticEvent(e,t={}){let r=this.getState(),n=hh(r.analyticsBaseUrl,e),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(r.logEvents&&C.log("Analytics.track",n,i),!r.sendEvents)return Promise.resolve();if(!this.authReady)return!r.key&&!r.secret&&!r.accessToken?void 0:C.warn("Auth needs to be ready to send analytics.");let a={...t,g:r.geolocationMode,sdk_version:r.version,...r.externalId?{externalId:r.externalId}:{}};return r.userPosition&&Object.assign(a,r.userPosition),i["Content-Type"]="application/json",!r.noAuth&&r.enterprise&&r.secret&&r.key?(i["x-mappedin-key"]=btoa(r.key),i["x-mappedin-secret"]=btoa(r.secret)):r.accessToken&&(i.Authorization=`Bearer ${r.accessToken}`),cc(n,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(e,t){if(mh.includes(e))return C.warn(`${e} event is sent internally.`),Promise.resolve();let r=gh.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(r,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent(bc,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent(Tc,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent(mc)}sendMapViewLoadedEvent({firstRenderDuration:e,dimension:t,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n}){return this.sendAnalyticEvent(yc,{type:"3d",firstRenderDuration:e,width:t.width,height:t.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n})}sendGetDirectionsEvent=kl((e,t,r)=>{let n={start:e,end:t,type:"location_to_location"};return r!==void 0&&(n.accessible=r),this.sendAnalyticEvent(vc,n)},2500);sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};function Ia({mapId:o,baseUri:e=gc}){return`${e}${o}/`}function dc(){return Lt.getInstance().loadLocalData("deviceId")}function uc(){return Lt.getInstance().loadSessionData("id")}function hh(o,e){return o+e}function fc(o){return hc.find(e=>e===o)}var gh=["$select-location","$select-category","$query-suggest","$query-search"],mh=[yc,bc,vc,mc,Tc],xb=new tr,jr=class{#e;constructor(e){this.#e=e,this.capture=this.#e.capture.bind(this.#e),this.updateState=this.#e.updateState.bind(this.#e)}capture;updateState;getState(){let{sessionId:e,deviceId:t,...r}=this.#e.getState();return r}getContext(){return this.#e.getContext()}getSessionId(){return this.#e.getSessionId()}getDeviceId(){return this.#e.getDeviceId()}};f();f();var Gr=class{#e;searchInstance;#t;#o;enabled=!1;constructor(e,t,{enabled:r=!1}={}){this.#e=e,this.#t=t,this.#o=()=>{this.searchInstance?.then(n=>n.populate())},r&&this.enable()}async query(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return C.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(e,t)}catch(r){return C.error("Search.query failed due to",r),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return C.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(e,t)}catch(r){return C.error("Search.suggest failed due to",r),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-MWOCYEXN.js").then(({InternalSearch:e})=>new e(this.#e))),this.#t.on("language-change",this.#o),await this.searchInstance)}};var Ic={"enterprise-location":"location-profile","enterprise-category":"location-category"},Sc={"location-profile":"enterprise-location","location-category":"enterprise-category"},Ec=new WeakMap,Sa=class{#e;#t;Analytics;Search;Query;internal;constructor(e,{search:t}={}){this.#e=new Mt,this.#t=e,Ec.set(this,e),this.Analytics=new jr(e.Analytics),this.Query=e.Query,this.internal=e,this.Search=new Gr(this,e,{enabled:t?.enabled}),this.#t.on("language-change",r=>{this.#e.publish("language-change",r)})}on=(e,t)=>{this.#e.on(e,t)};off=(e,t)=>{this.#e.off(e,t)};getEnv(){return this.#t.getEnv()}getAccessToken(){return this.#t.tokenManager?.getAccessToken().token}get mapName(){return this.#t.mapName}get mapId(){return this.#t.getMapDataOptions?.mapId}get isEnterpriseMode(){return this.#t.enterpriseMode}get mapCenter(){return this.#t.mapCenter}get organizationId(){return this.#t.organizationId}get outdoorViewToken(){return this.#t.outdoorViewToken}getByType(e){let t=this.#t.getByType(e);if(Array.isArray(t)&&t.length===0){let r=this.isEnterpriseMode;!r&&e in Ic?C.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is a Maker map (API key starts with 'mik_'). Use '${Ic[e]}' instead. See https://developer.mappedin.com/web-sdk/getting-started`):r&&e in Sc&&C.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is an Enterprise map. Use '${Sc[e]}' instead. See https://developer.mappedin.com/web-sdk/getting-started`)}return t}getById(e,t){return this.#t.getById(e,t)}getByExternalId(e,t){return this.#t.getByExternalId(e,t)}getGeoJSON(e){return e.geoJSON}async changeLanguage(e){return this.#t.changeLanguage(e)}get currentLanguage(){return this.#t.currentLanguage}get naturalBearing(){return this.#t.naturalBearing??0}__LEGACY_GET_DIRECTIONS_SYNC=(e,t,r)=>this.#t.__LEGACY_GET_DIRECTIONS_SYNC(e,t,r);getDirections=(e,t,r)=>this.#t.getDirections(e,t,r);__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC=(e,t,r)=>this.#t.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,t,r);getDirectionsMultiDestination=(e,t,r)=>this.#t.getDirectionsMultiDestination(e,t,r);getDistance(e,t){return this.#t.getDistance(e,t)}toBinaryBundle({downloadLanguagePacks:e=!0}={}){return this.#t.toBinaryBundle({downloadLanguagePacks:e})}toJSONBundle({downloadLanguagePacks:e=!0}={}){return this.#t.toJSONBundle({downloadLanguagePacks:e})}},Ur=Sa;function Hr(o){let e=Ec.get(o);if(!e)throw new Error("MapDataInternal not found");return e}f();f();f();f();f();function or(o){return o.endsWith("/")?o:`${o}/`}f();var rr="https://app.mappedin.com/",Mc="https://auth.mappedin.com/",xc=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"}),yh=Object.freeze({...xc,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),bh=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"}),Th=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"}),vh=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Ih={eu:bh,us:xc,"us-enterprise":yh,"us-staging-enterprise":Th,"us-staging-self-serve":vh};function Cc(o){return Ih[o]}f();f();var Sh=o=>{let e=Date.now();return o-e},Qn=(o,e)=>Sh(o)<=e*60*1e3;var Pc=10,Oc=Pc*60*1e3,_c="accessTokens",Eh="mik_";function Dc(o){return typeof o=="string"&&o.startsWith(Eh)}async function Wr(o,e=!1){let t=`${o.key}`,r=Lt.getInstance(),n=r?.loadSessionData(_c)||{},i=Math.floor(Date.now()/1e3);if(n[t]&&!Qn(n[t].expiresTimestamp*1e3,Pc))return n[t];let a=e?await Mh(o,i):await xh(o,i),s={...n,[t]:a};return r?.saveSessionData(_c,s),a}async function Mh(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri??Mc}oauth2/token`;let r;try{r=await ht()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:o.key,client_secret:o.secret})})}catch(i){let a=i instanceof Error?i.message:String(i);throw new Error(`Failed to fetch enterprise access token from ${t}: ${a}`)}if(!r.ok)throw new Error(`${r.status} ${r.statusText}: ${await r.text()}`);let n=await r.json();return{accessToken:n.access_token,expiresTimestamp:e+n.expires_in}}async function xh(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri?or(o.baseAuthUri):rr}api/v1/api-key/token`;let r;try{r=await ht()(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:o.key,secret:o.secret})})}catch(i){let a=i instanceof Error?i.message:String(i);throw new Error(`Failed to fetch access token from ${t}: ${a}`)}if(!r.ok)throw new Error(`${r.status} ${r.statusText}: ${await r.text()}`);let n=await r.json();return{accessToken:n.access_token,expiresTimestamp:e+n.expires_in}}f();var Ac=10,Fc=Ac*60*1e3,wc="miSasTokens";async function Ea(o,e){let t=`${e}__${o.mapId}`,r=Lt.getInstance(),n=r?.loadSessionData(wc)||{};if(n[t]&&!Qn(n[t].expires,Ac))return n[t];let i=await Ch(o,e),a={...n,[t]:{token:i.token,expires:new Date(i.expires).getTime()}};return r?.saveSessionData(wc,a),i}async function Ch(o,e){let t=`${o.baseUri?or(o.baseUri):rr}api/v1/venue/${o.mapId}/sas-token`,r=await ht()(t,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`${r.status} ${r.statusText}: ${await r.text()}`);let n=await r.json();return{token:n.token,expires:new Date(n.expires).getTime()}}f();var gt=Uint8Array,Fo=Uint16Array,kc=Uint32Array,Lc=new gt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Rc=new gt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_h=new gt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nc=function(o,e){for(var t=new Fo(31),r=0;r<31;++r)t[r]=e+=1<<o[r-1];for(var n=new kc(t[30]),r=1;r<30;++r)for(var i=t[r];i<t[r+1];++i)n[i]=i-t[r]<<5|r;return[t,n]},Bc=Nc(Lc,2),Vc=Bc[0],Ph=Bc[1];Vc[28]=258,Ph[258]=28;var jc=Nc(Rc,0),Oh=jc[0],d0=jc[1],_a=new Fo(32768);for(re=0;re<32768;++re)so=(re&43690)>>>1|(re&21845)<<1,so=(so&52428)>>>2|(so&13107)<<2,so=(so&61680)>>>4|(so&3855)<<4,_a[re]=((so&65280)>>>8|(so&255)<<8)>>>1;var so,re,zr=(function(o,e,t){for(var r=o.length,n=0,i=new Fo(e);n<r;++n)o[n]&&++i[o[n]-1];var a=new Fo(e);for(n=0;n<e;++n)a[n]=a[n-1]+i[n-1]<<1;var s;if(t){s=new Fo(1<<e);var l=15-e;for(n=0;n<r;++n)if(o[n])for(var c=n<<4|o[n],p=e-o[n],h=a[o[n]-1]++<<p,g=h|(1<<p)-1;h<=g;++h)s[_a[h]>>>l]=c}else for(s=new Fo(r),n=0;n<r;++n)o[n]&&(s[n]=_a[a[o[n]-1]++]>>>15-o[n]);return s}),Xr=new gt(288);for(re=0;re<144;++re)Xr[re]=8;var re;for(re=144;re<256;++re)Xr[re]=9;var re;for(re=256;re<280;++re)Xr[re]=7;var re;for(re=280;re<288;++re)Xr[re]=8;var re,Gc=new gt(32);for(re=0;re<32;++re)Gc[re]=5;var re;var Dh=zr(Xr,9,1);var wh=zr(Gc,5,1),Ma=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},Rt=function(o,e,t){var r=e/8|0;return(o[r]|o[r+1]<<8)>>(e&7)&t},xa=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},Ah=function(o){return(o+7)/8|0},Oa=function(o,e,t){(e==null||e<0)&&(e=0),(t==null||t>o.length)&&(t=o.length);var r=new(o.BYTES_PER_ELEMENT==2?Fo:o.BYTES_PER_ELEMENT==4?kc:gt)(t-e);return r.set(o.subarray(e,t)),r};var Fh=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Nt=function(o,e,t){var r=new Error(e||Fh[o]);if(r.code=o,Error.captureStackTrace&&Error.captureStackTrace(r,Nt),!t)throw r;return r},kh=function(o,e,t){var r=o.length;if(!r||t&&t.f&&!t.l)return e||new gt(0);var n=!e||t,i=!t||t.i;t||(t={}),e||(e=new gt(r*3));var a=function(Je){var Dt=e.length;if(Je>Dt){var qe=new gt(Math.max(Dt*2,Je));qe.set(e),e=qe}},s=t.f||0,l=t.p||0,c=t.b||0,p=t.l,h=t.d,g=t.m,T=t.n,I=r*8;do{if(!p){s=Rt(o,l,1);var E=Rt(o,l+1,3);if(l+=3,E)if(E==1)p=Dh,h=wh,g=9,T=5;else if(E==2){var V=Rt(o,l,31)+257,L=Rt(o,l+10,15)+4,G=V+Rt(o,l+5,31)+1;l+=14;for(var U=new gt(G),R=new gt(19),j=0;j<L;++j)R[_h[j]]=Rt(o,l+j*3,7);l+=L*3;for(var te=Ma(R),fe=(1<<te)-1,ce=zr(R,te,1),j=0;j<G;){var Pe=ce[Rt(o,l,fe)];l+=Pe&15;var D=Pe>>>4;if(D<16)U[j++]=D;else{var Oe=0,Ge=0;for(D==16?(Ge=3+Rt(o,l,3),l+=2,Oe=U[j-1]):D==17?(Ge=3+Rt(o,l,7),l+=3):D==18&&(Ge=11+Rt(o,l,127),l+=7);Ge--;)U[j++]=Oe}}var De=U.subarray(0,V),ve=U.subarray(V);g=Ma(De),T=Ma(ve),p=zr(De,g,1),h=zr(ve,T,1)}else Nt(1);else{var D=Ah(l)+4,x=o[D-4]|o[D-3]<<8,A=D+x;if(A>r){i&&Nt(0);break}n&&a(c+x),e.set(o.subarray(D,A),c),t.b=c+=x,t.p=l=A*8,t.f=s;continue}if(l>I){i&&Nt(0);break}}n&&a(c+131072);for(var ft=(1<<g)-1,io=(1<<T)-1,Yt=l;;Yt=l){var Oe=p[xa(o,l)&ft],se=Oe>>>4;if(l+=Oe&15,l>I){i&&Nt(0);break}if(Oe||Nt(2),se<256)e[c++]=se;else if(se==256){Yt=l,p=null;break}else{var ue=se-254;if(se>264){var j=se-257,vt=Lc[j];ue=Rt(o,l,(1<<vt)-1)+Vc[j],l+=vt}var ae=h[xa(o,l)&io],It=ae>>>4;ae||Nt(3),l+=ae&15;var ve=Oh[It];if(It>3){var vt=Rc[It];ve+=xa(o,l)&(1<<vt)-1,l+=vt}if(l>I){i&&Nt(0);break}n&&a(c+131072);for(var ie=c+ue;c<ie;c+=4)e[c]=e[c-ve],e[c+1]=e[c+1-ve],e[c+2]=e[c+2-ve],e[c+3]=e[c+3-ve];c=ie}}t.l=p,t.p=Yt,t.b=c,t.f=s,p&&(s=1,t.m=g,t.d=h,t.n=T)}while(!s);return c==e.length?e:Oa(e,0,c)};var Lh=new gt(0);var qt=function(o,e){return o[e]|o[e+1]<<8},Bt=function(o,e){return(o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24)>>>0},Ca=function(o,e){return Bt(o,e)+Bt(o,e+4)*4294967296};function Rh(o,e){return kh(o,e)}var Pa=typeof TextDecoder<"u"&&new TextDecoder,Nh=0;try{Pa.decode(Lh,{stream:!0}),Nh=1}catch{}var Bh=function(o){for(var e="",t=0;;){var r=o[t++],n=(r>127)+(r>223)+(r>239);if(t+n>o.length)return[e,Oa(o,t-1)];n?n==3?(r=((r&15)<<18|(o[t++]&63)<<12|(o[t++]&63)<<6|o[t++]&63)-65536,e+=String.fromCharCode(55296|r>>10,56320|r&1023)):n&1?e+=String.fromCharCode((r&31)<<6|o[t++]&63):e+=String.fromCharCode((r&15)<<12|(o[t++]&63)<<6|o[t++]&63):e+=String.fromCharCode(r)}};function Vh(o,e){if(e){for(var t="",r=0;r<o.length;r+=16384)t+=String.fromCharCode.apply(null,o.subarray(r,r+16384));return t}else{if(Pa)return Pa.decode(o);var n=Bh(o),i=n[0],a=n[1];return a.length&&Nt(8),i}}var jh=function(o,e){return e+30+qt(o,e+26)+qt(o,e+28)},Gh=function(o,e,t){var r=qt(o,e+28),n=Vh(o.subarray(e+46,e+46+r),!(qt(o,e+8)&2048)),i=e+46+r,a=Bt(o,e+20),s=t&&a==4294967295?Uh(o,i):[a,Bt(o,e+24),Bt(o,e+42)],l=s[0],c=s[1],p=s[2];return[qt(o,e+10),l,c,n,i+qt(o,e+30)+qt(o,e+32),p]},Uh=function(o,e){for(;qt(o,e)!=1;e+=4+qt(o,e+2));return[Ca(o,e+12),Ca(o,e+4),Ca(o,e+20)]};function Da(o,e){for(var t={},r=o.length-22;Bt(o,r)!=101010256;--r)(!r||o.length-r>65558)&&Nt(13);var n=qt(o,r+8);if(!n)return{};var i=Bt(o,r+16),a=i==4294967295||n==65535;if(a){var s=Bt(o,r-12);a=Bt(o,s)==101075792,a&&(n=Bt(o,s+32),i=Bt(o,s+48))}for(var l=e&&e.filter,c=0;c<n;++c){var p=Gh(o,i,a),h=p[0],g=p[1],T=p[2],I=p[3],E=p[4],D=p[5],x=jh(o,D);i=E,(!l||l({name:I,size:g,originalSize:T,compression:h}))&&(h?h==8?t[I]=Rh(o.subarray(x,x+g),new gt(T)):Nt(14,"unknown compression type "+h):t[I]=Oa(o,x,x+g))}return t}var Uc=globalThis.fetch,Wh=S?.env?.npm_package_version;function ht(){if(Uc==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Uc}var wa={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Wc(o){let e={...wa,...o};return e.headers={...e.headers,"mappedin-sdk-version":Wh},e.things=[],"platformString"in o&&(e.headers={...e.headers,"mappedin-platform-version":o.platformString}),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e.language=e.language?.toLowerCase(),e}function zh(o,e,t=!1){let r={language:o.language,clientId:o.clientId,clientSecret:o.clientSecret};t&&delete r.language;let{headers:n}=o;n["Content-Type"]=n["Content-Type"]||"text/json",o.accessToken?n.Authorization=`Bearer ${o.accessToken}`:o.noAuth||o.clientId&&o.clientSecret&&(n["x-mappedin-key"]=btoa(o.clientId),n["x-mappedin-secret"]=btoa(o.clientSecret));let i={method:"GET",headers:n};return o.secure&&(e+="&withcdntoken"),{req:i,url:e}}async function Xh(o,e,t=!1){let r=zh(o,e,t),n=await ht()(r.url,r.req);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return n.json()}var $h=o=>{let e=o!=null&&typeof o=="object"&&"perspectives"in o&&o.perspectives!=null&&typeof o.perspectives=="object"?o.perspectives:null;if(e==null||Object.keys(e).length===0)return C.warn("No perspectives available in response!"),null;let t={};for(let[r,n]of Object.entries(e)){let i="url"in n&&typeof n.url=="string"?n.url:null,a="locale_packs"in n&&typeof n.locale_packs=="object"?n.locale_packs:null;if(i==null||a==null){C.warn(`Perspective ${r} is missing url or locale_packs!`);continue}t[r]={url:i,locale_packs:a}}return t};async function Yh(o,e="exports/mvf/1/bundle"){let t=Wc({baseUri:"https://api-gateway.mappedin.com/",...wa,...o}),r=`${t.baseUri+e}?venue=${t.venue}&version=${t.version??"2.0.0"}`;t.headers["Content-Type"]="application/zip";let n=await Xh(t,r),i=n.url,a=n.locale_packs,s=t.perspective??wa.perspective,l=$h(n);if(s!=null&&s!==""&&l!=null){let c=l[s];c==null?C.warn(`Perspective ${s} not found in response! Loading default perspective instead.`):(C.log(`Loading perspective "${s}"`),i=c.url,a=c.locale_packs)}return{url:i,localePacks:a,updated_at:n.updated_at}}var nr=(function(){let o;return()=>(o||(o=new TextDecoder),o)})();async function Aa(o,{signal:e}){let t=await(await ht()(o,{signal:e})).arrayBuffer();return new Uint8Array(t)}async function ir(o){let e=Da(o),t={};if(e["enterprise/"]!=null){t.enterprise={};let r=e["enterprise/locations.json"];r&&(t.enterprise.locations=JSON.parse(nr().decode(r)));let n=e["enterprise/locationInstances.json"];n&&(t.enterprise.locationInstances=JSON.parse(nr().decode(n)));let i=e["enterprise/categories.json"];i&&(t.enterprise.categories=JSON.parse(nr().decode(i)))}return e["floorstack.json"]&&(t["floorstack.json"]=JSON.parse(nr().decode(e["floorstack.json"]))),e["floor.geojson"]&&(t["floor.geojson"]=JSON.parse(nr().decode(e["floor.geojson"]))),e["manifest.json"]&&(t["manifest.geojson"]=JSON.parse(nr().decode(e["manifest.json"]))),t}async function zc(o,{signal:e}){try{let t=await(await ht()(o,{signal:e})).arrayBuffer();if(e.aborted)return;let r=new Uint8Array(t);return await ir(r)}catch(t){let r=new Error("downloadLanguagePack failed");throw r.cause=t,r}}function Zh(o){let{mvfVersion:e,useDraftData:t}=o;if(e==="3.0.0")return t?"exports/mvf3-draft/1/bundle":"exports/mvf3/1/bundle";if(e==null||e==="2.0.0")return t?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle";if(e==="2.0.0-c")return t?"exports/mvf2c-draft/1/bundle":"exports/mvf2c/1/bundle";throw new Error(`Unsupported MVF version: ${e}`)}async function Fa(o){return new Promise(async(e,t)=>{try{let r=Zh(o),{url:n,localePacks:i}=await Yh(o,r),a=await ht()(n).then(l=>l.arrayBuffer()),s=new Uint8Array(a);e({compressed:s,localePacks:i})}catch(r){t(r)}})}async function ka(o,e){return new Promise(async(t,r)=>{try{let{url:n}=await Jh(o,e),i=await ht()(n).then(s=>s.arrayBuffer()),a=new Uint8Array(i);t(a)}catch(n){r(n)}})}async function Jh(o,e){let t=new URL(`${o.baseUri?or(o.baseUri):rr}api/v1/venue/${o.mapId}/mvf`);o.viewId&&t.searchParams.set("configId",o.viewId),o.mvfVersion&&t.searchParams.set("version",o.mvfVersion);let r=await ht()(t.toString(),{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return r.json()}function Xc(o){return ca(o)}function qh(o){if(o==null||typeof o!="object")return!1;let e=["connection.json","manifest.geojson","floor.geojson"in o?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in o?"floorstack.json":"mapstack.json"in o?"mapstack.json":"mapstack.geojson"];"styles.json"in o&&e.push("styles.json"),"shapes.json"in o&&e.push("shapes.json"),"navigationFlags.json"in o&&e.push("navigationFlags.json"),"annotation-symbols.json"in o&&e.push("annotation-symbols.json");for(let t of e)if(o[t]==null||o[t][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}async function La(o){return new Promise(async(e,t)=>{try{if(o==null||typeof o!="object")throw new Error("Error parsing data! Unzipping failed.");if(o[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let r=Da(o);if(!qh(r))throw new Error("MVF is missing some expect static files. Unzipping failed.");let n={},i=Object.keys(r);for(let a of i){if(r[a].length===0)continue;let s=a.split("/");if(s.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(s.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(s.length===1){n[s[0]]=r[a];continue}if(s[0]==="image"){C.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else n[s[0]]==null&&(n[s[0]]={}),n[s[0]][s[1]]=r[a]}e(n)}catch(r){t(r)}})}function To(){let o="us",e={};function t(){return Qh(Cc(o),e)}return{updateByUserOption(r){r.environment&&(o=r.environment),r.baseUri&&(e.baseUri=r.baseUri),r.baseAuthUri&&(e.baseAuthUri=r.baseAuthUri),r.analytics?.baseUri&&(e.analyticsBaseUri=r.analytics?.baseUri)},updateTileServerBaseUrl(r){e.tileServerUri=r},updateEnvironment(r){o=r},setEnterprise(r){(o==="us"||o==="us-enterprise")&&(o=r?"us-enterprise":"us")},getBaseUri(){return t().baseUri},getBaseAuthUri(){return t().baseAuthUri},getAnalyticsBaseUri(){return t().analyticsBaseUri},getTileServerUri(){return t().tileServerUri},reset(){o="us",e={}},__getState:t}}function Qh(o,e){return{...o,...e}}var Kn=o=>{let e=Object.values(o["floorstack.json"]??o["mapstack.json"]??{});return e.length===1?[]:e.filter(t=>t.type!=="Outdoor").map(t=>t.id.replace("fs_","").replace("ms_",""))},Hc=async o=>{let e=performance.now(),t,r=Wl.decompressUnsafeSync(o);r.isOk()?t=r.unwrap():C.error("MVFv3 decompression failed!");let n;if(t)try{n=Hl(t)}catch(i){C.error("MVFv3 to MVFv2 conversion failed!",i)}if(C.log(`Parsed MVFv3 in ${performance.now()-e}ms`),!n)throw new Error("Failed to parse MVFv2 from MVFv3!");return{mvf2:n,mvf3:t}};async function ei(o,e="2.0.0"){switch(e){case"2.0.0":case"2.0.0-c":try{let t=performance.now(),r=await La(o),n=ca(r);return C.log(`Parsed MVFv2 in ${performance.now()-t}ms`),{mvf2:n}}catch{return C.error("MVFv2 parsing failed! Trying MVFv3."),Hc(o)}case"3.0.0":return Hc(o);default:throw new Error(`Unsupported MVF version: ${e}`)}}f();f();function Kh(o,e,t){t===void 0&&(t={});for(var r=bo(o),n=qo(e),i=0;i<n.length-1;i++){var a=!1;if(t.ignoreEndVertices&&(i===0&&(a="start"),i===n.length-2&&(a="end"),i===0&&i+1===n.length-1&&(a="both")),eg(n[i],n[i+1],r,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function eg(o,e,t,r,n){var i=t[0],a=t[1],s=o[0],l=o[1],c=e[0],p=e[1],h=t[0]-s,g=t[1]-l,T=c-s,I=p-l,E=h*I-g*T;if(n!==null){if(Math.abs(E)>n)return!1}else if(E!==0)return!1;if(r){if(r==="start")return Math.abs(T)>=Math.abs(I)?T>0?s<i&&i<=c:c<=i&&i<s:I>0?l<a&&a<=p:p<=a&&a<l;if(r==="end")return Math.abs(T)>=Math.abs(I)?T>0?s<=i&&i<c:c<i&&i<=s:I>0?l<=a&&a<p:p<a&&a<=l;if(r==="both")return Math.abs(T)>=Math.abs(I)?T>0?s<i&&i<c:c<i&&i<s:I>0?l<a&&a<p:p<a&&a<l}else return Math.abs(T)>=Math.abs(I)?T>0?s<=i&&i<=c:c<=i&&i<=s:I>0?l<=a&&a<=p:p<=a&&a<=l;return!1}var $c=Kh;f();function tg(o,e){e===void 0&&(e={});var t=Jo(o),r=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return Zo([r,n],e.properties,e)}var ar=tg;f();f();function og(o,e,t){t===void 0&&(t={});var r=bo(o),n=bo(e),i=Zt(n[1]-r[1]),a=Zt(n[0]-r[0]),s=Zt(r[1]),l=Zt(n[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return Ll(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),t.units)}var vo=og;function ti(o,e){return e===void 0&&(e={}),Bl(o,function(t,r){var n=r.geometry.coordinates;return t+vo(n[0],n[1],e)},0)}f();f();f();function oi(o,e,t){if(t===void 0&&(t={}),t.final===!0)return rg(o,e);var r=bo(o),n=bo(e),i=Zt(r[0]),a=Zt(n[0]),s=Zt(r[1]),l=Zt(n[1]),c=Math.sin(a-i)*Math.cos(l),p=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(a-i);return Rl(Math.atan2(c,p))}function rg(o,e){var t=oi(e,o);return t=(t+180)%360,t}function ng(o,e,t){t===void 0&&(t={});var r=Zo([1/0,1/0],{dist:1/0}),n=0;return Nl(o,function(i){for(var a=qo(i),s=0;s<a.length-1;s++){var l=Zo(a[s]);l.properties.dist=vo(e,l,t);var c=Zo(a[s+1]);c.properties.dist=vo(e,c,t);var p=vo(l,c,t),h=Math.max(l.properties.dist,c.properties.dist),g=oi(l,c),T=pa(e,h,g+90,t),I=pa(e,h,g-90,t),E=zl(Br([T.geometry.coordinates,I.geometry.coordinates]),Br([l.geometry.coordinates,c.geometry.coordinates])),D=null;E.features.length>0&&(D=E.features[0],D.properties.dist=vo(e,D,t),D.properties.location=n+vo(l,D,t)),l.properties.dist<r.properties.dist&&(r=l,r.properties.index=s,r.properties.location=n),c.properties.dist<r.properties.dist&&(r=c,r.properties.index=s+1,r.properties.location=n+p),D&&D.properties.dist<r.properties.dist&&(r=D,r.properties.index=s),n+=p}}),r}var $r=ng;function ig(o,e,t){var r=qo(t);if(jl(t)!=="LineString")throw new Error("line must be a LineString");var n=$r(t,o),i=$r(t,e),a;n.properties.index<=i.properties.index?a=[n,i]:a=[i,n];for(var s=[a[0].geometry.coordinates],l=a[0].properties.index+1;l<a[1].properties.index+1;l++)s.push(r[l]);return s.push(a[1].geometry.coordinates),Br(s,t.properties)}var Ra=ig;var ag=1e-7;function Na(o){return{type:"Point",coordinates:o}}function sg(o,e){let{coordinates:t}=e.geometry,{coordinates:r}=o.geometry,n=t.map(i=>$r(o,Na(i)));return r.reduce((i,a)=>{let s=Ra(Na(a),n[0],o),l=Ra(Na(a),n[1],o),c=ti(s)<ti(l)?s:l;return c.properties={...o.properties,entrances:[]},i.concat([c])},[])}function Ba(o,e){return e.reduce((t,r)=>{let n={epsilon:ag},i=t.obstructions.findIndex(s=>$c(ar(r),s,n)),a=t.obstructions[i];if(a){let[s,l]=sg(a,r);t.entrances.push(r),t.obstructions.splice(i,1,s,l)}return t},{obstructions:[o],entrances:[]})}f();f();f();var Fe=class{id;constructor(e){this.id=e}};f();f();var Va=class o{static __type="coordinate";__type=o.__type;id=ee();latitude;longitude;floorId;verticalOffset;#e={};static is(e){return e.__type===o.__type}constructor(e,t,r){if(typeof e=="object")this.latitude=e.latitude,this.longitude=e.longitude,this.floorId=e.floorId,this.verticalOffset=e.verticalOffset??0;else{if(t==null)throw new Error("Coordinate longitude is required.");this.latitude=e,this.longitude=t,this.floorId=r,this.verticalOffset=0}}get anchorTarget(){return this}get focusTarget(){return this}get navigationTarget(){return this}isEqual(e){return this.latitude===e.latitude&&this.longitude===e.longitude&&this.floorId===e.floorId}toJSON(){return{__type:o.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}get geoJSON(){if(this.#e.geoJSON!=null)return this.#e.geoJSON;let e=[this.longitude,this.latitude];return this.verticalOffset!==0&&e.push(this.verticalOffset),this.#e.geoJSON={type:"Feature",properties:null,geometry:{type:"Point",coordinates:e}},this.#e.geoJSON}toGeoJSON(){return this.geoJSON.geometry}destroy(){for(let e of globalThis.Object.keys(this.#e))delete this.#e[e]}},H=Va;function ja(o){let e=o.enterprise?.locations?.reduce((n,i)=>(n[i.id]=i,n),{})||{};for(let n of o.enterprise?.locationInstances||[])e[n.id]=n;let t={};for(let n of o["floorstack.json"]||[])t[n.id]=n;let r={};for(let n of o["floor.geojson"]?.features||[])n.properties&&n.properties.id&&(r[n.properties.id]=n.properties);return{type:"downloaded",data:o,optimized:{"enterprise-location":e,"enterprise-category":o.enterprise?.categories?.reduce((n,i)=>(n[i.id]=i,n),{})||{},"floor-stack":t,floor:r}}}var lg=/^https?:\/\/cdn(-staging)?\.mappedin\.com(\/|$)/;function Yc(o){return lg.test(o)}function Zc(o){return!!o.split("?")[1]?.includes("sv=")}function Ze(o,e){let t=o?.properties?.id||"unknown";if(o.geometry==null)return C.error(`Cannot get the center coordinate for "${t}" because it has no geometry.`),new H({latitude:0,longitude:0,floorId:e});try{if(o.geometry.type==="LineString"){let[[r,n],[i,a]]=o.geometry.coordinates,s=(r+i)/2,l=(n+a)/2;return new H({latitude:l,longitude:s,floorId:e})}else if(o.geometry.type==="Point"){let[r,n]=o.geometry.coordinates;return new H({latitude:n,longitude:r,floorId:e})}else if(o.geometry.type==="Polygon"){let r=o;if(r.properties.center!=null){let[n,i]=r.properties.center;return new H({latitude:i,longitude:n,floorId:e})}}}catch{}try{let[r,n]=ar(o).geometry.coordinates;return new H({latitude:n,longitude:r,floorId:e})}catch(r){return C.error(`Failed to get center coordinate for "${t}" ${r instanceof Error?r.stack:""}`),new H({latitude:0,longitude:0,floorId:e})}}function Jc(o,e){return e&&(o.flags[e.index]&1<<e.bit)!==0}function ri(o,e){let t=o.instanceLocationsByPolygonId?.[e];if(t)return[t];let r=[],n=o.mvfLocationsByGeometryId[e];if(n)for(let i of n){let a=o.getById("enterprise-location",i.id);a&&r.push(a)}return r}var Ga=class o extends Fe{static __type="node";__type=o.__type;#e;#t={};#o;#r;static is(e){return e.__type===o.__type}constructor(e,t){super(t.mvfData.properties.id),this.#e=e,this.#o=t.floorId,this.#r=t.mvfData}get locations(){return this.#t.locations?this.#t.locations:(this.#t.locations=(this.#e.locationIdsByNodeId[this.id]||[]).map(e=>this.#e.getById("enterprise-location",e)).filter(Boolean),this.#t.locations)}get space(){return this.#e.getById("space",this.#e.spaceIdsByNodeId[this.id]?.[0])}get object(){return this.#e.getById("object",this.#e.objectIdsByNodeId[this.id]?.[0])}get floor(){let e=this.#e.getById("floor",this.#o);if(e==null)throw new Error(`Floor ${this.#o} not found!`);return e}get coordinate(){return this.#t.coordinate==null&&(this.#t.coordinate=Ze(this.#r,this.#o)),this.#t.coordinate}get externalId(){return this.#r.properties.externalId??""}get neighbors(){if(this.#t.neighbors==null){let e=this.#r.properties.neighbors.map(t=>{let r=this.#e.getById("node",t.id);if(r==null)throw new Error(`Node ${t.id} not found!`);return r});this.#t.neighbors=e}return this.#t.neighbors}get navigationFlags(){if(this.#t.navigationFlags==null){let e=[],t=this.#r.properties.flags;if(t!=null&&t.length>0)for(let[r,n]of Object.entries(this.#e.navigationFlags))t.length>n.index&&t[n.index]!=null&&Jc({flags:t},n)&&e.push(r);this.#t.navigationFlags=Object.freeze(e)}return this.#t.navigationFlags}get geoJSON(){return{...this.#r,properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(e=>e.id)}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},xt=Ga;f();f();f();f();var Ua=class o extends Fe{static __type="hyperlink";__type=o.__type;#e={};#t;static is(e){return e.__type===o.__type}constructor(e){super(String(ee())),this.#t=e.mvfData}get url(){return this.#t.url}get name(){if("displayName"in this.#t)return this.#t.displayName;if("label"in this.#t)return this.#t.label}toJSON(){return{__type:o.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(this.#e))delete this.#e[e]}},ko=Ua;f();f();function Yr(o){return typeof o=="string"?o:o?.id??""}function qc(o){return Array.isArray(o)&&Number.isFinite(o[0])&&Number.isFinite(o[1])}var cg=/^https:\/\/cdn\.mappedin\.com\/category-symbols\/.+$/,pg=/^https:\/\/cdn-staging\.mappedin\.net\/category-symbols\/.+$/,dg=o=>cg.test(o)||pg.test(o),ug=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,fg=/^https:\/\/cdn-staging\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,hg=o=>dg(o)?!1:ug.test(o)||fg.test(o),sr=o=>{if(!hg(o))return null;let e="";o.startsWith("https://")?(e="https://",o=o.slice(8)):o.startsWith("http://")&&(e="http://",o=o.slice(7));let[t,r,n]=o.split("/"),i=n.split(".").pop()??"";return{origin:e+t,mapId:r,fileName:n,fileType:i}};function Ha(o){return o.reduce((e,t,r)=>r===0?e:e+Jt(o[r-1].toGeoJSON().coordinates,t.toGeoJSON().coordinates),0)}function lo(o){return o!=null&&typeof o=="object"&&"__type"in o&&o.__type!==null&&typeof o.__type=="string"}function Wa(o){return o!=null&&typeof o=="object"&&"name"in o&&o.name!=null&&typeof o.name=="string"&&o.name!==""}function Qc(o){return lo(o)&&Wa(o)}var za=class o extends Fe{static __type="image";__type=o.__type;#e={};#t;#o;static is(e){return e.__type===o.__type}constructor(e){super(String(ee())),this.#t=e.mvfData,this.#o=e.mapData}get url(){let e=this.#t.url;if(this.#o.tokenManager==null)return e;let t=sr(this.#t.url);if(t==null)return e;let r=t.mapId;try{if(this.#o.tokenManager.isEnterpriseMode())return e;let n=this.#o.tokenManager.getSasToken(r).token;if(n==null||n==="")throw new Error("SAS token empty!");return`${e}?${n}`}catch(n){return t.fileType!=="svg"&&C.error("Error getting SAS token for image",{error:n,url:e}),e}}get name(){return this.#t.altText}get altText(){return this.#t.altText}toJSON(){return{__type:o.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(this.#e))delete this.#e[e]}},Qt=za;f();var Vt=class{id;constructor(e,t){this.id=e}#e=void 0;get geoJSONBoundingBox(){return this.#e?this.#e:"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(this.#e=Jo(this.geoJSON),this.#e)}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};var ke=class extends Vt{#e;#t;#o={};constructor(e,t){super(t.properties.id,e),this.#e=e,this.#t=t}get externalId(){return this.#t.properties.externalId??""}get name(){let e=this.#t.properties.details?.name??"";return e===""&&(e=this.locationProfiles.find(t=>t.name&&t.name.length>0)?.name??""),e}get icon(){return this.locationProfiles.find(e=>e.icon!=null&&e.icon.url!=null&&e.icon.url.length>0)?.icon}get description(){let e=this.#t.properties.details?.description??"";return e===""&&(e=this.locationProfiles.find(t=>t.description&&t.description.length>0)?.description??""),e}get images(){if(this.#o.images!=null)return this.#o.images;let e=this.#t.properties.details?.images?.map(t=>new Qt({mvfData:t,mapData:this.#e}))??[];return(e==null||e.length===0)&&(e=this.locationProfiles.find(t=>t.images.length>0)?.images??[]),this.#o.images=e,e}get links(){if(this.#o.links!=null)return this.#o.links;let e=this.#t.properties.details?.links?.map(t=>new ko({mvfData:t}))??[];return(e==null||e.length===0)&&(e=this.locationProfiles.find(t=>t.links.length>0)?.links??[]),this.#o.links=e,e}get locationProfiles(){return this.#e.locationProfilesByAttachedFeatureId[this.id]??[]}_serializeDetailedMapData(){return{externalId:this.externalId,name:this.name,description:this.description,images:this.images,links:this.links,locationProfiles:this.locationProfiles}}};f();var mt=class o{#e;#t;#o;target;static __type="image-3d";__type=o.__type;static is(e){return e.__type===o.__type}constructor(e,t,r,n){this.#e=e,this.#t=t,this.target=r,this.#o=n}get id(){return this.#e}get url(){if(this.#o==null)return this.#t;let e=sr(this.#t);if(e==null)return this.#t;let t=e.mapId;try{if(this.#o.isEnterpriseMode())return this.#t;let r=this.#o.getSasToken(t).token;if(r==null||r==="")throw new Error("SAS token empty!");return`${this.#t}?${r}`}catch(r){return e.fileType!=="svg"&&C.error("Error getting SAS token for image",{error:r,url:this.#t}),this.#t}}};f();f();function Io(o){let e;if(H.is(o))e=o;else if(lt.is(o))e=o.coordinates[0];else if(co.is(o))if(o.spaces.length>0)e=o.spaces[0].center;else return;else if(We.is(o))if(o.coordinates.length>0)e=o.coordinates[0];else return;else if("center"in o&&H.is(o.center))e=o.center;else if("coordinate"in o&&H.is(o.coordinate))e=o.coordinate;else return;return e}f();f();var Zr={debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building-outline","building-top","building","building-wall","building-buffer"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!0,floorGap:"auto",footprintColor:"#ffffff"},disableUpdateStateValidation:!1},Kt="ExteriorWalls",So="Walls",Kc=0,lr="InteriorDoors",cr="ExteriorDoors",pr="InteriorDoorsLayer",dr="ExteriorDoorsLayer",ye="GeometryLayer",eo="LabelsLayer",jt="MarkersLayer",Jr="FootprintLayer",Lo="OcclusionLayer",Ro="AreasLayer",ur="ImagesLayer",No="FacadesLayer",to="PathsLayer",Gt="ModelsLayer";var ep=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com","https://staging.mappedin.com","https://mappedin-staging.auth0.com/userinfo","https://mappedin.com","https://mappedin.auth0.com/userinfo"],gg={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var mg=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors"]),yg=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function Xa(o){o.outdoorView?.enabled&&!o.outdoorView?.token&&C.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function $a(o,e){let t=o?.outdoorView?.token||e.outdoorViewToken,r={...Zr,...o,outdoorView:{enabled:o?.outdoorView?.enabled===void 0?!!t:o?.outdoorView?.enabled,layersHiddenByGeometry:Zr.outdoorView?.layersHiddenByGeometry,...o?.outdoorView},bearing:o?.bearing??e.naturalBearing??0,imagePlacementOptions:{...Zr.imagePlacementOptions,...o?.imagePlacementOptions},multiFloorView:{...Zr.multiFloorView,...o?.multiFloorView},disableUpdateStateValidation:o?.disableUpdateStateValidation??!1};return t&&r.outdoorView&&(r.outdoorView.token=t),r}function tp(o){let e={remove_watermark:!1};if(o)try{let t=$n(o);Object.assign(e,t.capabilities)}catch(t){C.error("Error decoding capabilities from token",t)}return e}function op(o){let e=Object.fromEntries(Object.entries(o).filter(([t])=>mg.has(t)));return e.outdoorView&&(e.outdoorView=Object.fromEntries(Object.entries(e.outdoorView).filter(([t])=>yg.has(t)))),e}var Ya=class o extends ke{static __type="area";__type=o.__type;#e;#t;#o={};#r;static is(e){return e.__type===o.__type}constructor(e,t){super(e,t.mvfData),this.#e=e,this.#t=t.floorId,this.#r=t.mvfData}get center(){return this.#o.center==null&&(this.#o.center=Ze(this.#r,this.#t)),this.#o.center}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#i();return t?[...e,t]:e}#i(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new mt(`${this.id}-polygon-image-${ee()}`,e.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get geoJSON(){return{...this.#r,properties:null}}get focusTarget(){return this}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}},Ct=Ya;f();var Za=class o extends ke{static __type="door";__type=o.__type;#e;#t;#o;#r;static is(e){return e.__type===o.__type}constructor(e,t){super(e,t.mvfData),this.#t={},this.#r=t.mvfData,this.#e=e,this.#o=t.floorId}get floor(){let e=this.#e.getById("floor",this.#o);if(e==null)throw new Error(`Floor ${this.#o} not found!`);return e}get center(){return this.#t.center==null&&(this.#t.center=Ze(this.#r,this.#o)),this.#t.center}get isExterior(){if(this.#r.properties.isExterior!==void 0)return this.#r.properties.isExterior;let e=this.#e.obstructionIdByEntranceId[this.id];return this.#e.getMVFFeatureById("obstruction",e)?.properties.footprintComponent??!1}get geoJSON(){return{...this.#r,properties:null}}get focusTarget(){return this.center}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},et=Za;f();var Ja=class o extends ke{static __type="space";__type=o.__type;#e;#t;#o={};#r;static is(e){return e.__type===o.__type}constructor(e,t){super(e,t.mvfData),this.#e=e,this.#t=t.floorId,this.#r=t.mvfData}get type(){return Tg(this.#r.properties.kind)}get enterpriseLocations(){return this.#o.enterpriseLocations!=null?this.#o.enterpriseLocations:(this.#o.enterpriseLocations=ri(this.#e,this.id),this.#o.enterpriseLocations)}get locations(){return this.enterpriseLocations}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get doors(){if(this.#o.doors)return this.#o.doors;this.#o.doors=[];let e=this.#e.entranceNodeIdsBySpaceId?.[this.id]??[];for(let t of e){let r=this.#e.doorsByNodeId[t];r&&this.#o.doors.push(r)}return this.#o.doors}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#i();return t?[...e,t]:e}#i(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new mt(`${this.id}-polygon-image-${ee()}`,e.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get center(){return this.#o.center==null&&(this.#o.center=Ze(this.#r,this.#t)),this.#o.center}get geoJSON(){return{...this.#r,properties:null}}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(this.#o))delete this.#o[e]}},bg=["room","hallway","exterior","void","gate","otb"];function Tg(o){if(o==null||o==="default")return"room";let e=o.toLowerCase();return bg.includes(e)?e:"room"}var Te=Ja;f();var qa=class o extends Vt{static __type="floor";__type=o.__type;#e;#t={};#o;static is(e){return e.__type===o.__type}constructor(e,t){super(t.mvfData.properties.id,e),this.#e=e,this.#o=t.mvfData}#r(e){let t=this.#o.properties[e];return this.#e.getPropTranslation(this.__type,e,this.id,t)}get focusTarget(){return this}get name(){if(!("name"in this.#o.properties))return this.#o.properties.externalId??"";let e=this.#r("name");return typeof e=="string"?e:""}get shortName(){if(!("shortName"in this.#o.properties))return this.#o.properties.externalId??"";let e=this.#r("shortName");return typeof e=="string"?e:""}get subtitle(){let e=this.#r("subtitle");return typeof e=="string"?e:""}get externalId(){return this.#o.properties.externalId??""}get elevation(){return this.#o.properties.elevation}get maxHeight(){return this.#o.properties.maxHeight}get spaces(){if(this.#t.spaces==null){let e=this.#e.spaces.filter(t=>t.floor.id===this.id);this.#t.spaces=e}return this.#t.spaces}get spacesOpenToBelow(){if(this.#t.spacesOpenToBelow==null){let e=[];for(let t of this.spaces)(t.type==="void"||t.type==="otb")&&e.push(t);this.#t.spacesOpenToBelow=e}return this.#t.spacesOpenToBelow}get geoJSON(){return{type:"Feature",properties:null,geometry:this.#o.geometry??{type:"Polygon",coordinates:[]}}}get objects(){if(this.#t.objects==null){let e=this.#e.objects.filter(t=>t.floor.id===this.id);this.#t.objects=e}return this.#t.objects}get connections(){if(this.#t.connections==null){let e=this.#e.connections.filter(t=>t.floors.includes(this));this.#t.connections=e}return this.#t.connections}get doors(){if(this.#t.doors==null){let e=this.#e.doors.filter(t=>t.floor.id===this.id);this.#t.doors=e}return this.#t.doors}get annotations(){if(this.#t.annotations==null){let e=this.#e.annotations.filter(t=>t.floor.id===this.id);this.#t.annotations=e}return this.#t.annotations}get pois(){if(this.#t.pois==null){let e=this.#e.pointsOfInterest.filter(t=>t.floor.id===this.id);this.#t.pois=e}return this.#t.pois}get floorStack(){if(this.#t.floorStack==null){let e=this.#e.floorStacks.find(t=>t.floors.includes(this));this.#t.floorStack=e}return this.#t.floorStack}get center(){return this.#t.center==null&&(this.#t.center=Ze(this.#o,this.id)),this.#t.center}toJSON(){return{__type:o.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,maxHeight:this.maxHeight,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(this.#t))delete this.#t[e]}},ct=qa;f();var Qa=class o extends ke{static __type="connection";__type=o.__type;#e;#t;#o;static is(e){return e.__type===o.__type}constructor(e,t){super(e,{type:"Feature",geometry:{type:"Point",coordinates:[0,0]},properties:t.mvfData}),this.#t={},this.#e=e,this.#o=t.mvfData}get accessible(){return this.#o.accessible??!1}get type(){return this.#o.type??"unknown"}get extra(){return this.#o.extra}get coordinates(){if(this.#t.coordinates==null){this.#t.coordinates=[];for(let e of this.nodes)this.#t.coordinates.some(t=>t.isEqual(e.coordinate))||this.#t.coordinates.push(e.coordinate)}return this.#t.coordinates}get nodes(){return this.#o.nodes.map(e=>this.#e.getById("node",e)).filter(er)}get floors(){return this.coordinates.map(e=>e.floorId?this.#e.getById("floor",e.floorId):void 0).filter(er)}get focusTarget(){return this.coordinates}get navigationTarget(){return this.coordinates}toJSON(){return{__type:o.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(e=>e.toJSON()),floors:this.floors.map(e=>e.id),extra:this.extra}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},We=Qa;f();var Ka=class o extends ke{static __type="object";__type=o.__type;#e;#t;#o={};#r;static is(e){return e.__type===o.__type}constructor(e,t){super(e,t.mvfData),this.#e=e,this.#t=t.floorId,this.#r=t.mvfData}get type(){let e=this.#r.properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get enterpriseLocations(){return this.#o.enterpriseLocations!=null?this.#o.enterpriseLocations:(this.#o.enterpriseLocations=ri(this.#e,this.id),this.#o.enterpriseLocations)}get locations(){return this.enterpriseLocations}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get center(){return this.#o.center==null&&(this.#o.center=Ze(this.#r,this.#t)),this.#o.center}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#i();return t?[...e,t]:e}#i(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new mt(`${this.id}-polygon-image-${ee()}`,e.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get geoJSON(){return{...this.#r,properties:null}}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get navigationTarget(){return this}toJSON(){return{__type:o.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of globalThis.Object.keys(this.#o))this.#o[e]=null}},pt=Ka;f();var es=class o extends ke{static __type="point-of-interest";__type=o.__type;#e;#t;#o={};#r;static is(e){return e.__type===o.__type}get navigationTarget(){return this.coordinate}constructor(e,t){super(e,t.mvfData),this.#e=e,this.#r=t.mvfData,this.#t=t.floorId}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get coordinate(){return this.#o.coordinate==null&&(this.#o.coordinate=Ze(this.#r,this.#t)),this.#o.coordinate}get geoJSON(){return{...this.#r,properties:null}}get images3D(){return this.#e.floorImagesByAnchorId.get(this.id)??[]}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:o.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in this.#o)this.#o[e]=null}},yt=es;f();var ts=class o extends ke{static __type="annotation";__type=o.__type;#e;#t;#o={};#r;#i;static is(e){return e.__type===o.__type}constructor(e,t){super(e,t.mvfData),this.#e=e,this.#t=t.floorId,this.#r=t.mvfData,this.#i=t.symbol??{url:"",name:""}}#n(){let[e,t]=this.#r.properties.symbolId.split("--");return{group:e,type:t}}get group(){return this.#n().group}get type(){return this.#n().type}get coordinate(){return this.#o.coordinate==null&&(this.#o.coordinate=Ze(this.#r,this.#t)),this.#o.coordinate}get floor(){let e=this.#e.getById("floor",this.#t);if(e==null)throw new Error(`Floor ${this.#t} not found!`);return e}get name(){return super.name||this.#i.name||""}get icon(){return this.#o.icon==null&&(this.#o.icon=super.icon||new Qt({mvfData:{url:this.#i.url,altText:this.#i.name},mapData:this.#e})),this.#o.icon}get geoJSON(){return{...this.#r,properties:null}}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}get navigationTarget(){return this.coordinate}toJSON(){return{__type:o.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(this.#o))delete this.#o[e]}},Ut=ts;f();f();var rp=Hn(ns(),1);function vg(o,e,t){t===void 0&&(t={});var r=Qo(o),n=Qo(e),i=rp.default.union(r.coordinates,n.coordinates);return i.length===0?null:i.length===1?zn(i[0],t.properties):Xn(i,t.properties)}var ni=vg;var is=class o extends Vt{static __type="floor-stack";__type=o.__type;#e;#t={};#o;#r;static is(e){return e.__type===o.__type}constructor(e,t){super(t.mvfData.id,e),this.#e=e,this.#o=t.mvfData,this.#r=t.facadeId}#i(e){return this.#e.getPropTranslation(this.__type,e,this.id,this.#o[e])}get type(){return this.#o.type}get name(){let e=this.#i("name");return typeof e=="string"?e:""}get shortName(){let e=this.#i("shortName");return typeof e=="string"?e:""}get externalId(){return this.#o.externalId??""}get floors(){if(this.#t.floors==null){let e=(this.#o.floors??this.#o.maps??[]).reduce((t,r)=>{let n=this.#e.floorsById[r];return n&&t.push(n),t},[]);e.length===0&&C.error(`Floor stack ${this.id} has no floors`),this.#t.floors=e.sort((t,r)=>t.elevation-r.elevation)}return this.#t.floors}get defaultFloor(){if(this.#t.defaultFloor!=null)return this.#t.defaultFloor;let e=this.#o.defaultFloor?this.#e.getById("floor",this.#o.defaultFloor):void 0;return this.#t.defaultFloor=e||this.floors.reduce((t,r)=>Math.abs(r.elevation)<Math.abs(t.elevation)?r:t),this.#t.defaultFloor}get facade(){return this.#r?this.#e.facadesById[this.#r]:void 0}get focusTarget(){return this}get geoJSON(){if(this.#t.geoJSON!=null)return this.#t.geoJSON;let e=null;for(let t of this.floors){let r=t.geoJSON;e==null?e=r:e=ni(e,r)}return this.#t.geoJSON=e??{type:"Feature",properties:null,geometry:{type:"Polygon",coordinates:[]}},this.#t.geoJSON}toJSON(){return{__type:o.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(this.#t))delete this.#t[e]}},fr=is;f();var as=class o extends Vt{static __type="facade";__type=o.__type;static is(e){return e.__type===o.__type}#e;#t;#o;#r={};constructor(e,t){super(t.mvfData.id,e),this.#e=t.mvfData,this.#t=e,this.#o=t.floorStackId}get floorStack(){return this.#t.getById("floor-stack",this.#o)}get spaces(){if(!this.#r.spaces){this.#r.spaces=[];for(let e of this.#e.spaces){let t=this.#t.getById("space",e.spaceId);t&&this.#r.spaces.push(t)}}return this.#r.spaces}get center(){if(!this.#r.center){let e={type:"FeatureCollection",features:[]};for(let r of this.spaces){let n=this.#t.mvfSpacesById[r.id];n&&e.features.push(n)}if(e.features.length===0)throw new Ce("No geometry found for facade!");let t=ar(e);this.#r.center=new H({latitude:t.geometry.coordinates[1],longitude:t.geometry.coordinates[0],floorId:this.#e.spaces[0].floorId})}return this.#r.center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}get navigationTarget(){return this}toJSON(){return{id:this.id,__type:o.__type,floorStackId:this.#o,floorStack:this.floorStack,spaces:this.spaces}}},Ne=as;f();var Ig=new Set(["wall","area"]),Sg=new Set(["desk-entrance"]),Eg=o=>{let e={};for(let t of o?.locations??[])e[t.id]=t;return{mvf3LocationsById:e}},Mg=(o,e,t)=>{let r={},n={},i={},a={},s={},l={};for(let c of e["location.json"]||[]){let p=new co(o,{mvf2Data:c,mvf3Data:t[c.id]});if(r[c.id]=p,c.externalId&&(a[c.externalId]==null&&(a[c.externalId]=[]),a[c.externalId].push(p)),c.categories)for(let g of c.categories)s[g]==null&&(s[g]=[]),s[g].push(p);let h=[...c.obstructions?.map(g=>g.id)??[],...c.spaces?.map(g=>g.id)??[],...c.annotations?.map(g=>g.id)??[],...c.connections??[],...c.entrances?.map(g=>g.id)??[],...c.areas?.map(g=>g.id)??[]];for(let g of h)g&&(l[g]==null&&(l[g]=[]),l[g].push(p))}for(let c of e["category.json"]||[]){let p=new ai(o,{mvfData:c});n[c.id]=p,c.parent&&(i[c.parent]==null&&(i[c.parent]=[]),i[c.parent].push(p))}return{locationCategoriesByParentId:i,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:a,locationProfilesByCategoryId:s,locationProfilesByAttachedFeatureId:l}},xg=(o,e)=>{let t={},r={},n={},i={},a={},s={},l={},c={},p={},h=globalThis.Object.keys(o.space);for(let g of h){let T=o.space[g];if(T!=null){for(let I of T.features)if(p[I.properties.id]=g,s[I.properties.id]=I,I.properties.kind==="desk-entrance"&&(a[I.properties.externalId]==null&&(a[I.properties.externalId]=[]),a[I.properties.externalId].push(...I.properties.destinationNodes)),!Vg(I))if(I.properties.kind==="poi"||I.geometry.type==="Point"&&I.properties.kind==null){let E=new yt(e,{floorId:g,mvfData:I});n[I.properties.id]=E,c[g]||(c[g]=[]),c[g].push(I),I.properties.externalId&&(i[I.properties.externalId]==null&&(i[I.properties.externalId]=[]),i[I.properties.externalId].push(E))}else if(I.geometry.type==="Point")C.warn("Encountered a point space with an unknown kind!",I.properties.kind);else{let E=new Te(e,{floorId:g,mvfData:I});t[I.properties.id]=E,I.properties.externalId&&(r[I.properties.externalId]==null&&(r[I.properties.externalId]=[]),r[I.properties.externalId].push(E)),l[g]||(l[g]=[]),l[g].push(I)}}}return{spacesById:t,spacesByExternalId:r,poisById:n,poisByExternalId:i,objectEntranceNodeIdsByObstructionId:a,mvfSpacesById:s,mvfSpacesByFloorId:l,mvfPoisByFloorId:c}},Cg=(o,e)=>{let t={},r={},n={},i={};for(let a of o["node.geojson"].features){n[a.properties.id]=a;let s=new xt(e,{mvfData:a,floorId:a.properties.floor??a.properties.map});t[a.properties.id]=s,a.properties.externalId&&(r[a.properties.externalId]==null&&(r[a.properties.externalId]=[]),r[a.properties.externalId].push(s));let l=a.properties.floor??a.properties.map;i[l]||(i[l]=[]),i[l].push(a)}return{nodesById:t,nodesByExternalId:r,mvfNodesById:n,mvfNodesByFloorId:i}},_g=(o,e)=>{let t={},r={},n={},i={},a=globalThis.Object.keys(o.obstruction);for(let s of a){let l=o.obstruction[s];if(l!=null)for(let c of l.features){n[c.properties.id]=c;for(let h of c.properties.entrances)i[h]=c.properties.id;if(Ig.has(c.properties.kind?.toLowerCase()??""))continue;let p=new pt(e,{floorId:s,mvfData:c});t[c.properties.id]=p,c.properties.externalId&&(r[c.properties.externalId]==null&&(r[c.properties.externalId]=[]),r[c.properties.externalId].push(p))}}return{objectsById:t,objectsByExternalId:r,mvfObstructionById:n,obstructionIdByEntranceId:i}},Pg=(o,e)=>{let t={},r={},n={};if("floor.geojson"in o&&o["floor.geojson"]!=null)for(let i of o["floor.geojson"].features){n[i.properties.id]=i.properties;let a=new ct(e,{mvfData:i});t[i.properties.id]=a,i.properties.externalId&&(r[i.properties.externalId]==null&&(r[i.properties.externalId]=[]),r[i.properties.externalId].push(a))}else for(let i of o["map.geojson"]){n[i.id]=i;let a=new ct(e,{mvfData:{properties:i}});t[i.id]=a}return{floorsById:t,floorsByExternalId:r,mvfFloorsById:n}},Og=(o,e)=>{let t={},r={},n={},i={},a={},s=o["floorstack.json"]||o["mapstack.json"]||o["mapstack.geojson"];if(s!=null)for(let l of s){let c=o.facade?.[l.id],p=new fr(e,{mvfData:l,facadeId:c?.id});if(t[l.id]=p,l.externalId&&(r[l.externalId]==null&&(r[l.externalId]=[]),r[l.externalId].push(p)),n[l.id]=l,c){let h=new Ne(e,{mvfData:c,floorStackId:l.id});i[c.id]=h;for(let g of c.spaces)a[g.spaceId]=h}}return{floorStacksById:t,floorStacksByExternalId:r,mvfFloorStacksById:n,facadesById:i,facadesBySpaceId:a}},Dg=(o,e)=>{let t={},r={},n=o["connection.json"].reduce((i,a)=>{if(a.nodes.forEach(l=>i[l]=a),r[a.id]=a,a.type==="door")return i;let s=new We(e,{mvfData:a});return t[a.id]=s,i},{});return{connectionsById:t,mvfConnectionsById:r,mvfConnectionsByNodeId:n}},wg=(o,e)=>{let t={},r={},n={},i={},a={},s=globalThis.Object.keys(o.entrance);for(let l of s){let c=o.entrance[l];if(c!=null)for(let p of c.features){i[p.properties.id]=p;let h=new et(e,{floorId:l,mvfData:p});p.properties.node&&(n[p.properties.node]=h),t[p.properties.id]=h,p.properties.externalId&&(r[p.properties.externalId]==null&&(r[p.properties.externalId]=[]),r[p.properties.externalId].push(h)),a[l]||(a[l]=[]),a[l].push(p)}}return{doorsById:t,doorsByExternalId:r,doorsByNodeId:n,mvfEntrancesById:i,mvfEntrancesByFloorId:a}},Ag=(o,e,t)=>{if(o.textAreas!=null)for(let r in o.textAreas){let n=o.textAreas[r]?.features;if(n!=null){for(let i of n)if("anchorId"in i.properties){let a=i?.properties,s=e[a.anchorId]||t[a.anchorId];if(s!=null&&a!=null){let l=s.properties;l.textArea=a,l.textArea&&(l.textArea.position=i.geometry.coordinates)}}}}},Fg=(o,e,t,r)=>{if(o.floorImages!=null)for(let n in o.floorImages){let i=o.floorImages[n]?.features;if(i!=null){for(let a of i)if("anchorId"in a.properties){let s=a?.properties,l=e[s.anchorId]||t[s.anchorId]||r[s.anchorId];if(l!=null&&s!=null){let c=l.properties;c.image=s,c.image&&(c.image.position=a.geometry.coordinates)}}}}},kg=(o,e)=>{if(o.enterprise?.enterpriseStyles==null)return;let t=o.enterprise?.enterpriseStyles;for(let r in t){let n=t[r];n.geometryAnchors.forEach(i=>{let a=e[i.geometryId];if(a!=null){let s=a.properties;s.style={styleId:r,edgeOffset:n.edgeOffset}}})}},Lg=(o,e,t)=>{if(!(o.enterprise==null||o.enterprise.textures==null))for(let r of o.enterprise.textures)for(let n of r.geometryAnchors){let i=e[n.geometryId]||t[n.geometryId];if(i!=null){let a=i.properties;a.textures==null&&(a.textures=[]),a.textures.push(r)}}},Rg=(o,e)=>{let t={},r={},n={};if(o.annotation==null)return{annotationsById:t,mvfAnnotationsById:r,mvfAnnotationsByFloorId:n};let i=o["annotation-symbols.json"]||{},a=globalThis.Object.keys(o.annotation);for(let s of a){let l=o.annotation[s];if(l!=null)for(let c of l.features){r[c.properties.id]=c;let p=new Ut(e,{floorId:s,mvfData:c,symbol:i[c.properties.symbolId]});t[c.properties.id]=p,n[s]||(n[s]=[]),n[s].push(c)}}return{annotationsById:t,mvfAnnotationsById:r,mvfAnnotationsByFloorId:n}},Ng=(o,e)=>{let t={},r={},n={};if(o.area==null)return{areasById:t,areasByExternalId:r,mvfAreasById:n};let i=globalThis.Object.keys(o.area);for(let a of i){let s=o.area[a];if(s!=null)for(let l of s.features){n[l.properties.id]=l;let c=new Ct(e,{floorId:a,mvfData:l});t[l.properties.id]=c,l.properties.externalId&&(r[l.properties.externalId]==null&&(r[l.properties.externalId]=[]),r[l.properties.externalId].push(c))}}return{areasById:t,areasByExternalId:r,mvfAreasById:n}},Bg=(o,e)=>{let t={},r={},n={},i={};for(let a in o){let s=o[a];if(s==null)continue;let l=s.properties.destinationNodes??[];if(l.length<1)continue;let c=[];for(let p of l)e[p]!=null&&c.push(p),r[p]==null&&(r[p]=[]),r[p].push(s.properties.id),s.properties.kind==="desk-entrance"&&(n[p]==null&&(n[p]=[]),n[p].push(s.properties.externalId));c.length>0&&(t[a]=c),i[a]=l}return{entranceNodeIdsBySpaceId:t,spaceIdsByNodeId:r,objectIdsByNodeId:n,destinationNodesIdsBySpaceId:i}},np=(o,e)=>{let t={},r={},n={},i={},a=(o.enterprise?.locations??[]).reduce((A,V)=>(A[V.id]=V,A),{}),s={},l={},c={},p={},h={},g={},T=o.enterprise?.venue||{},I={},E={},D={};for(let A of o.enterprise?.categories??[]){let V=new ii(e,{mvfData:A});s[A.id]=V,A.externalId&&(l[A.externalId]==null&&(l[A.externalId]=[]),l[A.externalId].push(V)),c[A.id]=A,A.locations.forEach(L=>{h[L]==null&&(h[L]=[]),h[L].push(A.id)})}let x={};for(let A of o.enterprise?.locationInstances??[]){let V=a[A.parent],L=Object.keys(V),G={};for(let j of L)G[j]=void 0;let U={...G,polygons:[],nodes:[],...A};x[U.parent]==null&&(x[U.parent]=[]);let R=new lt(e,{mvfData:U,categoryIds:o.enterprise?.categoryPriorities?.[U.id]||h[U.id],parentId:A.parent});x[U.parent].push(R);for(let j of A.polygons??[])D[j.id]=R;I[U.id]=A,E[U.id]=R,A.externalId&&(i[A.externalId]==null&&(i[A.externalId]=[]),i[A.externalId].push(R))}for(let A of o.enterprise?.locations??[]){let V=new lt(e,{mvfData:A,categoryIds:o.enterprise?.categoryPriorities?.[A.id]||h[A.id],locationInstances:x[A.id]});n[A.id]=V,A.externalId&&(i[A.externalId]==null&&(i[A.externalId]=[]),i[A.externalId].push(V)),A.nodes.forEach(L=>{g[L.id]==null&&(g[L.id]=[]),g[L.id].push(A.id)});for(let L of A.polygons)p[L.id]==null&&(p[L.id]=[]),p[L.id].push(A)}if(e.enterpriseMode===!0){for(let A in e.mvfConnectionsById){let V={},L=e.mvfConnectionsById[A],G={id:A,externalId:L.externalId,kind:"enterprise."+L.type,destinationNodes:[],flags:L.flags,type:L.type,nodes:L.nodes,accessible:L.accessible,extra:L.extra,details:L.details};for(let U of e.mvfConnectionsById[A].nodes){let R=e.nodesById[U];R!=null&&(V[R.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[R.coordinate.longitude,R.coordinate.latitude]},properties:G})}Object.keys(V).length>0&&(t[A]=new We(e,{mvfData:G}),L.externalId&&(r[L.externalId]==null&&(r[L.externalId]=[]),r[L.externalId].push(t[A])))}e.connectionsById=t}return{connectionsByExternalId:r,locationIdsByNodeId:g,mvfLocationsByGeometryId:p,mvfLocationsById:a,mvfCategoriesById:c,locationsById:n,locationInstancesById:E,instanceLocationsByPolygonId:D,locationsByExternalId:i,mvfLocationInstancesById:I,categoriesById:s,categoriesByExternalId:l,venue:T}},ip=(o,e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}=Cg(e,o),{connectionsById:s,mvfConnectionsById:l,mvfConnectionsByNodeId:c}=Dg(e,o),{spacesById:p,spacesByExternalId:h,poisById:g,poisByExternalId:T,mvfSpacesById:I,objectEntranceNodeIdsByObstructionId:E,mvfSpacesByFloorId:D,mvfPoisByFloorId:x}=xg(e,o),{objectsById:A,objectsByExternalId:V,mvfObstructionById:L,obstructionIdByEntranceId:G}=_g(e,o),{floorsById:U,floorsByExternalId:R,mvfFloorsById:j}=Pg(e,o),{floorStacksById:te,floorStacksByExternalId:fe,mvfFloorStacksById:ce,facadesById:Pe,facadesBySpaceId:Oe}=Og(e,o),{doorsById:Ge,doorsByExternalId:De,doorsByNodeId:ve,mvfEntrancesById:ft,mvfEntrancesByFloorId:io}=wg(e,o),{annotationsById:Yt,mvfAnnotationsById:se,mvfAnnotationsByFloorId:ue}=Rg(e,o),{areasById:vt,areasByExternalId:ae,mvfAreasById:It}=Ng(e,o);Fg(e,I,L,It),Ag(e,I,L),kg(e,I),Lg(e,I,L);let{mvf3LocationsById:ie}=Eg(t),{locationCategoriesByParentId:Je,locationProfilesById:Dt,locationCategoriesById:qe,locationProfilesByExternalId:Oo,locationProfilesByCategoryId:mo,locationProfilesByAttachedFeatureId:Xo}=Mg(o,e,ie),{entranceNodeIdsBySpaceId:Ue,spaceIdsByNodeId:wt,objectIdsByNodeId:$e,destinationNodesIdsBySpaceId:St}=Bg(I,ve);return{spacesById:p,spacesByExternalId:h,nodesById:r,nodesByExternalId:n,objectsById:A,objectsByExternalId:V,floorsById:U,floorsByExternalId:R,floorStacksById:te,floorStacksByExternalId:fe,facadesById:Pe,facadesBySpaceId:Oe,connectionsById:s,doorsById:Ge,doorsByExternalId:De,doorsByNodeId:ve,poisById:g,poisByExternalId:T,annotationsById:Yt,areasById:vt,areasByExternalId:ae,objectEntranceNodeIdsByObstructionId:E,obstructionIdByEntranceId:G,locationProfilesById:Dt,locationCategoriesById:qe,locationProfilesByExternalId:Oo,locationProfilesByCategoryId:mo,locationCategoriesByParentId:Je,mvfSpacesById:I,mvfNodesById:i,mvfObstructionById:L,mvfFloorsById:j,mvfFloorStacksById:ce,mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfEntrancesById:ft,mvfAnnotationsById:se,mvfNodesByFloorId:a,mvfSpacesByFloorId:D,mvfPoisByFloorId:x,mvfAreasById:It,mvfEntrancesByFloorId:io,mvfAnnotationsByFloorId:ue,locationProfilesByAttachedFeatureId:Xo,entranceNodeIdsBySpaceId:Ue,spaceIdsByNodeId:wt,objectIdsByNodeId:$e,destinationNodesIdsBySpaceId:St,mvf3LocationsById:ie}};function Vg(o){return!["Polygon","MultiPolygon"].includes(o.geometry.type)&&"kind"in o.properties&&o.properties.kind==null||o.properties.kind?.includes("connection")||Sg.has(o.properties.kind??"")}f();var jg=new Set(["polygons"]),ss=class o extends Fe{static __type="enterprise-location";__type=o.__type;description;name="";amenity;externalId="";extra;gallery;instances;logo;operationHours;phone;picture;shortName;showFloatingLabelWhenImagePresent;showLogo;siblingGroups;social;sortOrder=-1;states;tags;type="";hidden=!1;primaryCategory;#e;#t={};#o;#r;static is(e){return e.__type===o.__type}constructor(e,t){super(t.mvfData.externalId),this.#e=e,this.#o=t.mvfData,this.#r=t.categoryIds||[],this.instances=t.locationInstances||[];for(let r in t.mvfData)!jg.has(r)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),r)&&Object.defineProperty(this,r,{enumerable:!0,get(){if(t.parentId){let n=this.#e.locationsById[t.parentId];return this.#o[r]!=null?this.#e.getPropTranslation(this.__type,r,this.#o.id,this.#o[r]):this.#e.getPropTranslation(this.__type,r,this.#o.id,n[r])}return this.#e.getPropTranslation(this.__type,r,this.#o.id,this.#o[r])}})}get focusTarget(){return this.spaces.length>0?this.spaces:this.coordinates}get navigationTarget(){return this.spaces}get categories(){return this.#t.categories?this.#t.categories:(this.#t.categories=(this.#r.map(e=>this.#e.getById("enterprise-category",e))||[]).filter(Boolean),this.#t.categories)}get coordinates(){if(this.#t.coordinates)return this.#t.coordinates;this.#t.coordinates=[];for(let e=0;e<this.nodes.length;e++)this.#t.coordinates.push(this.nodes[e].coordinate);return this.#t.coordinates}get nodes(){if(this.#t.nodes)return this.#t.nodes;this.#t.nodes=[];for(let e=0;e<this.#o.nodes.length;e++){let t=this.#e.getById("node",this.#o.nodes[e].id);t&&this.#t.nodes.push(t)}return this.#t.nodes}get points(){if(this.#t.points)return this.#t.points;this.#t.points=[];for(let e=0;e<this.#o.spaces.length;e++){let t=this.#e.getById("point-of-interest",this.#o.spaces[e].id);t&&this.#t.points.push(t)}return this.#t.points}get spaces(){if(this.#t.spaces)return this.#t.spaces;this.#t.spaces=[];let e=Array.isArray(this.#o.spaces)?this.#o.spaces:this.#o.polygons;for(let t=0;t<e.length;t++){let r=this.#e.getById("space",e[t].id);r&&this.#t.spaces.push(r)}return this.#t.spaces}get objects(){if(this.#t.objects)return this.#t.objects;this.#t.objects=[];for(let e=0;e<this.#o.polygons.length;e++){let t=this.#e.getById("object",this.#o.polygons[e].id);t&&this.#t.objects.push(t)}return this.#t.objects}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},lt=ss;f();var Gg=new Set,ls=class o extends Fe{static __type="enterprise-category";__type=o.__type;name="";color;externalId="";extra;icon;iconFromDefaultList;sortOrder=-1;picture;#e;#t={};#o;static is(e){return e.__type===o.__type}constructor(e,t){super(t.mvfData.externalId),this.#e=e,this.#o=t.mvfData;for(let r in t.mvfData)!Gg.has(r)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),r)&&Object.defineProperty(this,r,{get(){return this.#e.getPropTranslation(this.__type,r,this.#o.id,this.#o[r])}})}get children(){if(this.#t.children)return this.#t.children;this.#t.children=[];for(let e=0;e<this.#o.children.length;e++){let t=this.#e.getById("enterprise-category",this.#o.children[e]);t&&this.#t.children.push(t)}return this.#t.children}get locations(){if(this.#t.locations)return this.#t.locations;this.#t.locations=[];for(let e=0;e<this.#o.locations.length;e++){let t=this.#e.getById("enterprise-location",this.#o.locations[e]);t&&this.#t.locations.push(t)}return this.#t.locations}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(this.#t))delete this.#t[e]}},ii=ls;f();var Ug=new Set,cs=class o extends Fe{static __type="enterprise-venue";__type=o.__type;countrycode;coverImage;externalId="";defaultLanguage={code:"en",name:"English"};defaultFloor;extra;icon;languages=[];links=[];logo;mappedinWebUrl;operationHours;slug="";topLocations;tzid;#e={};#t;static is(e){return e.__type===o.__type}constructor(e,t){super(t.mvfData.externalId),this.#t=t.mvfData;for(let r in t.mvfData)!Ug.has(r)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),r)&&(this[r]=t.mvfData[r])}get name(){return this.#t.name??""}get defaultMap(){return this.#t.defaultMap??this.defaultFloor??""}get enterpriseType(){return this.#t.type??void 0}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(this.#e))delete this.#e[e]}},ps=cs;f();f();f();f();f();var ap=(i=>(i.Departure="Departure",i.TakeConnection="TakeConnection",i.ExitConnection="ExitConnection",i.Turn="Turn",i.Arrival="Arrival",i))(ap||{}),ds=(a=>(a.Straight="Straight",a.Right="Right",a.SlightRight="SlightRight",a.Left="Left",a.SlightLeft="SlightLeft",a.Back="Back",a))(ds||{}),sp=(p=>(p.stairs="stairs",p.elevator="elevator",p.escalator="escalator",p.door="door",p.ramp="ramp",p.slide="slide",p.portal="portal",p.security="security",p.shuttle="shuttle",p.ladder="ladder",p))(sp||{}),si=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(si||{}),li=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(li||{});f();function lp(o){let{fromPosition:e,toPosition:t,junctionInset:r,fromAltitude:n,toAltitude:i}=o;if(r<=0)return null;let a=(e[1]+t[1])/2,{toCartesian:s,toGeographic:l}=Vl(a),c=s(e),p=s(t),h=p.x-c.x,g=p.y-c.y,T=i-n,I=Math.sqrt(h*h+g*g+T*T);if(I<=r*2)return null;let E=r/I,D={x:c.x+h*E,y:c.y+g*E},x=l(D.x,D.y),A=e[2]!==void 0?e[2]+T*E:void 0,V={x:p.x-h*E,y:p.y-g*E},L=l(V.x,V.y),G=t[2]!==void 0?t[2]-T*E:void 0;return{fromPosition:A!==void 0?[x.lon,x.lat,A]:[x.lon,x.lat],toPosition:G!==void 0?[L.lon,L.lat,G]:[L.lon,L.lat]}}function us(o,e,t,r,n){let i=lp({fromPosition:o,toPosition:e,junctionInset:t,fromAltitude:r,toAltitude:n});return i?(o[0]=i.fromPosition[0],o[1]=i.fromPosition[1],o[2]!==void 0&&i.fromPosition[2]!==void 0&&(o[2]=i.fromPosition[2]),e[0]=i.toPosition[0],e[1]=i.toPosition[1],e[2]!==void 0&&i.toPosition[2]!==void 0&&(e[2]=i.toPosition[2]),!0):!1}function bt(o){return o.verticalOffset===0?[o.longitude,o.latitude]:[o.longitude,o.latitude,o.verticalOffset]}function zg(o){return new Map(o.map(e=>{let{properties:t}=e,{id:r}=t;return[r,e]}))}var gs=(o,e)=>{let t=zg(e),r={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:o[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let n of o){let i=[n.geometry.coordinates],a=(n.properties.entrances||[]).reduce((s,l)=>(t.has(l)&&s.push(t.get(l)),s),[]);if(a.length){let{entrances:s,obstructions:l}=Ba(n,a);i=l.map(c=>c.geometry.coordinates),r.entrances.features.push(...s)}r.walls.geometry.coordinates.push(...i)}return r};function pp(o,e){return((e-o+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function dp(o,e){let t="Left";return o<=-Math.PI/4?t="Right":o<=-e?t="SlightRight":o<=e?t="Straight":o<=Math.PI/4?t="SlightLeft":t="Left",t}function up(o){let e={};for(let t in o){let r=o[t];if(r!=null){if(r.id=t,"polygons"in r)for(let n of r.polygons)e[n]=r;else if("lineStrings"in r)for(let n of r.lineStrings)e[n]=r;else if("points"in r)for(let n of r.points)e[n]=r}}return e}function fp(o,e){return o.reduce((t,r)=>{let n=e[r.properties.id];if(n==null)return t;if("textures"in r.properties&&Array.isArray(r.properties.textures)&&r.properties.textures.length>0){let i={...n,id:n.id+"-textures"};t.set(i,[r])}else t.has(n)||t.set(n,[]),t.get(n).push(r);return t},new Map)}function hr(o,e={}){let t={...o,flipImageToFaceCamera:e?.flipImagesToFaceCamera??!0},r=e?.style?.shading??e?.shadingAndOutlines;r===!0?t.shading={start:.1,end:.15,intensity:.4}:typeof r=="object"&&(t.shading={start:r.start,end:r.end,intensity:r.intensity});let n=e?.style?.outlines??e?.shadingAndOutlines;if(t.outline=typeof n=="object"?!0:n,"lineStrings"in o){let i=e?.style?.wallTopColor??e?.wallTopColor;i!=null&&(t.topColor=i)}return t}var ms=(o,e)=>{let r=(e.currentMap?.currentFloor).layers.get(ye);switch(o){case"interior-walls":return r?.layers.get(So);case"exterior-walls":return r?.layers.get(Kt);case"interior-doors":return r?.layers.get(lr);case"exterior-doors":return r?.layers.get(cr);default:return typeof o=="string"?o:o?.id}};function ys(o){return new Promise(e=>{o.onComplete(e),o.onStop(e)})}function hp(o){return o.bbox?o.bbox:Jo(o)}function gr(o,e,t){return o.floorId&&e.has(o.floorId)?e.get(o.floorId):t}function mr(o){if(Te.is(o)||pt.is(o))return o.id}function gp(o,e,t){let r=o.coordinates.length===2&&o.coordinates[0].floorId!==o.coordinates[1].floorId,n=!0;if(r&&o.coordinates[0].floorId!=null&&o.coordinates[1].floorId!=null){let i=e?.getById("floor",o.coordinates[0].floorId),a=e?.getById("floor",o.coordinates[1].floorId);if(i&&a){let s=t.getState(i),l=t.getState(a);s!=null&&l!=null&&(n=s.visible&&l.visible&&s.altitude!==l.altitude)}}else{let i=o.coordinates[0].floorId!=null?e?.getById("floor",o.coordinates[0].floorId):void 0;n=i?t.getState(i)?.visible??!0:!0}return n}function mp(o,e){let t=o.properties.path.split("/"),r=t[t.length-1].split(".")[0],n=atob(r);return"img_"+Wn(n).toString()+"-"+e}function fs(o="auto",e,t=1,r){return o!=="auto"?o*t:e!=null?e*t:r!=null?r*t:3*t}function cp(o,e,t,r){if(o.maxHeight!=null&&o.maxHeight>0)return fs(e,o.maxHeight,t,r);let n=fs(e,void 0,t,r);if(e==="auto"&&"geometryMaxHeight"in o){let i=o.geometryMaxHeight;if(i!=null&&i>0){let a=Math.ceil(i*1.1);if(a>n)return a}}return n}function yp(o,e="auto",t=1,r,n){if(!o.length)return new Map;let i=o.sort((p,h)=>p.elevation-h.elevation),a=i.findIndex(p=>p.elevation>=0);a===-1&&(a=i.length);let s=0,l=new Map,c=-1;for(let p=a;p<i.length;p+=1){let h=i[p],g=cp(h,e,t,r);if(!n){let T=h.elevation-c-1;T>0&&(s+=T*g)}l.set(h.elevation,{altitude:s,visualHeight:g}),s+=g,c=h.elevation}s=0;for(let p=a-1;p>=0;p-=1){let h=i[p],g=cp(h,e,t,r),T=-(s+g);l.set(h.elevation,{altitude:T,visualHeight:g}),s+=g}return l}function bp(o,e,t="auto",r=1,n){let i=[...o].sort((c,p)=>c.elevation-p.elevation),a=i.findIndex(c=>c.elevation>=0);if(a===-1)return[];let s=[],l=-1;for(let c=a;c<i.length;c+=1){let p=i[c],h=p.elevation-l-1;if(h>0){let g=e.get(p.elevation),T=g?.visualHeight??fs(t,void 0,r,n),I=h*T,E=g?.altitude??0;s.push({altitude:E-I,height:I,floorAboveElevation:p.elevation,missingCount:h})}l=p.elevation}return s}function ci(o,e){let t=e(o.center);return{center:new H({latitude:t[1],longitude:t[0]}),radius:o.radius}}function Tp(o){if(o.geometry.type==="Polygon")return{type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[0]]},properties:o.properties};let e=[];for(let t of o.geometry.coordinates)e.push([t[0]]);return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:e},properties:o.properties}}var vp=Math.PI*.1,Eo=class{id;#e={};#t;#o;constructor(e,t,r,n,i){this.id=i?.id??ee(),this.#t=t,this.#o=e.features,this.departure=r,this.destination=n}get path(){return this.#o.map(e=>this.#t.getById("node",e.properties.id)).filter(Boolean)}departure;destination;get coordinates(){return this.#e.coordinates?this.#e.coordinates:(this.#e.coordinates=this.#o.map(e=>new H(e.geometry.coordinates[1],e.geometry.coordinates[0],e.properties.groupBy)),this.#e.coordinates)}get distance(){return this.#e.distance?this.#e.distance:(this.#e.distance=this.#o.reduce((e,t)=>e+(t.properties.distance||0),0),this.#e.distance)}get instructions(){if(this.#o.length<2)return[];if(this.#e.instructions)return this.#e.instructions;let e=[],t=0;for(let r=0;r<this.#o.length;r++){let n=this.#o[r],i=this.#o[r-1],a=this.#o[r+1],s=new H(n.geometry.coordinates[1],n.geometry.coordinates[0],n.properties.groupBy),l=this.#s({prevDirection:i,direction:n,nextDirection:a});t+=i?.properties.distance||0;for(let c of l)c&&(e.push({action:c,distance:t,coordinate:s,node:this.#t.getById("node",n.properties.id)}),t=0)}return this.#e.instructions=e,this.#e.instructions}#r;#i;#n;#s(e){let{prevDirection:t,direction:r,nextDirection:n}=e,i=t&&this.#t.getById("floor",t.properties.groupBy),a=this.#t.getById("floor",r.properties.groupBy),s=n&&this.#t.getById("floor",n.properties.groupBy),l=[];t||l.push({type:"Departure"});let c=this.#t.getMVFFeatureByNodeId("connection",r.properties.id),p=c?this.#t.getById("connection",c.id):void 0,h=c&&c.nodes.length>1,g=this.#t.enterpriseMode&&(!r.properties.destination||!c?.nodes.includes(r.properties.destination)||!c?.nodes.includes(r.properties.id));if(c&&!(!h||g))if(!this.#r||this.#r==="exit")l.push(this.#c("TakeConnection",a,s,p,c)),this.#r="take",this.#i=p,this.#n=c;else{let I=this.#t.getMVFFeatureByNodeId("connection",t?.properties.id??""),E=this.#t.getById("connection",I?.id??"");l.push(this.#c("ExitConnection",a,i,E,I)),this.#r="exit",this.#i=p,this.#n=c}else this.#r==="take"?(l.push(this.#c("ExitConnection",a,i,this.#i,this.#n)),this.#r="exit",this.#i=p):s&&a?.id!==s.id?l.push(this.#c("TakeConnection",a,s,p)):i&&i.id!==a?.id?l.push(this.#c("ExitConnection",a,i,p)):l.push(this.#a(t,r));return n||l.push({type:"Arrival"}),l}#c(e,t,r,n,i){let a="none",s=t?t.elevation:0;if(s!=null&&r?.elevation!=null){let c=s-r.elevation;c>0?a="down":c<0&&(a="up")}let l=n?.type??i?.type??"stairs";return{type:e,fromFloor:t,toFloor:r,direction:a,connection:n,connectionType:l}}#a(e,t){let r=t.properties.edges;if(!r||r.filter(a=>a.destination.properties.id!==e?.properties.id&&a.destination.properties.id!==t.properties.destination).length===0)return null;let i=e?-pp(e.properties.angle,t.properties.angle):0;return Math.abs(i)>=vp?{type:"Turn",bearing:dp(i,vp),referencePosition:"At"}:null}toJSON(){return{id:this.id,directions:this.#o,__type:"directions",from:this.departure,to:this.destination,coordinates:this.coordinates,distance:this.distance,instructions:this.instructions}}};f();f();f();function Ip(o){return lo(o)?"navigationTarget"in o&&o.navigationTarget!=null:!1}var Xg={lineOfSight:!0,mode:"absolute-distance",maxResults:1};function Sp(o){return{...Xg,lineOfSight:!o}}var pe=new WeakMap;function pi(o,e,t){let r=Sp(t),i=e.Query.__LEGACY_NEAREST_SYNC(o,e.getByType("node"),r)?.[0]?.feature.id;return i?[i]:[]}async function di(o,e,t){let r=Sp(t),i=(await e.Query.nearest(o,e.getByType("node"),r))?.[0]?.feature.id;return i?[i]:[]}function $g(o,e,t){let r=[];for(let n of o.navigationTarget){let i=yr(n,e,t);r.push(...i)}return r}async function Yg(o,e,t){let r=[];for(let n of o.navigationTarget){let i=await Mo(n,e,t);r.push(...i)}return r}function Ep(o,e){let r=e?.getMVFFeatureById("entrance",o.id)?.properties.node;return r?[r]:[]}function Mp(o,e){return e?.getMVFFeatureById("area",o.id)?.properties.destinationNodes??[]}function xp(o,e){let t=e?.getMVFFeatureById("space",o.id);if(t==null)return[];let r=e.entranceNodeIdsBySpaceId?.[o.id];return r&&r.length>0?r:t.properties.destinationNodes??[]}function Zg(o,e,t){let r=[];for(let n of o.coordinates){let i=pi(n,e,t);i.length>0&&r.push(i[0])}return r}async function Jg(o,e,t){let r=[];for(let n of o.coordinates){let i=await di(n,e,t);i.length>0&&r.push(i[0])}return r}function Cp(o,e){return e?.objectEntranceNodeIdsByObstructionId[o.id]??[]}function _p(o,e){return o.spaces.flatMap(t=>e?.getMVFFeatureById("space",t.id)?.properties.destinationNodes??[]).filter(t=>typeof t=="string")}function Pp(o){return o.nodes.map(e=>e.id)}function yr(o,e,t){if(pe.has(o))return pe.get(o);if(co.is(o)){let r=$g(o,e,t);return pe.set(o,r),r}else if(Ut.is(o)){let r=pi(o,e,t);return pe.set(o,r),r}else if(H.is(o)){let r=pi(o,e,t);return pe.set(o,r),r}else{if(yt.is(o))return pi(o,e,t);if(et.is(o)){let r=Ep(o,e);return pe.set(o,r),r}else if(Ct.is(o)){let r=Mp(o,e);return pe.set(o,r),r}else if(Te.is(o)){let r=xp(o,e);return pe.set(o,r),r}else if(We.is(o)){let r=Zg(o,e,t);return pe.set(o,r),r}else if(pt.is(o)){let r=Cp(o,e);return pe.set(o,r),r}else if(Ne.is(o)){let r=_p(o,e);return pe.set(o,r),r}else if(lt.is(o)){let r=Pp(o);return pe.set(o,r),r}else if(xt.is(o)){let r=[o.id];return pe.set(o,r),r}else return[]}}async function Mo(o,e,t){if(pe.has(o))return pe.get(o);if(co.is(o)){let r=await Yg(o,e,t);return pe.set(o,r),r}else if(Ut.is(o)){let r=await di(o,e,t);return pe.set(o,r),r}else if(H.is(o)){let r=await di(o,e,t);return pe.set(o,r),r}else if(yt.is(o)){let r=await di(o,e,t);return pe.set(o,r),r}else if(et.is(o)){let r=Ep(o,e);return pe.set(o,r),r}else if(Ct.is(o)){let r=Mp(o,e);return pe.set(o,r),r}else if(Te.is(o)){let r=xp(o,e);return pe.set(o,r),r}else if(We.is(o)){let r=await Jg(o,e,t);return pe.set(o,r),r}else if(pt.is(o)){let r=Cp(o,e);return pe.set(o,r),r}else{if(Ne.is(o))return _p(o,e);if(lt.is(o)){let r=Pp(o);return pe.set(o,r),r}else if(xt.is(o)){let r=[o.id];return pe.set(o,r),r}else return[]}}function Op(o,e){if(!o.instances||o.instances.length===0)return o;for(let t of o.instances)if(t.nodes.map(n=>n.id).includes(e))return t;return o}function Dp(o,e,t){let r=o.features[0]?.properties.id,n=e[0];if(e.length>1){for(let i of e)if((t.get(i)??[]).includes(r)){n=i;break}}return lt.is(n)&&(n=Op(n,r)),n}function wp(o,e,t){let r=o.features[o.features.length-1]?.properties.id,n=e[0];if(e.length>1){for(let i of e)if((t.get(i)??[]).includes(r)){n=i;break}}return lt.is(n)&&(n=Op(n,r)),n}function bs(o){if(H.is(o))return o;if(!(!Ip(o)||Array.isArray(o.navigationTarget)||!H.is(o.navigationTarget)))return o.navigationTarget}var br=class{navigator;connections;constructor({nodes:e,geojsonCollection:t,connections:r,groupBy:n,multiplicativeDistanceWeightScaling:i,flagDeclarations:a,getDoorByNodeId:s}){this.navigator=new $l({nodes:e,geojsonCollection:this.createCollection(t),groupBy:n,multiplicativeDistanceWeightScaling:i,flagDeclarations:a,getDoorByNodeId:s}),this.connections=r}processTargets(e,t,r){let n=[],i=[],a=new Map,s=new Set,l=new Set;for(let[c,p]of e){let h=a.get(c);h||(h=[],a.set(c,h)),Te.is(c)&&s.add(c.id);for(let g of p)h.push(g),n.push(g)}for(let[c,p]of t){let h=a.get(c);h||(h=[],a.set(c,h)),Te.is(c)&&l.add(c.id);for(let g of p)h.push(g),i.push(g)}if(s.size===0&&l.size===0)return{originIds:n,destinationNodeIds:i,featureToNodeIdsMap:a};for(let c of n){let p=r.spaceIdsByNodeId[c]||[];for(let h of p)if(l.has(h)){i.push(c);break}}for(let c of i){let p=r.spaceIdsByNodeId[c]||[];for(let h of p)if(s.has(h)){n.push(c);break}}return{originIds:n,destinationNodeIds:i,featureToNodeIdsMap:a}}getDirections=async(e,t,r,n)=>{let i=new Map,a=new Map;for(let p of e)i.set(p,await Mo(p,n,n.enterpriseMode));for(let p of t)a.set(p,await Mo(p,n,n.enterpriseMode));let{originIds:s,destinationNodeIds:l,featureToNodeIdsMap:c}=this.processTargets(i,a,n);return this.#e(e,t,s,l,r,n,c)};getDirectionsSync=(e,t,r,n)=>{let i=new Map(e.map(p=>[p,yr(p,n,n.enterpriseMode)])),a=new Map(t.map(p=>[p,yr(p,n,n.enterpriseMode)])),{originIds:s,destinationNodeIds:l,featureToNodeIdsMap:c}=this.processTargets(i,a,n);return this.#e(e,t,s,l,r,n,c)};#e=(e,t,r,n,i,a,s)=>{let l=this.getDisabledConnectionNodeIds(i.accessible).filter(x=>!r.includes(x)&&!n.includes(x)),c=new Map,p={...i.connectionIdWeightMap};for(let x of i.excludedConnections)p[x.id]=1/0;for(let x in p){let A=a.getById("connection",x);A&&this.#t(A,p[x],c)}let g=(i.smoothing.__EXPERIMENTAL_METHOD??"greedy-los")!=="greedy-los",T=this.navigator.getDirections({zones:i.zones.map(x=>({geometry:x.geometry,cost:x.cost,map:x.floor?.id})),originIds:r,from:g?Ap(e):[],to:g?Ap(t):[],destinationNodeIds:n,disabledConnectionNodeIds:l,simplify:i.smoothing,overrideEdgeWeights:c,multiplicativeDistanceWeightScaling:!a.enterpriseMode,includeNonPublic:i.includeNonPublic});this.addCoordinateDirections(T,e,t);let I=Dp(T,e,s),E=wp(T,t,s),D=new Eo(T,a,I,E);if(!(D.distance===0&&new Set([...r,...n]).size===r.length+n.length))return D};getDisabledConnectionNodeIds=e=>e===!1?[]:this.connections.reduce((t,r)=>r.accessible?t:t.concat(r.nodes),[]);#t=(e,t,r)=>{if(e.nodes.length<2)return;let n=new Set(e.nodes.map(i=>i.id));for(let i of e.nodes){let a=this.navigator.graph.edges[i.id];if(a)for(let s of a)n.has(s.destination.properties.id)&&r.set(s,t)}};addCoordinateDirections=(e,[t],[r])=>{if(!e.features.length)return;let n=bs(t);if(n){let a=this.createDirectionFeature(n,this.navigator.getAngle([n.longitude,n.latitude],e.features[0].geometry.coordinates),this.navigator.getDistance([n.longitude,n.latitude],e.features[0].geometry.coordinates));e.features.splice(0,0,a)}let i=bs(r);if(i){let a=this.createDirectionFeature(i,0,0),s=e.features[e.features.length-1];s.properties.distance=this.navigator.getDistance(s.geometry.coordinates,[i.longitude,i.latitude]),s.properties.angle=this.navigator.getAngle(s.geometry.coordinates,[i.longitude,i.latitude]),e.features.push(a)}};createCollection(e){return{type:"FeatureCollection",features:Object.entries(e).reduce((t,[r,n])=>t.concat(n.features.map(i=>(i.properties.map=r,i))),[])}}createDirectionFeature=(e,t,r)=>({type:"Feature",geometry:{type:"Point",coordinates:[e.longitude,e.latitude]},properties:{groupBy:e.floorId,id:e.id,angle:t,distance:r,edges:[]}})};function qg(o){if(H.is(o))return o.floorId;if(Te.is(o)||et.is(o)||yt.is(o)||Ut.is(o)||pt.is(o)||Ct.is(o)||xt.is(o))return o.floor.id;if((We.is(o)||lt.is(o))&&o.coordinates.length>0)return o.coordinates[0].floorId;if(Ne.is(o)&&o.spaces.length>0)return o.spaces[0].floor.id}function Ap(o){return o.reduce((e,t)=>{let r=Io(t);if(!r)return e;let n=qg(t);return e.push({type:"Feature",geometry:{type:"Point",coordinates:[r.longitude,r.latitude]},properties:{id:t.id,neighbors:[],map:n}}),e},[])}f();f();f();import Bo from"zod";var Tr=50,Ts=1,vs=!1,Fp=Bo.object({limit:Bo.enum(["same-floor","same-elevation","all-floors"]).optional(),mode:Bo.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:Bo.boolean().optional().or(Bo.literal("auto")),maxDistance:Bo.number().optional(),maxResults:Bo.number().optional()}),kp={lineOfSight:vs,mode:"travel-distance",maxDistance:Tr,limit:"same-floor",maxResults:Ts},qr=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}__LEGACY_NEAREST_SYNC=(e,t,r)=>{let n={...kp,...r};try{Fp.parse(n)}catch(p){C.error(p);return}let i=Io(e);if(!i)return;let a=this.#o(i,n),s=[],l={},c=[];for(let p of t){let h=yr(p,this.#e,this.#e.enterpriseMode);if(h)for(let g of h)l[g]||(l[g]=[]),l[g].push(p),c.push(g)}return r?.mode==="absolute-distance"?s=this.#r(i,a,t,n):s=this.#n(e,a,c,l,n),s.sort((p,h)=>p.distance-h.distance)};async nearest(e,t,r){let n={...kp,...r};try{Fp.parse(n)}catch(h){C.error(h);return}let i=Io(e);if(!i)return;let a=this.#o(i,n),s=[],l={},c=[],p=[];if(r?.mode==="absolute-distance")s=this.#r(i,a,t,n);else{for(let h of t)p.push(Mo(h,this.#e,this.#e.enterpriseMode).then(g=>{if(g)for(let T of g)l[T]||(l[T]=[]),l[T].push(h),c.push(T)}));await Promise.all(p),s=await this.#i(e,a,c,l,n)}return s.sort((h,g)=>h.distance-g.distance)}#o(e,t){let r=e.floorId?[e.floorId]:[];if(t?.limit==="all-floors")r=this.#e.getByType("floor").map(n=>n.id);else if(e.floorId==null)for(let n of this.#e.getByType("floor-stack")){let i=n.defaultFloor;i&&r.push(i.id)}else if(t?.limit==="same-elevation"){let n=this.#e.floorsById[e.floorId];if(n){let i=n?.elevation;i!=null&&(r=this.#e.getByType("floor-stack").map(a=>a.floors.find(s=>s.elevation===i)?.id).filter(Boolean))}}return r}#r=(e,t,r,n)=>{let i=[],a=new Set(r.map(s=>s.__type));for(let s of t)for(let l of a){let c=this.#t.searchWithIncludedIds([e.longitude,e.latitude],l,this.#e.mapName,s,r.filter(p=>p.__type===l).map(p=>p.id),n?.maxDistance??Tr,n?.lineOfSight==="auto"?vs:n?.lineOfSight,n?.maxResults??1);if(c)for(let p of c)i.push({distance:p.distance,feature:this.#e.getById(l,p.node.properties.parentId)||this.#e.getById(l,p.node.properties.id)})}return i};#i=async(e,t,r,n,i)=>{let a=[];for(let s of t){let l,c=0;if(!xt.is(e)){let p=this.#r(e.anchorTarget,[s],this.#e.getByType("node").filter(h=>h.floor.id===s),{limit:"same-floor",lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??Tr,maxResults:1});p.length>0&&(l=p[0].feature,c=p[0].distance)}if(l){let p=new Set,h=this.#e.directions.navigator.findNearestNodesOnGraph(l.id,(i?.maxDistance??Tr)-c,s,r,!1,i?.maxResults??Ts);for(let g of h)for(let T of n[g.feature.properties.id])p.has(T.id)||(a.push({distance:g.distance+c,feature:T}),p.add(T.id))}}return a};#n=(e,t,r,n,i)=>{let a=[];for(let s of t){let l;if(xt.is(e)||(l=this.__LEGACY_NEAREST_SYNC(e,this.#e.getByType("node"),{lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??Tr,maxResults:1})?.[0].feature),l){let c=this.#e.directions.navigator.findNearestNodesOnGraph(l.id,i?.maxDistance??Tr,s,r,i?.lineOfSight==="auto"?vs:i?.lineOfSight,i?.maxResults??Ts);for(let p of c)for(let h of n[p.feature.properties.id])a.push({distance:p.distance,feature:h})}}return a}};f();var ui=class{#e;constructor(e){this.#e=e}at(e){let t=[],r=[e.longitude,e.latitude],n=e.floorId?[e.floorId]:this.#e.getAllFloorIds();for(let i of n){let a=this.#e.searchAtCoordinate(e,i);for(let s of a)this.#t(r,s)&&t.push(s)}return t}#t(e,t){let r=t.geoJSON;if(!r||!r.geometry)return!1;let n=r.geometry.type;return n==="Point"?e[0]===r.geometry.coordinates[0]&&e[1]===r.geometry.coordinates[1]:n!=="Polygon"&&n!=="MultiPolygon"?!1:Xl(e,r)}};f();f();f();f();function Lp(o){let e=+this._x.call(null,o),t=+this._y.call(null,o);return Rp(this.cover(e,t),e,t,o)}function Rp(o,e,t,r){if(isNaN(e)||isNaN(t))return o;var n,i=o._root,a={data:r},s=o._x0,l=o._y0,c=o._x1,p=o._y1,h,g,T,I,E,D,x,A;if(!i)return o._root=a,o;for(;i.length;)if((E=e>=(h=(s+c)/2))?s=h:c=h,(D=t>=(g=(l+p)/2))?l=g:p=g,n=i,!(i=i[x=D<<1|E]))return n[x]=a,o;if(T=+o._x.call(null,i.data),I=+o._y.call(null,i.data),e===T&&t===I)return a.next=i,n?n[x]=a:o._root=a,o;do n=n?n[x]=new Array(4):o._root=new Array(4),(E=e>=(h=(s+c)/2))?s=h:c=h,(D=t>=(g=(l+p)/2))?l=g:p=g;while((x=D<<1|E)===(A=(I>=g)<<1|T>=h));return n[A]=i,n[x]=a,o}function Np(o){var e,t,r=o.length,n,i,a=new Array(r),s=new Array(r),l=1/0,c=1/0,p=-1/0,h=-1/0;for(t=0;t<r;++t)isNaN(n=+this._x.call(null,e=o[t]))||isNaN(i=+this._y.call(null,e))||(a[t]=n,s[t]=i,n<l&&(l=n),n>p&&(p=n),i<c&&(c=i),i>h&&(h=i));if(l>p||c>h)return this;for(this.cover(l,c).cover(p,h),t=0;t<r;++t)Rp(this,a[t],s[t],o[t]);return this}f();function Bp(o,e){if(isNaN(o=+o)||isNaN(e=+e))return this;var t=this._x0,r=this._y0,n=this._x1,i=this._y1;if(isNaN(t))n=(t=Math.floor(o))+1,i=(r=Math.floor(e))+1;else{for(var a=n-t||1,s=this._root,l,c;t>o||o>=n||r>e||e>=i;)switch(c=(e<r)<<1|o<t,l=new Array(4),l[c]=s,s=l,a*=2,c){case 0:n=t+a,i=r+a;break;case 1:t=n-a,i=r+a;break;case 2:n=t+a,r=i-a;break;case 3:t=n-a,r=i-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=t,this._y0=r,this._x1=n,this._y1=i,this}f();function Vp(){var o=[];return this.visit(function(e){if(!e.length)do o.push(e.data);while(e=e.next)}),o}f();function jp(o){return arguments.length?this.cover(+o[0][0],+o[0][1]).cover(+o[1][0],+o[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}f();f();function Be(o,e,t,r,n){this.node=o,this.x0=e,this.y0=t,this.x1=r,this.y1=n}function Gp(o,e,t){var r,n=this._x0,i=this._y0,a,s,l,c,p=this._x1,h=this._y1,g=[],T=this._root,I,E;for(T&&g.push(new Be(T,n,i,p,h)),t==null?t=1/0:(n=o-t,i=e-t,p=o+t,h=e+t,t*=t);I=g.pop();)if(!(!(T=I.node)||(a=I.x0)>p||(s=I.y0)>h||(l=I.x1)<n||(c=I.y1)<i))if(T.length){var D=(a+l)/2,x=(s+c)/2;g.push(new Be(T[3],D,x,l,c),new Be(T[2],a,x,D,c),new Be(T[1],D,s,l,x),new Be(T[0],a,s,D,x)),(E=(e>=x)<<1|o>=D)&&(I=g[g.length-1],g[g.length-1]=g[g.length-1-E],g[g.length-1-E]=I)}else{var A=o-+this._x.call(null,T.data),V=e-+this._y.call(null,T.data),L=A*A+V*V;if(L<t){var G=Math.sqrt(t=L);n=o-G,i=e-G,p=o+G,h=e+G,r=T.data}}return r}f();function Up(o){if(isNaN(p=+this._x.call(null,o))||isNaN(h=+this._y.call(null,o)))return this;var e,t=this._root,r,n,i,a=this._x0,s=this._y0,l=this._x1,c=this._y1,p,h,g,T,I,E,D,x;if(!t)return this;if(t.length)for(;;){if((I=p>=(g=(a+l)/2))?a=g:l=g,(E=h>=(T=(s+c)/2))?s=T:c=T,e=t,!(t=t[D=E<<1|I]))return this;if(!t.length)break;(e[D+1&3]||e[D+2&3]||e[D+3&3])&&(r=e,x=D)}for(;t.data!==o;)if(n=t,!(t=t.next))return this;return(i=t.next)&&delete t.next,n?(i?n.next=i:delete n.next,this):e?(i?e[D]=i:delete e[D],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[x]=t:this._root=t),this):(this._root=i,this)}function Hp(o){for(var e=0,t=o.length;e<t;++e)this.remove(o[e]);return this}f();function Wp(){return this._root}f();function zp(){var o=0;return this.visit(function(e){if(!e.length)do++o;while(e=e.next)}),o}f();function Xp(o){var e=[],t,r=this._root,n,i,a,s,l;for(r&&e.push(new Be(r,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!o(r=t.node,i=t.x0,a=t.y0,s=t.x1,l=t.y1)&&r.length){var c=(i+s)/2,p=(a+l)/2;(n=r[3])&&e.push(new Be(n,c,p,s,l)),(n=r[2])&&e.push(new Be(n,i,p,c,l)),(n=r[1])&&e.push(new Be(n,c,a,s,p)),(n=r[0])&&e.push(new Be(n,i,a,c,p))}return this}f();function $p(o){var e=[],t=[],r;for(this._root&&e.push(new Be(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var n=r.node;if(n.length){var i,a=r.x0,s=r.y0,l=r.x1,c=r.y1,p=(a+l)/2,h=(s+c)/2;(i=n[0])&&e.push(new Be(i,a,s,p,h)),(i=n[1])&&e.push(new Be(i,p,s,l,h)),(i=n[2])&&e.push(new Be(i,a,h,p,c)),(i=n[3])&&e.push(new Be(i,p,h,l,c))}t.push(r)}for(;r=t.pop();)o(r.node,r.x0,r.y0,r.x1,r.y1);return this}f();function Yp(o){return o[0]}function Zp(o){return arguments.length?(this._x=o,this):this._x}f();function Jp(o){return o[1]}function qp(o){return arguments.length?(this._y=o,this):this._y}function Qr(o,e,t){var r=new Is(e??Yp,t??Jp,NaN,NaN,NaN,NaN);return o==null?r:r.addAll(o)}function Is(o,e,t,r,n,i){this._x=o,this._y=e,this._x0=t,this._y0=r,this._x1=n,this._y1=i,this._root=void 0}function Qp(o){for(var e={data:o.data},t=e;o=o.next;)t=t.next={data:o.data};return e}var tt=Qr.prototype=Is.prototype;tt.copy=function(){var o=new Is(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,r;if(!e)return o;if(!e.length)return o._root=Qp(e),o;for(t=[{source:e,target:o._root=new Array(4)}];e=t.pop();)for(var n=0;n<4;++n)(r=e.source[n])&&(r.length?t.push({source:r,target:e.target[n]=new Array(4)}):e.target[n]=Qp(r));return o};tt.add=Lp;tt.addAll=Np;tt.cover=Bp;tt.data=Vp;tt.extent=jp;tt.find=Gp;tt.remove=Up;tt.removeAll=Hp;tt.root=Wp;tt.size=zp;tt.visit=Xp;tt.visitAfter=$p;tt.x=Zp;tt.y=qp;f();function Ss(o,e,t,r=0,n=0,i=0,a=0){if(t===void 0){t=o.root();let l=o.extent();if(l&&([[r,n],[i,a]]=l,e(t,r,n,i,a)))return!0;if(!t)return!1}let s=[[r,n,(i+r)/2,(a+n)/2],[(i+r)/2,n,i,(a+n)/2],[r,(a+n)/2,(i+r)/2,a],[(i+r)/2,(a+n)/2,i,a]];for(let l=0;l<4;l++){let c=t[l];if(c){let[p,h,g,T]=s[l];e(c,p,h,g,T)||Ss(o,e,c,p,h,g,T)}}return!1}var Kp=1e3,Qg=.1,Kg=5,em=1.5,fi=class{#e={};#t=new Map;getMaxSearchRadiusForFloorId=(e,t)=>{let r=this.#t.get(this.#r.mapName)?.get(t);if(r)return r;let n=this.getNodeTreeByTypeAndFloorId(e,this.#r.mapName,t);if(typeof n.extent=="function")if(n.extent()){let[[i,a],[s,l]]=n.extent(),c=s-i,p=l-a;r=Math.max(c,p)}else r=Kp;else r=Kp;return this.#t.set(this.#r.mapName,new Map([[t,r]])),r};searchWithIncludedIds(e,t,r,n,i,a,s=!1,l=1/0){let c=this.getNodeTreeByTypeAndFloorId(t,r,n),p=new Set,h=[],g=Kg,T=Math.max(a,this.getMaxSearchRadiusForFloorId(t,n));for(;h.length<l&&g<=T;){let I=this.#o(e,c,i,g,a,p);I.sort((E,D)=>E.distance-D.distance);for(let E of I){if(h.length>=l)break;s?this.#r.directions.navigator.hasLineOfSight(e,E.node.geometry.coordinates,n,Qg)&&h.push(E):h.push(E)}g=g*em}return h}#o(e,t,r,n,i,a){let{x:s,y:l}=this.#i(e[0],e[1]),c=s-n,p=s+n,h=l-n,g=l+n,T=[];return Ss(t,(I,E,D,x,A)=>{let V=E>=p||D>=g||x<c||A<h;if("data"in I){let L=I.data,G=L.properties.parentId||L.properties.id;if(r.includes(G)&&!a.has(G)){a.add(G);let U=Jt(e,L.geometry.coordinates);U<=i&&T.push({node:L,distance:U})}}return V}),T}#r;getNodeTreeByTypeAndFloorId(e,t,r){if(this.#e[e]||(this.#e[e]={}),this.#e[e][t]?.[r])return this.#e[e][t][r];this.#e[e][t]||(this.#e[e][t]={}),this.#e[e][t][r]=Qr();let n=this.#e[e][t][r];n.x(a=>{let s=a.geometry.coordinates;return this.#i(s[0],s[1]).x}),n.y(a=>{let s=a.geometry.coordinates;return this.#i(s[0],s[1]).y});let i=[];switch(e){case"space":i=this.#r.mvfSpacesByFloorId[r].flatMap(c=>c.properties.destinationNodes).map(c=>{let p=this.#r.mvfNodesById[c];return p?{...p,properties:{id:p.properties.id,parentId:p.properties.space[0]}}:null});break;case"node":i=this.#r.mvfNodesByFloorId[r]?.filter(c=>c.properties.neighbors.length>0)||[];break;case"point-of-interest":i=this.#r.mvfPoisByFloorId[r]||[];break;case"door":i=this.#r.mvfEntrancesByFloorId[r]||[];break;case"annotation":i=this.#r.mvfAnnotationsByFloorId[r]||[];break;case"enterprise-location":let s=this.#r.mvfNodesByFloorId[r]||[],l=this.#r.locationIdsByNodeId;i=[];for(let c=0;c<s.length;c++){let p=s[c],h=l[p.properties.id];h?.length>0&&i.push({...p,properties:{id:p.properties.id,parentId:h[0]}})}break}return i?.length>0&&n.addAll(i),n}#i;constructor(e,t){this.#r=e,this.#i=t}};f();f();f();f();function hi(o,e,t=0,r=o.length-1,n=tm){for(;r>t;){if(r-t>600){let l=r-t+1,c=e-t+1,p=Math.log(l),h=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*h*(l-h)/l)*(c-l/2<0?-1:1),T=Math.max(t,Math.floor(e-c*h/l+g)),I=Math.min(r,Math.floor(e+(l-c)*h/l+g));hi(o,e,T,I,n)}let i=o[e],a=t,s=r;for(Kr(o,t,e),n(o[r],i)>0&&Kr(o,t,r);a<s;){for(Kr(o,a,s),a++,s--;n(o[a],i)<0;)a++;for(;n(o[s],i)>0;)s--}n(o[t],i)===0?Kr(o,t,s):(s++,Kr(o,s,r)),s<=e&&(t=s+1),e<=s&&(r=s-1)}}function Kr(o,e,t){let r=o[e];o[e]=o[t],o[t]=r}function tm(o,e){return o<e?-1:o>e?1:0}var on=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,r=[];if(!mi(e,t))return r;let n=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let s=t.children[a],l=t.leaf?n(s):s;mi(e,l)&&(t.leaf?r.push(s):Ms(e,l)?this._all(s,r):i.push(s))}t=i.pop()}return r}collides(e){let t=this.data;if(!mi(e,t))return!1;let r=[];for(;t;){for(let n=0;n<t.children.length;n++){let i=t.children[n],a=t.leaf?this.toBBox(i):i;if(mi(e,a)){if(t.leaf||Ms(e,a))return!0;r.push(i)}}t=r.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let r=0;r<e.length;r++)this.insert(e[r]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let r=this.data;this.data=t,t=r}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=Ir([]),this}remove(e,t){if(!e)return this;let r=this.data,n=this.toBBox(e),i=[],a=[],s,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],s=a.pop(),c=!0),r.leaf){let p=om(e,r.children,t);if(p!==-1)return r.children.splice(p,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Ms(r,n)?(i.push(r),a.push(s),s=0,l=r,r=r.children[0]):l?(s++,r=l.children[s],c=!1):r=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let r=[];for(;e;)e.leaf?t.push(...e.children):r.push(...e.children),e=r.pop();return t}_build(e,t,r,n){let i=r-t+1,a=this._maxEntries,s;if(i<=a)return s=Ir(e.slice(t,r+1)),vr(s,this.toBBox),s;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),s=Ir([]),s.leaf=!1,s.height=n;let l=Math.ceil(i/a),c=l*Math.ceil(Math.sqrt(a));ed(e,t,r,c,this.compareMinX);for(let p=t;p<=r;p+=c){let h=Math.min(p+c-1,r);ed(e,p,h,l,this.compareMinY);for(let g=p;g<=h;g+=l){let T=Math.min(g+l-1,h);s.children.push(this._build(e,g,T,n-1))}}return vr(s,this.toBBox),s}_chooseSubtree(e,t,r,n){for(;n.push(t),!(t.leaf||n.length-1===r);){let i=1/0,a=1/0,s;for(let l=0;l<t.children.length;l++){let c=t.children[l],p=Es(c),h=im(e,c)-p;h<a?(a=h,i=p<i?p:i,s=c):h===a&&p<i&&(i=p,s=c)}t=s||t.children[0]}return t}_insert(e,t,r){let n=r?e:this.toBBox(e),i=[],a=this._chooseSubtree(n,this.data,t,i);for(a.children.push(e),tn(a,n);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(n,i,t)}_split(e,t){let r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);let a=this._chooseSplitIndex(r,i,n),s=Ir(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,vr(r,this.toBBox),vr(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,t){this.data=Ir([e,t]),this.data.height=e.height+1,this.data.leaf=!1,vr(this.data,this.toBBox)}_chooseSplitIndex(e,t,r){let n,i=1/0,a=1/0;for(let s=t;s<=r-t;s++){let l=en(e,0,s,this.toBBox),c=en(e,s,r,this.toBBox),p=am(l,c),h=Es(l)+Es(c);p<i?(i=p,n=s,a=h<a?h:a):p===i&&h<a&&(a=h,n=s)}return n||r-t}_chooseSplitAxis(e,t,r){let n=e.leaf?this.compareMinX:rm,i=e.leaf?this.compareMinY:nm,a=this._allDistMargin(e,t,r,n),s=this._allDistMargin(e,t,r,i);a<s&&e.children.sort(n)}_allDistMargin(e,t,r,n){e.children.sort(n);let i=this.toBBox,a=en(e,0,t,i),s=en(e,r-t,r,i),l=gi(a)+gi(s);for(let c=t;c<r-t;c++){let p=e.children[c];tn(a,e.leaf?i(p):p),l+=gi(a)}for(let c=r-t-1;c>=t;c--){let p=e.children[c];tn(s,e.leaf?i(p):p),l+=gi(s)}return l}_adjustParentBBoxes(e,t,r){for(let n=r;n>=0;n--)tn(t[n],e)}_condense(e){for(let t=e.length-1,r;t>=0;t--)e[t].children.length===0?t>0?(r=e[t-1].children,r.splice(r.indexOf(e[t]),1)):this.clear():vr(e[t],this.toBBox)}};function om(o,e,t){if(!t)return e.indexOf(o);for(let r=0;r<e.length;r++)if(t(o,e[r]))return r;return-1}function vr(o,e){en(o,0,o.children.length,e,o)}function en(o,e,t,r,n){n||(n=Ir(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let i=e;i<t;i++){let a=o.children[i];tn(n,o.leaf?r(a):a)}return n}function tn(o,e){return o.minX=Math.min(o.minX,e.minX),o.minY=Math.min(o.minY,e.minY),o.maxX=Math.max(o.maxX,e.maxX),o.maxY=Math.max(o.maxY,e.maxY),o}function rm(o,e){return o.minX-e.minX}function nm(o,e){return o.minY-e.minY}function Es(o){return(o.maxX-o.minX)*(o.maxY-o.minY)}function gi(o){return o.maxX-o.minX+(o.maxY-o.minY)}function im(o,e){return(Math.max(e.maxX,o.maxX)-Math.min(e.minX,o.minX))*(Math.max(e.maxY,o.maxY)-Math.min(e.minY,o.minY))}function am(o,e){let t=Math.max(o.minX,e.minX),r=Math.max(o.minY,e.minY),n=Math.min(o.maxX,e.maxX),i=Math.min(o.maxY,e.maxY);return Math.max(0,n-t)*Math.max(0,i-r)}function Ms(o,e){return o.minX<=e.minX&&o.minY<=e.minY&&e.maxX<=o.maxX&&e.maxY<=o.maxY}function mi(o,e){return e.minX<=o.maxX&&e.minY<=o.maxY&&e.maxX>=o.minX&&e.maxY>=o.minY}function Ir(o){return{children:o,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ed(o,e,t,r,n){let i=[e,t];for(;i.length;){if(t=i.pop(),e=i.pop(),t-e<=r)continue;let a=e+Math.ceil((t-e)/r/2)*r;hi(o,a,e,t,n),i.push(e,a,a,t)}}var yi=class extends on{#e;constructor(e){super(),this.#e=e}toBBox=e=>{let t=e.geoJSONBoundingBox;t==null&&C.warn(`Item "${e.id}" has no geoJSONBoundingBox; falling back to zero-size bbox at origin.`);let r=t!=null&&t.length===6,n=t?.[0]??0,i=t?.[1]??0,a=(r?t?.[3]:t?.[2])??0,s=(r?t?.[4]:t?.[3])??0,l=this.#e(n,i),c=this.#e(a,s);return{minX:l.x,minY:l.y,maxX:c.x,maxY:c.y}};compareMinX=(e,t)=>{let r=this.toBBox(e),n=this.toBBox(t);return r.minX-n.minX};compareMinY=(e,t)=>{let r=this.toBBox(e),n=this.toBBox(t);return r.minY-n.minY};search(e,t,r,n){if(typeof e=="object")return super.search(e);let i=this.#e(e,t),a=this.#e(r,n);return super.search({minX:i.x,minY:i.y,maxX:a.x,maxY:a.y})}searchCoordinate(e){return this.search(e.longitude,e.latitude,e.longitude,e.latitude)}};var bi=class{#e;#t;#o=new Map;constructor(e,t){this.#e=e,this.#t=t}getTreeByFloorId(e){let t=this.#o.get(e);if(t)return t;let r=new yi(this.#t),n=this.#e.floorsById[e];if(n){let i=[n,...n.spaces,...n.objects];for(let a of this.#e.areas)a.floor.id===e&&i.push(a);r.load(i)}return this.#o.set(e,r),r}searchAtCoordinate(e,t){return this.getTreeByFloorId(t).searchCoordinate(e)}getAllFloorIds(){return this.#e.floors.map(e=>e.id)}};f();function td(o,e){let t=111319.9*Math.cos(e*Math.PI/180);return(r,n)=>({x:(r-o)*t,y:(n-e)*111319.9})}var rn=class{#e;#t;#o;#r;constructor(e){let t=td(e.mapCenter.longitude,e.mapCenter.latitude);this.#o=new fi(e,t),this.#r=new bi(e,t),this.#e=new qr(e,this.#o),this.#t=new ui(this.#r)}__LEGACY_NEAREST_SYNC=(e,t,r)=>this.#e.__LEGACY_NEAREST_SYNC(e,t,r);async nearest(e,t,r){return this.#e.nearest(e,t,r)}async at(e){return this.#t.at(e)}};f();f();var Ti=class{#e;constructor(e){this.#e=e||[]}get raw(){return this.#e}};var xs=class o extends Fe{static is(e){return e.__type===o.__type}static __type="location-profile";__type=o.__type;id="loc_";name="";externalId;description;logo;logoImage;phone;social=[];images=[];links=[];website;icon;extra;searchTags;#e;#t={};#o;#r;constructor(e,t){super(t.mvf2Data.id),this.#e=e,this.#o=t.mvf2Data,this.#r=t.mvf3Data;for(let r in t.mvf2Data)r==="links"?this.links=t.mvf2Data.links.map(n=>new ko({mvfData:n})):r==="pictures"?this.images=t.mvf2Data.pictures.map(n=>n.url?new Qt({mvfData:{...n,url:n.url??""},mapData:this.#e}):void 0).filter(n=>n!=null):r==="website"?t.mvf2Data.website&&(this.website=new ko({mvfData:t.mvf2Data.website})):r==="icon"?t.mvf2Data.icon&&(this.icon=new Qt({mvfData:{url:t.mvf2Data.icon},mapData:this.#e})):r==="logo"?t.mvf2Data.logo&&(this.logoImage=new Qt({mvfData:{url:t.mvf2Data.logo},mapData:this.#e}),Object.defineProperty(this,"logo",{get(){return this.logoImage?.url}})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),r)||Object.defineProperty(this,r,{enumerable:!0,get(){return this.#o[r]}});this.#r&&(this.extra=this.#r.extra)}get spaces(){if(this.#t.spaces)return this.#t.spaces;if(this.#o.spaces==null)return this.#t.spaces=[],this.#t.spaces;this.#t.spaces=[];for(let e=0;e<this.#o.spaces.length;e++){let t=this.#e.getById("space",this.#o.spaces[e].id);t&&this.#t.spaces.push(t)}return this.#t.spaces}get points(){if(this.#t.points)return this.#t.points;if(this.#o.spaces==null)return this.#t.points=[],this.#t.points;this.#t.points=[];for(let e=0;e<this.#o.spaces.length;e++){let t=this.#e.getById("point-of-interest",this.#o.spaces[e].id);t&&this.#t.points.push(t)}return this.#t.points}get doors(){if(this.#t.doors)return this.#t.doors;if(this.#o.entrances==null)return this.#t.doors=[],this.#t.doors;this.#t.doors=[];for(let e=0;e<this.#o.entrances.length;e++){let t=this.#e.getById("door",this.#o.entrances[e].id);t&&this.#t.doors.push(t)}return this.#t.doors}get connections(){if(this.#t.connections)return this.#t.connections;if(this.#o.connections==null)return this.#t.connections=[],this.#t.connections;this.#t.connections=[];for(let e of this.#o.connections){let t=this.#e.getById("connection",e);t&&this.#t.connections.push(t)}return this.#t.connections}get annotations(){if(this.#t.annotations)return this.#t.annotations;if(this.#o.annotations==null)return this.#t.annotations=[],this.#t.annotations;this.#t.annotations=[];for(let e=0;e<this.#o.annotations.length;e++){let t=this.#e.getById("annotation",this.#o.annotations[e].id);t&&this.#t.annotations.push(t)}return this.#t.annotations}get categories(){return this.#t.categories?this.#t.categories:this.#o.categories==null?(this.#t.categories=[],this.#t.categories):(this.#t.categories=this.#o.categories.map(e=>this.#e.getById("location-category",e)).filter(e=>e!=null),this.#t.categories)}get mapObjects(){return this.#t.mapObjects?this.#t.mapObjects:this.#o.obstructions==null?(this.#t.mapObjects=[],this.#t.mapObjects):(this.#t.mapObjects=this.#o.obstructions.map(e=>this.#e.getById("object",e.id)).filter(e=>e!=null),this.#t.mapObjects)}get areas(){return this.#t.areas?this.#t.areas:this.#o.areas==null?(this.#t.areas=[],this.#t.areas):(this.#t.areas=this.#o.areas.map(e=>this.#e.getById("area",e.id)).filter(e=>e!=null),this.#t.areas)}get focusTarget(){if(this.#t.focusTarget)return this.#t.focusTarget;let e=[];for(let t of this.spaces)e.push(t);for(let t of this.connections)e.push(...t.coordinates);for(let t of this.doors)e.push(t.focusTarget);for(let t of this.mapObjects)e.push(t.focusTarget);for(let t of this.annotations)e.push(t.focusTarget);for(let t of this.points)e.push(t.focusTarget);for(let t of this.areas)e.push(t.focusTarget);return this.#t.focusTarget=e,e}get openingHours(){return this.#t.openingHours?this.#t.openingHours:(this.#t.openingHours=new Ti(this.#o.openingHoursSpecification??[]),this.#t.openingHours)}get navigationTarget(){if(this.#t.navigationTarget)return this.#t.navigationTarget;let e=[];for(let t of this.spaces)e.push(t);for(let t of this.connections)e.push(...t.coordinates);for(let t of this.doors)e.push(t.focusTarget);for(let t of this.mapObjects)e.push(t.focusTarget);for(let t of this.annotations)e.push(t.focusTarget);for(let t of this.points)e.push(t.focusTarget);return this.#t.navigationTarget=e,e}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}},co=xs;f();var Cs=class o extends Fe{static is(e){return e.__type===o.__type}static __type="location-category";__type=o.__type;id="cat_";name="";icon="";#e;#t={};#o;constructor(e,t){super(t.mvfData.id),this.#e=e,this.#o=t.mvfData;for(let r in t.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),r)||Object.defineProperty(this,r,{enumerable:!0,get(){return this.#o[r]}})}get parent(){return this.#t.parent?this.#t.parent:(this.#t.parent=this.#o.parent?this.#e.getById("location-category",this.#o.parent):void 0,this.#t.parent)}get children(){return this.#t.children?this.#t.children:(this.#t.children=this.#e.locationCategoriesByParentId[this.id]||[],this.#t.children)}get locationProfiles(){if(this.#t.locationProfiles)return this.#t.locationProfiles;let e=[];for(let t of this.#e.locationProfilesByCategoryId[this.id]||[]){let r=this.#e.getById("location-profile",t.id);r&&e.push(r)}return this.#t.locationProfiles=e,e}toJSON(){return{__type:o.__type,id:this.id,name:this.name}}},ai=Cs;var _s=.75;function sm(o){let e=[];if(o.geometry.type==="Polygon")for(let t=1;t<o.geometry.coordinates.length;t++)e.push({type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[t]]},properties:{...o.properties,id:ee()}});else if(o.geometry.type==="MultiPolygon")for(let t of o.geometry.coordinates)for(let r=1;r<t.length;r++)e.push({type:"Feature",geometry:{type:"Polygon",coordinates:[t[r]]},properties:{...o.properties,id:ee()}});return e}function lm(o){let e={},t=o["floor.geojson"]?.features??[];for(let r of t){let n=r.properties.id;if(!n)continue;let i=[];if(r.geometry!=null&&r.geometry.coordinates.length>0){let a=sm(r);for(let s of a)i.push(s)}e[n]={voids:{type:"FeatureCollection",features:i}}}return e}var Vo=class extends Mt{Analytics;#e={};Query;mvf;outdoorViewToken;objectEntranceNodeIdsByObstructionId;obstructionIdByEntranceId;venue;tokenManager;directions;enterpriseMode=!1;nodesById;spacesById;floorsById;floorStacksById;facadesById;facadesBySpaceId;connectionsById;objectsById;doorsById;pointsOfInterestById;annotationsById;areasById;locationProfilesById;locationCategoriesById;locationProfilesByExternalId;locationProfilesByCategoryId;locationCategoriesByParentId;doorsByNodeId;mvfAnnotationsById;mvfConnectionsById;mvfConnectionsByNodeId;mvfEntrancesById;mvfNodesById;mvfObstructionById;mvfSpacesById;mvfFloorsById;mvfFloorStacksById;mvfAreasById;spacesByExternalId;nodesByExternalId;objectsByExternalId;poisByExternalId;floorsByExternalId;floorStacksByExternalId;doorsByExternalId;areasByExternalId;locationProfilesByAttachedFeatureId={};entranceNodeIdsBySpaceId={};locationsById={};locationInstancesById={};instanceLocationsByPolygonId={};categoriesById={};mvfLocationsByGeometryId={};locationIdsByNodeId={};spaceIdsByNodeId={};objectIdsByNodeId={};connectionsByExternalId={};locationsByExternalId={};categoriesByExternalId={};destinationNodesIdsBySpaceId={};mvfNodesByFloorId;mvfSpacesByFloorId;mvfPoisByFloorId;mvfEntrancesByFloorId;mvfAnnotationsByFloorId;voidsByFloorId={};floorImagesByAnchorId=new Map;localePacksUrls;currentLanguage;languagePacks={};tilesets={};navigationFlags;binaryBundle;envControl;getMapDataOptions;#t;constructor(e,t){super();let r=t?.env??To();if(this.envControl=r,this.binaryBundle=t?.binaryBundle,this.Analytics=new tr,this.localePacksUrls=t?.localePacksUrls??{},this.mvf=e,this.outdoorViewToken=t?.outdoorViewToken,this.getMapDataOptions=t?.getMapDataOptions,this.#t=t?.mvf3,e["tileset.json"]?.default!=null&&(this.tilesets[e["tileset.json"].default.key]=e["tileset.json"].default,r.updateTileServerBaseUrl(e["tileset.json"].default.url),e["tileset.json"].others!=null))for(let i of e["tileset.json"].others)this.tilesets[i.key]=i;this.navigationFlags=e["navigationFlags.json"]??{},this.enterpriseMode=t?.enterprise??!1,this.tokenManager=t?.tokenManager;let n=ip(this,e,t?.mvf3);if(this.nodesById=n.nodesById,this.spacesById=n.spacesById,this.floorsById=n.floorsById,this.floorStacksById=n.floorStacksById,this.facadesById=n.facadesById,this.facadesBySpaceId=n.facadesBySpaceId,this.connectionsById=n.connectionsById,this.objectsById=n.objectsById,this.doorsById=n.doorsById,this.pointsOfInterestById=n.poisById,this.annotationsById=n.annotationsById,this.areasById=n.areasById,this.locationProfilesById=n.locationProfilesById,this.locationCategoriesById=n.locationCategoriesById,this.locationProfilesByCategoryId=n.locationProfilesByCategoryId,this.locationCategoriesByParentId=n.locationCategoriesByParentId,this.spacesByExternalId=n.spacesByExternalId,this.nodesByExternalId=n.nodesByExternalId,this.objectsByExternalId=n.objectsByExternalId,this.floorsByExternalId=n.floorsByExternalId,this.locationProfilesByExternalId=n.locationProfilesByExternalId,this.floorStacksByExternalId=n.floorStacksByExternalId,this.poisByExternalId=n.poisByExternalId,this.doorsByExternalId=n.doorsByExternalId,this.areasByExternalId=n.areasByExternalId,this.mvfAnnotationsById=n.mvfAnnotationsById,this.mvfConnectionsById=n.mvfConnectionsById,this.mvfConnectionsByNodeId=n.mvfConnectionsByNodeId,this.mvfEntrancesById=n.mvfEntrancesById,this.mvfNodesById=n.mvfNodesById,this.mvfObstructionById=n.mvfObstructionById,this.mvfSpacesById=n.mvfSpacesById,this.mvfFloorsById=n.mvfFloorsById,this.mvfFloorStacksById=n.mvfFloorStacksById,this.mvfNodesByFloorId=n.mvfNodesByFloorId,this.mvfSpacesByFloorId=n.mvfSpacesByFloorId,this.mvfPoisByFloorId=n.mvfPoisByFloorId,this.mvfEntrancesByFloorId=n.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=n.mvfAnnotationsByFloorId,this.mvfAreasById=n.mvfAreasById,this.doorsByNodeId=n.doorsByNodeId,this.objectEntranceNodeIdsByObstructionId=n.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=n.obstructionIdByEntranceId,this.locationProfilesByAttachedFeatureId=n.locationProfilesByAttachedFeatureId,this.entranceNodeIdsBySpaceId=n.entranceNodeIdsBySpaceId,this.spaceIdsByNodeId=n.spaceIdsByNodeId,this.objectIdsByNodeId=n.objectIdsByNodeId,this.destinationNodesIdsBySpaceId=n.destinationNodesIdsBySpaceId,this.voidsByFloorId=lm(e),this.enterpriseMode||nn()){let i=np(e,this);if(this.locationsById=i.locationsById,this.locationInstancesById=i.locationInstancesById,this.instanceLocationsByPolygonId=i.instanceLocationsByPolygonId,this.categoriesById=i.categoriesById,this.mvfLocationsByGeometryId=i.mvfLocationsByGeometryId,this.locationIdsByNodeId=i.locationIdsByNodeId,this.connectionsByExternalId=i.connectionsByExternalId,this.locationsByExternalId=i.locationsByExternalId,this.categoriesByExternalId=i.categoriesByExternalId,i.venue.name!=null){this.venue=new ps(this,{mvfData:i.venue});let a={};for(let s in i.mvfLocationsById)a[s]=i.mvfLocationsById[s];for(let s in i.mvfLocationInstancesById)a[s]=i.mvfLocationInstancesById[s];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":a,"enterprise-category":i.mvfCategoriesById,"floor-stack":n.mvfFloorStacksById,floor:n.mvfFloorsById}},t?.languagePacks?.forEach(({language:s,localePack:l})=>{this.languagePacks[s.code]=ja(l)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new br({nodes:e["node.geojson"],geojsonCollection:this.enterpriseMode&&e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode,flagDeclarations:e["navigationFlags.json"],getDoorByNodeId:(i=>{let a=this.doorsByNodeId[i];if(a!=null)return{geoJSON:a.geoJSON}})}),this.Query=new rn(this)}getEnv(){let e=this;return{get baseUri(){return e.envControl.getBaseUri()},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){return this.mvf["manifest.geojson"].features[0].properties.org_id??""}#o=new H(0,0,"initializing");get mapCenter(){return this.#o.floorId==="initializing"&&(this.#o=new H(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])),this.#o}get naturalBearing(){return this.mvf["manifest.geojson"].features[0].properties.naturalBearing??0}get spaces(){return this.#e.spaces==null&&(this.#e.spaces=globalThis.Object.values(this.spacesById)),this.#e.spaces}get objects(){return this.#e.objects==null&&(this.#e.objects=globalThis.Object.values(this.objectsById)),this.#e.objects}get connections(){return this.#e.connections==null&&(this.#e.connections=globalThis.Object.values(this.connectionsById)),this.#e.connections}get floors(){return this.#e.floors==null&&(this.#e.floors=globalThis.Object.values(this.floorsById)),this.#e.floors}get floorStacks(){return this.#e.floorStacks==null&&(this.#e.floorStacks=globalThis.Object.values(this.floorStacksById)),this.#e.floorStacks}get facades(){return this.#e.facades==null&&(this.#e.facades=globalThis.Object.values(this.facadesById)),this.#e.facades}get doors(){return this.#e.doors==null&&(this.#e.doors=globalThis.Object.values(this.doorsById)),this.#e.doors}get pointsOfInterest(){return this.#e.pointsOfInterest==null&&(this.#e.pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),this.#e.pointsOfInterest}get annotations(){return this.#e.annotations==null&&(this.#e.annotations=globalThis.Object.values(this.annotationsById)),this.#e.annotations}get areas(){return this.#e.areas==null&&(this.#e.areas=globalThis.Object.values(this.areasById)),this.#e.areas}get nodes(){return this.#e.nodes==null&&(this.#e.nodes=globalThis.Object.values(this.nodesById)),this.#e.nodes}get locations(){return this.#e.locations==null&&(this.#e.locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return this.#e.categories==null&&(this.#e.categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return this.#e.locationProfiles==null&&(this.#e.locationProfiles=globalThis.Object.values(this.locationProfilesById)),this.#e.locationProfiles}get locationCategories(){return this.#e.locationCategories==null&&(this.#e.locationCategories=globalThis.Object.values(this.locationCategoriesById)),this.#e.locationCategories}get mvfFloors(){return this.#e.mvfFloors==null&&(this.#e.mvfFloors=globalThis.Object.values(this.mvfFloorsById)),this.#e.mvfFloors}get mvfFloorStacks(){return this.#e.mvfFloorStacks==null&&(this.#e.mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),this.#e.mvfFloorStacks}getByType(e){switch(e){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;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[]}}getAllOfTypes(e,t){let r=e instanceof Set?e:new Set(e);return t!=null&&Array.isArray(t)?t.filter(n=>r.has(n.__type)):Array.from(r).flatMap(n=>this.getByType(n))}getById(e,t){let r={"location-profile":this.locationProfilesById,"location-category":this.locationCategoriesById,space:this.spacesById,floor:this.floorsById,"floor-stack":this.floorStacksById,facade:this.facadesById,node:this.nodesById,door:this.doorsById,connection:this.connectionsById,"mvf-connection":this.mvfConnectionsById,object:this.objectsById,"point-of-interest":this.pointsOfInterestById,annotation:this.annotationsById,area:this.areasById,"enterprise-location":a=>this.locationsById[a]??this.locationInstancesById[a],"enterprise-category":this.categoriesById},n=a=>{let s=r[a];if(s!=null)return typeof s=="function"?s(t):s[t]},i=()=>{for(let a of Object.keys(r)){let s=n(a);if(s!=null)return s}};return e==="unknown"?i():n(e)}getByExternalId(e,t){switch(e){case"location-profile":return this.locationProfilesByExternalId[t]??[];case"location-category":return[];case"space":return this.spacesByExternalId[t]??[];case"floor":return this.floorsByExternalId[t]??[];case"floor-stack":return this.floorStacksByExternalId[t]??[];case"node":return this.nodesByExternalId[t]??[];case"door":return this.doorsByExternalId[t]??[];case"connection":return this.connectionsByExternalId[t]??[];case"object":return this.objectsByExternalId[t]??[];case"point-of-interest":return this.poisByExternalId[t]??[];case"area":return this.areasByExternalId[t]??[];case"enterprise-location":return this.locationsByExternalId[t]??[];case"enterprise-category":return this.categoriesByExternalId[t]??[];default:return[]}}getMapDataById(e){return this.spacesById[e]??this.floorsById[e]??this.floorStacksById[e]??this.facadesById[e]??this.nodesById[e]??this.doorsById[e]??this.connectionsById[e]??this.objectsById[e]??this.pointsOfInterestById[e]??this.annotationsById[e]??this.areasById[e]}getMVFFeatureById(e,t){switch(e){case"space":return this.mvfSpacesById[t];case"node":return this.mvfNodesById[t];case"obstruction":return this.mvfObstructionById[t];case"floor":return this.mvfFloorsById[t];case"floor-stack":return this.mvfFloorStacksById[t];case"connection":return this.mvfConnectionsById[t];case"entrance":return this.mvfEntrancesById[t];case"annotation":return this.mvfAnnotationsById[t];case"area":return this.mvfAreasById[t];default:throw new Error(`Unknown MVF feature type: ${e}`)}}getMVFFeatureByNodeId(e,t){switch(e){case"connection":return this.mvfConnectionsByNodeId[t];default:throw new Error(`Unsupported MVF feature type: ${e}`)}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error(`Unsupported MVF feature type: ${e}`)}}propTranslationCache=new Map;getPropTranslation(e,t,r,n){if(!this.currentLanguage)return n;let{code:i}=this.currentLanguage,a=this.languagePacks[i]?.optimized?.[e];if(a){let s=a[r];if(s!=null&&s[t]!==void 0){let l=s[t];if(l!=null&&typeof l=="object"){if(typeof n=="object"&&typeof l=="object"&&!Array.isArray(l)){let c=Wn(i+e+r+t.toString());if(this.propTranslationCache.has(c))return this.propTranslationCache.get(c);let p=Ul(n,l,["id"]);return this.propTranslationCache.set(c,p),p}return l}return l}}return n}findPreferredLanguage(e){if(!this.venue)return;let t=Ps(this.venue,e);return e?.languageCode!=null&&e.languageCode.toLowerCase()!==t.code.toLowerCase()&&C.warn(`Language code "${e.languageCode}" could not be found in the venue. Using "${t.code}" instead.`),t}#r;async changeLanguage(e){let t=e.toLowerCase();if(!t){C.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){C.error("Changing the language is not supported for this map.");return}let r=this.currentLanguage.code,n=this.venue?.languages.find(({code:a})=>a.toLowerCase()===t.toLowerCase());if(!n){C.warn(`Language code "${t}" could not be found in the venue.`);return}if(r===n.code)return;let i=this.languagePacks[n.code];if(!i){let a=this.localePacksUrls[n.code];if(!a){C.error(`Locale pack URL not found for language code "${n.code}".`);return}this.#r&&this.#r.abort();let s=new AbortController;this.#r=s;let l;try{l=await zc(a,{signal:s.signal})}catch(c){C.error(`Failed to download language pack for language code "${n.code}".`,c);return}if(!l||s.signal.aborted)return;i=ja(l),this.languagePacks[n.code]=i}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=n,this.publish("language-change",this.currentLanguage)}__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC=(e,t,r)=>this.__LEGACY_GET_DIRECTIONS_SYNC(e,t,{...r,multiDestination:!0});__LEGACY_GET_DIRECTIONS_SYNC=(e,t,r)=>{let{accessible:n=!1,multiDestination:i=!1}=r||{},a=od(this.enterpriseMode,r),s=r?.zones||[],l={accessible:n,zones:s,smoothing:a,excludedConnections:r?.excludedConnections||[],connectionIdWeightMap:r?.connectionIdWeightMap||{},includeNonPublic:r?.includeNonPublic??!1};if(i&&Array.isArray(t)){let c=Array.isArray(e)?e:[e],p=[];for(let h of t){let g=Array.isArray(h)?h:[h],T=this.directions.getDirectionsSync(c,g,l,this);if(!T){C.error("getDirections failed due to missing directions for one of the segments");return}c=g,p.push(T)}return p}else{let c=Array.isArray(e)?e:[e],p=Array.isArray(t)?t:[t];if(Array.isArray(p[0])){C.error("getDirections does not support multi-destination without multisegment option");return}c[0].id&&p[0].id&&this.Analytics.sendGetDirectionsEvent(c[0].id,p[0].id,n);try{return this.directions.getDirectionsSync(c,p,l,this)}catch(h){C.error("Unable to get directions",h);return}}};getDirections=async(e,t,r)=>{let{accessible:n=!1}=r||{},i=od(this.enterpriseMode,r),a=r?.zones||[],s={accessible:n,zones:a,smoothing:i,excludedConnections:r?.excludedConnections||[],connectionIdWeightMap:r?.connectionIdWeightMap||{},includeNonPublic:r?.includeNonPublic??!1},l=Array.isArray(e)?e:[e],c=Array.isArray(t)?t:[t];if(Array.isArray(c[0])){C.error("getDirections does not support multi-destination without multisegment option");return}l[0].id&&c[0].id&&this.Analytics.sendGetDirectionsEvent(l[0].id,c[0].id,n);try{return this.directions.getDirections(l,c,s,this)}catch(p){C.error("Unable to get directions",p);return}};getDirectionsMultiDestination=async(e,t,r)=>Promise.resolve(this.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,t,r));getDistance(e,t){let r=Io(e),n=Io(t);return Jt([r.longitude,r.latitude],[n.longitude,n.latitude])}getDoorByNodeId=e=>this.doorsByNodeId[e];transformImageRequest=async e=>{if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!Yc(e))return{url:e};if(Zc(e))return{url:e};let t=sr(e);if(!t)return{url:e};try{let n=(await this.tokenManager?.getSasTokensAsync())?.tokens?.[t.mapId];if(n==null)throw new Error("SAS token not found");let[i]=e.split("?");return{url:`${i}?${n.token}`}}catch(r){return C.error("Failed to append SAS token to image request. Requests for private images may fail.",r),{url:e}}};async toJSONBundle({downloadLanguagePacks:e=!0}={}){let t=[];if(e&&this.enterpriseMode){let r=new AbortController;for(let n of this.venue?.languages||[])try{if(this.localePacksUrls[n.code]){let i=await Aa(this.localePacksUrls[n.code],{signal:r.signal}),a=await ir(i);a&&t.push({language:{code:n.code,name:n.name},localePack:a})}}catch(i){C.warn("failed downloading language pack",i)}}return{type:"json",options:{enterprise:this.enterpriseMode,mvf3:this.#t},languagePacks:t,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){if(!this.binaryBundle){C.error("binary bundle not found");return}let t=[];if(e&&this.enterpriseMode){let r=new AbortController;for(let n of this.venue?.languages||[])try{if(this.localePacksUrls[n.code]){let i=await Aa(this.localePacksUrls[n.code],{signal:r.signal});i&&t.push({language:{code:n.code,name:n.name},localePack:i})}}catch(i){C.warn("failed downloading language pack",i)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:t,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(this.#e))this.#e[e]=null;this.propTranslationCache.clear()}};var od=(o,e)=>{let t=!o,r=e?.smoothing,i=r!=null?typeof r=="object"?r.enabled??t:r:t,a=typeof r=="object"?r.radius:void 0,s=typeof r=="object"?r.__EXPERIMENTAL_METHOD??"greedy-los":"greedy-los";return s==="dp-optimal"?{enabled:i,radius:a??_s,__EXPERIMENTAL_METHOD:"dp-optimal",includeDoorBufferNodes:typeof r=="object"&&r.__EXPERIMENTAL_METHOD==="dp-optimal"?r.__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:void 0}:s==="rdp"?{enabled:i,radius:a??_s,__EXPERIMENTAL_METHOD:"rdp",mustIncludeDoorBufferNodes:typeof r=="object"&&r.__EXPERIMENTAL_METHOD==="rdp"?r.__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES:void 0}:{enabled:i,radius:a??_s,__EXPERIMENTAL_METHOD:s}};f();f();f();f();f();var po=class o{id;text;target;static __type="label";__type=o.__type;static is(e){return e.__type===o.__type}get focusTarget(){return this.target.anchorTarget}constructor(e,t,r){this.id=e,this.text=t,this.target=r}get navigationTarget(){return this.target.anchorTarget}};f();var oo=class o{id;static __type="marker";#e;get target(){return this.#e}get coordinate(){return this.#e.anchorTarget}get navigationTarget(){return this.target.anchorTarget}toJSON(){return{id:this.id,__type:o.__type,target:this.target,coordinate:this.coordinate}}__type=o.__type;contentEl;static is(e){return e.__type===o.__type}constructor(e,t,r){this.id=e,this.contentEl=t,this.#e=r}get focusTarget(){return this.target.anchorTarget}updateTarget(e){this.#e=e}};f();var jo=class o{id;groupId;static __type="model";__type=o.__type;#e;get target(){return this.#e}static is(e){return e.__type===o.__type}constructor(e,t,r){this.id=e,this.groupId=t,this.#e=r}updateTarget(e){this.#e=e}toJSON(){return{id:this.id,__type:o.__type,groupId:this.groupId,target:this.#e}}get navigationTarget(){return this.#e.anchorTarget}};f();var xo=class o{id;coordinates;#e;static __type="path-segment";__type=o.__type;static is(e){return e.__type===o.__type}constructor(e,t){this.id=e,this.coordinates=t}get isConnectionSegment(){return this.coordinates.length===2&&this.coordinates[0].floorId!==this.coordinates[1].floorId}get distance(){return this.#e?this.#e:(this.#e=Ha(this.coordinates),this.#e)}get focusTarget(){return this.coordinates}},_t=class o{id;animation;coordinates;segments;#e;static __type="path";__type=o.__type;static is(e){return e.__type===o.__type}get focusTarget(){return this.coordinates}constructor(e,t,r,n){this.id=e,this.animation=t,this.coordinates=r,this.segments=n.map(({id:i,coordinates:a})=>new xo(i.toString(),a))}get distance(){return this.#e?this.#e:(this.#e=Ha(this.coordinates),this.#e)}toJSON(){return{__type:o.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};f();var cm=7,an=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t?.precision??cm}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){let e=this.#e.center;if(this.#t===-1)return e;let t=Yn(e.latitude,this.#t),r=Yn(e.longitude,this.#t);return new H({latitude:t,longitude:r,floorId:e.floorId,verticalOffset:e.verticalOffset})}get bearing(){return this.#e.bearing}get pitch(){return this.#e.pitch}get zoomLevel(){return Yn(this.#e.zoomLevel,5)}};f();var uo=class o{id;static __type="shape";__type=o.__type;static is(e){return e.__type===o.__type}get focusTarget(){return this}constructor(e){this.id=e}};f();var fo=class o{id;constructor(e,t){this.id=e,this.target=t}target;static __type="text-3d";__type=o.__type;static is(e){return e.__type===o.__type}};f();f();f();var pm=new Map([["search-16x16",`<svg viewBox="0 0 16 16">
7
+ <path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ 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"
11
+ stroke="none"
12
+ />
13
+ </svg>`],["close-16x16",`<svg viewBox="0 0 16 16">
14
+ <path
15
+ 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"
16
+ stroke="none"
17
+ />
18
+ <path
19
+ 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"
20
+ stroke="none"
21
+ />
22
+ </svg>`],["empty-64x40",`<svg viewBox="0 0 64 40">
23
+ <g>
24
+ <g clipPath="url(#clip0_499_175492)">
25
+ <path
26
+ 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"
27
+ stroke="none"
28
+ fill="#F5F5F5"
29
+ />
30
+ <path
31
+ 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"
32
+ fill="none"
33
+ />
34
+ <path
35
+ 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"
36
+ fill="#FAFAFA"
37
+ />
38
+ </g>
39
+ <defs>
40
+ <clipPath id="clip0_499_175492">
41
+ <rect width="64" height="40" fill="white" />
42
+ </clipPath>
43
+ </defs>
44
+ </g>
45
+ </svg>`],["caret-12x12",`<svg viewBox="0 0 12 12">
46
+ <path
47
+ stroke="none"
48
+ 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"
49
+ />
50
+ </svg>`],["plus-16x16",`<svg viewBox="0 0 16 16">
51
+ <path
52
+ 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"
53
+ stroke="none"
54
+ />
55
+ </svg>`],["recenter-16x16",`<svg viewBox="0 0 16 16">
56
+ <g stroke="none">
57
+ <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" />
58
+ <path
59
+ fillRule="evenodd"
60
+ clipRule="evenodd"
61
+ 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"
62
+ />
63
+ <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" />
64
+ </g>
65
+ </svg>`],["minus-16x16",`<svg viewBox="0 0 16 16">
66
+ <path
67
+ 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"
68
+ stroke="none"
69
+ />
70
+ </svg>`],["logo-horizontal-206x48",`<svg viewBox="0 0 206 48">
71
+ <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" />
72
+ <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" />
73
+ <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" />
74
+ <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" />
75
+ </svg>`],["share-16x16",`<svg viewBox="0 0 16 16">
76
+ <path
77
+ fillRule="evenodd"
78
+ clipRule="evenodd"
79
+ 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"
80
+ stroke="none"
81
+ />
82
+ </svg>`],["checkmark-16x16",`<svg viewBox="0 0 16 16">
83
+ <path
84
+ fillRule="evenodd"
85
+ clipRule="evenodd"
86
+ 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"
87
+ stroke="none"
88
+ />
89
+ </svg>`],["arrow-right-16x16",`<svg viewBox="0 0 16 16">
90
+ <path
91
+ fillRule="evenodd"
92
+ clipRule="evenodd"
93
+ 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"
94
+ stroke="none"
95
+ />
96
+ </svg>`],["arrow-up-16x16",`<svg viewBox="0 0 16 16">
97
+ <path
98
+ fillRule="evenodd"
99
+ clipRule="evenodd"
100
+ 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"
101
+ stroke="none"
102
+ />
103
+ </svg>`],["connection-stairs-16x16",`<svg viewBox="0 0 16 16">
104
+ <g stroke="none">
105
+ <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" />
106
+ <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />
107
+ <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />
108
+ <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" />
109
+ </g>
110
+ </svg>`],["connection-stairs-14x14",`<svg viewBox="0 0 14 14">
111
+ <path
112
+ 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"
113
+ stroke="none"
114
+ />
115
+ </svg>`],["connection-stairs-12x12",`<svg viewBox="0 0 12 12" stroke="none">
116
+ <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" />
117
+ <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" />
118
+ <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" />
119
+ <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" />
120
+ </svg>`],["connection-escalator-16x16",`<svg viewBox="0 0 16 16">
121
+ <g stroke="none">
122
+ <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" />
123
+ <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />
124
+ <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" />
125
+ </g>
126
+ </svg>`],["connection-escalator-14x14",`<svg viewBox="0 0 14 14">
127
+ <path
128
+ 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"
129
+ stroke="none"
130
+ />
131
+ <path
132
+ 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"
133
+ stroke="none"
134
+ />
135
+ </svg>`],["connection-elevator-16x16",`<svg viewBox="0 0 16 16">
136
+ <g stroke="none">
137
+ <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" />
138
+ <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" />
139
+ <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />
140
+ <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />
141
+ </g>
142
+ </svg>`],["connection-elevator-14x14",`<svg viewBox="0 0 14 14">
143
+ <path
144
+ 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"
145
+ stroke="none"
146
+ />
147
+ <path
148
+ 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"
149
+ stroke="none"
150
+ />
151
+ <path
152
+ 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"
153
+ stroke="none"
154
+ />
155
+ </svg>`],["connection-elevator-12x12",`<svg viewBox="0 0 12 12" stroke="none">
156
+ <circle cx="1.9375" cy="4.4375" r="0.9375" />
157
+ <circle cx="1.9375" cy="7.5625" r="0.9375" />
158
+ <path
159
+ fillRule="evenodd"
160
+ clipRule="evenodd"
161
+ 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"
162
+ />
163
+ </svg>`],["new-tab-14x14",`<svg viewBox="0 0 14 14">
164
+ <g stroke="none">
165
+ <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" />
166
+ <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" />
167
+ </g>
168
+ </svg>`],["compress-16x16",`<svg viewBox="0 0 16 16">
169
+ <g stroke="none">
170
+ <path
171
+ id="Vector"
172
+ 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"
173
+ />
174
+ </g>
175
+ </svg>`],["washroom-14x14",`<svg viewBox="0 0 14 14" stroke="none">
176
+ <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" />
177
+ <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" />
178
+ <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" />
179
+ <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" />
180
+ <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" />
181
+ </svg>`],["point-of-interest-12x12",`<svg viewBox="0 0 12 12" stroke="none">
182
+ <path
183
+ stroke="none"
184
+ id="Subtract"
185
+ // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs
186
+ fill-rule="evenodd"
187
+ clip-rule="evenodd"
188
+ 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"
189
+ />
190
+ </svg>`],["flag-20x20",`<svg viewBox="0 0 20 20" stroke="none">
191
+ <path
192
+ 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"
193
+ stroke="none"
194
+ />
195
+ </svg>`],["link-16x16",`<svg viewBox="0 0 16 16" stroke="none">
196
+ <path
197
+ 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"
198
+ stroke="none"
199
+ />
200
+ </svg>`]]),dm=/<svg([^>]*)>/g;function rd(o,e,t){let r=pm.get(o);return r?r.replace(dm,`<svg$1 style="fill:${e}; width:${t}px; height:${t}px">`):""}var um=o=>`
201
+ <div class="pin-shadow" style="background: ${o}"></div>
202
+ <svg width="${20*.9}px" height="${48*.9}px" viewBox="0 0 20 48">
203
+ <path
204
+ 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"
205
+ fill="${o}"
206
+ stroke="white"
207
+ strokeWidth="2"
208
+ />
209
+ </svg>
210
+ `,fm=o=>`
211
+ <div class="pin-shadow" style="background: ${o}"></div>
212
+ <svg width="36" height="42" viewBox="-2 -2 40 46">
213
+ <path
214
+ 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"
215
+ fill="none"
216
+ stroke="white"
217
+ strokeWidth="4"
218
+ />
219
+ <path
220
+ 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"
221
+ fill="${o}"
222
+ />
223
+ </svg>
224
+ `,Os="#722ED1",Ds="#1890FF",nd=({type:o="departure",color:e=Ds,animated:t})=>`<div class="${t===!1?"":"dropped-pin-wrapper"}">
225
+ ${o==="departure"?um(e):fm(e)}
226
+ </div>`,hm=o=>{switch(o){case"default":return 28;case"selection":return 28;case"navigation":return 32}},id=({type:o="stairs",color:e=Os,direction:t="up",animated:r})=>{let n=hm("default"),i=n/2+2,a=t&&t!=="none";return`<div class="mappedin-connection-marker">
227
+ <div class="connection-circle"
228
+ role="button"
229
+ style="background:${e}; width:${n}px; height:${n}px;"
230
+ >
231
+ ${rd("connection-"+o+"-16x16","white",i)||""}
232
+ </div>
233
+ ${a?`<div style="margin-left: -${n*.2}px;">
234
+ <div class="${r===!1?"":"bouncey"}">
235
+ <div class="connection-circle"
236
+ role="button"
237
+ style="width: ${n}px; height: ${n}px;">
238
+ <div class="${t==="up"?"":"arrow--down"}">
239
+ <svg viewBox="0 0 16 16" style="fill: white; width: ${i}px; height: ${i}px">
240
+ <path
241
+ fillRule="evenodd"
242
+ clipRule="evenodd"
243
+ 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"
244
+ stroke="none"
245
+ />
246
+ </svg>
247
+ </div>
248
+ </div>
249
+ </div>
250
+ </div>`:""}
251
+ </div>`};f();var ad=63710088e-1,vi=new WeakMap,sd=async o=>new Promise(e=>setTimeout(e,o));function Sr(o,e,t){let r=o.distance;if(r===0)return 0;let n=ym(o,e,t);return n?(r-n.distance)/r:0}function Ii(o,e){if(o.coordinates.length===0)return[];if(vi.has(o)&&vi.get(o).has(e))return vi.get(o).get(e);let t=o.coordinates.map(r=>Er(r,e));return vi.set(o,new Map([[e,t]])),t}function Er(o,e){let t=e.latitude,r=e.longitude,n=o.latitude-t,i=o.longitude-r,a=Math.PI*ad/180,s=a*Math.cos(t*Math.PI/180),l=i*s,c=n*a;return{x:l,y:c}}function gm(o,e,t){if(o.length===0)return;let r=t??e,n,i=1/0,a=Er(e,r);for(let s=0;s<o.length;s++){let l=o[s],c=Ii(l,r);for(let p=0;p<c.length-1;p++){let h=c[p],g=c[p+1],T=sn(h,g,a),I=Ao(a,T);I<i&&(i=I,n=T)}}if(n)return mm(n,r)}function sn(o,e,t){let r=e.x-o.x,n=e.y-o.y,i=t.x-o.x,a=t.y-o.y,s=r*r+n*n;if(s===0)return{x:o.x,y:o.y};let l=(i*r+a*n)/s,c=Math.max(0,Math.min(1,l));return{x:o.x+c*r,y:o.y+c*n}}function mm(o,e){let r=Math.PI*ad/180,n=r*Math.cos(e.latitude*Math.PI/180),i=o.y/r,a=o.x/n,s=e.latitude+i,l=e.longitude+a;return new H({latitude:s,longitude:l,floorId:e.floorId,verticalOffset:e.verticalOffset})}function ym(o,e,t){let r=gm([o],e,t);if(!r)return;let n=Ii(o,t),i=Er(r,t),a=-1,s=1/0;for(let c=0;c<n.length-1;c++){let p=n[c],h=n[c+1],g=sn(p,h,i),T=Ao(g,i);T<1&&T<s&&(s=T,a=c)}if(a===-1){let c=0,p=1/0;for(let h=0;h<n.length;h++){let g=n[h],T=Ao(g,i);T<p&&(p=T,c=h)}a=Math.max(0,c-1)}let l=[r];for(let c=a+1;c<o.coordinates.length;c++)l.push(o.coordinates[c]);return new xo(`${o.id}_remaining`,l)}function ld(o,e,t){if(o.length===0)return;let r,n=1/0,i=Er(e,t);for(let a of o){let s=Ii(a,t),l=1/0;for(let c=0;c<s.length-1;c++){let p=s[c],h=s[c+1],g=sn(p,h,i),T=Ao(g,i);T<l&&(l=T),T<n&&(n=T,r=a)}}return r}function ln(o,e,t,r){let n,i,a=1/0,s=1/0,l=Er(e,r),c=Er(t,r);for(let h of o)for(let g of h.segments){if(g.isConnectionSegment)continue;let T=g.coordinates[0]?.floorId,I=T===e.floorId,E=T===t.floorId;if(!I&&!E)continue;let D=Ii(g,r);if(I){let x=1/0;for(let A=0;A<D.length-1;A++){let V=D[A],L=D[A+1],G=sn(V,L,l),U=Ao(G,l);U<x&&(x=U)}x<a&&(a=x,n=g)}if(E){let x=1/0;for(let A=0;A<D.length-1;A++){let V=D[A],L=D[A+1],G=sn(V,L,c),U=Ao(G,c);U<x&&(x=U)}x<s&&(s=x,i=g)}}if(!n||!i)return;let p=[];if(n.id===i.id)return p.push({segment:n,startHighlightFraction:Sr(n,e,r),endHighlightFraction:Sr(i,t,r)}),p;for(let h of o)for(let g of h.segments)g.id===n.id?p.push({segment:g,startHighlightFraction:Sr(g,e,r),endHighlightFraction:1}):g.id===i.id?p.push({segment:g,startHighlightFraction:0,endHighlightFraction:Sr(g,t,r)}):p.push({segment:g,startHighlightFraction:0,endHighlightFraction:1});return p}function cd([o,e],[t,r],[n,i],a=!1){let s=t-o,l=r-e,c=s**2+l**2;if(c===0)return;let p,h;if(a){let I=(e+r+i)/3,E=Math.cos(I*Math.PI/180),D=o*E,x=e,A=t*E,V=r,L=n*E,G=i,U=A-D,R=V-x,j=U*U+R*R;if(j===0)return;if(p=((L-D)*U+(G-x)*R)/j,p<=0)h=[o,e];else if(p>=1)h=[t,r];else{let te=D+p*U,fe=x+p*R;h=[te/E,fe]}}else p=((n-o)*s+(i-e)*l)/c,p<=0?h=[o,e]:p>=1?h=[t,r]:h=[o+p*s,e+p*l];let g=Jt([n,i],h),T;if(a){let I=n-h[0],E=i-h[1],D=Math.sqrt(I*I+E*E),x=Math.sqrt(s*s+l*l);if(D>0&&x>0){let V=(I*s+E*l)/(D*x);T=Math.acos(Math.abs(V))*(180/Math.PI)}}return{proportion:a?p:Math.max(0,Math.min(1,p)),intersection:h,distance:g,angle:T}}function pd(o,e,t){let r=t/111e3,n=[];for(let i of e){let a=(o.latitude+i.latitude)/2,s=Math.cos(a*Math.PI/180),l=o.longitude*s,c=o.latitude,p=i.longitude*s,h=i.latitude;Math.sqrt((l-p)**2+(c-h)**2)>r&&n.push(i)}return n}f();var bm=10;function Tm(o){switch(o){case"solid":return{dashed:!1,displayArrowsOnPath:!1};case"dashed-stripes":return{dashed:!0,displayArrowsOnPath:!1,__EXPERIMENTAL_DASH_OPTIONS:{__EXPERIMENTAL_DASH_MODE:"absolute",__EXPERIMENTAL_DASH_METERS:2,__EXPERIMENTAL_GAP_METERS:.2}};case"dashed-sparse":return{dashed:!0,displayArrowsOnPath:!1,__EXPERIMENTAL_DASH_OPTIONS:{__EXPERIMENTAL_DASH_MODE:"absolute",__EXPERIMENTAL_DASH_METERS:1,__EXPERIMENTAL_GAP_METERS:2}};case"bordered":return{dashed:!1,displayArrowsOnPath:!1,__EXPERIMENTAL_GEOMETRY:"ribbon",__EXPERIMENTAL_BORDER:{enabled:!0,color:"darken",width:.15}};case"dashed-boxes":default:return{dashed:!0,displayArrowsOnPath:!1,__EXPERIMENTAL_DASH_OPTIONS:{__EXPERIMENTAL_DASH_MODE:"absolute",__EXPERIMENTAL_DASH_METERS:1,__EXPERIMENTAL_GAP_METERS:.5}}}}var Si=class{#e;#t;#o;#r=new Set;#i=new Set;#n;#s=-1;constructor(e){this.#e=e}get isActive(){return this.#t!==void 0||this.#r.size>0}#c(){return this.#t!==void 0||this.#o!==void 0||this.#r.size>0||this.#i.size>0||this.#n!==void 0}get isShowingOutsideThresholdPath(){return this.#o!==void 0}tetherToCoordinate(e,t={}){let r=this.#e.activePath;if(!r)return null;let n=t?.tetherThresholdDistance??bm,i;for(let L of r.segments){if(L.isConnectionSegment)continue;let G=L.coordinates;for(let U=0;U<G.length-1;U++){let R=G[U],j=G[U+1];if(e.floorId&&!(R.floorId===e.floorId&&j.floorId===e.floorId))continue;let te=cd([R.longitude,R.latitude],[j.longitude,j.latitude],[e.longitude,e.latitude],!0);te&&(!i||te.distance<i.distance)&&(i={path:r,segment:L,edgeIndex:U,distance:te.distance,intersection:te.intersection})}}if(!i)return this.#a(),null;let a=i.distance<n,s=t.coordinateOutsideThresholdMode??"tether-and-dash";if(!a&&s==="untether")return this.#c()&&this.clear(),null;this.#o&&(this.#e.removeTetheredPath(this.#o),this.#o=void 0);let{path:l,segment:c,edgeIndex:p,intersection:h}=i,g=l.segments,T=g.findIndex(L=>L.id===c.id);if(this.#n?.id!==c.id){this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let L=this.#s;if(T>L)for(let G=Math.max(0,L+1);G<=T;G++){let U=g[G];this.#r.has(U)||(this.#e.updateState(U,{visible:!1}),this.#r.add(U))}else if(T<L)for(let G=T+1;G<=L&&G<g.length;G++){let U=g[G];this.#r.has(U)&&(this.#e.updateState(U,{visible:!0}),this.#r.delete(U))}this.#n=c,this.#s=T}else this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let E=c.coordinates,D=E.slice(p+1,E.length),x=new H({latitude:h[1],longitude:h[0],floorId:e.floorId}),A=pd(x,D,2.5);A.length===0&&D.length>0&&(A=[D[D.length-1]]);let V;if(a)V=[e,x,...A],this.#t=this.#e.createTetheredPath(V,{...this.#e.options.pathOptions,animateDrawing:!1,__EXPERIMENTAL_SMOOTHING_TENSION:.15,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:1.5,...t.tetherPathOptions});else{let L=this.#h(x,e,n);if(V=[L,x,...A],this.#t=this.#e.createTetheredPath(V,{...this.#e.options.pathOptions,animateDrawing:!1,__EXPERIMENTAL_SMOOTHING_TENSION:.15,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:1.5,...t.tetherPathOptions}),s==="tether-and-dash"){let G=Tm(t.outsideThresholdPathStyle??"dashed-boxes");this.#o=this.#e.createTetheredPath([e,L],{...this.#e.options.pathOptions,animateDrawing:!1,...G,...t?.outsideThresholdPathOptions})}}return t.hideMarkersOutsideThreshold?this.#e.markers.forEach(L=>{let G=L?.marker;if(!G)return;let U=this.#d(G.coordinate,D,g,T);this.#e.updateState(G,{enabled:U}),U?this.#i.delete(G):this.#i.add(G)}):this.#i.size>0&&this.#l(),V}clear(){this.#a(),this.#e.markers.forEach(e=>{let t=e?.marker;t&&this.#e.updateState(t,{enabled:!0})})}#a(){this.#o&&(this.#e.removeTetheredPath(this.#o),this.#o=void 0),this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);for(let e of this.#r)this.#e.updateState(e,{visible:!0});this.#r.clear(),this.#n=void 0,this.#s=-1,this.#l()}#l(){for(let e of this.#i)this.#e.updateState(e,{enabled:!0});this.#i.clear()}#d(e,t,r,n){for(let i=0;i<t.length;i++)if(t[i].isEqual(e))return!0;for(let i=n+1;i<r.length;i++){let a=r[i].coordinates;for(let s=0;s<a.length;s++)if(a[s].isEqual(e))return!0}return!1}#h(e,t,r){let n=Jt([e.longitude,e.latitude],[t.longitude,t.latitude]);if(r>=n)return new H({latitude:t.latitude,longitude:t.longitude,floorId:e.floorId});let i=r/n,a=e.latitude+i*(t.latitude-e.latitude),s=e.longitude+i*(t.longitude-e.longitude);return new H({latitude:a,longitude:s,floorId:e.floorId})}};f();var Ei=class{#e;#t=new Set;#o;#r=-1;#i=0;#n;constructor(e){this.#e=e}get isActive(){return this.#t.size>0||this.#o!==void 0}get travelledFraction(){let e=this.#e.activePath;if(!e)return 0;let t=0,r=0;for(let n of e.segments){let i=n.distance;t+=i,this.#t.has(n)?r+=i:n===this.#o&&(r+=i*this.#i)}return t===0?0:Math.min(1,r/t)}travelledUptoCoordinate(e,t){let r=this.#e.activePath;if(!r)return null;let n=t?.color??"#999";this.#n&&this.#n!==r.id&&this.#s(this.#n),this.#n=r.id;let i=this.#e.getMapCenter(),a=r.segments.filter(g=>{if(g.isConnectionSegment)return!1;let T=g.coordinates[0]?.floorId;return!e.floorId||T===e.floorId}),s=ld(a,e,i);if(!s)return null;let l=r.segments,c=l.findIndex(g=>g.id===s.id);if(this.#o?.id!==s.id){let g=this.#r;if(c>g){for(let T=Math.max(0,g+1);T<c;T++){let I=l[T];this.#t.has(I)||(this.#e.updateState(I,{travelledEndFraction:1,travelledColor:n}),this.#t.add(I))}if(g>=0&&g<c){let T=l[g];this.#t.has(T)||(this.#e.updateState(T,{travelledEndFraction:1,travelledColor:n}),this.#t.add(T))}}else if(c<g){for(let T=c+1;T<=g&&T<l.length;T++){let I=l[T];this.#t.has(I)?(this.#e.updateState(I,{travelledEndFraction:0}),this.#t.delete(I)):I===this.#o&&this.#e.updateState(I,{travelledEndFraction:0})}this.#t.delete(l[c])}this.#o=s,this.#r=c}let h=Sr(s,e,i);return this.#i=h,this.#e.updateState(s,{travelledEndFraction:h,travelledColor:n}),h}#s(e){let t=this.#e.allPaths.find(r=>r.id===e);if(t){this.#o&&t.segments.some(n=>n.id===this.#o.id)&&(this.#e.updateState(this.#o,{travelledEndFraction:0}),this.#o=void 0,this.#r=-1,this.#i=0);for(let r of t.segments)this.#t.has(r)&&(this.#e.updateState(r,{travelledEndFraction:0}),this.#t.delete(r))}}resetTravelledOnOtherPaths(){let e=this.#e.activePath;if(!e)return;this.#o&&(e.segments.some(n=>n.id===this.#o.id)||(this.#e.updateState(this.#o,{travelledEndFraction:0}),this.#o=void 0,this.#r=-1,this.#i=0));for(let r of this.#e.allPaths)if(r.id!==e.id)for(let n of r.segments)this.#e.updateState(n,{travelledEndFraction:0});let t=[];for(let r of this.#t)e.segments.some(i=>i.id===r.id)||t.push(r);for(let r of t)this.#t.delete(r)}clear(){for(let e of this.#t)this.#e.updateState(e,{travelledEndFraction:0});this.#t.clear(),this.#o&&this.#e.updateState(this.#o,{travelledEndFraction:0}),this.#o=void 0,this.#r=-1,this.#i=0,this.#n=void 0}};var dd=.01,ud=.02,Mi=0,fd={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},vm={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},Co={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:fd,inactivePathOptions:vm,markerOptions:{departureColor:Ds,destinationColor:Os},animatePathDrawing:!0};function Mr(o){let e={...o};return e.__EXPERIMENTAL_ENDCAP_EXTENSION=[0,0],o.__EXPERIMENTAL__CONNECTION_COLOR!==void 0&&(e.color=o.__EXPERIMENTAL__CONNECTION_COLOR),o.__EXPERIMENTAL__CONNECTION_JUNCTION_INSET!==void 0&&(e.__EXPERIMENTAL_JUNCTION_INSET=o.__EXPERIMENTAL__CONNECTION_JUNCTION_INSET),o.__EXPERIMENTAL__CONNECTION_DASHED!==void 0&&(e.dashed=o.__EXPERIMENTAL__CONNECTION_DASHED),o.__EXPERIMENTAL__CONNECTION_GEOMETRY!==void 0&&(e.__EXPERIMENTAL_GEOMETRY=o.__EXPERIMENTAL__CONNECTION_GEOMETRY),o.__EXPERIMENTAL__CONNECTION_BILLBOARDING!==void 0&&(e.__EXPERIMENTAL_BILLBOARDING=o.__EXPERIMENTAL__CONNECTION_BILLBOARDING),e}var Im={...Co,connectionPathOptions:Mr(fd)},cn=class{#e=new Map;#t=new Map;#o=new Map;#r;#i;#n=Im;#s;#c;#a=[];#l;#d=new Map;#h=new Map;#u;#f;#p=null;get isMultiFloor(){if(!this.#a.length)return!1;let e=new Set;for(let t of this.#a)for(let r of t.coordinates)if(r.floorId&&(e.add(r.floorId),e.size>1))return!0;return!1}constructor(e){this.#r=e;let t=this;this.#u=new Si({get activePath(){return t.#l},get options(){return t.#n},get markers(){return t.#e},updateState:(r,n)=>this.#r.updateState(r,n),createTetheredPath:(r,n)=>this.#_(r,n),removeTetheredPath:r=>this.#S(r)}),this.#f=new Ei({get activePath(){return t.#l},get allPaths(){return t.paths},getMapCenter:()=>this.#r.getMapData().mapCenter,updateState:(r,n)=>this.#r.updateState(r,n)})}#m(e){return e!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(e.type)}getPathById(e){return this.#t.get(e)}getMarkerById(e){return this.#e.get(e)}get paths(){let e=new Set;return this.#t.forEach(t=>e.add(t)),Array.from(e)}get activeDirections(){return this.#h.get(this.#l)}get activePath(){if(this.#l)return this.#t.get(this.#l.id)}get floorStacks(){let e=this.#r.getMapData();if(!this.#a.length||!e)return[];let t=new Set;for(let r of this.#a)for(let n of r.coordinates)if(n.floorId){let i=e.getById("floor",n.floorId);i&&t.add(i.floorStack)}return Array.from(t)}get floors(){let e=this.#r.getMapData();if(!this.#a.length||!e)return[];let t=new Set;for(let r of this.#a)for(let n of r.coordinates)if(n.floorId){let i=e.getById("floor",n.floorId);i&&t.add(i)}return Array.from(t)}setActivePathByIndex(e){let t=this.#a[e];if(!this.#a.length){C.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#a[e]){C.warn(`Direction #${e} does not exist`);return}let r=this.#d.get(t);if(!r){C.warn("The direction is not a part of muli-direcional path");return}this.#v(r)}setActivePath(e){if(!this.#a.length){C.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#h.get(e)){C.warn(`Path "${e.id}" is not a part of muli-direcional path`);return}this.#v(e)}#y(){if(!this.#l)return;let e=this.#t.get(this.#l.id);if(e){for(let t of this.#t.values())if(t.id.includes("internal-"))if(t.id===this.#l.id)for(let r of e.segments)this.#r.updateState(r,{verticalOffset:ud});else this.#r.updateState(t,{verticalOffset:dd})}}setActivePathByDirections(e){if(!this.#a.length){C.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let t=this.#d.get(e);if(!t){let r=this.#a.find(n=>n.id===e.id);if(!r){C.warn("[setActivePathByDirections] Cannot find directions for id");return}t=this.#d.get(r)}if(!t){C.warn("[setActivePathByDirections] Cannot find path for directions");return}this.#v(t)}clearHighlightedPathSection(){this.#i=void 0;for(let e of this.paths)for(let t of e.segments)this.#r.updateState(t,{highlightStartFraction:0,highlightEndFraction:0,highlightCompleteFraction:0});for(let e of this.#o.values())for(let t of e.segments)this.#r.updateState(t,{highlightStartFraction:0,highlightEndFraction:0,highlightCompleteFraction:0})}trackCoordinate(e,t){return this.#a.length?(this.#p&&this.#p!==t.mode&&this.stopTracking(),this.#p=t.mode,t.mode==="tethered"?this.#u.tetherToCoordinate(e,t):this.#f.travelledUptoCoordinate(e,t)):null}stopTracking(){this.#p==="tethered"?this.#u.clear():this.#p==="travelled"&&this.#f.clear(),this.#p=null}get currentTrackingMode(){return this.#p}get isTracking(){return this.#p==="tethered"?this.#u.isActive:this.#p==="travelled"?this.#f.isActive:!1}get isShowingOutsideThresholdPath(){return this.#u.isShowingOutsideThresholdPath}get travelledFraction(){return this.#p!=="travelled"?null:this.#f.travelledFraction}highlightPathSection(e,t,r){let n=r?.animationDuration??1500,i=this.#r.getMapData().mapCenter,a=ln(this.paths,e,t,i);if(!a)return;this.clearHighlightedPathSection(),this.#i={from:e,to:t,options:r};let s=a.map(p=>(this.#r.updateState(p.segment,{highlightStartFraction:p.startHighlightFraction,highlightEndFraction:p.endHighlightFraction,highlightColor:r?.color??"red",highlightWidthMultiplier:r?.widthMultiplier??1}),new ao({fraction:0}).to({fraction:1},n).onUpdate(h=>{this.#r.updateState(p.segment,{highlightCompleteFraction:h.fraction})}))),l=()=>{},c=new Promise(p=>{l=p});return s.length>0&&(s.forEach((p,h)=>{h<s.length-1&&p.chain(s[h+1]),this.#r.tweenGroup().add(s[h])}),s[0].start(),s[s.length-1].onComplete(()=>{this.#r.tweenGroup().remove(s[s.length-1]),l()})),{animation:c}}#S(e){this.#o.delete(e.id),this.#r.currentMap.Paths.remove(e.segments.map(t=>t.id.toString()))}drawSync(e,t={}){this.#c&&this.clear(),this.#c=!0,this.#x(t);let r=Array.isArray(e)?e:[e],n=r[0],i=r[r.length-1],a=n.coordinates[0];this.#a=r,a.floorId&&this.#n.setMapToDeparture&&this.#r.setFloor(a.floorId),this.#n.createMarkers?.departure&&this.#g("departure",n.instructions[0]);for(let s=0;s<r.length;s++){let l=r[s];if(l.coordinates.length<2){C.warn("Directions must have at least 2 coordinates");return}let c=s===Mi,p=c?this.#n.pathOptions:this.#n.inactivePathOptions,h=this.#b(c?"active":"inactive"),g={...Mr(p),animateDrawing:this.#n.animatePathDrawing,verticalOffset:h},T=this.#E(l.coordinates,{...p,animateDrawing:this.#n.animatePathDrawing,verticalOffset:h},g);this.#d.set(l,T),this.#h.set(T,l),this.#n.createMarkers?.connection&&this.#C(l.instructions,"connection"),c&&(this.#l=this.#d.get(this.#a[Mi]),this.#r.externalPubSub.on("click",this.#I))}this.#n.createMarkers?.destination&&this.#g("destination",i.instructions[i.instructions.length-1]),this.#r.mapObjects.forEach(s=>{s.processFloorChange(s.currentFloorId)}),this.#T()}#E(e,t,r){let n=t.id?.toString()??ee(),i=this.#r.currentMap.Paths.add(e,t,r),a=new _t(n,i.animation,e,i.paths);this.#t.set(n,a);for(let s of i.paths)this.#t.set(s.id.toString(),a);return a}#_(e,t){let r=t.id?.toString()??ee(),n=this.#r.currentMap.Paths.add(e,t),i=new _t(r,n.animation,e,n.paths);return this.#o.set(r,i),this.#P(i),i}#P(e){if(!this.#i)return;let{from:t,to:r,options:n}=this.#i,i=this.#r.getMapData().mapCenter,a=ln([e],t,r,i);if(a)for(let s of a)this.#r.updateState(s.segment,{highlightStartFraction:s.startHighlightFraction,highlightEndFraction:s.endHighlightFraction,highlightColor:n?.color??"red",highlightWidthMultiplier:n?.widthMultiplier??1,highlightCompleteFraction:1})}#O(e){this.#t.delete(e.id),this.#r.currentMap.Paths.remove(e.segments.map(t=>t.id.toString()))}#M(e,t,r=!1){let n=this.#n.markerOptions.animated,i=this.#r.currentMap.Markers.add(e.coordinate,t,{interactive:r,placement:"top",rank:"always-visible",animated:n}),a=this.#r.currentMap.Markers.getContentEl(i.id.toString());if(!a)throw new Error("marker component should exist");return new oo(i.id.toString(),a,e.coordinate)}#b(e){return e==="active"?ud+(this.#n.pathOptions?.verticalOffset??0):dd+(this.#n.inactivePathOptions?.verticalOffset??0)}#D(e){let t=e[0],r=e[e.length-1],n=!1;return this.#s={promise:new Promise(async i=>{if(S.env.NODE_ENV!=="test"&&await sd(500),n||!e.length){i();return}this.#n.createMarkers?.departure&&this.#g("departure",t.instructions[0]);for(let a=0;a<e.length;a++){let s=e[a];if(s.coordinates.length<2){C.warn("Directions must have at least 2 coordinates"),i();return}let l=a===Mi,c=l?this.#n.pathOptions:this.#n.inactivePathOptions,p=this.#b(l?"active":"inactive"),h={...Mr(c),animateDrawing:this.#n.animatePathDrawing,verticalOffset:p},g=this.#E(s.coordinates,{...c,animateDrawing:this.#n.animatePathDrawing,verticalOffset:p},h);if(this.#d.set(s,g),this.#h.set(g,s),l&&(this.#l=this.#d.get(this.#a[Mi]),this.#r.externalPubSub.on("click",this.#I)),S.env.NODE_ENV!=="test"&&await g.animation,n){i();return}this.#n.createMarkers?.connection&&this.#C(s.instructions,"connection")}if(this.#n.createMarkers?.destination&&this.#g("destination",r.instructions[r.instructions.length-1]),n){i();return}this.#r.mapObjects.forEach(a=>{a.processFloorChange(a.currentFloorId)}),this.#T(),i()}),cancel:()=>{n=!0}},this.#s.promise}#x(e){let t={...Co.pathOptions,...e.pathOptions};this.#n={setMapOnConnectionClick:e.setMapOnConnectionClick??Co.setMapOnConnectionClick,setMapToDeparture:e.setMapToDeparture??Co.setMapToDeparture,pathOptions:t,inactivePathOptions:{...Co.inactivePathOptions,...e.inactivePathOptions},connectionPathOptions:Mr(t),createMarkers:{...Co.createMarkers,...e.createMarkers},markerOptions:{...Co.markerOptions,...e.markerOptions},animatePathDrawing:e.animatePathDrawing??Co.animatePathDrawing}}#T(){this.#r.publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})}async draw(e,t={}){this.#s&&this.clear(),this.#x(t);let r=Array.isArray(e)?e:[e],i=r[0].coordinates[0];return this.#a=r,i.floorId&&this.#n.setMapToDeparture&&this.#r.setFloor(i.floorId),this.#D(r)}#v(e){this.#l=e,this.#p==="tethered"?this.#u.clear():this.#p==="travelled"&&this.#f.resetTravelledOnOtherPaths();let t=Mr(this.#n.pathOptions),r=Mr(this.#n.inactivePathOptions);this.#a.forEach(n=>{let i=this.#d.get(n);if(i){let a=i.id===this.#l.id,s={...a?this.#n.pathOptions:this.#n.inactivePathOptions,verticalOffset:this.#b(a?"active":"inactive")},l={...a?t:r,verticalOffset:this.#b(a?"active":"inactive")};for(let c of i.segments){let p=c.isConnectionSegment?l:s;this.#r.updateState(c,p)}}}),this.#r.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),this.#y(),this.#T()}#g(e,t){if(e==="connection"&&t){let r=t.action.type==="ExitConnection"?this.#n.markerOptions.departureColor:this.#n.markerOptions.destinationColor,n;typeof this.#n.createMarkers?.connection=="function"?(n=this.#n.createMarkers.connection(t),this.#r.updateState(n,{interactive:!0})):n=this.#M(t,id({type:t.action.connection?.type??t.action.connectionType,color:r,direction:t.action.direction,animated:this.#n.markerOptions.animated}),!0),this.#e.set(n.id,{instruction:t,marker:n})}else{let r=e==="departure"?this.#n.markerOptions.departureColor:this.#n.markerOptions.destinationColor,n;typeof this.#n.createMarkers?.departure=="function"&&e==="departure"?n=this.#n.createMarkers.departure(t):typeof this.#n.createMarkers?.destination=="function"&&e==="destination"?n=this.#n.createMarkers.destination(t):n=this.#M(t,nd({type:e,color:r,animated:this.#n.markerOptions.animated})),this.#e.set(n.id,{instruction:t,marker:n})}}#C(e,t){e.filter(n=>this.#m(n.action)).forEach(n=>{this.#g(t,n)})}#I=e=>{if(this.#n.createMarkers?.connection&&e.markers!=null&&e.markers.length>0){let{instruction:t}=this.#e.get(e.markers[0].id);t?.action.toFloor&&(this.#n.setMapOnConnectionClick&&this.#r.setFloor(t.action.toFloor.id,"navigation-connection-click"),this.#r.publish("navigation-connection-click",{instruction:t,fromFloor:t.action.fromFloor,toFloor:t.action.toFloor}))}};clear(){this.stopTracking(),this.#e.forEach(e=>{e?.marker&&this.#r.currentMap.Markers.remove(e.marker.id.toString())}),this.#e.clear(),this.#t.forEach(e=>{this.#O(e)}),this.#t.clear(),this.#o.forEach(e=>{this.#S(e)}),this.#o.clear(),this.#i=void 0,this.#s&&(this.#s.cancel(),this.#s=void 0),this.#c&&(this.#c=!1),this.#a=[],this.#d.clear(),this.#h.clear(),this.#l=void 0,this.#r.externalPubSub.off("click",this.#I),this.#r.mapObjects.forEach(e=>{e.processFloorChange(e.currentFloorId)}),this.#T()}};f();var pn=class{#e;#t;constructor(e){this.#t=e,this.#e=e.core}interactions={set:e=>{e?.pan!=null&&(this.#e.getSystems().cameraSystem.enablePan=e.pan),e?.zoom!=null&&(this.#e.getSystems().cameraSystem.enableZoom=e.zoom),e?.bearingAndPitch!=null&&(this.#e.getSystems().cameraSystem.enableRotate=e.bearingAndPitch)},enable:()=>{this.#e.getSystems().cameraSystem.enablePan=!0,this.#e.getSystems().cameraSystem.enableZoom=!0,this.#e.getSystems().cameraSystem.enableRotate=!0},disable:()=>{this.#e.getSystems().cameraSystem.enablePan=!1,this.#e.getSystems().cameraSystem.enableZoom=!1,this.#e.getSystems().cameraSystem.enableRotate=!1}};setScreenOffsets(e){this.#e.camera.setInsetPadding(e)}get screenOffsets(){return this.#e.camera.insetsPadding}get panMode(){return this.#e.camera.panMode}setPanMode(e){if(e!=="default"&&e!=="elevation")throw new Error("Invalid pan mode");e!==this.panMode&&this.#e.camera.setPanMode(e)}getFocusOnTransform(e,t){let r=this.#e.camera.getCameraFrameForCoordinates(this.#r(e),{pitch:t?.pitch,bearing:t?.bearing,padding:t?.screenOffsets||this.screenOffsets,maxZoomLevel:t?.maxZoomLevel,verticalPadding:t?.axisAlignedPadding?.vertical,minZoomLevel:t?.minZoomLevel,duration:t?.duration,easing:t?.easing,debugKey:e,debugColor:t?.debugColor});return{center:new H(r.center[1],r.center[0]),zoomLevel:r.zoomLevel,bearing:t?.bearing??this.bearing,pitch:t?.pitch??this.pitch}}#o(e){let t=this.#e.camera.elevation;return H.is(e)&&e.floorId!=null?this.#e.getState(e.floorId)?.altitude??t:ct.is(e)?this.#e.getState(e.id)?.altitude??t:"floor"in e&&ct.is(e.floor)?this.#e.getState(e.floor.id)?.altitude??t:t}#r(e){let t=[],n=(Array.isArray(e)?e:[e]).flatMap(i=>i?.focusTarget??[i]);for(let i of n)if(i!=null)if(H.is(i)){let a=this.#o(i);t.push([i.longitude,i.latitude,a])}else if(i?.id!=null){if(fr.is(i)){let l=this.#t.getFloorStackAltitudeData(i.id);for(let c of i.floors){let p=l.get(c.elevation),h=p?.altitude??this.#e.camera.elevation,g=p!=null?p.altitude+p.visualHeight:h;la(c.geoJSON,T=>{t.push([T[0],T[1],h]),g!==h&&t.push([T[0],T[1],g])})}continue}let a=this.#o(i);if(ct.is(i)&&this.#t.getMapDataInternal()?.enterpriseMode){t.push(i.id);continue}else if("geoJSON"in i&&i.geoJSON.geometry.coordinates.length>0){la(i.geoJSON,l=>{t.push([l[0],l[1],a])});continue}let s=this.#e.getBoundingArea(i.id);if(s)t.push(...s.map(l=>[l[0],l[1],a]));else if("geoJSONBoundingBox"in i){let l=this.#o(i);if(i.geoJSONBoundingBox!=null){let c=[[i.geoJSONBoundingBox[0],i.geoJSONBoundingBox[1],l],[i.geoJSONBoundingBox[2],i.geoJSONBoundingBox[3],l]];t.push(...c)}}}else qc(i)&&t.push(i);return t}focusOn(e,t){return this.#e.camera.focusOn(this.#r(e),{pitch:t?.pitch,bearing:t?.bearing,padding:t?.screenOffsets||this.screenOffsets,maxZoomLevel:t?.maxZoomLevel,minZoomLevel:t?.minZoomLevel,duration:t?.duration,verticalPadding:t?.axisAlignedPadding?.vertical,easing:t?.easing})}animateTo(e,t){let{center:r,zoomLevel:n,bearing:i,pitch:a}=e,s=r??this.center;return this.#e.camera.animateTo({center:r!=null?[s.longitude,s.latitude,this.#e.camera.elevation]:void 0,zoomLevel:n,bearing:i,pitch:a,duration:t?.duration??600,easing:t?.easing})}set(e){let{center:t=this.center,zoomLevel:r=this.zoomLevel,bearing:n=this.bearing,pitch:i=this.pitch}=e,a=[t.longitude,t.latitude];this.#e.camera.setCenter(a),this.#e.camera.setZoomLevel(r),this.#e.camera.setBearing(n),this.#e.camera.setPitch(i)}get center(){let e=this.#e.camera.center;return new H(e[1],e[0],void 0)}setAutoMinZoomLevel(e){this.#e.camera.setAutoMinZoomLevel(e)}get autoMinZoomLevel(){return this.#e.camera.autoMinZoomLevel}get zoomLevel(){return this.#e.camera.zoomLevel}get pitch(){return this.#e.camera.pitch}get minPitch(){return this.#e.camera.minPitch}get maxPitch(){return this.#e.camera.maxPitch}setMinPitch=e=>{this.#e.camera.setMinPitch(e)};setMaxPitch=e=>{this.#e.camera.setMaxPitch(e)};get bearing(){let e=this.#e.camera.bearing;return(e<0?e+360:e)%360}get minZoomLevel(){return this.#e.camera.minZoomLevel}setMinZoomLevel=e=>{this.#e.camera.setMinZoomLevel(e,!0)};get maxZoomLevel(){return this.#e.camera.maxZoomLevel}setMaxZoomLevel=e=>{this.#e.camera.setMaxZoomLevel(e)};setElevation(e){this.#e.camera.setElevation(e)}get elevation(){return this.#e.camera.elevation}get maxElevation(){return this.#e.camera.maxElevation}setMaxElevation(e){this.#e.camera.setMaxElevation(e)}animateElevation(e,t){return this.#e.camera.animateElevation(e,t)}get bounds(){return ci(this.#e.getSystems().cameraSystem.panBounds,this.#e.convert3DMapPositionToCoordinate)}get isAnimating(){return this.#e.camera.isAnimating}cancelAnimation(){this.#e.camera.cancelAnimation()}updateFacadesInView(){this.#e.getSystems().geometryInFocusSystem.compute()}};f();var dn=class{#e;get currentMap(){return this.#e()}constructor({currentMapGetter:e}){this.#e=e}async getCurrentSceneGLTF(e){let t=this.#e();return t?t?.Exporter.getCurrentSceneGLTF(e):(C.error("There is no map to export. Please load a map first."),new Blob)}};f();var un=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getAll(){return Array.from(this.#e.values()).map(e=>e.label)}getById(e){return this.#e.get(e)}add(e,t,r){let n=e.anchorTarget,i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Labels.add(n,t,{...r,attachTo:mr(e),rank:r?.rank==null||r?.rank==="initial"?"medium":r.rank}),s=new po(a.id.toString(),t,e);return this.#e.set(s.id,{label:s,entityId:s.id}),s}__EXPERIMENTAL__all(e){let t=[];return this.currentMap?.Labels.all({onCreate:(r,n,i)=>{let a=new po(r.toString(),n,i);this.#e.set(a.id,{label:a,entityId:a.id}),t.push(a)},labelOptions:e}),t}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Labels.remove(t),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(({label:t})=>{this.remove(t),e.push(t),this.#e.delete(t.id.toString())}),e}};f();f();f();f();var hd=Hn(ns(),1);function Sm(o,e){var t=Qo(o),r=Qo(e),n=o.properties||{},i=hd.default.difference(t.coordinates,r.coordinates);return i.length===0?null:i.length===1?zn(i[0],n):Xn(i,n)}var gd=Sm;var md=.2,yd=.1,Go=nc.UNDERGROUND_MASK,Em=!1;function bd(o){if(!o||o.length<3)return null;let e=[],t=0;for(let s=0;s<o.length;s++){let l=o[s],c=`${l[0]},${l[1]}`,p=!1;for(let h=0;h<e.length;h++)if(e[h]===c){p=!0;break}p||(e.push(c),t++)}if(t<3)return null;let r=o[0],n=o[o.length-1];if(r[0]===n[0]&&r[1]===n[1])return o;let a=[];for(let s=0;s<o.length;s++)a.push(o[s]);return a.push(r),a}function Td(o,e){let t=[];if(o.type==="Polygon"){let r=bd(o.coordinates[0]);r&&t.push(r)}else if(o.type==="MultiPolygon")for(let r of o.coordinates){let n=bd(r[0]);n&&t.push(n)}return{type:"Feature",geometry:{type:"MultiLineString",coordinates:t},properties:e||{}}}var fn=class{renderer;mapObject;config;wallsId;maskedWallsId;voidWallsId;maskedVoidWallsId;ceilingId;ceilingMaskId;basementMaskId;extrudedPolygonId;footprintColor;layer;groupContainer;constructor(e,t,r,n){this.renderer=e,this.mapObject=t,this.config=n;let i=ro;if(n.obstructions!=null&&n.obstructions.features.length>0){let s=n.obstructions.features.filter(l=>l.geometry.type==="LineString"&&l.properties.kind?.toLowerCase()==="wall"&&l.properties.footprintComponent===!0);if(s!=null&&s.length>0){let l=n.styleMap[s[0].properties?.id];l!=null&&(i=l)}}this.footprintColor=i.color;let a=!n.multiFloorView?.footprintsHidden;this.groupContainer=this.renderer.addGroupContainer(`Footprint-${n.floorId}`,{visible:a},r),this.layer=this.renderer.addGroupContainer(`${Jr}-${n.floorId}`,{visible:a},this.groupContainer.id.toString())}getFloorAltitudes(){return this.mapObject.getFloorStackAltitudeData(this.config.floorStackId)}getVisualHeight(){return this.config.fixedHeight!=null?this.config.fixedHeight:(this.getFloorAltitudes()??new Map).get(this.config.elevation)?.visualHeight??0}get footprintGeometry(){return this.config.footprintGeometry}buildWalls(){let r=Td(this.config.footprintGeometry.geometry,{id:`Footprint-Floor-${this.config.floorId}`}).geometry.coordinates.map((s,l)=>({type:"Feature",geometry:{type:"LineString",coordinates:s},properties:{id:`Footprint-Floor-Section-${this.config.floorId}-${l}`}})),n=this.getVisualHeight(),i="front";this.wallsId=`Footprint-Walls-${this.config.floorId}`;let a={color:this.footprintColor,height:n,altitude:0,width:yd,outline:!1,visible:!0,opacity:1,side:i,renderOrder:2};this.config.elevation<0&&(a.__EXPERIMENTAL_maskMode="masked-object",a.__EXPERIMENTAL_maskEffect="reveal",a.__EXPERIMENTAL_maskEnabled=!0,a.__EXPERIMENTAL_maskId=Go),this.renderer.addFeatureCollection(this.wallsId,{features:r},a,void 0,this.groupContainer)}buildVoidWalls(e){if(!e||e.length===0)return;let t=[],r=0;for(let s of e){let l=Td(s.geometry,{id:`Void-Wall-${this.config.floorId}-${r}`});for(let c of l.geometry.coordinates)t.push({type:"Feature",geometry:{type:"LineString",coordinates:c},properties:{id:`Void-Wall-Section-${this.config.floorId}-${r}`}}),r++}if(t.length===0)return;let n=this.getVisualHeight(),i="front";this.voidWallsId=`Void-Walls-${this.config.floorId}`;let a={color:this.footprintColor,height:n,altitude:0,width:yd,outline:!1,visible:!0,opacity:1,side:i,renderOrder:2};this.config.elevation<0&&(a.__EXPERIMENTAL_maskMode="masked-object",a.__EXPERIMENTAL_maskEffect="reveal",a.__EXPERIMENTAL_maskEnabled=!0,a.__EXPERIMENTAL_maskId=Go),this.renderer.addFeatureCollection(this.voidWallsId,{features:t},a,void 0,this.groupContainer)}buildExtrudedPolygon(){this.extrudedPolygonId=`Footprint-Extruded-${this.config.floorId}`;let e=this.getVisualHeight(),t={color:this.footprintColor,height:e,altitude:0,visible:!0,outline:!1,opacity:1,side:"front",renderOrder:2};this.config.elevation<0&&(t.__EXPERIMENTAL_maskMode="masked-object",t.__EXPERIMENTAL_maskEffect="reveal",t.__EXPERIMENTAL_maskEnabled=!0,t.side="back",t.__EXPERIMENTAL_maskId=Go);let r=ws(this.config.footprintGeometry);this.renderer.addFeatureCollection(this.extrudedPolygonId,{features:[{...r,properties:{id:`Footprint-Extruded-Geometry-${this.config.floorId}`,externalId:this.config.externalId,elevation:this.config.elevation}}]},t,void 0,this.groupContainer)}buildCeiling(e){let t={...this.config.footprintGeometry};t=ws(t),e?.length>0&&(t=Mm(t,e));let r="front";this.ceilingId=`Ceiling-${this.config.floorId}`;let n={color:this.footprintColor,height:-md,altitude:0,visible:!0,outline:!1,opacity:1,side:r};this.config.elevation<0&&(n.__EXPERIMENTAL_maskMode="masked-object",n.__EXPERIMENTAL_maskEffect="reveal",n.__EXPERIMENTAL_maskEnabled=!0,n.__EXPERIMENTAL_maskId=Go),this.renderer.addFeatureCollection(this.ceilingId,{features:[{...t,properties:{id:`Footprint-Ceiling-${this.config.floorId}`,externalId:this.config.externalId,elevation:this.config.elevation}}]},n,{altitude:this.getVisualHeight()},this.groupContainer)}buildBasementMask(e=[]){let t=this.config.footprintGeometry;for(let n of e)try{let i=ni(t,n);i&&(t=i)}catch{}t=ws(t),this.basementMaskId=`Footprint-Basement-Mask-${this.config.floorId}`;let r={color:vd(-1),altitude:0,visible:!0,height:.01,outline:!1,__EXPERIMENTAL_maskEnabled:!0,__EXPERIMENTAL_maskMode:"mask",__EXPERIMENTAL_maskId:Go};if(this.renderer.addFeatureCollection(this.basementMaskId,{features:[{...t,properties:{id:`Footprint-Basement-Mask-Geometry-${this.config.floorId}`}}]},r,void 0,"outdoors-container"),Em){let n={color:vd(-1),altitude:0,opacity:.5,visible:!1,height:.01,outline:!1};this.renderer.addFeatureCollection(this.basementMaskId+"debug",{features:[{...t,properties:{id:`Footprint-Basement-Mask-Geometry-${this.config.floorId}-debug`}}]},n,void 0,"outdoors-container")}}update(e){if(e.basementMaskEnabled!==void 0&&this.basementMaskId&&(this.renderer.setState(this.basementMaskId,{visible:e.basementMaskEnabled}),this.renderer.setState(this.basementMaskId+"debug",{visible:e.basementMaskEnabled})),this.config.multiFloorView?.footprintsHidden)return;let t={};if(e.altitude!==void 0&&(t.altitude=e.altitude),e.visible!==void 0&&(t.visible=e.visible),Object.keys(t).length>0&&this.renderer.setState(this.groupContainer.id,t),this.extrudedPolygonId){let i={};e.opacity!==void 0&&(i.opacity=e.opacity),e.side!==void 0&&(i.side=e.side),e.color!==void 0&&(i.color=e.color),e.outline!==void 0&&(i.outline=e.outline),e.height!==void 0&&(i.height=e.height),Object.keys(i).length>0&&this.renderer.setState(this.extrudedPolygonId,i);return}let r={};e.opacity!==void 0&&(r.opacity=e.opacity),e.side!==void 0&&(r.side=e.side),e.color!==void 0&&(r.color=e.color),e.outline!==void 0&&(r.outline=e.outline);let n={};if(e.height!==void 0&&(r.height=e.height,n.altitude=e.height),this.wallsId&&Object.keys(r).length>0&&this.renderer.setState(this.wallsId,r),this.voidWallsId&&Object.keys(r).length>0&&this.renderer.setState(this.voidWallsId,r),this.maskedWallsId&&Object.keys(r).length>0){let{outline:i,...a}=r;Object.keys(a).length>0&&this.renderer.setState(this.maskedWallsId,a)}if(this.maskedVoidWallsId&&Object.keys(r).length>0){let{outline:i,...a}=r;Object.keys(a).length>0&&this.renderer.setState(this.maskedVoidWallsId,a)}if(e.opacity!==void 0&&(n.opacity=e.opacity),e.color!==void 0&&(n.color=e.color),e.ceilingVisible!==void 0&&(n.visible=e.ceilingVisible),e.outline!==void 0&&(n.outline=e.outline),this.ceilingId&&Object.keys(n).length>0&&this.renderer.setState(this.ceilingId,n),this.ceilingMaskId&&Object.keys(n).length>0){let{outline:i,...a}=n;Object.keys(a).length>0&&this.renderer.setState(this.ceilingMaskId,a)}}getState(){let e=this.renderer.getState(this.groupContainer.id),t=e.altitude,r=e.visible,n=this.ceilingId?this.renderer.getState(this.ceilingId):void 0,i=n?.visible,a=n?.height??md,s=this.basementMaskId?this.renderer.getState(this.basementMaskId)?.visible:void 0;if(this.extrudedPolygonId){let l=this.renderer.getState(this.extrudedPolygonId);return{altitude:t,visible:r,opacity:l.opacity,side:l.side,color:l.color,height:l.height,outline:l.outline,basementMaskEnabled:s,ceilingVisible:!0,ceilingThickness:0}}if(this.wallsId){let l=this.renderer.getState(this.wallsId),c=l.height;return{altitude:t,visible:r,opacity:l.opacity,side:l.side,color:l.color,height:c,ceilingVisible:i,basementMaskEnabled:s,outline:l.outline,ceilingThickness:a}}return{altitude:t,visible:r,ceilingVisible:i,basementMaskEnabled:s,ceilingThickness:a}}};function ws(o){if(o.geometry.type==="Polygon")return{type:"Feature",geometry:{type:"Polygon",coordinates:[o.geometry.coordinates[0]]},properties:o.properties};let e=[];for(let t of o.geometry.coordinates)e.push([t[0]]);return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:e},properties:o.properties}}function Mm(o,e){let t;if(Array.isArray(e))if(e.length>0&&"geometry"in e[0])t=e;else{t=[];for(let n of e)for(let i of n.coordinates)t.push({type:"Feature",geometry:{type:"Polygon",coordinates:i},properties:{}})}else{t=[];for(let n of e.coordinates)t.push({type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}})}if(t.length===0)return o;let r=o;for(let n=0;n<t.length;n++){let i=t[n];if(r===null)break;try{r=gd(r,i)}catch(a){C.warn(`Polygon difference failed for hole ${i.properties?.id??"unknown"} (index ${n}/${t.length}), skipping. Error: ${a instanceof Error?a.message:a}`)}}return r===null?{type:"Feature",geometry:{type:"MultiPolygon",coordinates:[]},properties:o.properties}:{...r,properties:o.properties}}var vd=o=>o===0?"red":o===-1?"blue":o===-2?"green":"black";var xm={color:"#ffffff",opacity:1},ro={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},Id={opacity:.25,color:"#a7d1ec",height:.8,width:.05,cap:"square"},Sd=.1,As={color:"red",opacity:.2,height:ro.height+.1,visible:!0,borderVisible:!1},Ed=.5,ot=class{containerId;layers;renderer;constructor(e,t,r=new Map){this.containerId=t,this.layers=r,this.renderer=e}get visible(){return this.renderer.getState(this.containerId)?.visible===!0}setVisible(e){this.visible!==e&&this.renderer.setState(this.containerId,{visible:e})}},Md=0,hn=class{id;name;elevation;maxHeight;containerId;externalId;metadata;shortName;subtitle;occluderId;loaded=!1;styleMap={};obstructions;entrances;spaces;floorImages;floorText;areas;renderer;mapObject;options;layers=new Map;footprint;ceiling;floorStackId;multiFloorView;mapDataInternal;_computedMaxHeight;get geometryMaxHeight(){return this._computedMaxHeight}get spacesOpenToBelowEnabled(){return this.multiFloorView?.spacesOpenToBelowEnabled??!1}get voids(){return this.mapDataInternal?.voidsByFloorId[this.id]?.voids?.features??[]}get spacesOpenToBelow(){if(!this.spaces)return[];let e=[];for(let t of this.spaces.features){if(t.geometry.type!=="Polygon")continue;(t.properties.kind?.toLowerCase()==="void"||t.properties.kind?.toLowerCase()==="otb")&&e.push(t)}return e}facadesByStyleId=new Map;footprintObject;gapFootprintObject;#e;get geoJSONBoundingBox(){if(this.#e)return this.#e;if(!this.footprint){C.warn(`Attempting to get bounding box with no footprint for floor ${this.id}`);return}return this.#e=hp(this.footprint),this.#e}constructor(e,t,r,n,i,a,s,l){this.mapObject=r,this.renderer=r.renderer,this.id=t.id,this.options=i;let c=this.renderer.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:i.preloadFloors?.map(p=>p.id).includes(t.id)},e);if(this.containerId=c.id.toString(),this.externalId=t.externalId,this.metadata=t.metadata,this.shortName=t.shortName,this.subtitle=t.subtitle,this.name=t.name,this.maxHeight=t.maxHeight,this.elevation=t.elevation,a!=null&&s!=null){this.styleMap=s,this.spaces=a.space[this.id],this.entrances=a.entrance[this.id],this.areas=a.area?.[this.id],this.obstructions=a.obstruction[this.id],this.floorImages=a.floorImages?.[this.id],this.floorText=a.enterprise?.floorText?.[this.id];let p=a["floor.geojson"]?.features.find(h=>h.properties.id===t.id);p&&p.geometry!=null&&p.geometry.coordinates.length>0&&(this.footprint=p)}this.floorStackId=e,this.multiFloorView=n,this.mapDataInternal=l}load=(e=!1)=>{if(this.loaded)return this;this.footprint?.geometry==null&&this.obstructions?.features.length===0&&this.spaces?.features.length===0&&C.warn(`Floor ${this.id} exists in the data but contains no geometry.`),this.loaded=!0;let t=this.renderer.addGroupContainer(`${eo}-${this.id}`,{},this.id);this.layers.set(eo,new ot(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer(`${jt}-${this.id}`,{},this.id);this.layers.set(jt,new ot(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer(`${ye}-${this.id}`,{focusable:e},this.id);this.layers.set(ye,new ot(this.renderer,n.id.toString()));let i=this.renderer.addGroupContainer(`${to}-${this.id}`,{},this.id);this.layers.set(to,new ot(this.renderer,i.id.toString()));let a=this.renderer.addGroupContainer(`${Gt}-${this.id}`,{},this.id);if(this.layers.set(Gt,new ot(this.renderer,a.id.toString())),this.multiFloorView?.__EXPERIMENTAL_DEBUG_showVoids){let s=0;for(let l of this.voids)this.renderer.addFeatureCollection(`Void-${this.id}-${s}`,{features:[l]},{color:"red"},void 0,n),s++}if(this.multiFloorView?.__EXPERIMENTAL_DEBUG_showOpenToBelow){let s=0;for(let l of this.spacesOpenToBelow)this.renderer.addFeatureCollection(`SpacesOpenToBelow-${this.id}-${s}`,{features:[l]},{color:"blue"},void 0,n),s++}if(this.spaces!=null&&this.spaces.features.length>0){let s=[],l=new Map,c=this.multiFloorView?.__EXPERIMENTAL_excludeSpaceIdsInAutoHeightCalculation,p=c!=null&&c.length>0?new Set(c):void 0;for(let T of this.spaces.features){if(T.geometry.type!=="Polygon")continue;let I=T.properties.kind?.toLowerCase();if(I==="void"||I==="otb")continue;let E=this.styleMap[T.properties.id];if(E!=null&&"height"in E&&E?.height!=null&&(p==null||!p.has(T.properties.id))){let x=(E.altitude??0)+E.height;(this._computedMaxHeight==null||x>this._computedMaxHeight)&&(this._computedMaxHeight=x)}let D=this.mapDataInternal?.facadesBySpaceId[T.properties.id];if(D){let x=l.get(D.id);x==null&&(x=[],l.set(D.id,x)),x.push(T)}else s.push(T)}let h=this.renderer.addGroupContainer(`spaces-${this.id}`,{},n),g=this.renderer.addFeatureCollection(`Spaces-${this.id}-0`,{features:s},T=>T?.properties?.id!=null&&this.styleMap[T.properties.id]!=null?hr(this.styleMap[T.properties.id],this.options):xm,void 0,h);if(this.layers.get(ye).layers.set("Spaces",g.id.toString()),l.size>0){let T=this.renderer.addGroupContainer(`${No}-${this.id}`,{},this.id);this.layers.set(No,new ot(this.renderer,T.id.toString()));for(let[I,E]of l){let D=this.renderer.addGroupContainer(I,{focusable:!0},T),x=this.renderer.addGroupContainer(`${I}-geometry`,{},D),A=fp(E,this.styleMap),V=0;for(let[L,G]of A){let U={...hr(L,this.options),renderOrder:3},R=this.renderer.addFeatureCollection(`Facades-${this.id}-${I}-${V}`,{features:G},()=>U,void 0,x);V++;let j=L.id||R.id.toString();this.layers.get(No).layers.set(`${I}-${j}`,R.id.toString()),this.facadesByStyleId.has(j)?this.facadesByStyleId.get(j)?.push(I):this.facadesByStyleId.set(j,[I])}}}}if(this.footprint?.geometry!=null&&this.footprint.geometry.coordinates.length>0&&this.styleMap!=null&&(this.footprintObject=new fn(this.renderer,this.mapObject,this.id,{floorId:this.id,externalId:this.externalId,elevation:this.elevation,floorStackId:this.floorStackId,footprintGeometry:this.footprint,obstructions:this.obstructions,styleMap:this.styleMap,multiFloorView:this.multiFloorView}),this.layers.set(Jr,new ot(this.renderer,this.footprintObject.layer.id.toString())),this.footprint=Tp(this.footprint)),this.obstructions!=null&&this.obstructions.features.length>0){let s=this.obstructions.features.filter(x=>x.geometry.type==="Polygon"&&(x.properties.kind==="object"||x.properties.kind==="unknown")),l=this.renderer.addGroupContainer(`objects-${this.id}`,{},n),c=0,p=this.renderer.addFeatureCollection(`Objects-${this.id}-${c}`,{features:s},({properties:x})=>x.id!=null&&this.styleMap[x.id]!=null?hr(this.styleMap[x.id],this.options):ro,void 0,l);c++;let h=l.id.toString();this.layers.get(ye).layers.set(h,p.id.toString());let g=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind?.toLowerCase()==="wall"&&x.properties.footprintComponent===!1),T=this.obstructions.features.filter(x=>x.geometry.type==="LineString"&&x.properties.kind?.toLowerCase()==="wall"&&x.properties.footprintComponent===!0),I=this.entrances,E=ro,D=ro;if(g!=null&&g.length>0){let x=this.styleMap[g[0].properties?.id];x!=null&&(E={...x}),D=E;let{walls:A,entrances:V}=gs(g,I?.features||[]),L=Math.max(E.height-.11,Ed),G={...Id,height:L},U=this.renderer.addGroupContainer(`${pr}-${this.id}`,{visible:!1,altitude:Sd},n);this.layers.set(pr,new ot(this.renderer,U.id.toString()));let R=this.renderer.addFeatureCollection(`InteriorDoors-${this.id}`,V,()=>G,void 0,U);this.layers.get(ye).layers.set(lr,R.id.toString());let j=hr(E,this.options),te=this.renderer.addFeatureCollection(`Walls-${this.id}`,{features:[A]},j,void 0,n);this.layers.get(ye).layers.set(So,te.id.toString())}if(T!=null&&T.length>0){let x=this.styleMap[T[0].properties?.id];x!=null&&(D={...x,id:Kt});let{walls:A,entrances:V}=gs(T,I?.features||[]),L=Math.max(D.height-.11,Ed),G={...Id,height:L},U=this.renderer.addGroupContainer(`${dr}-${this.id}`,{visible:!1,altitude:Sd},n);this.layers.set(dr,new ot(this.renderer,U.id.toString()));let R=this.renderer.addFeatureCollection(`ExteriorDoors-${this.id}`,V,()=>G,void 0,U);this.layers.get(ye).layers.set(cr,R.id.toString());let j=hr(D,this.options),te=this.renderer.addFeatureCollection(`ExteriorWalls-${this.id}`,{features:[A]},j,void 0,n);this.layers.get(ye).layers.set(Kt,te.id.toString())}}if(this.floorImages!=null){let s=this.renderer.addGroupContainer(`images-${this.id}`,{},this.id);for(let l of this.floorImages.features||[]){let c="anchorId"in l.properties?l.properties.anchorId:null,p=c==null,h=c!=null&&this.mapDataInternal!=null&&this.mapDataInternal.pointsOfInterestById[c]!=null;if(p||h){let g=mp(l,Md),I=((l.properties.rotation??0)%360+360)%360;if(h){let E=new H({latitude:l.geometry.coordinates[1],longitude:l.geometry.coordinates[0],floorId:this.id});this.mapDataInternal.Query.at(E).then(D=>{let x=0;for(let A of D)if(Te.is(A)){let V=this.renderer.getState(A.id)?.height??0;V>x&&(x=V)}this.mapObject.api.Image3D.add(new H({latitude:l.geometry.coordinates[1],longitude:l.geometry.coordinates[0],floorId:this.id,verticalOffset:x}),l.properties.path,{id:g,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...l.properties,rotation:I})})}else this.mapObject.api.Image3D.add(new H({latitude:l.geometry.coordinates[1],longitude:l.geometry.coordinates[0],floorId:this.id}),l.properties.path,{id:g,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...l.properties,rotation:I});Md++}}this.layers.set(ur,new ot(this.renderer,s.id.toString()))}if(this.floorText!=null)for(let s of this.floorText.features||[]){let l=0;"geometryId"in s.properties?l=this.renderer.getState(s.properties.geometryId)?.height??0:l=s.properties.verticalOffset??0,this.renderer.addText3D(ee(),{...s,properties:{...s.properties,verticalOffset:l}},{appearance:{flipToFaceCamera:!1}},this.id)}if(this.areas!=null){let s=this.renderer.addGroupContainer(`areas-${this.id}`,{},this.id);this.layers.set(Ro,new ot(this.renderer,s.id.toString()));let l=this.renderer.addFeatureCollection(`Areas-${this.id}`,{features:this.areas.features},()=>({color:As.color,height:As.height}),void 0,s);for(let c of this.areas.features||[])this.renderer.setState(c.properties.id,{...As,visible:!1});this.layers.get(Ro).layers.set(l.id.toString(),l.id.toString())}return this.renderer.render(),this};addOccluder(){if(this.footprint?.geometry==null)return;let e=this.renderer.addGroupContainer(`${Lo}-${this.id}`,{},this.id),t=new ot(this.renderer,e.id.toString());this.layers.set(Lo,t),this.occluderId=this.renderer.addOccluder(this.footprint,t.containerId)}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(e){this.renderer.setState(this.containerId,{visible:e})}buildCeiling(e){this.footprintObject&&this.footprintObject.buildCeiling(e)}buildExtrudedPolygon(){this.footprintObject&&this.footprintObject.buildExtrudedPolygon()}buildBasementMask(){this.footprintObject&&this.footprintObject.buildBasementMask(this.spacesOpenToBelow)}buildGapFootprint(e,t){this.footprint?.geometry!=null&&(this.gapFootprintObject=new fn(this.renderer,this.mapObject,this.id,{floorId:`gap-below-${this.id}`,externalId:this.externalId,elevation:this.elevation,floorStackId:this.floorStackId,footprintGeometry:this.footprint,obstructions:void 0,styleMap:{},multiFloorView:this.multiFloorView,fixedHeight:e}),this.gapFootprintObject.buildWalls(),this.gapFootprintObject.buildCeiling(t),this.gapFootprintObject.update({altitude:-e,visible:!1}))}getFootprintStyle(){let e=ro;if(this.obstructions!=null&&this.obstructions.features.length>0){let t=this.obstructions.features.filter(r=>r.geometry.type==="LineString"&&r.properties.kind?.toLowerCase()==="wall"&&r.properties.footprintComponent===!0);t!=null&&t.length>0&&(e=this.styleMap[t[0].properties?.id])}return e}buildFootprint(){if(!this.footprintObject)return;this.footprintObject.buildWalls(),this.footprintObject.buildVoidWalls(this.voids);let e=new ot(this.renderer,this.footprintObject.layer.id.toString());this.layers.set(Jr,e)}setBatchedTextVisible(e){let t=this.renderer.getInternalState().geometry3DMap.get(this.id);if(t&&t instanceof ic){let r=this.renderer.getSystems().text3DSystem.batchedTextMap.get(t);r&&r.then(n=>{n.visible=e})}}};f();var gn=class{id;externalId;name;type;floorIds;defaultFloorId;floorObjects=[];floorObjectsByElevation=new Map;metadata;containerId;facade;renderer;altitudeMap=new Map;constructor(e,t,r,n){this.id=e.id,this.externalId=e.externalId,this.name=e.name,this.type=e.type,this.metadata=e.metadata,this.floorIds=e.floors??e.maps,this.defaultFloorId=e.defaultFloor;let i=r.addGroupContainer(this.id,{visible:!0,interactive:!0},t);this.containerId=i.id.toString(),this.facade=n,this.renderer=r}#e;get defaultFloor(){if(this.#e==null){if(this.floorObjects.length===0)throw new Ce(`No floors in floor stack (${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,r)=>Math.abs(r.elevation)<Math.abs(t.elevation)?r:t)),this.#e=e}return this.#e}get isOutdoors(){return this.type?.toLowerCase()==="outdoor"?!0:this.facade!=null?!1:this.floorObjects.some(t=>t.hasFacadeGeometry)}addFloor(e){if(this.floorObjectsByElevation.has(e.elevation)){C.error(`Floor with same elevation ${e.elevation} already exists in Stack (${this.id}). Floor (${e.id}) will not be added.`);return}this.floorObjects.push(e),this.floorObjectsByElevation.set(e.elevation,e)}loadAllFloors(e){this.floorObjects.sort((t,r)=>t.elevation-r.elevation);for(let t of this.floorObjects)t.load(this.facade!=null),!this.isOutdoors&&!t.hasFacadeGeometry&&t.footprint!=null&&t.addOccluder();if(this.altitudeMap=yp(this.floorObjects,e?.floorGap,e?.floorGapMultiplier,e?.floorGapFallback,e?.__EXPERIMENTAL_disableGapFilling),e?.enabled)for(let t of this.floorObjects){let r=this.altitudeMap.get(t.elevation);r&&this.renderer.setState(t.id,{altitude:r.altitude})}if(!this.isOutdoors&&e?.enabled){for(let t of this.floorObjects){let r=this.floorObjectsByElevation.get(t.elevation+1),n=[];if(t.spacesOpenToBelowEnabled){for(let i of t.voids)n.push(i);if(r)for(let i of r.spacesOpenToBelow)n.push(i)}t.spacesOpenToBelowEnabled&&n.length>0?(t.buildCeiling(n),t.buildFootprint()):t.buildExtrudedPolygon(),t.elevation<=0&&t.buildBasementMask()}if(!e.__EXPERIMENTAL_disableGapFilling){let t=bp(this.floorObjects,this.altitudeMap,e.floorGap,e.floorGapMultiplier,e.floorGapFallback);for(let r of t){let n=this.floorObjectsByElevation.get(r.floorAboveElevation);if(!n)continue;let i=n.spacesOpenToBelow;n.buildGapFootprint(r.height,i)}}}}};f();var Cm=5,_m="#ffffff";function Pm(o,e){return typeof o=="string"?o:o[e]??_m}function Om(o){return o.spacesOpenToBelow.length>0}function Fs(o,e,t,r,n){let i={outdoorOpacity:"initial",floorStates:[]},{spacesOpenToBelowEnabled:a}=n,s=n.spacesOpenToBelowVisualEffectEnabled??!0,l=r.get(e.elevation)?.altitude??0,c=l;for(let[g,T]of r)g<e.elevation&&T.altitude<c&&(c=T.altitude);let p=l-c+Cm,h=o.sort((g,T)=>g.elevation-T.elevation);for(let g of h){let T=r.get(g.elevation),I=T?.visualHeight??0,E=T?.altitude??0,D=n.opacity??(g.elevation<0?1:.4),x=!1;if(a){let j=g.elevation<e.elevation?o.find(te=>te.elevation===g.elevation+1):null;x=j?Om(j):!1}let A={maskEnabled:g.elevation<0,maskId:Go,maskEffect:"reveal",maskMode:"masked-object"},V=a?g.elevation===e.elevation||x:!1,L=a?g.elevation<e.elevation:g.elevation===e.elevation&&g.elevation<0,G=(e.elevation>=0?g.elevation===0:g.elevation===e.elevation)&&g.floorStack?.type?.toLowerCase()!=="outdoor",U={color:Pm(n.color,g.id),ceilingVisible:g.elevation<e.elevation,visible:L,basementMaskEnabled:G,outline:n.outline,ceilingThickness:.5,height:I,opacity:D},R={floor:g,state:{type:"floor",altitude:E,visible:V,geometry:a?{visible:V,...A,effectStart:g.elevation<e.elevation&&s?l:0,effectDistance:g.elevation<e.elevation&&s?p:0,darkenAmount:s?n.spacesOpenToBelowVisualEffectDarkenAmount??.2:0,darkenUseDepth:n.spacesOpenToBelowVisualEffectDarkenUseDepth??!0,desaturateAmount:s?n.spacesOpenToBelowVisualEffectDesaturateAmount??0:0,desaturateUseDepth:n.spacesOpenToBelowVisualEffectDesaturateUseDepth??!0,washOutAmount:s?n.spacesOpenToBelowVisualEffectWashOutAmount??0:0,washOutUseDepth:n.spacesOpenToBelowVisualEffectWashOutUseDepth??!1}:{...A,visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:U,occlusion:{enabled:!1},areas:{visible:!1},text3d:{visible:!1},images:{visible:!1,collisionsEnabled:g.id===e.id},paths:{visible:!1},models:{visible:!1}}};i.floorStates.push(R),g.id===e.id?(R.state.visible=!0,R.state.images.visible=!0,R.state.paths.visible=!0,R.state.geometry.visible=!0,R.state.models.visible=!0,R.state.labels.enabled=!0,R.state.markers.enabled=!0,R.state.occlusion.enabled=!0,R.state.areas.visible=!0,R.state.text3d.visible=!0,g.elevation<0&&(R.state.footprint.height=I*Math.abs(g.elevation),R.state.footprint.visible=!0,i.outdoorOpacity=.2)):t.includes(g.id)&&g.elevation<e.elevation?(R.state.visible=!0,R.state.geometry.visible=!0,R.state.models.visible=!0,R.state.paths.visible=!0,R.state.markers.enabled=!0,R.state.occlusion.enabled=!0,R.state.footprint.visible=!0,R.state.footprint.height=I,g.elevation<0&&(i.outdoorOpacity=.2)):e.elevation>0&&g.elevation<e.elevation&&g.elevation>=0&&(R.state.visible=!0,R.state.footprint.visible=!0,R.state.footprint.height=I)}return i}f();import Y from"zod";f();import{z as xd}from"zod";function Cd(o){try{let e=o.shape;if("type"in e){let t=e.type;if(t instanceof xd.ZodOptional&&(t=t._def.innerType),"value"in t)return String(t.value);if(t instanceof xd.ZodDefault&&"value"in t._def.innerType)return String(t._def.innerType.value)}return"unknown"}catch{return"unknown"}}function _d(o){if(o.success)return{};let e={};for(let t of o.error.issues)if(t.path.length>0){let r=String(t.path[0]);e[r]||(e[r]=[]),e[r].push(t.message)}return e}function Pd(o,e){let t=Object.entries(o);if(t.length>0){let r=t.map(([n,i])=>`${n}: ${i.join(", ")}`).join("; ");C.warn(`${t.length} invalid field(s) in ${e??"unknown"} state: [${r}]`)}}function ne(o,e,t){if(t?.disableValidation)return e;if(e==null||typeof e!="object")return{};let r=o.safeParse(e);if(r.success){let a={};for(let s of Object.keys(e))s in r.data&&(a[s]=e[s]);return a}let n=_d(r);t?.warn&&Pd(n,Cd(o));let i={};for(let a of Object.keys(e))!(a in n)&&a in o.shape&&(i[a]=e[a]);return i}function Ve(o,e,t){if(t?.disableValidation)return e;let r=o.safeParse(e);if(r.success)return r.data;if(t?.warn===!0){let n=_d(r);Pd(n,Cd(o))}return e}var Od="path",Ht={color:"#4b90e2",width:1,completeFraction:0,visible:!0,verticalOffset:.1,xrayOpacity:.25,__EXPERIMENTAL_SMOOTHING_TENSION:ua.tension,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:ua.cornerRadius,dashed:!1,__EXPERIMENTAL_ENDCAP_EXTENSION:[.5,.5],__EXPERIMENTAL_BILLBOARDING:80,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:!1},ks=Y.object({type:Y.literal(Od).default(Od),color:Y.string().default(Ht.color),width:Y.union([Y.number(),Y.string().regex(da),Y.object({on:Y.literal("zoom-level"),input:Y.array(Y.number()).nonempty(),output:Y.union([Y.array(Y.number()).nonempty(),Y.array(Y.string().regex(da)).nonempty()]),easing:Y.string().optional()})]),completeFraction:Y.number().default(Ht.completeFraction),visible:Y.boolean().default(Ht.visible),verticalOffset:Y.number().default(Ht.verticalOffset),highlightStartFraction:Y.number().default(0),highlightEndFraction:Y.number().default(0),highlightColor:Y.string().default("red"),highlightWidthMultiplier:Y.number().default(1.1),highlightCompleteFraction:Y.number().default(1),xrayOpacity:Y.number().min(0).max(1).default(Ht.xrayOpacity),travelledEndFraction:Y.number().default(0),travelledColor:Y.string().default("#999"),__EXPERIMENTAL_SMOOTHING_TENSION:Y.number().default(Ht.__EXPERIMENTAL_SMOOTHING_TENSION),__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:Y.number().default(Ht.__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS),dashed:Y.boolean().default(Ht.dashed),__EXPERIMENTAL_DASH_OPTIONS:Y.discriminatedUnion("__EXPERIMENTAL_DASH_MODE",[Y.object({__EXPERIMENTAL_DASH_MODE:Y.literal("length-scaling"),__EXPERIMENTAL_DASH_LENGTH:Y.number().min(0).max(1).default(.1),__EXPERIMENTAL_DASH_GAP:Y.number().min(0).max(1).default(.1)}),Y.object({__EXPERIMENTAL_DASH_MODE:Y.literal("width-scaling"),__EXPERIMENTAL_DASH_SIZE:Y.number().min(0).default(3),__EXPERIMENTAL_GAP_SIZE:Y.number().min(0).default(2)}),Y.object({__EXPERIMENTAL_DASH_MODE:Y.literal("absolute"),__EXPERIMENTAL_DASH_METERS:Y.number().min(0).default(1),__EXPERIMENTAL_GAP_METERS:Y.number().min(0).default(.5)})]).optional(),__EXPERIMENTAL_GEOMETRY:Y.enum(["tube","ribbon"]).default("tube"),__EXPERIMENTAL_ENDCAP_EXTENSION:Y.tuple([Y.number(),Y.number()]).default(Ht.__EXPERIMENTAL_ENDCAP_EXTENSION),__EXPERIMENTAL_BILLBOARDING:Y.union([Y.boolean(),Y.number().min(0).max(90)]).default(Ht.__EXPERIMENTAL_BILLBOARDING),__EXPERIMENTAL_BORDER:Y.object({enabled:Y.boolean(),color:Y.custom(o=>typeof o=="string"),width:Y.number().optional()}).optional(),__EXPERIMENTAL_PREVENT_SELF_OVERLAP:Y.boolean().default(Ht.__EXPERIMENTAL_PREVENT_SELF_OVERLAP),__EXPERIMENTAL_XRAY_STYLE:Y.object({opacity:Y.number().min(0).max(1).optional(),color:Y.string().optional(),tint:Y.number().min(0).max(1).optional(),dithering:Y.number().min(0).optional()}).optional()}),Ls=ks.partial(),i3=Y.strictObject(ks.shape);function Dd(o){let{color:e,visible:t,width:r,verticalOffset:n,completeFraction:i,highlightStartFraction:a,highlightEndFraction:s,highlightColor:l,highlightWidthMultiplier:c,highlightCompleteFraction:p,travelledEndFraction:h,travelledColor:g,xrayOpacity:T,xrayStyle:I,smoothingTension:E,smoothingCornerRadius:D,dashed:x,dashLength:A,dashGap:V,dashRelativeToWidth:L,dashSize:G,gapSize:U,dashAbsolute:R,dashMeters:j,gapMeters:te,__EXPERIMENTAL_GEOMETRY:fe,__EXPERIMENTAL_ENDCAP_EXTENSION:ce,__EXPERIMENTAL_BILLBOARDING:Pe,__EXPERIMENTAL_BORDER:Oe,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:Ge}=o,De={};T!==void 0&&(De.opacity=T),I?.color!==void 0&&(De.color=I.color),I?.tint!==void 0&&(De.tint=I.tint),I?.dithering!==void 0&&(De.dithering=I.dithering);let ve=Object.keys(De).length>0?De:void 0,ft;return R?ft={__EXPERIMENTAL_DASH_MODE:"absolute",__EXPERIMENTAL_DASH_METERS:j,__EXPERIMENTAL_GAP_METERS:te}:L?ft={__EXPERIMENTAL_DASH_MODE:"width-scaling",__EXPERIMENTAL_DASH_SIZE:G,__EXPERIMENTAL_GAP_SIZE:U}:ft={__EXPERIMENTAL_DASH_MODE:"length-scaling",__EXPERIMENTAL_DASH_LENGTH:A,__EXPERIMENTAL_DASH_GAP:V},Ve(ks,{color:e,visible:t,width:r,verticalOffset:n,completeFraction:i,highlightStartFraction:a,highlightEndFraction:s,highlightColor:l,highlightWidthMultiplier:c,highlightCompleteFraction:p,travelledEndFraction:h,travelledColor:g,xrayOpacity:T,__EXPERIMENTAL_XRAY_STYLE:ve,__EXPERIMENTAL_SMOOTHING_TENSION:E,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:D,dashed:x,__EXPERIMENTAL_DASH_OPTIONS:ft,__EXPERIMENTAL_GEOMETRY:fe,__EXPERIMENTAL_ENDCAP_EXTENSION:ce,__EXPERIMENTAL_BILLBOARDING:Pe,__EXPERIMENTAL_BORDER:Oe,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:Ge})}function xr(o){let e={};for(let t in o)if(t==="__EXPERIMENTAL_SMOOTHING_TENSION"){let r=o[t];r!==void 0&&(e.smoothingTension=r)}else if(t==="__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS"){let r=o[t];r!==void 0&&(e.smoothingCornerRadius=r)}else if(t==="__EXPERIMENTAL_DASH_OPTIONS"){let r=o[t];r&&(r.__EXPERIMENTAL_DASH_MODE==="length-scaling"?(e.dashRelativeToWidth=!1,e.dashAbsolute=!1,r.__EXPERIMENTAL_DASH_LENGTH!==void 0&&(e.dashLength=r.__EXPERIMENTAL_DASH_LENGTH),r.__EXPERIMENTAL_DASH_GAP!==void 0&&(e.dashGap=r.__EXPERIMENTAL_DASH_GAP)):r.__EXPERIMENTAL_DASH_MODE==="width-scaling"?(e.dashRelativeToWidth=!0,e.dashAbsolute=!1,r.__EXPERIMENTAL_DASH_SIZE!==void 0&&(e.dashSize=r.__EXPERIMENTAL_DASH_SIZE),r.__EXPERIMENTAL_GAP_SIZE!==void 0&&(e.gapSize=r.__EXPERIMENTAL_GAP_SIZE)):r.__EXPERIMENTAL_DASH_MODE==="absolute"&&(e.dashAbsolute=!0,e.dashRelativeToWidth=!1,r.__EXPERIMENTAL_DASH_METERS!==void 0&&(e.dashMeters=r.__EXPERIMENTAL_DASH_METERS),r.__EXPERIMENTAL_GAP_METERS!==void 0&&(e.gapMeters=r.__EXPERIMENTAL_GAP_METERS)))}else if(t==="xrayOpacity")o.__EXPERIMENTAL_XRAY_STYLE?.opacity===void 0&&(e[t]=o[t]);else if(t==="__EXPERIMENTAL_XRAY_STYLE"){let r=o[t];if(r){r.opacity!==void 0&&(e.xrayOpacity=r.opacity);let n={};r.color!==void 0&&(n.color=r.color),r.tint!==void 0&&(n.tint=r.tint),r.dithering!==void 0&&(n.dithering=r.dithering),Object.keys(n).length>0&&(e.xrayStyle=n)}}else e[t]=o[t];return e}var mn=class extends Mt{floorStacksById=new Map;floorsById=new Map;startingFloorId="";currentFloorId="";currentFloorStackId="";outdoorFloorStacks=new Set;id;renderer;api;mvf;options={};styleMap;animations=new Map;get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);if(!e)throw new Ce(`Current floor stack with id "${this.currentFloorStackId}" not found`);return e}setFloorStack(e,t){if(this.currentFloorStackId===e)return;let r=this.floorStacksById.get(e);if(r==null){C.error(`Invalid floor stack passed to setFloorStack (${e}), the floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}if(r.floorObjects.length===0){C.error(`Floor stack (${e}) has no floors. The floor stack was not changed. Current floor stack is still ${this.currentFloorStack.id}.`);return}this.setFloor(r.defaultFloor.id,t)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);if(!e)throw new Ce(`Floor with id "${this.currentFloorId}" not found`);return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){if(this.api.manualFloorVisibility===!0)return;let t=this.api.getMapDataInternal()?.getById("floor",e),r=this.api.getMapDataInternal()?.getById("floor-stack",this.currentFloorStackId);if(t&&r){let n=t.floorStack.id===r?.id,i=this.api.getMapDataInternal()?.getById("floor-stack",t.floorStack.id);if(this.#e?.enabled&&i){if(!n)for(let s of this.floorStacksById.values())s.id!==i.id&&s.floorObjects.forEach(l=>{l.setVisible(!1)});let a=Fs(i.floors,t,this.api.Navigation?.floors?.map(s=>s.id)||[],this.getFloorStackAltitudeData(i.id),{color:this.#e.footprintColor??ro.color,opacity:this.#e.footprintOpacity,outline:this.#e.footprintOutline??!0,spacesOpenToBelowEnabled:this.#e.spacesOpenToBelowEnabled??!1,spacesOpenToBelowVisualEffectEnabled:this.#e.spacesOpenToBelowVisualEffectEnabled,spacesOpenToBelowVisualEffectDarkenAmount:this.#e.spacesOpenToBelowVisualEffectDarkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#e.spacesOpenToBelowVisualEffectDarkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:this.#e.spacesOpenToBelowVisualEffectDesaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#e.spacesOpenToBelowVisualEffectDesaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:this.#e.spacesOpenToBelowVisualEffectWashOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#e.spacesOpenToBelowVisualEffectWashOutUseDepth});if(this.api?.Outdoor?.setOpacity(a.outdoorOpacity),a.floorStates.forEach(s=>{if(s.floor){let l=this.api.getMapData()?.getById("floor",s.floor.id);l&&this.api.updateState(l,s.state)}}),this.#e.updateCameraElevationOnFloorChange){let s=this.getFloorStackAltitudeData(i.id);this.api.Camera.setElevation(s.get(t.elevation)?.altitude??0)}}else for(let a of this.floorStacksById.values())a.floorObjects.forEach(s=>{s.id!==e&&s.setVisible(!1)})}}updateMultiFloorViewEffects(e){this.#e={...this.#e,...e},this.processFloorChange(this.currentFloorId)}getMultiFloorViewEffects(){return{spacesOpenToBelowVisualEffectEnabled:this.#e.spacesOpenToBelowVisualEffectEnabled??!0,spacesOpenToBelowVisualEffectDarkenAmount:this.#e.spacesOpenToBelowVisualEffectDarkenAmount??.2,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#e.spacesOpenToBelowVisualEffectDarkenUseDepth??!0,spacesOpenToBelowVisualEffectDesaturateAmount:this.#e.spacesOpenToBelowVisualEffectDesaturateAmount??0,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#e.spacesOpenToBelowVisualEffectDesaturateUseDepth??!0,spacesOpenToBelowVisualEffectWashOutAmount:this.#e.spacesOpenToBelowVisualEffectWashOutAmount??0,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#e.spacesOpenToBelowVisualEffectWashOutUseDepth??!1}}setFloor(e,t){if(this.currentFloorId===e)return;if(!this.floorsById.get(e)){C.error(`Invalid floor passed to setFloor (${e}), the floor was not changed. Current floor is still ${this.currentFloor.id}`);return}let n=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:n,floorId:e,reason:t}),this.currentFloorStack&&this.processFloorChange(e),this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.updateOutdoorPathLayerVisibility(),this.publish("floor-change",{reason:t,floorId:this.currentFloor.id,previousFloorId:n})}updateOutdoorPathLayerVisibility(){let e=this.api.hidePathsNotOnCurrentFloor===!0&&!this.options.multiFloorView?.enabled;for(let t of this.floorsById.values()){if(!this.floorStacksById.get(t.floorStackId)?.isOutdoors)continue;let n=t.layers.get(to);if(!n)continue;let i=!e||t.id===this.currentFloor.id;n.setVisible(i)}}getFloorStackAltitudeData(e){return this.floorStacksById.get(e)?.altitudeMap??new Map}cancelAnimation(e){let t=this.animations.get(e);t&&(t.stop(),this.animations.delete(e),this.renderer.getInternalTweenGroup().remove(t))}Models={add:(e,t,r)=>{let{floorId:n,scale:i,...a}=r,s=n?this.floorsById.get(n):void 0,l=s?.layers.get(Gt),c={...a};i!=null&&(c.scale=Array.isArray(r.scale)?r.scale:[r.scale,r.scale,r.scale]);let p=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:t.map(h=>({type:"Feature",properties:{id:ee(),rotation:r.rotation,scale:c.scale,interactive:r.interactive},geometry:{type:"Point",coordinates:bt(h)}}))},c,{parent:l?.containerId??s?.id});if(p==null)throw new Ce("error creating model");return this.renderer.getState(p).children},remove:(e,t)=>{this.renderer.remove(e)}};Image3D={add:(e,t,r)=>{let{floorId:n,flipImageToFaceCamera:i,maxImageSize:a,interactive:s,...l}=r,c=n?this.floorsById.get(n):this.currentFloor,p={type:"Feature",properties:l,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(r.id??ee(),p,{url:t,flipImageToFaceCamera:i??!1,maxImageSize:a,interactive:s},c.id)},remove:e=>{this.renderer.remove(e)},removeAll:()=>{}};Markers={add:(e,t,r)=>{let n=gr(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),{attachTo:i,...a}=r,s=a;a.rank==="initial"&&(s.rank="medium");let l=n.layers.get(jt),c=this.renderer.addMarker2D(bt(e),t,{...s,occluderId:n?.occluderId,attachTo:i},l?.containerId);if(!c)throw new Ce("Failed to create Marker");return c},remove:e=>{this.renderer.remove(e)},getContentEl:e=>{let t=this.renderer.getState(e);if(t?.type==="marker")return t.element},removeAll:()=>{},setPosition:(e,t,r)=>{let n=this.renderer.getState(e),i=r?this.floorsById.get(r):this.currentFloor;if(!n){C.error(`Failed to retrieve state for Marker with id "${e}".`);return}if(n.type!=="marker"){C.error(`Geometry with id "${e}" is not of type "marker".`);return}this.renderer.setState(n,{position:t,parent:i?.layers.get(jt)?.containerId})},animateTo:(e,t,r,n)=>{let i=this.renderer.getState(e),a=r?this.floorsById.get(r):this.currentFloor;if(!i)return C.error(`Failed to retrieve state for Marker with id "${e}".`),Promise.resolve();if(i.type!=="marker")return C.error(`Geometry with id "${e}" is not of type "marker".`),Promise.resolve();let s={duration:1e3,easing:"ease-in-out",...n};this.cancelAnimation(e);let l=new ao({lon:i.position[0],lat:i.position[1]}).to({lon:t[0],lat:t[1]},s.duration).easing(Ko[s.easing]).onUpdate(({lon:c,lat:p})=>{if(!this.renderer.getState(e))this.cancelAnimation(e);else{let g=a?.layers.get(jt)?.containerId;g&&this.Markers.setPosition(e,[c,p],g)}}).start();return this.renderer.getInternalTweenGroup().add(l),this.renderer.render(),this.animations.set(e,l),ys(l).then(()=>{this.animations.delete(e)})}};Exporter={getCurrentSceneGLTF:async e=>this.renderer.getCurrentSceneGLTF(e)};Shapes={add:(e,t,r)=>{let n=r?.floorId?this.floorsById.get(r?.floorId):this.currentFloor,i="shape-"+ee(),{visible:a,altitude:s,...l}=t;return this.renderer.addFeatureCollection(i,e,l,{visible:a,altitude:s},n.id),i},remove:e=>(this.renderer.remove(e.id),e.id)};Text3D={label:(e,t,r)=>{if(!this.api.getMapDataInternal()?.enterpriseMode){C.warn("Enterprise mode is not enabled, skipping label creation");return}let n=wd(this.renderer,e,t,r);if(n)return{textInfo:n,target:e}},labelAll:(e={})=>{if(!this.api.getMapDataInternal()?.enterpriseMode)return C.warn("Enterprise mode is not enabled, skipping label creation"),[];let t=this.api.getMapData();if(!t)return[];let r=[];return t.getByType("space").forEach(n=>{if(n.enterpriseLocations[0]){let i=wd(this.renderer,n,n.enterpriseLocations[0]?.name??n.name,e);i&&r.push({textInfo:i,target:n})}}),r},add:(e,t,r)=>{let{rotation:n=0,appearance:i}=r,{fontSize:a=12,color:s="black",font:l=""}=i??{},c=gr(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),h={type:"Feature",properties:{text:t,rotation:n,verticalOffset:e.verticalOffset??0,fontSize:a,color:s,align:"center",visible:!0,fontFamily:l},geometry:{type:"Point",coordinates:bt(e)}},g=ee();return this.renderer.addText3D(g,h,{appearance:{...i,fontSize:a,color:s,font:l||void 0}},c.id)},remove:e=>(this.renderer.remove(e),e)};Labels={all:({onCreate:e,labelOptions:t={}})=>{for(let r of Object.entries(this.mvf.space)){let[n,i]=r;i&&i.features.forEach(a=>{let s=this.api.getMapData()?.getById("space",a.properties.id);if(!s)return;let l=this.styleMap[a.properties.id]?.showImage,c=a.properties.details?.images,h={icon:(l&&c?.[0]?.url?{icon:c[0].url}:{}).icon,...t.appearance},T=(n?this.floorsById.get(n):this.currentFloor).layers.get(eo);if(a.properties.center&&s.name!==""){let I=this.renderer.addLabel2D(a.properties.center,s.name,{id:a.properties.id+"-label",...t,appearance:h,rank:t.rank,attachTo:mr(s)},Te.is(s)?s.id:T?.containerId);I&&e(I.id,s.name,s)}})}},add:(e,t,r={})=>{let{attachTo:n,...i}=r,a=gr(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),s=a.layers.get(eo),l=this.renderer.addLabel2D(bt(e),t,{...i,occluderId:a.occluderId,attachTo:n},s?.containerId);if(!l)throw new Ce("label creating failed");return l},remove:({entityId:e})=>{this.renderer.remove(e)},removeAll:()=>{}};Paths={add:(e,t,r)=>{let n=t?xr(t):void 0,i=t?.animateDrawing??!0,a=[],s=e[0].floorId||"root",l=0;for(let p of e){let h=p.floorId??s,{latitude:g,longitude:T}=p;h!==s&&(l++,s=h),a[l]==null&&a.push({floorId:h,coordinates:[]});let I=p.floorId===h?p:new H({longitude:T,latitude:g,floorId:h});a[l].coordinates.push(I)}let c=a.reduce((p,{floorId:h,coordinates:g},T)=>{if(T!==0){let D=a[T-1],x=D.coordinates[D.coordinates.length-1],A=g[0],V=bt(x),L=bt(A),G=this.floorsById.get(D.floorId),U=this.floorsById.get(h),R=G?.floorStackId,j=U?.floorStackId,te=R?this.getFloorStackAltitudeData(R):void 0,fe=j?this.getFloorStackAltitudeData(j):void 0,ce=te?.get(G?.elevation??0)?.altitude??0,Pe=fe?.get(U?.elevation??0)?.altitude??0,Oe=r?.__EXPERIMENTAL_JUNCTION_INSET??0;us(V,L,Oe,ce,Pe);let Ge=r?xr(r):n,De=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:D.floorId},geometry:{type:"Point",coordinates:V}},{type:"Feature",properties:{parentId:h},geometry:{type:"Point",coordinates:L}}]},Ge,this.id);De&&(i&&this.renderer.setState(De.id,{completeFraction:0}),p.push({...De,coordinates:[x,A]}))}if(g.length<2)return p;let I=this.floorsById.get(h)?.layers.get(to)?.containerId,E=this.renderer.addPath({type:"FeatureCollection",features:g.map(D=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:bt(D)}}))},n,I??h);return E&&(i&&this.renderer.setState(E.id,{completeFraction:0}),p.push({...E,coordinates:g})),p},[]);if(i){let p=[],h=this.api.getMapData();return c.forEach(g=>{let T=gp(g,h,this.api);p.push(new ao({fraction:0}).to({fraction:1},T?t?.drawDuration??1500:0).onUpdate(I=>{this.renderer.setState(g.id,{completeFraction:I.fraction})}))}),p.forEach((g,T)=>{T<p.length-1&&g.chain(p[T+1]),this.renderer.getInternalTweenGroup().add(g)}),p[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),p[0]),{paths:c,animation:ys(p[p.length-1]).then(()=>{this.animations.delete(c[0].id.toString())})}}else return{paths:c,animation:Promise.resolve()}},remove:e=>{e.forEach(t=>{this.cancelAnimation(t),this.renderer.remove(t)})}};#e={enabled:!1,floorGap:"auto",updateCameraElevationOnFloorChange:!0,footprintColor:ro.color,footprintOpacity:void 0,footprintOutline:!0,spacesOpenToBelowEnabled:!1};constructor(e,t,r,n){super(),this.renderer=n.core,this.api=n,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=r??{},this.mvf=t?.mvf??{};let i=up(this.mvf["styles.json"]||{});if(this.styleMap=i,this.#e={...this.#e,...r?.multiFloorView},!t){this.id!=="outdoors-container"&&C.warn(`Map (${this.id}) created with no data.`);let l=new gn({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(l.id,l),this.currentFloorStackId=l.id;let c=new hn(l.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,this.#e,r??{});this.floorsById.set(c.id,c),l.addFloor(c),this.setFloor(c.id);return}let a=t.getMVFFeatureByType("floor-stack");if(a==null||a.length===0)throw new Ce("MVF does not contain any Floor Stacks.");for(let l of a){let c=new gn(l,this.id,this.renderer,this.mvf.facade?.[l.id]);for(let p of c.floorIds){let h=t.getMVFFeatureById("floor",p);if(h!=null){let g=new hn(c.id,h,this,this.#e,r??{},this.mvf,i,t);this.floorsById.set(g.id,g),c.addFloor(g)}}if(c.floorObjects.length<1){C.warn(`Floor stack ${l.id} has no floors. It will not be loaded.`);continue}this.floorStacksById.set(l.id,c),this.currentFloorStackId||(this.currentFloorStackId=l.id)}for(let[l]of Object.entries(t.facadesBySpaceId)){let c=t.getById("space",l);c&&(this.outdoorFloorStacks.add(c.floor.floorStack.id),this.floorsById.get(c.floor.id)?.setVisible(!0))}let s=this.mvf.enterprise?.venue.defaultMap;if(r?.initialFloor){let l=Yr(r.initialFloor);l&&this.floorsById.has(l)?s=l:C.error(`Invalid initial floor specified (${r.initialFloor}), using default behavior instead`)}s||(s=this.currentFloorStack.defaultFloor.id),this.startingFloorId=s}loadAllFloors(){for(let e of this.floorStacksById.values())e.loadAllFloors(this.#e)}};function wd(o,e,t,r){return o.labelText3D(e.id,t??e.name,{...r,parentId:e.floor.id})}f();var yn=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getAll(){return Array.from(this.#e.values()).map(({marker:e})=>e)}getById(e){return this.#e.get(e)}add(e,t,r){let n=e.anchorTarget;if(!n)throw new Error("get coordinate failed");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Markers.add(n,t,{...r,rank:r?.rank||"medium",dynamicResize:r?.dynamicResize??!0,attachTo:mr(e)});if(a==null)throw new Error("error creating marker");let s=i.Markers.getContentEl(a.id.toString());if(!s)throw new Error("marker component should exist");let l=new oo(a.id.toString(),s,e);return this.#e.set(l.id,{marker:l,entityId:a.id.toString()}),l}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Markers.remove(t.entityId),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(({marker:t})=>{this.remove(t),e.push(t),this.#e.delete(t.id.toString())}),e}setPosition(e,t){let r=t.anchorTarget;if(!r){C.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){C.error("Cannot determine the current map.");return}let i=this.#e.get(e.id);if(!i){C.error(`Cannot find the Marker with id "${e.id}".`);return}n.Markers.setPosition(i.entityId,bt(r),r.floorId??n.currentFloorId),i.marker.updateTarget(t)}animateTo(e,t,r){let n=t.anchorTarget;if(!n)return C.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return C.error("Cannot determine the current map."),Promise.resolve();let a=this.#e.get(e.id);return a?(a.marker.updateTarget(t),i.Markers.animateTo(a.entityId,bt(n),n.floorId??i.currentFloorId,r)):(C.error(`Cannot find the Marker with id "${e.id}".`),Promise.resolve())}};f();var bn=class{#e=new Map;#t;#o;get currentMap(){return this.#t()}constructor({currentMapGetter:e,mapDataInternalGetter:t}){this.#t=e,this.#o=t}getById(e){return this.#e.get(e)}add(e,t,r){let n=e.anchorTarget;if(!n)throw new Error("Target does not implement IAnchorable.");let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Image3D.add(bt(n),t,{...r,floorId:n.floorId,verticalOffset:n.verticalOffset+(r.verticalOffset??0)});if(!a)throw new Error("image component should exist");let s=this.#o?.(),l=new mt(a.id.toString(),t,e,s?.tokenManager);if(this.#e.set(l.id,{image:l,entityId:a.id.toString(),anchorId:r.anchorId}),r.anchorId!=null&&s!=null){let c=s.floorImagesByAnchorId.get(r.anchorId)??[];c.push(l),s.floorImagesByAnchorId.set(r.anchorId,c)}return l}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Image3D.remove(t.entityId),this.#e.delete(e.id),this.#r(t.anchorId,e))}#r(e,t){if(e==null)return;let r=this.#o?.()?.floorImagesByAnchorId;if(r==null)return;let n=r.get(e);if(n==null)return;let i=n.filter(a=>a!==t);i.length===0?r.delete(e):r.set(e,i)}removeAll(){let e=[];return this.#e.forEach(({image:t})=>{this.remove(t),e.push(t),this.#e.delete(t.id.toString())}),e}};f();var Tn=class{#e=new Map;#t;#o;get currentMap(){return this.#t()}constructor({currentMapGetter:e,mapDataInternalGetter:t}){this.#t=e,this.#o=t}getById(e){return this.#e.get(e)}add(e,t,r){let n=[e],i=n.reduce((l,c)=>{if(!c)return C.error("Cannot determine coordinate from options."),l;let p=gr(c,this.currentMap.floorsById,this.currentMap.floorsById.get("default-floor"))?.id;return l.has(p)||l.set(p,[]),l.get(p)?.push(c),l},new Map);if(!n.length)throw new Error("targets should not be empty when adding a model");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let s=[];return i.forEach((l,c)=>{let p=ee();a.Models.add(p,l,{...r,url:t,floorId:c,verticalOffset:l[0].verticalOffset+(r?.verticalOffset??0)}).forEach(g=>{let T=new jo(g.toString(),p,l[0]);this.#e.set(T.id,{model:T,entityId:g.toString(),groupId:p}),s.push(T)})}),s[0]}all(){let e=this.#o?.();if(!e)return[];let t=e.getByType("enterprise-venue");if(!t)return[];let r=t.extra?.models;if(!r?.models?.length)return[];let n=[];for(let i of r.models){if(!i?.url||!i.coordinate||!e.getById("floor",i.coordinate.floorId))continue;let s=new H({latitude:i.coordinate.latitude,longitude:i.coordinate.longitude,floorId:i.coordinate.floorId,verticalOffset:i.coordinate.verticalOffset}),l=this.add(s,i.url,{visible:!0,rotation:i.rotation,scale:i.scale,material:{Default:{color:i.color},Fabric:{color:i.color}},EXPERIMENTAL_clippingEnabled:!!i.manifolded});n.push(l)}return n}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Models.remove(t.entityId,t.groupId),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(({model:t})=>{let r=this.#e.get(t.id);r&&(e.push(t),this.currentMap?.Models.remove(r.entityId,r.groupId),this.#e.delete(t.id.toString()))}),e}};f();var vn=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getById(e){return this.#e.get(e)?.path}add(e,t){let r=this.currentMap;if(!r)throw new Error("currentMap should exist");let n=r.Paths.add(e,t),i=n.paths.map(s=>s.id.toString()),a=new _t(t?.id||ee(),n.animation,e,n.paths);for(let s of i)this.#e.set(s,{path:a,entityIds:i});return this.#e.set(a.id,{path:a,entityIds:i}),a}highlightPathSection(e,t,r,n){let i=this.currentMap?.api.getMapData()?.mapCenter;if(!i)return;let a=ln([e],t,r,i);if(!a)return;let s=n?.animationDuration??1500,l=()=>{},c=new Promise(h=>{l=h}),p=new ao({fraction:0}).to({fraction:1},s).onUpdate(h=>{for(let g of a)this.currentMap?.api.updateState(g.segment,{highlightCompleteFraction:h.fraction})}).onStart(()=>{for(let h of a)this.currentMap?.api.updateState(h.segment,{highlightStartFraction:h.startHighlightFraction,highlightEndFraction:h.endHighlightFraction,highlightColor:n?.color??"red",highlightWidthMultiplier:n?.widthMultiplier??1})}).onComplete(()=>{l(),this.currentMap?.api.removeTween(p)});return this.currentMap?.api.tweenGroup().add(p),p.start(),{animation:c}}clearHighlightedPathSection(e){this.currentMap?.api.updateState(e,{highlightCompleteFraction:0,highlightStartFraction:0,highlightEndFraction:0})}clearAllHighlightedPathSections(){for(let e of this.#e.values())this.clearHighlightedPathSection(e.path)}remove(e){let t=this.#e.get(e.id);t&&(this.currentMap?.Paths.remove(t.entityIds),this.#e.delete(e.id),t.entityIds.forEach(r=>this.#e.delete(r)))}removeAll(){let e=[];return this.#e.forEach(({path:t})=>{this.remove(t),e.push(t)}),e}};f();var In=class{#e=new Map;#t;get currentMap(){return this.#t()}constructor({currentMapGetter:e}){this.#t=e}getById(e){return this.#e.get(e)}add(e,t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Shapes.add(e,t||{},{floorId:r?.id}),a=new uo(i);return this.#e.set(a.id,a),a}remove(e){this.#e.get(e.id)&&(this.currentMap?.Shapes.remove(e),this.#e.delete(e.id.toString()))}removeAll(){let e=[];return this.#e.forEach(t=>{this.remove(t),e.push(t.id),this.#e.delete(t.id.toString())}),e}};f();var Sn=class{#e;get currentMap(){return this.#e()}constructor({currentMapGetter:e}){this.#e=e}setFromStyleCollection(e){for(let t in e)for(let r of this.currentMap?.floors||[]){if(e[t]==null||!r.layers.has(ye))continue;let n=r.layers.get(ye);for(let s of Object.values(e))if(s&&"polygons"in s&&"color"in s)for(let l of s.polygons)this.currentMap?.renderer.setState(l,{color:s.color});if(n?.layers.has(t)&&"color"in e[t]){let s=n.layers.get(t);s&&this.currentMap?.renderer.setState(s,{color:e[t].color})}if(n&&t===So&&!(Kt in e)){let s=n.layers.get(Kt);s&&"color"in e[t]&&this.currentMap?.renderer.setState(s,{color:e[t].color})}if(!r.layers.has(No))continue;let i=r.layers.get(No),a=r.facadesByStyleId.get(t);if(a&&a.length>0)for(let s of a){let l=i.layers.get(`${s}-${t}`);l&&"color"in e[t]&&this.currentMap?.renderer.setState(l,{color:e[t].color})}}}};f();var Rs={opacity:1},Dm=["flyTo","jumpTo","easeTo","panTo","panBy","zoomTo","zoomIn","zoomOut","setZoom","setCenter","setCenterClampedToGround","setCenterElevation","setBearing","setPitch","setRoll","rotateTo","resetNorth","resetNorthPitch","snapToNorth","setPadding","fitBounds","fitScreenCoordinates"],wm=new Set(Dm),Cr=class{#e;#t=[];#o={opacity:"initial"};#r={opacity:new Map};#i=new Set;#n=new WeakMap;constructor(e,t){this.#e=e,this.#t=t||[];let r=this.#e.map;r&&r.on("idle",()=>{this.#r.opacity.size||this.#s(r)})}#s(e){let t=e.getStyle().layers;t&&t.forEach(r=>{e.getLayoutProperty(r.id,"visibility")!=="none"&&(r.id==="background"||(r.type==="symbol"?this.#r.opacity.set(r.id,[e.getPaintProperty(r.id,"icon-opacity")??Rs.opacity,e.getPaintProperty(r.id,"text-opacity")??Rs.opacity]):this.#r.opacity.set(r.id,[e.getPaintProperty(r.id,`${r.type}-opacity`)??Rs.opacity,void 0])))})}#c(){Object.values(this.#r).forEach(e=>e.clear())}setStyle(e){if(this.#e.map){this.#e.map?.setStyle(e),this.#i.size&&(this.#i.clear(),this.hide()),this.#c(),this.#s(this.#e.map),this.setOpacity(this.#o.opacity),this.#e.map?.moveLayer(Ql);for(let[t,r]of this.#t||[])this.#e.hideOutdoorLayersIntersectingPolygons(t,r)}}get map(){let e=this.#e.map;if(e)return this.#a(e)}#a(e){let t=this.#n.get(e);if(t)return t;let r=Object.create(e),n=new Set,i=new Set;for(let a=e;a&&a!==Object.prototype;a=Object.getPrototypeOf(a))for(let s of Object.getOwnPropertyNames(a)){if(i.has(s)||s==="constructor")continue;i.add(s);let l=Object.getOwnPropertyDescriptor(a,s);!l||l.get||l.set||typeof e[s]=="function"&&(wm.has(s)?r[s]=(...c)=>(n.has(s)||(n.add(s),C.warn(`\`mapView.Outdoor.map.${s}()\` is not supported \u2014 Mappedin JS controls the outdoor camera, so this call may be overridden. Use \`mapView.Camera.animateTo()\`, \`Camera.set()\`, or \`Camera.focusOn()\` instead.`)),e[s](...c)):r[s]=e[s].bind(e))}return this.#n.set(e,r),r}get enabled(){return!!this.#e.map}get visible(){return this.#i.size===0}show(){let e=this.#e.map;if(!e)return;let t=e.getStyle().layers;t&&(t.forEach(r=>{this.#i.has(r.id)&&e.setLayoutProperty(r.id,"visibility","visible")}),this.#i.clear())}hide(e=[]){let t=this.#e.map;if(!t)return;let r=t.getStyle().layers;r&&r.forEach(n=>{let i=t.getLayoutProperty(n.id,"visibility");!e.includes(n.id)&&i!=="none"&&(t.setLayoutProperty(n.id,"visibility","none"),this.#i.add(n.id))})}setOpacity(e,t=[]){let r=this.#e.map;if(!r)return;let n=this.#e.map?.getStyle?.()?.layers;n&&r.once("idle",()=>{n.forEach(i=>{let a=r.getLayoutProperty(i.id,"visibility");if(!t.includes(i.id)&&a!=="none")try{let s=this.#r.opacity.get(i.id);s!==void 0&&(i.id==="background"||(i.type==="symbol"?(r.setPaintProperty(i.id,"icon-opacity",e==="initial"?s[0]:e),r.setPaintProperty(i.id,"text-opacity",e==="initial"?s[1]:e)):r.setPaintProperty(i.id,`${i.type}-opacity`,e==="initial"?s[0]:e)),this.#o.opacity=e)}catch(s){C.warn("Error setting opacity:",s)}})})}};f();function Am(){tc(!1)}var En=class{#e;#t=new Map;#o=new Map;constructor({currentMapGetter:e}){this.#e=e}labelAll(e={}){let t=[],r=new Set;return this.#e()?.Text3D.labelAll(e)?.forEach(({textInfo:n,target:i})=>{let a=n.id.toString(),s=this.#o.get(a);if(s){r.has(a)||t.push(s.text3DView),r.add(a);return}r.add(a);let l=new fo(a,i);this.#t.set(l.id,{targetId:i.id,text3d:a,text3DView:l}),this.#o.set(a,{text3DView:l}),t.push(l)}),t}label(e,t,r={}){if(this.#e())if(Te.is(e)){let i=this.#e()?.Text3D.label(e,t,r);if(!i)return;let a=i.textInfo.id.toString(),s=this.#o.get(a);if(s)return s.text3DView;let l=new fo(a,i.target);return this.#t.set(l.id,{targetId:i.target.id,text3d:a,text3DView:l}),this.#o.set(a,{text3DView:l}),l}else throw new Error("Non-space target is not supported")}add(e,t,r={}){let n=this.#e();if(!n)throw new Error("Current map not found.");if(!H.is(e))throw new Error("Target must be a Coordinate");let i=e.anchorTarget,a=n.Text3D.add(i,t,r);if(!a)throw new Error("Failed to add Text3D.");let s=a.id.toString(),l=this.#o.get(s);if(l)return C.warn(`Text3DView with ID ${s} already exists. A new Text3DView will not be created. Returning existing. `),l.text3DView;let c=new fo(s,e);return this.#t.set(c.id,{targetId:e.id,text3d:s,text3DView:c}),this.#o.set(s,{text3DView:c}),c}remove(e){let t=typeof e=="string"?e:e.id,r=this.#t.get(t);r&&(this.#e()?.Text3D.remove(r.text3d),this.#t.delete(t),this.#o.delete(r.text3d))}removeAll(){this.#t.forEach(e=>{this.#e()?.Text3D.remove(e.text3d)}),this.#t.clear(),this.#o.clear()}};f();f();import Wt from"zod";var Ad="doors",Ns=Wt.object({type:Wt.literal(Ad).default(Ad),color:Wt.string().default("#ffffff"),topColor:Wt.string().optional(),texture:Wt.object({url:Wt.string().optional()}).optional(),topTexture:Wt.object({url:Wt.string().optional()}).optional(),visible:Wt.boolean().default(!1),opacity:Wt.number().default(1)}),xi=Ns.partial(),c5=Wt.strictObject(Ns.shape);function Fd(o,e){let{color:t,topColor:r,texture:n,topTexture:i,opacity:a}=o,s=e?.visible??!1;return Ve(Ns,{visible:s,color:t,topColor:r,opacity:a,texture:n?{url:n}:void 0,topTexture:i?{url:i}:void 0})}function Bs(o,e){let t={featureCollection:{},container:{}};return o.visible!==void 0&&(t.container.visible=o.visible),o.color&&(o.color==="initial"?t.featureCollection.color=e?.initialColor:t.featureCollection.color=o.color),o.topColor&&(o.topColor==="initial"?t.featureCollection.topColor=e?.initialTopColor:t.featureCollection.topColor=o.topColor),o.texture?.url!==void 0&&(t.featureCollection.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.featureCollection.topTexture=o.topTexture.url),o.opacity!==void 0&&(t.featureCollection.opacity=o.opacity),t}function kd(o,e){let t={};return e==null||(o.color&&(o.color==="initial"?t.color=e.initialColor:t.color=o.color),o.topColor&&(o.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=o.topColor),o.visible!==void 0&&(t.visible=o.visible),o.texture?.url!==void 0&&(t.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.topTexture=o.topTexture.url),o.opacity!==void 0&&(t.opacity=o.opacity)),t}f();import{z as Mn}from"zod";var Ld="facade",Vs=Mn.object({type:Mn.literal(Ld).default(Ld),opacity:Mn.number().default(1),visible:Mn.boolean().default(!0)}),Rd=Vs.partial(),h5=Mn.strictObject(Vs.shape);function Nd(o){return Ve(Vs,{opacity:o.opacity,visible:o.visible})}f();import{z as X}from"zod";var zt="floor",Bd=`${zt}.footprint`,Vd=`${zt}.geometry`,jd=`${zt}.labels`,Gd=`${zt}.markers`,Ud=`${zt}.images`,Hd=`${zt}.occlusion`,Wd=`${zt}.paths`,zd=`${zt}.areas`,Xd=`${zt}.models`,Uo=X.object({type:X.literal(Bd).default(Bd),altitude:X.number().default(0),visible:X.boolean().default(!1),height:X.number().default(0),opacity:X.number().default(1),side:X.enum(["double","front","back"]).default("double"),color:X.string().default("#ffffff"),ceilingVisible:X.boolean().default(!0),basementMaskEnabled:X.boolean().default(!1),outline:X.boolean().default(!0),ceilingThickness:X.number().default(.2)}),I5=Uo.partial(),Ci=X.object({type:X.literal(Vd).default(Vd),opacity:X.number().default(1),visible:X.boolean().default(!0),maskId:X.number().nullable().default(null),maskEffect:X.enum(["hide","reveal"]).default("hide"),maskMode:X.enum(["mask","masked-object"]).default("mask"),maskEnabled:X.boolean().default(!1),effectStart:X.number().default(0),effectDistance:X.number().default(0),darkenAmount:X.number().default(0),darkenUseDepth:X.boolean().default(!0),desaturateAmount:X.number().default(0),desaturateUseDepth:X.boolean().default(!0),washOutAmount:X.number().default(0),washOutUseDepth:X.boolean().default(!1)}),$d=Ci.partial(),_i=X.object({type:X.literal(jd).default(jd),enabled:X.boolean().default(!0)}),Yd=_i.partial(),Pi=X.object({type:X.literal(Gd).default(Gd),enabled:X.boolean().default(!0)}),Zd=Pi.partial(),Oi=X.object({type:X.literal(Ud).default(Ud),visible:X.boolean().default(!0),collisionsEnabled:X.boolean().default(!1)}),Jd=Oi.partial(),Di=X.object({type:X.literal(Hd).default(Hd),enabled:X.boolean().default(!0)}),qd=Di.partial(),wi=X.object({type:X.literal(Wd).default(Wd),visible:X.boolean().default(!0)}),Qd=wi.partial(),Ai=X.object({type:X.literal(zt).default(zt),visible:X.boolean().default(!1),altitude:X.number().default(0)}),Fi=X.object({type:X.literal(zd).default(zd),visible:X.boolean().default(!0)}),Kd=Fi.partial(),ki=X.object({visible:X.boolean().default(!0)}),eu=ki.partial(),Li=X.object({type:X.literal(Xd).default(Xd),visible:X.boolean().default(!0)}),tu=Li.partial(),Fm=X.object({...Ai.shape,geometry:Ci,labels:_i,markers:Pi,images:Oi,footprint:Uo,occlusion:Di,paths:wi,areas:Fi,text3d:ki,models:Li}),ou=Ai.partial(),S5=X.object({...Ai.shape,geometry:Ci.partial(),labels:_i.partial(),markers:Pi.partial(),images:Oi.partial(),footprint:Uo.partial(),occlusion:Di.partial(),paths:wi.partial(),areas:Fi.partial(),text3d:ki.partial(),models:Li.partial()}).partial(),E5=X.strictObject({...Ai.shape,geometry:X.strictObject(Ci.shape),labels:X.strictObject(_i.shape),markers:X.strictObject(Pi.shape),images:X.strictObject(Oi.shape),footprint:X.strictObject(Uo.shape),occlusion:X.strictObject(Di.shape),paths:X.strictObject(wi.shape),areas:X.strictObject(Fi.shape),text3d:X.strictObject(ki.shape),models:X.strictObject(Li.shape)});function ru(o,e,t){if(!e){C.error("Floor is not defined. Cannot get floor state.");return}let r=e.layers.get(ye),n=r?t?.getState(r.containerId):void 0,i=e.layers.get(eo),a=e.layers.get(jt),s=e.footprintObject?.getState(),l=e.layers.get(Lo),c=l?t?.getState(l.containerId):void 0,p=e.layers.get(ur),h=p?t?.getState(p.containerId):void 0,g=!1;if(r?.layers)for(let te of r.layers.values()){let fe=t?.getState(te);if(fe?.children?.[0]){g=t?.getState(fe.children[0])?.enableImageCollisions??!1;break}}let T=e.layers.get(to),I=T?t?.getState(T.containerId):void 0,E=e.layers.get(Ro),D=E?t?.getState(E.containerId):void 0,x=e.layers.get(Gt),A=x?t?.getState(x.containerId):void 0,V=!0,L=!0,G=!0,U=!0;for(let[,te]of r.layers){let fe=t?.getState(te);fe?.maskId||(V=!1),fe?.maskEffect||(L=!1),fe?.maskMode||(G=!1),fe?.maskEnabled||(U=!1)}let R=t?.getInternalState().geometry3DMap.get(e.id),j=!1;return R?.type==="group-container"&&(j=(R?t?.getSystems().text3DSystem.getBatchedText(R):void 0)?.visible??!0),Ve(Fm,{geometry:{opacity:n?.opacity,visible:n?.visible,maskId:V,maskEffect:L,maskMode:G,maskEnabled:U},labels:{enabled:i?.visible},markers:{enabled:a?.visible},footprint:{altitude:s?.altitude,visible:s?.visible,height:s?.height,opacity:s?.opacity,side:s?.side,color:s?.color,ceilingVisible:s?.ceilingVisible,basementMaskEnabled:s?.basementMaskEnabled,outline:s?.outline,ceilingThickness:s?.ceilingThickness},images:{visible:h?.visible,collisionsEnabled:g},occlusion:{enabled:c?.visible},paths:{visible:I?.visible},areas:{visible:D?.visible},text3d:{visible:j},models:{visible:A?.visible},visible:o.visible,altitude:o.altitude})}f();import{z as de}from"zod";var nu="geometry",js=de.object({type:de.literal(nu).default(nu),visible:de.boolean().default(!0),color:de.union([de.string(),de.literal("initial")]).default("#ffffff"),topColor:de.union([de.string(),de.literal("initial")]).optional(),hoverColor:de.union([de.string(),de.literal("initial")]).optional(),interactive:de.boolean().default(!1),opacity:de.number().default(1),height:de.number().default(0),altitude:de.number().default(0),texture:de.object({url:de.string()}).optional(),topTexture:de.object({url:de.string()}).optional(),flipImageToFaceCamera:de.boolean().default(!1),enableImageCollisions:de.boolean().default(!1),borderVisible:de.boolean().default(!1),borderColor:de.string().optional(),borderWidth:de.number().optional()}),Gs=js.partial(),P5=de.strictObject(js.shape);function iu(o){let{altitude:e,interactive:t,hoverColor:r,color:n,visible:i,opacity:a,height:s,texture:l,topTexture:c,flipImageToFaceCamera:p,enableImageCollisions:h,topColor:g,borderVisible:T,borderColor:I,borderWidth:E}=o;return Ve(js,{interactive:t,hoverColor:r,color:n,visible:i,opacity:a,height:s,texture:l?{url:o.texture}:void 0,topTexture:c?{url:c}:void 0,flipImageToFaceCamera:p,enableImageCollisions:h,topColor:g,altitude:e,borderVisible:T,borderColor:I,borderWidth:E})}function au(o,e){let t={};return e==null||(o.color&&(o.color==="initial"?t.color=e.initialColor:t.color=o.color),o.topColor&&(o.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=o.topColor),o.visible!==void 0&&(t.visible=o.visible),o.texture?.url!==void 0&&(t.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.topTexture=o.topTexture.url),o.hoverColor!==void 0&&(t.hoverColor=o.hoverColor),o.interactive!==void 0&&(t.interactive=o.interactive),o.height!==void 0&&(t.height=o.height),o.opacity!==void 0&&(t.opacity=o.opacity),o.flipImageToFaceCamera!==void 0&&(t.flipImageToFaceCamera=o.flipImageToFaceCamera),o.enableImageCollisions!==void 0&&(t.enableImageCollisions=o.enableImageCollisions),o.altitude!==void 0&&(t.altitude=o.altitude),o.borderVisible!==void 0&&(t.borderVisible=o.borderVisible),o.borderColor!==void 0&&(t.borderColor=o.borderColor),o.borderWidth!==void 0&&(t.borderWidth=o.borderWidth)),t}f();import Pt from"zod";var Us="label",km=Pt.object({type:Pt.literal(Us).default(Us),text:Pt.string(),rank:Pt.custom(o=>Zn.safeParse(o).success||o==="initial"),appearance:Pt.custom(o=>oc.safeParse(o).success),interactive:Pt.boolean().default(!1),enabled:Pt.boolean().default(!0),textPlacement:Pt.union([Pt.enum(ba),Pt.array(Pt.enum(ba))]).default(Ta),occlude:Pt.boolean().default(!0)}),su=km.partial();function lu(o){let{text:e,enabled:t,options:r}=o;return{type:Us,text:e??"",appearance:rc(r?.appearance??{}),rank:r?.rank??"medium",enabled:t??!0,interactive:r?.interactive??!1,textPlacement:r?.textPlacement??Ta,occlude:r?.occlude??!0}}function cu(o,e){let t={options:{}};if(!t.options)throw new Error("options should exist");return o.text&&(t.text=o.text),o.appearance&&(t.options.appearance=o.appearance),o.textPlacement&&(t.options.textPlacement=o.textPlacement),o.rank!=null&&(o.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=o.rank),o.enabled!==void 0&&(t.enabled=o.enabled),o.interactive!==void 0&&(t.options.interactive=o.interactive),o.occlude!==void 0&&(t.options.occlude=o.occlude),o.enabled!==void 0&&(t.enabled=o.enabled),t}f();import Ee from"zod";var Hs="marker",Lm=Ee.object({type:Ee.literal(Hs).default(Hs),rank:Ee.custom(o=>Zn.safeParse(o).success||o==="initial"),placement:Ee.union([Ee.enum(va),Ee.array(Ee.enum(va))]).optional(),interactive:Ee.union([Ee.boolean(),Ee.literal("pointer-events-auto")]).default(!1),dynamicResize:Ee.boolean().default(!0),enabled:Ee.boolean().default(!0),zIndex:Ee.number().optional(),lowPriorityPin:Ee.object({enabled:Ee.boolean().optional(),size:Ee.number().positive().optional(),color:Ee.string().optional()}).optional(),element:Ee.custom(o=>o instanceof HTMLElement,{error:"Must be an HTMLElement instance"}),contentHTML:Ee.string(),occlude:Ee.boolean().default(!0),animated:Ee.boolean().default(!0)}),pu=Lm.omit({element:!0}).partial();function du(o,e){let t=e?.target?e.target.anchorTarget:void 0,{enabled:r,placement:n,element:i,dynamicResize:a,contentHTML:s,options:l,position:c,parent:p}=o,h=typeof p=="object"?p.id:p;return t==null&&(t=new H({latitude:c?.[1]??0,longitude:c?.[0]??0,floorId:h?.toString()})),{type:Hs,rank:l?.rank??"medium",interactive:l?.interactive??!1,enabled:r??!0,element:i,placement:n??[],zIndex:l?.zIndex,dynamicResize:a??!0,lowPriorityPin:l?.lowPriorityPin,contentHTML:s??"",occlude:l?.occlude??!0,animated:l?.animated??!0}}function uu(o,e){let t={};return t.options={},o.rank!=null&&(o.rank==="initial"?t.options.rank=e.initialRank||2:t.options.rank=o.rank),o.dynamicResize!=null&&(t.options.dynamicResize=o.dynamicResize),o.enabled!=null&&(t.enabled=o.enabled),o.interactive!=null&&(t.options.interactive=o.interactive),o.enabled!=null&&(t.enabled=o.enabled),o.contentHTML!=null&&(t.contentHTML=o.contentHTML),o.placement!=null&&(t.placement=o.placement),o.occlude!=null&&(t.options.occlude=o.occlude),o.zIndex!=null&&(t.options.zIndex=o.zIndex),o.animated!=null&&(t.options.animated=o.animated),t}f();import{z as ze}from"zod";var fu="shape",Ws=ze.object({type:ze.literal(fu).default(fu),visible:ze.boolean().default(!0),altitude:ze.number().default(0),color:ze.string().default("#ffffff"),hoverColor:ze.string().optional(),height:ze.number().default(0),opacity:ze.number().default(1),interactive:ze.boolean().default(!1),bevel:ze.object({enabled:ze.boolean().optional(),thickness:ze.number().optional(),size:ze.number().optional(),offset:ze.number().optional(),segments:ze.number().optional()}).optional(),position:ze.custom(o=>H.is(o))}),zs=Ws.partial(),W5=ze.strictObject(Ws.shape);function hu(o){let{children:e,bevel:t,position:r}=o;if(e==null||e.length<1){C.error(`Expected at least one child for Shape (${o.id}). Cannot get shape state.`);return}let{color:n,hoverColor:i,opacity:a,interactive:s,height:l,visible:c,altitude:p}=o;return Ve(Ws,{altitude:p,visible:c,color:n,hoverColor:i,height:l,opacity:a,interactive:s,bevel:t,position:new H({latitude:r[1],longitude:r[0],verticalOffset:p??0})})}function gu(o){let e=ne(zs,o,{warn:!0}),t={};return e.visible!==void 0&&(t.visible=e.visible),e.altitude!==void 0&&(t.altitude=e.altitude),e.color!==void 0&&(t.color=e.color),e.hoverColor!==void 0&&(t.hoverColor=e.hoverColor),e.opacity!==void 0&&(t.opacity=e.opacity),e.height!==void 0&&(t.height=e.height),e.interactive!==void 0&&(t.interactive=e.interactive),e.bevel!==void 0&&(t.bevel={enabled:e.bevel.enabled||!1,thickness:e.bevel.thickness,size:e.bevel.size,offset:e.bevel.offset,segments:e.bevel.segments}),e.position!==void 0&&(t.position=[e.position.longitude,e.position.latitude],t.altitude=e.position.verticalOffset),{mergedShapeState:t}}f();import Ri from"zod";var mu="text3d",yu=Ri.object({type:Ri.literal(mu).default(mu),position:Ri.custom(o=>o instanceof H,{error:"Must be a Coordinate instance"})}),bu=Jl.extend({...yu.shape}),Tu=ql.extend({...yu.shape}).partial(),q5=Ri.strictObject(bu.shape);function vu(o){let{position:e,visible:t,color:r,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:s,outlineOpacity:l,outlineBlur:c,outlineWidth:p,outlineOffsetX:h,outlineOffsetY:g,strokeWidth:T,strokeOpacity:I,strokeColor:E,fillOpacity:D,hoverColor:x,rotation:A,content:V}=o;return Ve(bu,{position:new H({latitude:e?.[1]??0,longitude:e?.[0]??0}),visible:t,color:r,flipToFaceCamera:n,font:i,fontSize:a,outlineColor:s,outlineOpacity:l,outlineBlur:c,outlineWidth:p,outlineOffsetX:h,outlineOffsetY:g,strokeWidth:T,strokeOpacity:I,strokeColor:E,fillOpacity:D,hoverColor:x,rotation:A,content:V})}f();import dt from"zod";var Iu="walls",Xs=dt.object({type:dt.literal(Iu).default(Iu),color:dt.string().default("#ffffff"),topColor:dt.string().optional(),texture:dt.object({url:dt.string()}).or(dt.undefined()),topTexture:dt.object({url:dt.string()}).or(dt.undefined()),visible:dt.boolean().default(!0),height:dt.number().default(0),opacity:dt.number().default(1)}),$s=Xs.partial(),oC=dt.strictObject(Xs.shape);function Su(o){let{color:e,topColor:t,texture:r,topTexture:n,visible:i,height:a,opacity:s}=o;return Ve(Xs,{visible:i,color:e,topColor:t,texture:r?{url:r}:void 0,topTexture:n?{url:n}:void 0,height:a,opacity:s})}function Ys(o,e){let t={};return e==null||(o.color&&(o.color==="initial"?t.color=e.initialColor:t.color=o.color),o.topColor&&(o.topColor==="initial"?t.topColor=e.initialTopColor:t.topColor=o.topColor),o.visible!==void 0&&(t.visible=o.visible),o.texture?.url!==void 0&&(t.texture=o.texture.url),o.topTexture?.url!==void 0&&(t.topTexture=o.topTexture.url),o.height!==void 0&&(t.height=o.height),o.opacity!==void 0&&(t.opacity=o.opacity)),t}f();import{z as Xt}from"zod";var Zs="image3d",Rm=Xt.object({type:Xt.literal(Zs).default(Zs),visible:Xt.boolean().default(!0),opacity:Xt.number().min(0).max(1).default(1),position:Xt.custom(o=>o instanceof H,{error:"Must be a Coordinate instance"}),width:Xt.number().default(1),height:Xt.number().default(1),rotation:Xt.number().default(0),verticalOffset:Xt.number().default(0),flipImagesToFaceCamera:Xt.boolean().default(!1),interactive:Xt.boolean().default(!1)}),Eu=Rm.partial();function Mu(o){let{position:e}=o;return{type:Zs,visible:o.visible??!0,opacity:o.opacity??1,position:new H({latitude:e?.[1]??0,longitude:e?.[0]??0,verticalOffset:e?.[2]}),width:o.width??1,height:o.height??1,rotation:o.rotation??0,verticalOffset:o.verticalOffset??0,flipImagesToFaceCamera:o.flipImageToFaceCamera??!1,interactive:o.interactive??!1}}f();import{z as oe}from"zod";var xu="model",Js=Yl.extend({type:oe.literal(xu).default(xu),color:oe.string().optional(),position:oe.custom(o=>H.is(o),{error:"Expected a Coordinate"}),visible:oe.boolean().default(!0),rotation:oe.tuple([oe.number(),oe.number(),oe.number()]).default([0,0,0]),scale:oe.tuple([oe.number(),oe.number(),oe.number()]).default([1,1,1]),verticalOffset:oe.number().default(0),opacity:oe.number().default(1),material:oe.record(oe.string(),Zl).optional(),interactive:oe.boolean().default(!1),clippingPlaneZOffset:oe.custom(o=>typeof o=="number"&&!Number.isNaN(o),{message:"Must be a valid number (including Infinity)"}).default(1/0),clippingPlaneTopColor:oe.string().default("#E67B5B"),clippingPlaneTopVisible:oe.boolean().default(!0)}),Cu=Js.extend({scale:oe.union([oe.number(),oe.tuple([oe.number(),oe.number(),oe.number()])]),rotation:oe.union([oe.number(),oe.tuple([oe.number(),oe.number(),oe.number()])])}).partial(),hC=oe.strictObject(Js.shape);function _u(o){let{color:e,position:t,rotation:r,scale:n,visible:i,interactive:a,opacity:s,material:l,verticalOffset:c,parent:p,clippingPlaneZOffset:h,clippingPlaneTopColor:g,clippingPlaneTopVisible:T}=o,I=typeof p=="object"?p?.id?.toString():p?.toString(),E=`${Gt}-`,D=I?.startsWith(E)?I.slice(E.length):I;return Ve(Js,{color:e,position:new H({latitude:t?.[1]??0,longitude:t?.[0]??0,verticalOffset:t?.[2],floorId:D}),rotation:r,scale:n,visible:i,interactive:a,opacity:s,material:l,verticalOffset:c,clippingPlaneZOffset:h,clippingPlaneTopColor:g,clippingPlaneTopVisible:T})}f();f();f();var Or=Hn(bf());Or.registerHelper({});Or.registerPartial({});var Tf=Or.template({compiler:[8,">= 4.3.0"],main:function(o,e,t,r,n){var i=o.lambda,a=o.escapeExpression,s=o.lookupProperty||function(l,c){if(Object.prototype.hasOwnProperty.call(l,c))return l[c]};return`<div class='mappedin-annotation-marker'>
252
+ <div style='width: `+a(i(e!=null?s(e,"size"):e,e))+"px; height: "+a(i(e!=null?s(e,"size"):e,e))+`px'>
253
+ <img src='`+a(i(e!=null?s(e,"icon"):e,e))+"' alt='"+a(i(e!=null?s(e,"name"):e,e))+"' width='"+a(i(e!=null?s(e,"size"):e,e))+"' height='"+a(i(e!=null?s(e,"size"):e,e))+`' />
254
+ </div>
255
+ </div>`},useData:!0});var p1=30,vf=new Set(["annotation"]);function d1(o){return Tf({size:p1,icon:o.icon?.url??"",name:o.name})}function u1(o={}){return{rank:"high",placement:["center"],interactive:!0,...o}}function f1(o,e){return e.Markers.add(o.coordinate,d1(o),u1())}function If(o,e){let t=[];for(let r of e)lo(r)&&Ut.is(r)&&r.icon!=null&&typeof r.icon.url=="string"&&r.icon.url.length>0&&t.push(f1(r,o));return t}f();var Sf=new Set(["space","object"]);function Ef(o,e){e.forEach(t=>{Qc(t)&&o.updateState(t,{interactive:!0})})}f();f();function Mf(o){return lo(o)?"anchorTarget"in o&&o.anchorTarget!=null:!1}f();f();var{entries:Nf,setPrototypeOf:xf,isFrozen:h1,getPrototypeOf:g1,getOwnPropertyDescriptor:m1}=Object,{freeze:nt,seal:Ot,create:wr}=Object,{apply:vl,construct:Il}=typeof Reflect<"u"&&Reflect;nt||(nt=function(e){return e});Ot||(Ot=function(e){return e});vl||(vl=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return e.apply(t,n)});Il||(Il=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new e(...r)});var On=_e(Array.prototype.forEach),y1=_e(Array.prototype.lastIndexOf),Cf=_e(Array.prototype.pop),Dn=_e(Array.prototype.push),b1=_e(Array.prototype.splice),rt=Array.isArray,Fn=_e(String.prototype.toLowerCase),gl=_e(String.prototype.toString),_f=_e(String.prototype.match),Dr=_e(String.prototype.replace),Pf=_e(String.prototype.indexOf),T1=_e(String.prototype.trim),v1=_e(Number.prototype.toString),I1=_e(Boolean.prototype.toString),Of=typeof BigInt>"u"?null:_e(BigInt.prototype.toString),Df=typeof Symbol>"u"?null:_e(Symbol.prototype.toString),Se=_e(Object.prototype.hasOwnProperty),wn=_e(Object.prototype.toString),Xe=_e(RegExp.prototype.test),ta=S1(TypeError);function _e(o){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return vl(o,e,r)}}function S1(o){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Il(o,t)}}function Q(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fn;if(xf&&xf(o,null),!rt(e))return o;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let i=t(n);i!==n&&(h1(e)||(e[r]=i),n=i)}o[n]=!0}return o}function E1(o){for(let e=0;e<o.length;e++)Se(o,e)||(o[e]=null);return o}function ut(o){let e=wr(null);for(let[t,r]of Nf(o))Se(o,t)&&(rt(r)?e[t]=E1(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=ut(r):e[t]=r);return e}function M1(o){switch(typeof o){case"string":return o;case"number":return v1(o);case"boolean":return I1(o);case"bigint":return Of?Of(o):"0";case"symbol":return Df?Df(o):"Symbol()";case"undefined":return wn(o);case"function":case"object":{if(o===null)return wn(o);let e=o,t=Ar(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:wn(r)}return wn(o)}default:return wn(o)}}function Ar(o,e){for(;o!==null;){let r=m1(o,e);if(r){if(r.get)return _e(r.get);if(typeof r.value=="function")return _e(r.value)}o=g1(o)}function t(){return null}return t}function x1(o){try{return Xe(o,""),!0}catch{return!1}}var wf=nt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ml=nt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),yl=nt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),C1=nt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),bl=nt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_1=nt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Af=nt(["#text"]),Ff=nt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Tl=nt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kf=nt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),oa=nt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P1=Ot(/\{\{[\w\W]*|[\w\W]*\}\}/gm),O1=Ot(/<%[\w\W]*|[\w\W]*%>/gm),D1=Ot(/\$\{[\w\W]*/gm),w1=Ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),A1=Ot(/^aria-[\-\w]+$/),Bf=Ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),F1=Ot(/^(?:\w+script|data):/i),k1=Ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vf=Ot(/^html$/i),L1=Ot(/^[a-z][.\w]*(-[.\w]+)+$/i),Lf=Object.freeze({__proto__:null,ARIA_ATTR:A1,ATTR_WHITESPACE:k1,CUSTOM_ELEMENT:L1,DATA_ATTR:w1,DOCTYPE_NAME:Vf,ERB_EXPR:O1,IS_ALLOWED_URI:Bf,IS_SCRIPT_OR_DATA:F1,MUSTACHE_EXPR:P1,TMPLIT_EXPR:D1}),An={element:1,text:3,progressingInstruction:7,comment:8,document:9},R1=function(){return typeof window>"u"?null:window},N1=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Rf=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jf(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R1(),e=Z=>jf(Z);if(e.version="3.4.1",e.removed=[],!o||!o.document||o.document.nodeType!==An.document||!o.Element)return e.isSupported=!1,e;let{document:t}=o,r=t,n=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:p=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:h,DOMParser:g,trustedTypes:T}=o,I=l.prototype,E=Ar(I,"cloneNode"),D=Ar(I,"remove"),x=Ar(I,"nextSibling"),A=Ar(I,"childNodes"),V=Ar(I,"parentNode");if(typeof a=="function"){let Z=t.createElement("template");Z.content&&Z.content.ownerDocument&&(t=Z.content.ownerDocument)}let L,G="",{implementation:U,createNodeIterator:R,createDocumentFragment:j,getElementsByTagName:te}=t,{importNode:fe}=r,ce=Rf();e.isSupported=typeof Nf=="function"&&typeof V=="function"&&U&&U.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Pe,ERB_EXPR:Oe,TMPLIT_EXPR:Ge,DATA_ATTR:De,ARIA_ATTR:ve,IS_SCRIPT_OR_DATA:ft,ATTR_WHITESPACE:io,CUSTOM_ELEMENT:Yt}=Lf,{IS_ALLOWED_URI:se}=Lf,ue=null,vt=Q({},[...wf,...ml,...yl,...bl,...Af]),ae=null,It=Q({},[...Ff,...Tl,...kf,...oa]),ie=Object.seal(wr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Je=null,Dt=null,qe=Object.seal(wr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oo=!0,mo=!0,Xo=!1,Ue=!0,wt=!1,$e=!0,St=!1,Lr=!1,$o=!1,At=!1,Do=!1,Yo=!1,Nn=!0,Rr=!1,Bn="user-content-",Nr=!0,He=!1,wo={},Ft=null,Vn=Q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ia=null,jn=Q({},["audio","video","img","source","image","track"]),M=null,d=Q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),u="http://www.w3.org/1998/Math/MathML",m="http://www.w3.org/2000/svg",b="http://www.w3.org/1999/xhtml",y=b,O=!1,_=null,F=Q({},[u,m,b],gl),w=Q({},["mi","mo","mn","ms","mtext"]),W=Q({},["annotation-xml"]),P=Q({},["title","style","font","a","script"]),k=null,B=["application/xhtml+xml","text/html"],J="text/html",z=null,K=null,q=t.createElement("form"),le=function(v){return v instanceof RegExp||v instanceof Function},Me=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(K&&K===v)return;(!v||typeof v!="object")&&(v={}),v=ut(v),k=B.indexOf(v.PARSER_MEDIA_TYPE)===-1?J:v.PARSER_MEDIA_TYPE,z=k==="application/xhtml+xml"?gl:Fn,ue=Se(v,"ALLOWED_TAGS")&&rt(v.ALLOWED_TAGS)?Q({},v.ALLOWED_TAGS,z):vt,ae=Se(v,"ALLOWED_ATTR")&&rt(v.ALLOWED_ATTR)?Q({},v.ALLOWED_ATTR,z):It,_=Se(v,"ALLOWED_NAMESPACES")&&rt(v.ALLOWED_NAMESPACES)?Q({},v.ALLOWED_NAMESPACES,gl):F,M=Se(v,"ADD_URI_SAFE_ATTR")&&rt(v.ADD_URI_SAFE_ATTR)?Q(ut(d),v.ADD_URI_SAFE_ATTR,z):d,ia=Se(v,"ADD_DATA_URI_TAGS")&&rt(v.ADD_DATA_URI_TAGS)?Q(ut(jn),v.ADD_DATA_URI_TAGS,z):jn,Ft=Se(v,"FORBID_CONTENTS")&&rt(v.FORBID_CONTENTS)?Q({},v.FORBID_CONTENTS,z):Vn,Je=Se(v,"FORBID_TAGS")&&rt(v.FORBID_TAGS)?Q({},v.FORBID_TAGS,z):ut({}),Dt=Se(v,"FORBID_ATTR")&&rt(v.FORBID_ATTR)?Q({},v.FORBID_ATTR,z):ut({}),wo=Se(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?ut(v.USE_PROFILES):v.USE_PROFILES:!1,Oo=v.ALLOW_ARIA_ATTR!==!1,mo=v.ALLOW_DATA_ATTR!==!1,Xo=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Ue=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,wt=v.SAFE_FOR_TEMPLATES||!1,$e=v.SAFE_FOR_XML!==!1,St=v.WHOLE_DOCUMENT||!1,At=v.RETURN_DOM||!1,Do=v.RETURN_DOM_FRAGMENT||!1,Yo=v.RETURN_TRUSTED_TYPE||!1,$o=v.FORCE_BODY||!1,Nn=v.SANITIZE_DOM!==!1,Rr=v.SANITIZE_NAMED_PROPS||!1,Nr=v.KEEP_CONTENT!==!1,He=v.IN_PLACE||!1,se=x1(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:Bf,y=typeof v.NAMESPACE=="string"?v.NAMESPACE:b,w=Se(v,"MATHML_TEXT_INTEGRATION_POINTS")&&v.MATHML_TEXT_INTEGRATION_POINTS&&typeof v.MATHML_TEXT_INTEGRATION_POINTS=="object"?ut(v.MATHML_TEXT_INTEGRATION_POINTS):Q({},["mi","mo","mn","ms","mtext"]),W=Se(v,"HTML_INTEGRATION_POINTS")&&v.HTML_INTEGRATION_POINTS&&typeof v.HTML_INTEGRATION_POINTS=="object"?ut(v.HTML_INTEGRATION_POINTS):Q({},["annotation-xml"]);let N=Se(v,"CUSTOM_ELEMENT_HANDLING")&&v.CUSTOM_ELEMENT_HANDLING&&typeof v.CUSTOM_ELEMENT_HANDLING=="object"?ut(v.CUSTOM_ELEMENT_HANDLING):wr(null);if(ie=wr(null),Se(N,"tagNameCheck")&&le(N.tagNameCheck)&&(ie.tagNameCheck=N.tagNameCheck),Se(N,"attributeNameCheck")&&le(N.attributeNameCheck)&&(ie.attributeNameCheck=N.attributeNameCheck),Se(N,"allowCustomizedBuiltInElements")&&typeof N.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=N.allowCustomizedBuiltInElements),wt&&(mo=!1),Do&&(At=!0),wo&&(ue=Q({},Af),ae=wr(null),wo.html===!0&&(Q(ue,wf),Q(ae,Ff)),wo.svg===!0&&(Q(ue,ml),Q(ae,Tl),Q(ae,oa)),wo.svgFilters===!0&&(Q(ue,yl),Q(ae,Tl),Q(ae,oa)),wo.mathMl===!0&&(Q(ue,bl),Q(ae,kf),Q(ae,oa))),qe.tagCheck=null,qe.attributeCheck=null,Se(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?qe.tagCheck=v.ADD_TAGS:rt(v.ADD_TAGS)&&(ue===vt&&(ue=ut(ue)),Q(ue,v.ADD_TAGS,z))),Se(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?qe.attributeCheck=v.ADD_ATTR:rt(v.ADD_ATTR)&&(ae===It&&(ae=ut(ae)),Q(ae,v.ADD_ATTR,z))),Se(v,"ADD_URI_SAFE_ATTR")&&rt(v.ADD_URI_SAFE_ATTR)&&Q(M,v.ADD_URI_SAFE_ATTR,z),Se(v,"FORBID_CONTENTS")&&rt(v.FORBID_CONTENTS)&&(Ft===Vn&&(Ft=ut(Ft)),Q(Ft,v.FORBID_CONTENTS,z)),Se(v,"ADD_FORBID_CONTENTS")&&rt(v.ADD_FORBID_CONTENTS)&&(Ft===Vn&&(Ft=ut(Ft)),Q(Ft,v.ADD_FORBID_CONTENTS,z)),Nr&&(ue["#text"]=!0),St&&Q(ue,["html","head","body"]),ue.table&&(Q(ue,["tbody"]),delete Je.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw ta('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ta('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=v.TRUSTED_TYPES_POLICY,G=L.createHTML("")}else L===void 0&&(L=N1(T,n)),L!==null&&typeof G=="string"&&(G=L.createHTML(""));nt&&nt(v),K=v},be=Q({},[...ml,...yl,...C1]),we=Q({},[...bl,..._1]),Le=function(v){let N=V(v);(!N||!N.tagName)&&(N={namespaceURI:y,tagName:"template"});let $=Fn(v.tagName),me=Fn(N.tagName);return _[v.namespaceURI]?v.namespaceURI===m?N.namespaceURI===b?$==="svg":N.namespaceURI===u?$==="svg"&&(me==="annotation-xml"||w[me]):!!be[$]:v.namespaceURI===u?N.namespaceURI===b?$==="math":N.namespaceURI===m?$==="math"&&W[me]:!!we[$]:v.namespaceURI===b?N.namespaceURI===m&&!W[me]||N.namespaceURI===u&&!w[me]?!1:!we[$]&&(P[$]||!be[$]):!!(k==="application/xhtml+xml"&&_[v.namespaceURI]):!1},he=function(v){Dn(e.removed,{element:v});try{V(v).removeChild(v)}catch{D(v)}},ge=function(v,N){try{Dn(e.removed,{attribute:N.getAttributeNode(v),from:N})}catch{Dn(e.removed,{attribute:null,from:N})}if(N.removeAttribute(v),v==="is")if(At||Do)try{he(N)}catch{}else try{N.setAttribute(v,"")}catch{}},it=function(v){let N=null,$=null;if($o)v="<remove></remove>"+v;else{let xe=_f(v,/^[\r\n\t ]+/);$=xe&&xe[0]}k==="application/xhtml+xml"&&y===b&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");let me=L?L.createHTML(v):v;if(y===b)try{N=new g().parseFromString(me,k)}catch{}if(!N||!N.documentElement){N=U.createDocument(y,"template",null);try{N.documentElement.innerHTML=O?G:me}catch{}}let Ye=N.body||N.documentElement;return v&&$&&Ye.insertBefore(t.createTextNode($),Ye.childNodes[0]||null),y===b?te.call(N,St?"html":"body")[0]:St?N.documentElement:Ye},at=function(v){return R.call(v.ownerDocument||v,v,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Qe=function(v){return v instanceof h&&(typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||!(v.attributes instanceof p)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function")},Ke=function(v){return typeof s=="function"&&v instanceof s};function Ae(Z,v,N){On(Z,$=>{$.call(e,v,N,K)})}let yo=function(v){let N=null;if(Ae(ce.beforeSanitizeElements,v,null),Qe(v))return he(v),!0;let $=z(v.nodeName);if(Ae(ce.uponSanitizeElement,v,{tagName:$,allowedTags:ue}),$e&&v.hasChildNodes()&&!Ke(v.firstElementChild)&&Xe(/<[/\w!]/g,v.innerHTML)&&Xe(/<[/\w!]/g,v.textContent)||$e&&v.namespaceURI===b&&$==="style"&&Ke(v.firstElementChild)||v.nodeType===An.progressingInstruction||$e&&v.nodeType===An.comment&&Xe(/<[/\w]/g,v.data))return he(v),!0;if(Je[$]||!(qe.tagCheck instanceof Function&&qe.tagCheck($))&&!ue[$]){if(!Je[$]&&Un($)&&(ie.tagNameCheck instanceof RegExp&&Xe(ie.tagNameCheck,$)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck($)))return!1;if(Nr&&!Ft[$]){let me=V(v)||v.parentNode,Ye=A(v)||v.childNodes;if(Ye&&me){let xe=Ye.length;for(let st=xe-1;st>=0;--st){let Et=E(Ye[st],!0);me.insertBefore(Et,x(v))}}}return he(v),!0}return v instanceof l&&!Le(v)||($==="noscript"||$==="noembed"||$==="noframes")&&Xe(/<\/no(script|embed|frames)/i,v.innerHTML)?(he(v),!0):(wt&&v.nodeType===An.text&&(N=v.textContent,On([Pe,Oe,Ge],me=>{N=Dr(N,me," ")}),v.textContent!==N&&(Dn(e.removed,{element:v.cloneNode()}),v.textContent=N)),Ae(ce.afterSanitizeElements,v,null),!1)},Gn=function(v,N,$){if(Dt[N]||Nn&&(N==="id"||N==="name")&&($ in t||$ in q))return!1;if(!(mo&&!Dt[N]&&Xe(De,N))){if(!(Oo&&Xe(ve,N))){if(!(qe.attributeCheck instanceof Function&&qe.attributeCheck(N,v))){if(!ae[N]||Dt[N]){if(!(Un(v)&&(ie.tagNameCheck instanceof RegExp&&Xe(ie.tagNameCheck,v)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(v))&&(ie.attributeNameCheck instanceof RegExp&&Xe(ie.attributeNameCheck,N)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(N,v))||N==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&Xe(ie.tagNameCheck,$)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck($))))return!1}else if(!M[N]){if(!Xe(se,Dr($,io,""))){if(!((N==="src"||N==="xlink:href"||N==="href")&&v!=="script"&&Pf($,"data:")===0&&ia[v])){if(!(Xo&&!Xe(ft,Dr($,io,"")))){if($)return!1}}}}}}}return!0},aa=Q({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Un=function(v){return!aa[Fn(v)]&&Xe(Yt,v)},Dl=function(v){Ae(ce.beforeSanitizeAttributes,v,null);let{attributes:N}=v;if(!N||Qe(v))return;let $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0},me=N.length;for(;me--;){let Ye=N[me],{name:xe,namespaceURI:st,value:Et}=Ye,kt=z(xe),sa=Et,Re=xe==="value"?sa:T1(sa);if($.attrName=kt,$.attrValue=Re,$.keepAttr=!0,$.forceKeepAttr=void 0,Ae(ce.uponSanitizeAttribute,v,$),Re=$.attrValue,Rr&&(kt==="id"||kt==="name")&&Pf(Re,Bn)!==0&&(ge(xe,v),Re=Bn+Re),$e&&Xe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Re)){ge(xe,v);continue}if(kt==="attributename"&&_f(Re,"href")){ge(xe,v);continue}if($.forceKeepAttr)continue;if(!$.keepAttr){ge(xe,v);continue}if(!Ue&&Xe(/\/>/i,Re)){ge(xe,v);continue}wt&&On([Pe,Oe,Ge],Fl=>{Re=Dr(Re,Fl," ")});let Al=z(v.nodeName);if(!Gn(Al,kt,Re)){ge(xe,v);continue}if(L&&typeof T=="object"&&typeof T.getAttributeType=="function"&&!st)switch(T.getAttributeType(Al,kt)){case"TrustedHTML":{Re=L.createHTML(Re);break}case"TrustedScriptURL":{Re=L.createScriptURL(Re);break}}if(Re!==sa)try{st?v.setAttributeNS(st,xe,Re):v.setAttribute(xe,Re),Qe(v)?he(v):Cf(e.removed)}catch{ge(xe,v)}}Ae(ce.afterSanitizeAttributes,v,null)},wl=function(v){let N=null,$=at(v);for(Ae(ce.beforeSanitizeShadowDOM,v,null);N=$.nextNode();)Ae(ce.uponSanitizeShadowNode,N,null),yo(N),Dl(N),N.content instanceof i&&wl(N.content);Ae(ce.afterSanitizeShadowDOM,v,null)};return e.sanitize=function(Z){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N=null,$=null,me=null,Ye=null;if(O=!Z,O&&(Z="<!-->"),typeof Z!="string"&&!Ke(Z)&&(Z=M1(Z),typeof Z!="string"))throw ta("dirty is not a string, aborting");if(!e.isSupported)return Z;if(Lr||Me(v),e.removed=[],typeof Z=="string"&&(He=!1),He){let Et=Z.nodeName;if(typeof Et=="string"){let kt=z(Et);if(!ue[kt]||Je[kt])throw ta("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof s)N=it("<!---->"),$=N.ownerDocument.importNode(Z,!0),$.nodeType===An.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?N=$:N.appendChild($);else{if(!At&&!wt&&!St&&Z.indexOf("<")===-1)return L&&Yo?L.createHTML(Z):Z;if(N=it(Z),!N)return At?null:Yo?G:""}N&&$o&&he(N.firstChild);let xe=at(He?Z:N);for(;me=xe.nextNode();)yo(me),Dl(me),me.content instanceof i&&wl(me.content);if(He)return Z;if(At){if(wt){N.normalize();let Et=N.innerHTML;On([Pe,Oe,Ge],kt=>{Et=Dr(Et,kt," ")}),N.innerHTML=Et}if(Do)for(Ye=j.call(N.ownerDocument);N.firstChild;)Ye.appendChild(N.firstChild);else Ye=N;return(ae.shadowroot||ae.shadowrootmode)&&(Ye=fe.call(r,Ye,!0)),Ye}let st=St?N.outerHTML:N.innerHTML;return St&&ue["!doctype"]&&N.ownerDocument&&N.ownerDocument.doctype&&N.ownerDocument.doctype.name&&Xe(Vf,N.ownerDocument.doctype.name)&&(st="<!DOCTYPE "+N.ownerDocument.doctype.name+`>
256
+ `+st),wt&&On([Pe,Oe,Ge],Et=>{st=Dr(st,Et," ")}),L&&Yo?L.createHTML(st):st},e.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Me(Z),Lr=!0},e.clearConfig=function(){K=null,Lr=!1},e.isValidAttribute=function(Z,v,N){K||Me({});let $=z(Z),me=z(v);return Gn($,me,N)},e.addHook=function(Z,v){typeof v=="function"&&Dn(ce[Z],v)},e.removeHook=function(Z,v){if(v!==void 0){let N=y1(ce[Z],v);return N===-1?void 0:b1(ce[Z],N,1)[0]}return Cf(ce[Z])},e.removeHooks=function(Z){ce[Z]=[]},e.removeAllHooks=function(){ce=Rf()},e}var Gf=jf();var B1={"connection-stairs-12x12":`<svg viewBox="0 0 12 12" stroke="none">
257
+ <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" />
258
+ <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" />
259
+ <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" />
260
+ <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" />
261
+ </svg>`,"connection-elevator-12x12":`<svg viewBox="0 0 12 12" stroke="none">
262
+ <circle cx="1.9375" cy="4.4375" r="0.9375" />
263
+ <circle cx="1.9375" cy="7.5625" r="0.9375" />
264
+ <path
265
+ fillRule="evenodd"
266
+ clipRule="evenodd"
267
+ 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"
268
+ />
269
+ </svg>`,"point-of-interest-12x12":`<svg viewBox="0 0 12 12" stroke="none">
270
+ <path
271
+ stroke="none"
272
+ id="Subtract"
273
+ fill-rule="evenodd"
274
+ clip-rule="evenodd"
275
+ 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"
276
+ />
277
+ </svg>`,"door-12x12":`<svg viewBox="0 0 13 12">
278
+ <path
279
+ stroke="none"
280
+ d="M4.02533 0.662341H9.61421C9.95171 0.662341 10.2264 0.937033 10.2264 1.27453V10.726C10.2264 11.0639 9.95218 11.3382 9.61421 11.3382H4.02533C3.69721 11.3382 3.42674 11.078 3.41408 10.7504V1.24696C3.4272 0.919297 3.69721 0.659149 4.02533 0.659149V0.662341ZM5.96969 5.22798H6.64563V6.7725H5.96969V5.22798ZM4.94219 1.39218L7.31267 2.6541C7.43501 2.71973 7.50533 2.84488 7.50533 2.97473C7.50721 4.99181 7.50674 7.00877 7.50674 9.02585C7.50674 9.17679 7.41487 9.30663 7.28361 9.36195L4.94217 10.6084H9.49653V1.39227L4.94219 1.39218Z"
281
+ />
282
+ </svg>`,"building-12x12":`<svg viewBox="0 0 12 12" stroke="none">
283
+ <path
284
+ d="M11.2374 9.75H10.5V4.5C10.5 4.30109 10.421 4.11032 10.2804 3.96967C10.1397 3.82902 9.94894 3.75 9.75003 3.75H7.68753C7.6378 3.75 7.59011 3.76976 7.55495 3.80492C7.51978 3.84008 7.50003 3.88777 7.50003 3.9375V9.75H6.75003V1.51922C6.75127 1.4024 6.72592 1.28683 6.67589 1.18125C6.62587 1.07567 6.55248 0.982864 6.46128 0.909845C6.33697 0.812924 6.18528 0.757635 6.02776 0.751829C5.87024 0.746023 5.71489 0.789995 5.58378 0.877501L1.83378 3.375C1.73091 3.44364 1.6466 3.53664 1.58837 3.64574C1.53014 3.75484 1.4998 3.87665 1.50003 4.00031V9.75H0.762687C0.66578 9.74857 0.571927 9.78389 0.500006 9.84885C0.428085 9.91382 0.383432 10.0036 0.37503 10.1002C0.371625 10.1515 0.378802 10.2029 0.396116 10.2513C0.413431 10.2997 0.440513 10.344 0.47568 10.3815C0.510847 10.419 0.553349 10.4489 0.600545 10.4693C0.647741 10.4897 0.698623 10.5001 0.75003 10.5H11.25C11.3014 10.5001 11.3523 10.4897 11.3995 10.4693C11.4467 10.4489 11.4892 10.419 11.5244 10.3815C11.5595 10.344 11.5866 10.2997 11.6039 10.2513C11.6213 10.2029 11.6284 10.1515 11.625 10.1002C11.6166 10.0036 11.572 9.91382 11.5001 9.84885C11.4281 9.78389 11.3343 9.74857 11.2374 9.75ZM3.56253 8.625C3.56264 8.67641 3.55219 8.72729 3.53181 8.77449C3.51143 8.82168 3.48156 8.86418 3.44406 8.89935C3.40657 8.93452 3.36224 8.9616 3.31383 8.97892C3.26543 8.99623 3.21398 9.00341 3.16269 9C3.06605 8.99159 2.9762 8.94688 2.91122 8.87485C2.84624 8.80283 2.81098 8.70886 2.81253 8.61188V7.88766C2.81121 7.79078 2.84657 7.69699 2.91151 7.62509C2.97645 7.55319 3.06618 7.50851 3.16269 7.5C3.21398 7.4966 3.26543 7.50377 3.31383 7.52109C3.36224 7.5384 3.40657 7.56548 3.44406 7.60065C3.48156 7.63582 3.51143 7.67832 3.53181 7.72552C3.55219 7.77271 3.56264 7.82359 3.56253 7.875V8.625ZM3.56253 6C3.56264 6.05141 3.55219 6.10229 3.53181 6.14949C3.51143 6.19668 3.48156 6.23918 3.44406 6.27435C3.40657 6.30952 3.36224 6.3366 3.31383 6.35392C3.26543 6.37123 3.21398 6.37841 3.16269 6.375C3.06609 6.36649 2.9763 6.32174 2.91135 6.24974C2.84639 6.17774 2.81109 6.08383 2.81253 5.98688V5.26266C2.81121 5.16578 2.84657 5.07199 2.91151 5.00009C2.97645 4.92819 3.06618 4.88351 3.16269 4.875C3.21398 4.8716 3.26543 4.87877 3.31383 4.89609C3.36224 4.9134 3.40657 4.94048 3.44406 4.97565C3.48156 5.01082 3.51143 5.05332 3.53181 5.10052C3.55219 5.14771 3.56264 5.19859 3.56253 5.25V6ZM5.43753 8.625C5.43764 8.67641 5.42719 8.72729 5.40681 8.77449C5.38643 8.82168 5.35656 8.86418 5.31906 8.89935C5.28157 8.93452 5.23724 8.9616 5.18883 8.97892C5.14043 8.99623 5.08898 9.00341 5.03769 9C4.94122 8.9916 4.8515 8.94702 4.78654 8.8752C4.72159 8.80338 4.68622 8.70964 4.68753 8.61281V7.88766C4.68633 7.79086 4.72174 7.69718 4.78667 7.62539C4.8516 7.55359 4.94126 7.50897 5.03769 7.50047C5.08898 7.49706 5.14043 7.50424 5.18883 7.52156C5.23724 7.53887 5.28157 7.56595 5.31906 7.60112C5.35656 7.63629 5.38643 7.67879 5.40681 7.72598C5.42719 7.77318 5.43764 7.82406 5.43753 7.87547V8.625ZM5.43753 6C5.43764 6.05141 5.42719 6.10229 5.40681 6.14949C5.38643 6.19668 5.35656 6.23918 5.31906 6.27435C5.28157 6.30952 5.23724 6.3366 5.18883 6.35392C5.14043 6.37123 5.08898 6.37841 5.03769 6.375C4.94126 6.3665 4.8516 6.32188 4.78667 6.25008C4.72174 6.17829 4.68633 6.08461 4.68753 5.98781V5.26266C4.68633 5.16586 4.72174 5.07218 4.78667 5.00039C4.8516 4.92859 4.94126 4.88397 5.03769 4.87547C5.08898 4.87206 5.14043 4.87924 5.18883 4.89656C5.23724 4.91387 5.28157 4.94095 5.31906 4.97612C5.35656 5.01129 5.38643 5.05379 5.40681 5.10098C5.42719 5.14818 5.43764 5.19906 5.43753 5.25047V6Z"
285
+ stroke="none"
286
+ />
287
+ </svg>`,"ladder-12x12":`<svg viewBox="0 0 12 12">
288
+ <g id="surface1">
289
+ <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.34375 0.375 L 2.53125 0.375 L 2.625 11.53125 L 2.34375 11.625 L 2.25 0.46875 Z M 2.34375 0.375 "/>
290
+ <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 9.46875 0.375 L 9.65625 0.375 L 9.75 11.53125 L 9.46875 11.625 L 9.375 0.46875 Z M 9.46875 0.375 "/>
291
+ <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 2.25 L 2.25 1.875 L 9.75 1.875 L 9.75 2.25 Z M 2.25 2.25 "/>
292
+ <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 4.875 L 2.25 4.5 L 9.75 4.5 L 9.75 4.875 Z M 2.25 4.875 "/>
293
+ <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 7.5 L 2.25 7.125 L 9.75 7.125 L 9.75 7.5 Z M 2.25 7.5 "/>
294
+ <path style=" stroke:none;fill-rule:nonzero;fill:rgb(94.117647%,94.117647%,94.117647%);fill-opacity:1;" d="M 2.25 10.125 L 2.25 9.75 L 9.75 9.75 L 9.75 10.125 Z M 2.25 10.125 "/>
295
+ </g>
296
+ </svg>`},V1=/<svg([^>]*)>/g;function Uf(o,e,t){let r=B1[o];return r?r.replace(V1,`<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:${e}; width:${t}px; height:${t}px">`):null}function j1(o){return Gf.sanitize(o,{USE_PROFILES:{svg:!0}})}function G1(o,e){let n=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;return n==null||n.tagName==="parsererror"||n.tagName.toLowerCase()!=="svg"?(C.error("Failed to parse SVG",{svg:o,tagName:n?.tagName}),o):(e!=null&&(n.setAttribute("color",e),n.querySelectorAll("*").forEach(s=>{(s.getAttribute("fill")!=null||s.tagName==="path")&&s.getAttribute("fill")!=="none"&&s.setAttribute("fill","currentColor"),s.getAttribute("stroke")!=null&&s.getAttribute("stroke")!=="none"&&s.setAttribute("stroke","currentColor")})),new XMLSerializer().serializeToString(n))}async function Hf(o,e){let t="";try{if(o.trim()==="")throw new Error("URL is empty!");e?.style==="fill"&&(o=o.replace(".svg","-fill.svg"));let r=await ht()(o),n=r.headers.get("content-type");if(n?.includes("image/svg+xml")){let i=await r.text();return t=j1(i),e?.color!=null&&(t=G1(t,e.color)),{icon:t,type:"svg"}}else{if(n?.includes("image"))return{icon:o,type:"image"};throw new Error(`Expected SVG or Image content, but received: ${n}`)}}catch(r){return C.error(`Failed to fetch icon from ${o}.`,r),null}}f();function Wf(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Restroom")))}function zf(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Parking")))}var $f=new Set(["connection","point-of-interest","space","object","door","facade"]),zo={default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F",parking:"#418425",door:"#A0552C"},Fr={elevator:"connection-elevator-12x12",escalator:"connection-stairs-12x12",stairs:"connection-stairs-12x12",point:"point-of-interest-12x12",door:"door-12x12",building:"building-12x12",ladder:"ladder-12x12"};function U1(o){let e=null;if(We.is(o))switch(o.type){case"elevator":e=Fr.elevator;break;case"ladder":e=Fr.ladder;break;case"escalator":case"stairs":default:e=Fr.stairs}else yt.is(o)?e=Fr.point:et.is(o)?e=Fr.door:Ne.is(o)&&(e=Fr.building);return e!=null?Uf(e,"#FFFFFF",12):null}function Xf(o){return We.is(o)?zo.connection:Ne.is(o)?zo.default:Wf(o)?zo.washroom:zf(o)?zo.parking:yt.is(o)?zo.point:et.is(o)?zo.door:zo.default}async function H1(o,e){let t=null,r="locationProfiles"in o?o.locationProfiles.find(n=>n.icon!=null)?.icon:null;if(r?.url!=null&&(t=await Hf(r.url,{color:e.color,style:"fill"})),t==null){let n=U1(o);n!=null&&(t={icon:n,type:"svg"})}return t}function W1(o){return We.is(o)||et.is(o)?"low":yt.is(o)||Ne.is(o)?"high":"medium"}async function z1(o){let e={appearance:{color:Xf(o),pinOutlineColor:Xf(o),iconPadding:8,iconSize:24,textSize:12.5,iconScale:{on:"zoom-level",input:[18,20],output:[.7,1]}},rank:W1(o),interactive:!0},t=await H1(o,{color:"#FFFFFF"});return t!=null&&(e.appearance.icon=t.icon,t.type==="svg"?Ne.is(o)&&(e.appearance.iconSize=30,e.appearance.iconPadding=10):t.type==="image"&&(e.appearance.iconSize=48,e.appearance.iconPadding=2,e.appearance.pinOutlineColor="#FFFFFF",e.rank="high")),e}async function Yf(o,e){return(await Promise.all(e.map(async r=>{let n=[];if(!lo(r))return n;let i=await z1(r);return We.is(r)?n=r.coordinates.map(a=>o.Labels.add(a,r.name,i)):Ne.is(r)?r.spaces.length>0&&r.floorStack.name!=null&&r.floorStack.name!==""&&n.push(o.Labels.add(r.spaces[0],r.floorStack.name,i)):Mf(r)&&Wa(r)&&n.push(o.Labels.add(r,r.name,i)),n}))).flat()}async function Zf(o,e){let t=o.getMapDataInternal();if(!t)throw new Error("Map data not found");let r=t.getAllOfTypes($f,e),n=t.getAllOfTypes(vf,e),i=t.getAllOfTypes(Sf,e),[a,s]=await Promise.all([r.length>0?Yf(o,r):[],n.length>0?If(o,n):[],i.length>0?Ef(o,i):[]]);return{labels:a,markers:s}}var ra=.05,kn=class extends Mt{core;mapObjects=[];id;mapDataExternal={};mapsByFloorId={};mapData;currentMap;hiddenOutdoorGeometries=[];lastFacadeIntersected;#e=!1;#t=!1;mapView;externalPubSub;get manualFloorVisibility(){return this.#e}set manualFloorVisibility(e){this.#e=e,this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:e})}get hidePathsNotOnCurrentFloor(){return this.#t}set hidePathsNotOnCurrentFloor(e){this.#t=e,this.currentMap?.updateOutdoorPathLayerVisibility()}Camera;Labels;Text3D;Markers;Models;Paths;Exporter;Navigation;Outdoor;Shapes;Style;Image3D;constructor(e,t,r){super(),this.core=e,this.mapView=t,this.externalPubSub=r,this.Camera=new pn(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new mn("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{r.publish("pre-render")},{signal:this.signal}),this.core.on("post-render",()=>{r.publish("post-render")},{signal:this.signal}),this.core.on("resize",()=>{r.publish("resize")},{signal:this.signal}),this.core.on("render-error",({error:c})=>{r.publish("render-error",{error:new Gl(c instanceof Error?c.message:"Unknown error")})},{signal:this.signal});let i=c=>{let p=c;c.startsWith(`${ye}-`)&&(p=c.slice(ye.length+1));let h=this.getMapDataObject(p);switch(h?.__type){case"facade":return h;case"floor":return h.floorStack.facade;default:return null}};this.core.on("geometry-in-focus",c=>{let p=new Set;for(let h of c){let g=i(h);g&&p.add(g)}r.publish("facades-in-view-change",{facades:Array.from(p)})},{signal:this.signal}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{r.publish("state-change-internal",{Camera:this.getCameraState()})},{signal:this.signal});let a=new an(this.Camera,{precision:7});this.core.on("camera-change",()=>{r.publish("camera-change",a)},{signal:this.signal}),this.core.on("pan-bounds-change",c=>{r.publish("camera-bounds-change",ci(c,this.core.convert3DMapPositionToCoordinate))},{signal:this.signal}),this.core.camera.on("padding-change",({padding:c})=>{r.publish("camera-screen-offsets-change",c)},{signal:this.signal});let s=c=>p=>{let h=[],g=[],T=[],I=[],E=[];p.labels.forEach(R=>{let j=this.Labels.getById(R.toString());j&&h.push(j.label)}),p.markers.forEach(R=>{let j=this.Markers.getById(R.toString())||this.Navigation.getMarkerById(R.toString());j&&g.push(j.marker)}),p.models.forEach(R=>{let j=this.Models.getById(R.toString());j&&T.push(j.model)}),p.images.forEach(R=>{let j=this.Image3D.getById(R.toString());j&&I.push(j.image)}),p.paths.forEach(R=>{let j=this.Paths.getById(R.toString())||this.Navigation.getPathById(R.toString());j&&!E.includes(j)&&E.push(j)});let D=p.geometry,x;D.length>0&&(x=D.map(R=>this.getMapDataInternal()?.getById("space",R)).filter(Boolean)[0],x||(x=D.map(R=>this.getMapDataInternal()?.getById("object",R)).filter(Boolean)[0]),x||(x=D.map(R=>this.getMapDataInternal()?.getById("area",R)).filter(Boolean)[0]),x||(x=D.map(R=>this.Shapes.getById(R)).filter(Boolean)[0]));let A=p.containers.reduce((R,j)=>{let te=this.getMapDataInternal()?.getById("floor",j);return te&&ct.is(te)&&R.push(te),R},[]),V,L=0;if(A.length>0){V=A[0].id;let R=this.core.getState(V);L=p.coordinate[2]?p.coordinate[2]-R.altitude:L}let G;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(R=>{this.core.setState(R.id,{hovered:!1})}),x&&Te.is(x)&&(G=D.map(R=>this.getMapDataInternal()?.facadesBySpaceId[R]).filter(Boolean)[0],G&&G.spaces.forEach(R=>{this.core.setState(R.id,{hovered:!0})})),this.lastFacadeIntersected=G;let U={coordinate:new H({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:V,verticalOffset:L}),spaces:x&&Te.is(x)?[x]:[],objects:x&&pt.is(x)?[x]:[],areas:x&&Ct.is(x)?[x]:[],shapes:x&&uo.is(x)?[x]:[],markers:g,labels:h,models:T,images:I,paths:E,floors:A,facades:G?[G]:[]};"pointerEvent"in p&&(U.pointerEvent=p.pointerEvent),r.publish(c,U)};this.core.on("hover",s("hover"),{signal:this.signal}),this.core.on("click",s("click"),{signal:this.signal}),this.core.on("user-interaction-start",()=>{r.publish("user-interaction-start")},{signal:this.signal}),this.core.on("user-interaction-end",()=>{r.publish("user-interaction-end")},{signal:this.signal});let l={currentMapGetter:()=>this.currentMap,mapDataInternalGetter:()=>this.mapData?.internal};this.Markers=new yn(l),this.Models=new Tn(l),this.Labels=new un(l),this.Text3D=new En(l),this.Exporter=new dn(l),this.Paths=new vn(l),this.Navigation=new cn(this),this.on("navigation-state-change",c=>{this.externalPubSub.publish("state-change-internal",{Navigation:c})}),this.on("navigation-connection-click",c=>{this.externalPubSub.publish("navigation-connection-click",c)}),this.on("navigation-active-path-change",c=>{this.externalPubSub.publish("navigation-active-path-change",c)}),this.Outdoor=new Cr(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{r.publish("outdoor-view-loaded")},{signal:this.signal}),this.core.on("outdoor-style-loaded",()=>{r.publish("outdoor-style-loaded")},{signal:this.signal})),this.Image3D=new bn(l),this.Shapes=new In(l),this.Style=new Sn(l)}preloadFloors(e){e.forEach(t=>{t instanceof ct&&this.core.setState(t.id,{preloadGeometry:!0})})}updateState(e,t){if(t==null||typeof t!="object")return;let r=this.currentMap.options?.disableUpdateStateValidation??!1;if(e==="interior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(ye);if(a){let s=a.layers.get(So);s&&this.core.hasState(s)&&this.core.setState(s,Ys(ne($s,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="exterior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(ye);if(a){let s=a.layers.get(Kt);s&&this.core.hasState(s)&&this.core.setState(s,Ys(ne($s,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="interior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(ye),s=i.layers.get(pr);if(!a)return;let l=a.layers.get(lr);if(!l||!this.core.hasState(l))return;let c=Bs(ne(xi,t,{warn:!0,disableValidation:r}),this.core.getState(l));Object.keys(c.featureCollection).length>0&&this.core.setState(l,c.featureCollection),s&&Object.keys(c.container).length>0&&this.core.setState(s.containerId,c.container)});return}if(e==="exterior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(ye),s=i.layers.get(dr);if(!a)return;let l=a.layers.get(cr);if(!l||!this.core.hasState(l))return;let c=Bs(ne(xi,t,{warn:!0,disableValidation:r}),this.core.getState(l));Object.keys(c.featureCollection).length>0&&this.core.setState(l,c.featureCollection),s&&Object.keys(c.container).length>0&&this.core.setState(s.containerId,c.container)});return}let n=typeof e=="string"?this.getMapDataObject(e):e;if(n){if(n.__type!==_t.__type&&!this.core.hasState(n.id)){C.warn(`Failed to update state for "${n.id}". No ${n.__type} found with that ID.`);return}if(po.is(n))return this.core.setState(n.id,cu(ne(su,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(oo.is(n))return this.core.setState(n.id,uu(ne(pu,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(Te.is(n)||pt.is(n)){let i=this.core.getState(n.id);i!=null&&this.core.setState(n.id,au(ne(Gs,t,{warn:!0,disableValidation:r}),i))}if(Ct.is(n)&&this.core.setState(n.id,ne(Gs,t,{warn:!0,disableValidation:r})),mt.is(n)&&this.core.setState(n.id,ne(Eu,t,{warn:!0,disableValidation:r})),et.is(n)&&this.core.setState(n.id,kd(ne(xi,t,{warn:!0,disableValidation:r}),this.core.getState(n.id))),uo.is(n)){let i=gu(ne(zs,t,{warn:!0,disableValidation:r}));i.mergedShapeState&&this.core.setState(n.id,i.mergedShapeState)}if(jo.is(n)){let{position:i,scale:a,rotation:s,...l}=ne(Cu,t,{warn:!0,disableValidation:r}),c=l;i&&(c.position=[i.longitude,i.latitude,i.verticalOffset]),a!=null&&(Array.isArray(a)?c.scale=a:c.scale=[a,a,a]),s!=null&&(Array.isArray(s)?c.rotation=s:c.rotation=[s,s,s]),i&&n.updateTarget(i),this.core.setState(n.id,c)}if(ct.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;let a=ne(ou,t,{warn:!0,disableValidation:r});this.core.setState(n.id,a);let s=i.layers.get(ye);if(s!=null&&"geometry"in t&&t.geometry){this.core.setState(s.containerId,ne($d,t.geometry,{warn:!0,disableValidation:r}));for(let E of s.layers.keys())this.core.setState(s.layers.get(E),{maskId:t.geometry.maskId??void 0,maskEffect:t.geometry.maskEffect??void 0,maskMode:t.geometry.maskMode??void 0,maskEnabled:t.geometry.maskEnabled??void 0,effectStart:t.geometry.effectStart??void 0,effectDistance:t.geometry.effectDistance??void 0,darkenAmount:t.geometry.darkenAmount??void 0,darkenUseDepth:t.geometry.darkenUseDepth??void 0,desaturateAmount:t.geometry.desaturateAmount??void 0,desaturateUseDepth:t.geometry.desaturateUseDepth??void 0,washOutAmount:t.geometry.washOutAmount??void 0,washOutUseDepth:t.geometry.washOutUseDepth??void 0})}let l=i.layers.get(eo);if(l!=null&&"labels"in t&&t.labels){let E=ne(Yd,t.labels,{warn:!0,disableValidation:r});"enabled"in E&&typeof E.enabled=="boolean"&&l.setVisible(E.enabled)}let c=i.layers.get(jt);if(c!=null&&"markers"in t&&t.markers){let E=ne(Zd,t.markers,{warn:!0,disableValidation:r});"enabled"in E&&typeof E.enabled=="boolean"&&c.setVisible(E.enabled)}if(i.footprintObject&&"footprint"in t&&t.footprint){let E=ne(Uo,t.footprint,{warn:!0,disableValidation:r});i.footprintObject.update({altitude:E.altitude,visible:E.visible,height:E.height,opacity:E.opacity,side:E.side,color:E.color,ceilingVisible:E.ceilingVisible,ceilingThickness:E.ceilingThickness,basementMaskEnabled:E.basementMaskEnabled,outline:E.outline})}if(i.gapFootprintObject&&"visible"in t){let E={visible:t.visible};if("footprint"in t&&t.footprint){let D=ne(Uo,t.footprint,{warn:!0,disableValidation:r});D.color!==void 0&&(E.color=D.color),D.opacity!==void 0&&(E.opacity=D.opacity),D.outline!==void 0&&(E.outline=D.outline)}i.gapFootprintObject.update(E)}let p=i.layers.get(Lo);if(p!=null&&"occlusion"in t&&t.occlusion){let E=ne(qd,t.occlusion,{warn:!0,disableValidation:r});"enabled"in E&&typeof E.enabled=="boolean"&&p.setVisible(E.enabled)}let h=i.layers.get(ur);if(h!=null&&"images"in t&&t.images){let E=ne(Jd,t.images,{warn:!0,disableValidation:r});if("visible"in E&&typeof E.visible=="boolean"&&h.setVisible(E.visible),"collisionsEnabled"in E&&typeof E.collisionsEnabled=="boolean"&&s!=null)for(let D of s.layers.values()){let x=this.core.getState(D);if(x?.children)for(let A of x.children)this.core.setState(A,{enableImageCollisions:E.collisionsEnabled})}}let g=i.layers.get(to);if(g!=null&&"paths"in t&&t.paths!=null){let E=ne(Qd,t.paths,{warn:!0,disableValidation:r});E.visible!=null&&typeof E.visible=="boolean"&&g.setVisible(E.visible)}let T=i.layers.get(Ro);if(T!=null&&"areas"in t&&t.areas!=null){let E=ne(Kd,t.areas,{warn:!0,disableValidation:r});E.visible!=null&&typeof E.visible=="boolean"&&T.setVisible(E.visible)}let I=i.layers.get(Gt);if(I!=null&&"models"in t&&t.models!=null){let E=ne(tu,t.models,{warn:!0,disableValidation:r});E.visible!=null&&typeof E.visible=="boolean"&&I.setVisible(E.visible)}if("text3d"in t&&t.text3d!=null){let E=ne(eu,t.text3d,{warn:!0,disableValidation:r});E.visible!=null&&i.setBatchedTextVisible(E.visible)}}if(Ne.is(n)){let i=this.core.getState(n.id);for(let a of i.children)a.type==="group-container"&&this.core.setState(a.id,ne(Rd,t,{warn:!0,disableValidation:r}))}if(fo.is(n)&&this.core.setState(n.id,ne(Tu,t,{warn:!0,disableValidation:r})),_t.is(n)){let i=ne(Ls,t,{warn:!0,disableValidation:r}),a=xr(i);for(let s of n.segments)this.core.setState(s.id,a)}if(xo.is(n)){let i=ne(Ls,t,{warn:!0,disableValidation:r}),a=xr(i);this.core.setState(n.id,a)}}}getMapDataObject(e){return this.getMapDataInternal()?.getMapDataById(e)}update=()=>{this.core.render()};getMapDataInternal(){if(this.mapData)return Hr(this.mapData)}getMapData(){return this.mapData}addMap(e,t){return new Promise(r=>{let n;try{n=Hr(e)}catch(p){C.error("Error adding map",p),r(e);return}this.mapDataExternal[e.mapName]=e,this.mapData=e;let{mvf:i}=n,a=i["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new H(a[1],a[0])});let s=i["manifest.geojson"].features[0].properties.name,l=new mn(`mapObject-${s}`,n,t,this);this.currentMap=l,this.currentMap.loadAllFloors(),this.currentMap.setFloor(this.currentMap.startingFloorId),this.core.renderSync();let c=t?.outdoorView?.layersHiddenByGeometry??[];if(c.length>0){let p=[];for(let h of l.floorStacksById.values())h.isOutdoors===!1&&h.defaultFloor.footprint&&h.defaultFloor.footprint.geometry!=null&&h.defaultFloor.footprint.geometry?.coordinates.length>0&&p.push(h.defaultFloor.footprint);p.length>0&&(this.core.hideOutdoorLayersIntersectingPolygons(p,c),this.hiddenOutdoorGeometries.push([p,c]))}if(this.mapObjects.push(l),n.getMVFFeatureByType("floor").forEach(p=>{this.mapsByFloorId[p.id]=l}),l.on("floor-change-start",p=>{this.externalPubSub.publish("floor-change-start",{reason:p.reason,floor:this.getMapDataInternal()?.getById("floor",p.floorId)??this.currentFloor,previousFloor:this.getMapDataInternal()?.getById("floor",p.previousFloorId)??this.currentFloor})},{signal:this.signal}),l.on("floor-change",p=>{this.externalPubSub.publish("floor-change",{reason:p.reason,floor:this.currentFloor,previousFloor:this.getMapDataInternal()?.getById("floor",p.previousFloorId)??this.currentFloor}),this.externalPubSub.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})},{signal:this.signal}),t?.zoomLevel!=null)this.core.camera.setZoomLevel(t.zoomLevel),r(e);else if(this.core.mode!=="outdoors-overlay"&&this.currentFloor){let p=t?.screenOffsets??{top:ra*this.core.canvasHeight,left:ra*this.core.canvasWidth,right:ra*this.core.canvasWidth,bottom:ra*this.core.canvasHeight};this.Camera.focusOn(this.currentFloor,{duration:Kc,screenOffsets:p}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),r(e)})}else r(e)})}setFloor(e,t){return this.currentMap.setFloor(Yr(e),t)}setFloorStack(e,t){return this.currentMap.setFloorStack(Yr(e),t)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){let e=this.currentMap.currentFloorStack.id;if(!e)throw new Ce("Missing currentFloorStack.");let t=this.mapData?.getById("floor-stack",e);if(!t)throw new Ce("FloorStack was not found in map data.");return t}get currentFloor(){let e=this.currentMap.currentFloor.id;if(!e)throw new Ce("Missing currentFloor object from GeoJsonApi");let t=this.mapData?.getById("floor",e);if(!t)throw new Ce("Missing currentFloor");return t}getState(e){typeof e=="object"&&_t.is(e)&&C.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let t=ms(e,this),r=this.core.getState(t);if(r){if(["interior-walls","exterior-walls"].includes(e)&&r.type==="feature-collection")return Su(r);if(["interior-doors","exterior-doors"].includes(e)&&r.type==="feature-collection"){let n=e==="interior-doors"?pr:dr,i;for(let a of this.currentMap.floors){let s=a.layers.get(n);if(!s)continue;let l=this.core.getState(s.containerId);if(l){i=l;break}}return Fd(r,i)}else{if(r.type==="geometry")return iu(r);if(r.type==="label"&&r.options.appearance&&r.options.rank!==void 0&&r.options.interactive!==void 0)return lu(r);if(r.type==="marker"&&r.options?.rank!==void 0&&r.options.interactive!==void 0)return du(r,this.Markers.getById(r.id.toString())?.marker);if(r.type==="model")return _u(r);if(r.type==="image")return Mu(r);if(r.type==="text3d")return vu(r);if(r.type==="feature-collection"&&e&&typeof e!="string"&&uo.is(e))return hu(r);if(r.type==="path")return Dd(r);if(r.type==="group-container"&&typeof e!="string"&&ct.is(e))return ru(r,this.currentMap.floorsById.get(e.id),this.core);if(r.type==="group-container"&&r.children.length>0&&typeof e!="string"&&Ne.is(e)){let n=this.core.getState(r.children[0].id);return Nd(n)}}}}__EXPERIMENTAL__getRenderedState(e){let t=ms(e,this);if(t)return this.core.getRenderedState(t)}setHoverColor(e){this.core.setState({hoverColor:e})}getHoverColor(){let e=this.core.getState();return e?.type==="map-view"?e.hoverColor:void 0}getFloorStackAltitudeData(e){return this.currentMap.getFloorStackAltitudeData(e)}createCoordinateFromScreenCoordinate(e,t,r){if(r!=null){let l=this.core.projectScreenXYToCoordinate(e,t,!0);return l?new H(l.coordinate[1],l.coordinate[0],r.id):void 0}let n=this.core.projectScreenXYToCoordinate(e,t);if(n==null||n.coordinate==null)return;let{coordinate:i,groupContainers:a}=n,s=a?.find(l=>{let c=l.userData.entityId.toString();return c.includes("f_")||c.includes("m_")})?.userData.entityId.toString();return new H(i[1],i[0],s)}getScreenCoordinateFromCoordinate(e){let t=0;if(e.floorId!=null){let r=this.mapData?.getById("floor",e.floorId);r!=null&&(t=this.getState(r)?.altitude??0)}return t+=e.verticalOffset,this.core.projectCoordinateToScreenXY([e.longitude,e.latitude,t])}isInView(e){return this.core.isInView(typeof e=="string"?e:e.id)}getInView(e,t){let r=this.core.queryGeometry2DInView({screenOffsets:t?.screenOffsets,fullyContains:t?.fullyContains});if(r.length===0)return[];let n=[];switch(e){case po.__type:n=r.map(i=>this.Labels.getById(i)).filter(i=>i!=null).map(i=>i.label);break;case oo.__type:n=r.map(i=>this.Markers.getById(i)).filter(i=>i!=null).map(i=>i.marker)}return n}async __EXPERIMENTAL__auto(e){return await Zf(this,e)}tween(e){let t=new ao(e);return this.core.getExternalTweenGroup().add(t),this.core.render(),t}removeTween(e){this.core.getExternalTweenGroup().remove(e)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}getCameraState(){return this.core.camera.getState()}getNavigationState(){return{isMultiFloor:this.Navigation.isMultiFloor,floorStacks:this.Navigation.floorStacks,floors:this.Navigation.floors,activeDirections:this.Navigation.activeDirections,activePath:this.Navigation.activePath,paths:this.Navigation.paths}}getAllState(){return{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack,Camera:this.getCameraState(),Navigation:this.getNavigationState(),manualFloorVisibility:this.manualFloorVisibility}}publishAllState(){this.externalPubSub.publish("state-change-internal",this.getAllState())}clear(){this.Navigation.clear(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Image3D.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),super.destroy(),this.core.destroy()}getOptimalVisualDistanceBetweenFloors(e,t=!1){let r=this.currentMap;if(!r){C.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(e.length<2){C.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let n=r.renderer.getInternalState().geometry3DMap.get(e[0].id),i=r.renderer.getInternalState().geometry3DMap.get(e[1].id);if(!n||!i){C.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}ya(n,"group-container"),ya(i,"group-container"),t&&typeof r.renderer.debugVisualizeBoundingBoxes=="function"&&r.renderer.debugVisualizeBoundingBoxes(n,i);let a=r.renderer.computeMinZOffsetBetweenContainers(n,i);if(a!==-1)return a}};function X1(o){if(o===""){ha(""),ma("");return}ma(`${o}/${ec}`),ha(`${o}/${Kl}`)}f();var na=class{state;#e;constructor(e){this.#e=e,this.update=e.Debug.update.bind(e.Debug),this.state=e.Debug.state}update;getCameraState(){let e=this.#e.camera.center,t=this.#e.camera.bearing;return{center:new H({longitude:e[0],latitude:e[1]}),zoomLevel:this.#e.camera.zoomLevel,bearing:t,pitch:this.#e.camera.pitch}}};f();import je from"zod";var Jf=je.strictObject({environment:je.union([je.literal("basic"),je.literal(!1)]).optional(),text3d:je.object({hoverColor:je.string().optional()}).optional(),geometry:je.object({hoverColor:je.string().optional()}).optional(),backgroundColor:je.string().optional(),backgroundAlpha:je.number().optional(),multiFloorView:je.object({spacesOpenToBelowVisualEffectEnabled:je.boolean().optional(),spacesOpenToBelowVisualEffectDarkenAmount:je.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDarkenUseDepth:je.boolean().optional(),spacesOpenToBelowVisualEffectDesaturateAmount:je.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDesaturateUseDepth:je.boolean().optional(),spacesOpenToBelowVisualEffectWashOutAmount:je.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectWashOutUseDepth:je.boolean().optional()}).optional()});f();var Cl=Hn(uh(),1);f();var Ln=null;function qf(){if(Ln)return Ln;if(typeof OffscreenCanvas<"u")Ln=new OffscreenCanvas(1,1).getContext("2d");else if(typeof document<"u"){let o=document.createElement("canvas");o.width=1,o.height=1,Ln=o.getContext("2d")}return Ln}function Sl(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function El(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}function Ml(o){let e=qf();if(!e)return[0,0,0];e.fillStyle=o,e.fillRect(0,0,1,1);let[t,r,n]=e.getImageData(0,0,1,1).data;return[Sl(t/255),Sl(r/255),Sl(n/255)]}function Qf(o){let e=Math.round(Math.min(1,Math.max(0,El(o[0])))*255),t=Math.round(Math.min(1,Math.max(0,El(o[1])))*255),r=Math.round(Math.min(1,Math.max(0,El(o[2])))*255);return"#"+(1<<24|e<<16|t<<8|r).toString(16).slice(1)}var $1=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,Y1=/^rgba?\(\s*\d+/,Z1=/^hsla?\(\s*[\d.]+/;function xl(o){if(o==null||typeof o!="string")return!1;if($1.test(o)||Y1.test(o)||Z1.test(o))return!0;let e=qf();return e?(e.fillStyle="#000",e.fillStyle=o,e.fillStyle!=="#000000"||o.toLowerCase()==="black"||o==="#000"||o==="#000000"):!1}var J1=(o,e)=>{let t={},r=(n,i,a)=>{for(let s in i){let l=n[s],c=i[s];typeof c=="object"&&!Array.isArray(c)&&c!==null&&typeof l=="object"&&!Array.isArray(l)&&l!==null?(a[s]={},r(l,c,a[s])):a[s]=l}};return r(o,e,t),t},Kf=(o,e)=>{let t=J1(o,e),r=(0,Cl.default)({},t,e),n=(0,Cl.default)({},t),i=(a,s,l,c=n)=>{for(let p in s){let h=a[p],g=s[p];if(typeof g=="number"&&typeof h=="number")c[p]=h+(g-h)*l;else if(typeof g=="string"&&typeof h=="string"){if(xl(h)&&xl(g)){let T=Ml(h),I=Ml(g);T&&I?c[p]=Qf([T[0]+(I[0]-T[0])*l,T[1]+(I[1]-T[1])*l,T[2]+(I[2]-T[2])*l]):C.warn(`Color "${p}" could not be animated!`)}}else typeof g=="object"&&g!==null&&typeof h=="object"&&h!==null?i(h,g,l,c[p]):C.warn(`Value "${p}" could not be animated!`)}};return a=>(a=Math.min(Math.max(a,0),1),a===0?o:a===1?r:(i(t,e,a),n))};f();function q1(o){return o.getContext("webgl2")||o.getContext("webgl")}function _l(o){let e=q1(o);if(!e||o.width===0||o.height===0)return null;let t=e;t.PIXEL_PACK_BUFFER!==void 0&&t.bindBuffer(t.PIXEL_PACK_BUFFER,null);let r=new Uint8Array(o.width*o.height*4);e.readPixels(0,0,o.width,o.height,e.RGBA,e.UNSIGNED_BYTE,r);let n=document.createElement("canvas");n.width=o.width,n.height=o.height;let i=n.getContext("2d");if(!i)return null;let a=new ImageData(o.width,o.height);for(let s=0;s<o.height;s++)for(let l=0;l<o.width;l++){let c=((o.height-s-1)*o.width+l)*4,p=(s*o.width+l)*4;a.data[p]=r[c],a.data[p+1]=r[c+1],a.data[p+2]=r[c+2],a.data[p+3]=r[c+3]}return i.putImageData(a,0,0),n}async function eh(o,e=1e3){let t=null,r=new Promise(a=>{t=()=>{let s=o.getCanvas();a(s?_l(s):null)},o.once("render",t),o.triggerRepaint()}),n=new Promise(a=>setTimeout(()=>a(null),e)),i=await Promise.race([r,n]);return i===null&&t&&o.off("render",t),i}function Pl(o,e="labels"){let t=o.getContext("2d");if(!t)return null;try{let r=t.getImageData(0,0,o.width,o.height),n=document.createElement("canvas");n.width=o.width,n.height=o.height;let i=n.getContext("2d");return i?(i.putImageData(r,0,0),n):null}catch{let n=e==="overlay"?"HTML overlay canvas is tainted and cannot be included in screenshot. This may occur if overlay content contains cross-origin images without proper CORS headers.":"Labels canvas is tainted and cannot be included in screenshot. This may occur if labels contain cross-origin images without proper CORS headers.";return C.warn(n),null}}var Rn=class{#e;#t;#o;Camera;Labels;Text3D;Markers;Image3D;Models;Paths;Exporter;Navigation;Style;Shapes;Outdoor;constructor(e){this.#e=new Mt,this.#o=e;let t=new kn(e,this,this.#e);this.#t=t,this.Camera=this.#t.Camera,this.Markers=this.#t.Markers,this.Models=this.#t.Models,this.Labels=this.#t.Labels,this.Text3D=this.#t.Text3D,this.Exporter=this.#t.Exporter,this.Paths=this.#t.Paths,this.Navigation=this.#t.Navigation,this.Shapes=this.#t.Shapes,this.Style=this.#t.Style,this.Outdoor=this.#t.Outdoor,this.Image3D=this.#t.Image3D,this.#o.container.dataset.version=S.env.npm_package_version,this.Debug=new na(this.#t.core)}updateState(e,t){return this.#t.updateState(e,t)}animateState(e,t,r){let n=this.#t.getState(e);if(n==null)return C.warn(`Cannot animate state of ${e}.`),new Promise(c=>c({result:"completed"}));let i=Kf(n,t),a=this.#t.tween({percent:0}).to({percent:1},r?.duration??1e3).onUpdate(({percent:l})=>{this.#t.updateState(e,i(l))});r?.easing&&r.easing in Ko&&a.easing(Ko[r.easing]);let s=new Promise(l=>{a.onComplete(()=>{this.#t.removeTween(a),l({result:"completed"})}).onStop(()=>{this.#t.removeTween(a),l({result:"cancelled"})}),a.start()});return s.cancel=()=>{a.stop(),this.#t.updateState(e,i(0))},s}updateGlobalState(e){try{Jf.parse(e)}catch(t){C.error("updateGlobalState",t);return}if(typeof e=="object"){let t={};if(e.text3d?.hoverColor&&(t.text3dHoverColor=e.text3d.hoverColor),e.geometry?.hoverColor&&(t.hoverColor=e.geometry.hoverColor),e.backgroundColor||e.backgroundAlpha!==void 0){let r=e.backgroundColor??this.#t.core.backgroundColor,n=e.backgroundAlpha??this.#t.core.backgroundAlpha;this.#t.core.setBackgroundColor(r,n)}e.environment!=null&&this.#t.core.setEnvironment(e.environment),e.multiFloorView!=null&&this.#t.currentMap.updateMultiFloorViewEffects(e.multiFloorView),this.#t.core.setState(t),this.#e.publish("global-state-change")}}get options(){return op(this.#t.currentMap.options)}getGlobalState(){let e=this.#t.core.getState();return{backgroundColor:this.#t.core.backgroundColor,backgroundAlpha:this.#t.core.backgroundAlpha,environment:this.#t.core.getEnvironment(),geometry:{hoverColor:e.hoverColor},text3d:{hoverColor:e.text3dHoverColor},multiFloorView:this.#t.currentMap.getMultiFloorViewEffects()}}update=()=>{this.#t.core.render()};getMapData(){if(this.#t.mapData==null)throw new Ce("MapData not found.");return this.#t.mapData}getDimensions(){return{width:this.#o.canvasWidth,height:this.#o.canvasHeight}}addMap(e,t){return this.#t.addMap(e,t)}setFloor(e,t){return this.#t.setFloor(e,t?.context)}setFloorStack(e,t){return this.#t.setFloorStack(e,t?.context)}preloadFloors(e){this.#t.preloadFloors(e)}tween(e){return this.#t.tween(e)}removeTween(e){this.#t.removeTween(e)}get tweenGroup(){return this.#t.tweenGroup()}get currentFloorStack(){return this.#t.currentFloorStack}get currentFloor(){return this.#t.currentFloor}updateWatermark(e){this.#t.updateWatermark(e)}getState(e){return this.#t.getState(e)}getFloorStackAltitudeData(e){let t=typeof e=="string"?e:e.id;return this.#t.getFloorStackAltitudeData(t)}__EXPERIMENTAL__getRenderedState(e){return this.#t.__EXPERIMENTAL__getRenderedState(e)}setHoverColor(e){this.#t.setHoverColor(e)}getHoverColor(){return this.#t.getHoverColor()}convertAltitudeToMercatorZoomLevel(e){return this.#t.core.getSystems().cameraSystem.convertAltitudeToZoomLevel(e)}convertMercatorZoomLevelToAltitude(e){return this.#t.core.getSystems().cameraSystem.convertZoomLevelToAltitude(e)}isInView(e){return this.#t.isInView(e)}getInView(e,t){return this.#t.getInView(e,t)}getMetersPerPixel(){return this.#t.core.getMetersPerPixel()}__LEGACY_GET_DIRECTIONS_SYNC=(e,t,r)=>this.#t.getMapData()?.__LEGACY_GET_DIRECTIONS_SYNC(e,t,r)??void 0;getDirections=(e,t,r)=>this.#t.getMapData()?.getDirections(e,t,r)??Promise.resolve(void 0);__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC=(e,t,r)=>this.#t.getMapData()?.__LEGACY_GET_DIRECTIONS_MULTI_DESTINATION_SYNC(e,t,r)??void 0;getDirectionsMultiDestination=(e,t,r)=>this.#t.getMapData()?.getDirectionsMultiDestination(e,t,r)??Promise.resolve(void 0);getDistance(e,t){return this.#t.getMapData()?.getDistance(e,t)}createCoordinate(e,t,r){return typeof e=="object"?new H(e):new H(e,t,r?.id)}createCoordinateFromScreenCoordinate(e,t,r){return this.#t.createCoordinateFromScreenCoordinate(e,t,r)}getScreenCoordinateFromCoordinate(e){return this.#t.getScreenCoordinateFromCoordinate(e)}__EXPERIMENTAL__auto(e){return this.#t.__EXPERIMENTAL__auto(e)}on=(e,t)=>{this.#e.on(e,t)};off=(e,t)=>{this.#e.off(e,t)};get __core(){if(S.env.INTERNAL==="true")return this.#t.core;throw new Error("__core is not available.")}get container(){return this.#o.container}publishAllState(){this.#t.publishAllState()}clear(){this.#t.clear()}destroy(){this.#e.publish("destroy"),this.#e.destroy(),this.#t.destroy()}async enableDebug(e={}){let{Inspector:t}=await import("./inspector-Q3DGNXKB.js");await new t(this,this.#t).enable(e)}Debug;async takeScreenshot(e){let t={withOutdoorContext:e?.withOutdoorContext??!1,withLabels:e?.withLabels??!1,captureMarkers:e?.captureMarkers},r=this.#o.rendererDomElement,n=this.#o.map,i=!1,a=!1,s=[];if(this.Outdoor.enabled&&this.Outdoor.visible&&!t.withOutdoorContext&&(this.Outdoor.hide(),i=!0,n)){let l=null;n.triggerRepaint(),await Promise.race([new Promise(p=>{l=()=>p(),n.once("render",l)}),new Promise(p=>setTimeout(p,1e3))])===void 0&&l&&n.off("render",l)}if(this.Outdoor.enabled&&t.withOutdoorContext&&!this.Outdoor.visible){if(n){let l=n.getStyle()?.layers;l&&(s=l.filter(c=>n.getLayoutProperty(c.id,"visibility")!=="none").map(c=>c.id))}if(this.Outdoor.show(),a=!0,n){let l=null;n.triggerRepaint(),await Promise.race([new Promise(p=>{l=()=>p(),n.once("render",l)}),new Promise(p=>setTimeout(p,1e3))])===void 0&&l&&n.off("render",l)}}try{let l=document.createElement("canvas"),c=l.getContext("2d",{willReadFrequently:!0});if(l.width=r.width,l.height=r.height,!c)throw new Error("Failed to get 2D context");if(t.withOutdoorContext&&n){if(!n.loaded()){let g=null;await Promise.race([new Promise(I=>{g=()=>I(),n.once("idle",g)}),new Promise(I=>setTimeout(I,5e3))])===void 0&&g&&n.off("idle",g)}let h=await eh(n);h&&c.drawImage(h,0,0,l.width,l.height)}await this.#o.renderSync();let p=_l(r);if(p&&c.drawImage(p,0,0,l.width,l.height),t.withLabels){let h=this.#o.labelsCanvas;if(h){let g=Pl(h);g&&c.drawImage(g,0,0,l.width,l.height)}}if(t.withLabels&&t.captureMarkers){let h=this.#o.container;if(h)for(let g=0;g<h.children.length;g++){let T=h.children[g],I=T.classList.contains("mappedin-2d-entities");if(!(T.tagName==="CANVAS"||T.offsetWidth===0||T.offsetHeight===0||!I))try{let E=await t.captureMarkers(T),D=Pl(E,"overlay");D&&D.width>0&&D.height>0&&c.drawImage(D,0,0,l.width,l.height)}catch(E){C.warn(`Overlay layer capture failed: ${E instanceof Error?E.message:String(E)}. Continuing with other layers.`)}}}try{return l.toDataURL("image/png")}catch(h){if((h instanceof Error?h.name:h?.name)==="SecurityError"||h?.message?.includes("tainted")||h?.message?.includes("security")){let E=h instanceof Error?`Screenshot failed due to security restrictions: ${h.message}`:"Screenshot failed due to security restrictions. Ensure all images have proper CORS headers.";throw new Ce(E)}let I=h instanceof Error?`Screenshot failed: ${h.message}`:"Screenshot failed due to an unknown error.";throw new Ce(I)}}finally{i&&this.Outdoor.show(),a&&this.Outdoor.hide(s)}}get manualFloorVisibility(){return this.#t.manualFloorVisibility}set manualFloorVisibility(e){this.#t.manualFloorVisibility=e}getOptimalVisualDistanceBetweenFloors(e){return this.#t.getOptimalVisualDistanceBetweenFloors(e)}get __INTERNAL__hidePathsNotOnCurrentFloor(){return this.#t.hidePathsNotOnCurrentFloor}set __INTERNAL__hidePathsNotOnCurrentFloor(e){this.#t.hidePathsNotOnCurrentFloor=!!e}registerPlugin(e){C.warn("registerPlugin is super experimental and may change or be removed without notice."),this.#o.registerPlugin(e)}unregisterPlugin(e){this.#o.unregisterPlugin(e)}};f();var th=(o,{id:e}={})=>{let t=Array.isArray(o)?o:[o];if(!t.every(i=>typeof i=="string"))return;let r=t.join(""),n=null;if(e){let i=document.getElementById(e);i instanceof HTMLStyleElement&&(n=i)}n==null&&(n=document.createElement("style")),e&&e!==""&&(n.id=e),n.textContent=r,document.head.appendChild(n)};f();var Q1=1e3*60*60*2,kr=class{#e=new Mt;#t;#o;#r;#i;#n;#s;#c;#a;constructor(e,t){this.#t=e,this.#o=t}#l=()=>{"key"in this.#o&&"secret"in this.#o&&this.#u(),this.#f()};#d(e){let t=e.token!==this.#n?.token;this.#n=e,t&&this.#e.publish("access-token-refreshed",{accessToken:e})}#h(e){let t=JSON.stringify(e.tokens)!==JSON.stringify(this.#s?.tokens);this.#s=e,t&&this.#e.publish("sas-tokens-refreshed",{sasTokens:e.tokens})}async#u(e=!1){if("accessToken"in this.#o&&typeof this.#o.accessToken=="string"){let t={token:this.#o.accessToken,expires:Date.now()+72e5};return this.#n=t,t}if(!("key"in this.#o)||!("secret"in this.#o)||typeof this.#o.key!="string"||typeof this.#o.secret!="string")throw new Error("No API keys or access token provided!");return this.#r!=null?this.#r:this.#n!=null&&this.#n.expires!=null&&this.#n.expires>Date.now()&&!e?this.#n:(this.#r=Wr({...this.#o,key:this.#o.key,secret:this.#o.secret},this.#o.enterprise??!1).then(t=>{let r={token:t.accessToken,expires:t.expiresTimestamp*1e3};return this.#d(r),r}).catch(t=>{throw t}).finally(()=>{this.#r=void 0}),this.#r)}async#f(e=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:this.#i!=null?this.#i:this.#s!=null&&this.#s.expires>Date.now()&&!e?this.#s:(this.#i=new Promise((t,r)=>{this.#u().then(n=>{let i={},a=this.#t.map(s=>Ea({...this.#o,mapId:s},n.token).then(l=>{i[s]={token:l.token,expires:l.expires}}).catch(l=>{C.error(`Error getting SAS token for map ${s}:`,l)}));Promise.all(a).then(()=>{let s={tokens:i,expires:Math.min(...Object.values(i).map(l=>l.expires??1/0))};this.#h(s),t(s)})}).catch(n=>{r(n)})}),this.#i.catch(t=>{throw t}).finally(()=>{this.#i=void 0}),this.#i)}#p(e){if(!("key"in this.#o)||!("secret"in this.#o))return;let t=e.expires!=null?e.expires-Date.now():Q1;isFinite(t)&&(this.#c=setTimeout(()=>{this.#u(!0).then(r=>{this.#p(r)})},t-Oc))}#m(e){let t=e.expires-Date.now();isFinite(t)&&(this.#a=setTimeout(()=>{this.#f(!0).then(r=>{this.#m(r)})},t-Fc))}#y(){this.#c!=null&&clearTimeout(this.#c),this.#a!=null&&clearTimeout(this.#a)}setMapIds(e){this.#t=e}setEnterprise(e){this.#o.enterprise=e}async readySync(){if((!("key"in this.#o)||!("secret"in this.#o))&&!("accessToken"in this.#o)){C.error("No API keys or access token provided! Cannot preload tokens.");return}let e=[this.#u(),null];this.#o.enterprise||(e[1]=this.getSasTokensAsync());let[t,r]=await Promise.all(e);this.#y(),this.#p(t),r!=null&&this.#m(r),Vr()&&globalThis.addEventListener?.("focus",this.#l)}async refreshing(){let e=[];return this.#r!=null&&e.push(this.#r),this.#i!=null&&e.push(this.#i),Promise.all(e)}getAccessTokenAsync(){return this.#u()}getSasTokensAsync(){return this.#f()}getAccessToken(){return this.#n==null?(C.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):this.#n}getSasToken(e){return this.isEnterpriseMode()?(C.error("SAS tokens are not available in the enterprise mode!"),{token:""}):this.#s==null?(C.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):e in this.#s.tokens?this.#s.tokens[e]:(C.error(`SAS token for map ${e} not found!`),{token:""})}isEnterpriseMode(){return this.#o.enterprise??!1}on=(e,t)=>this.#e.on(e,t);off=(e,t)=>this.#e.off(e,t);destroy(){this.#y(),this.#e.destroy(),Vr()&&globalThis.removeEventListener("focus",this.#l)}};f();var K1=async(o,e)=>{let t=("mvfVersion"in(e??{})?e?.mvfVersion:void 0)??("options"in o&&"version"in(o.options??{})?o.options?.version:void 0),r={prefetchTokens:!0,...e||{},mvfVersion:t},n,i,a=To();a.updateByUserOption(r);let s={};if("type"in o&&typeof o.type=="string"){if(o.type==="binary"&&o.main instanceof Uint8Array){let A=await ei(o.main,r.mvfVersion);n=A.mvf2,i=A.mvf3,s.languagePacks=[];for(let V of o.languagePacks??[])V.localePack instanceof Uint8Array&&s.languagePacks.push({language:V.language,localePack:await ir(V.localePack)})}else if(o.type==="json")n=o.main,i=o.options?.mvf3,s.languagePacks=o.languagePacks??[];else throw new Error("Invalid backup type");o.type==="binary"&&o.main instanceof Uint8Array&&(s.binaryBundle=o.main);let x=n.enterprise!=null;o.options?.enterprise!==void 0&&(x?C.warn('The "enterprise" option in hydrateMapData is deprecated and ignored. Enterprise mode is now automatically detected from the MVF data.'):C.warn('The "enterprise" option in hydrateMapData is deprecated and will be removed in a future release. Please ensure your MVF bundle includes enterprise data for automatic detection.')),s.enterprise=x||(o.options?.enterprise??!1)}else n=o,s.enterprise=n.enterprise!=null;s.mvf3=i;let l="key"in r&&"secret"in r,c="accessToken"in r&&r.accessToken;l&&Dc(r.key)&&(s.enterprise=!1),a.setEnterprise(s.enterprise??!1);let p=Kn(n),h=p.length>0?p:[r.mapId];r.baseAuthUri=a.getBaseAuthUri();let g=new kr(h,{...r,enterprise:s.enterprise}),T;if(c)T=r.accessToken;else if(l){let x;try{x=await g.getAccessTokenAsync()}catch(A){C.error("Failed getting token during hydrateMapData",A)}T=x?.token||""}if(s.outdoorViewToken=T,s.env=a,s.getMapDataOptions=r,s.tokenManager=g,r.prefetchTokens&&(l||c))try{await g.readySync()}catch(x){C.error("Failed to ready token manager!",x)}nn()&&(s.enterprise&&C.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),r.mvfVersion!=="3.0.0"&&C.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let I=new Vo(n,s);T&&I.Analytics.init({accessToken:T,mapId:r.mapId,key:"key"in r?r.key:void 0,secret:"secret"in r?r.secret:void 0,enterprise:s.enterprise??!1,...r.analytics,baseUri:a.getAnalyticsBaseUri(),context:r.analytics?.context});let E=new Ur(I),D=I.findPreferredLanguage({languageCode:r.language,fallbackToNavigatorLanguage:!1});if(D)try{await E.changeLanguage(D.code)}catch{}return typeof e?.onMVFParsed=="function"&&e.onMVFParsed(n),E};var oh=`:root {
297
+ --pin-shadow-hover-scale: 0.9;
298
+ --pin-shadow-width: 12px;
299
+ --pin-shadow-height: 5px;
300
+ --pin-shadow-opacity: 0.35;
301
+ --pin-drop-animation-duration-ms: 250ms;
302
+ }
303
+
304
+ @keyframes drop-pin {
305
+ 0% {
306
+ transform: translateY(-200%);
307
+ }
308
+
309
+ 100% {
310
+ transform: translateY(0);
311
+ }
312
+ }
313
+
314
+ @keyframes pin-shadow {
315
+ 0% {
316
+ transform: scale(var(--pin-shadow-hover-scale));
317
+ }
318
+
319
+ 100% {
320
+ transform: scale(1);
321
+ }
322
+ }
323
+
324
+ .mappedin-dropped-pin-wrapper {
325
+ position: relative;
326
+
327
+ width: fit-content;
328
+ height: fit-content;
329
+ width: 36px;
330
+ height: 42px;
331
+
332
+ & svg {
333
+ position: absolute;
334
+ left: calc(50% - var(--pin-shadow-width));
335
+ animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;
336
+ }
337
+
338
+ & > .pin-shadow {
339
+ position: absolute;
340
+ left: calc(50% - (var(--pin-shadow-width) / 2));
341
+ bottom: 0;
342
+
343
+ height: var(--pin-shadow-height);
344
+ width: var(--pin-shadow-width);
345
+ border-radius: 100%;
346
+
347
+ opacity: var(--pin-shadow-opacity);
348
+
349
+ animation: pin-shadow 250ms ease-in;
350
+ }
351
+ }
352
+
353
+ @keyframes bounce {
354
+ 0% {
355
+ transform: translateY(-10px);
356
+ opacity: 0;
357
+ }
358
+ 12.5% {
359
+ transform: translateY(0);
360
+ opacity: 1;
361
+ }
362
+ 25% {
363
+ transform: translateY(0);
364
+ }
365
+ 37.5% {
366
+ transform: translateY(-10px);
367
+ }
368
+ 50% {
369
+ transform: translateY(0);
370
+ }
371
+ 62.5% {
372
+ transform: translateY(-10px);
373
+ }
374
+ 75% {
375
+ transform: translateY(0);
376
+ }
377
+ 87.5% {
378
+ transform: translateY(-10px);
379
+ }
380
+ 100% {
381
+ transform: translateY(0);
382
+ }
383
+ }
384
+
385
+ .mappedin-connection-marker {
386
+ position: relative;
387
+ display: flex;
388
+
389
+ .bouncey {
390
+ animation: bounce 2.5s linear;
391
+ }
392
+
393
+ .arrow--down {
394
+ transform: rotate(180deg);
395
+ }
396
+
397
+ .connection-circle {
398
+ display: flex;
399
+ box-sizing: border-box;
400
+ justify-content: center;
401
+ align-items: center;
402
+ border-radius: 50%;
403
+ border: 2px solid white;
404
+ box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
405
+ background: #595959;
406
+ }
407
+ }
408
+ `;var rh=`.mappedin-marker {
409
+ font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
410
+ font-weight: normal;
411
+ top: 0;
412
+ position: absolute;
413
+ font-weight: bold;
414
+ color: black;
415
+ display: flex;
416
+ flex-direction: row;
417
+ will-change: transform, opacity;
418
+ transition: opacity 150ms ease-in-out;
419
+ justify-content: center;
420
+ opacity: 0;
421
+ }
422
+
423
+ /* Opt out of CSS opacity transitions when the marker has animated: false.
424
+ * Without this, direct style.opacity assignments (from DOMDrawSystem's snap
425
+ * path and from onStrategySelected) still fade over the CSS transition
426
+ * duration, and during that fade \`marker.animation\` is null so the transform
427
+ * update path is skipped \u2014 causing markers to drift if the camera is moving.
428
+ */
429
+ .mappedin-marker[data-animated='false'] {
430
+ transition: none;
431
+ }
432
+
433
+ /* Low priority pin strategy styles */
434
+
435
+ /* Hide child elements as well */
436
+ .mappedin-marker[data-placement='hidden'] > .mappedin-marker-content {
437
+ visibility: hidden;
438
+ }
439
+
440
+ /* Create the pin using ::before pseudo-element */
441
+ .mappedin-marker::before {
442
+ content: '';
443
+ display: none;
444
+ border-radius: 50%;
445
+ position: relative;
446
+ /* Default values - will be overridden by inline styles */
447
+ width: var(--mappedin-pin-size, 2px);
448
+ height: var(--mappedin-pin-size, 2px);
449
+ background-color: var(--pin-color, #666);
450
+ }
451
+
452
+ .mappedin-marker[data-placement='hidden']::before {
453
+ display: block;
454
+ }
455
+ `;var nh=`.mappedin__smart-collision-engine__container {
456
+ position: absolute;
457
+ left: 0px;
458
+ top: 0px;
459
+ bottom: 0px;
460
+ right: 0px;
461
+ pointer-events: none;
462
+ /* Establishes a stacking context so inner z-indexed canvases stay scoped
463
+ * here, and lifts the wrapper above the WebGL canvas (which carries
464
+ * \`z-index: 1\` as a webkit compositing workaround). */
465
+ z-index: 1;
466
+ font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
467
+ }
468
+
469
+ .mappedin__smart-collision-engine-debug__container {
470
+ position: absolute;
471
+ left: 0px;
472
+ top: 0px;
473
+ bottom: 0px;
474
+ right: 0px;
475
+ transition: opacity 300ms ease-in-out;
476
+ pointer-events: none;
477
+ will-change: opacity;
478
+ &.interacting {
479
+ opacity: 0.2;
480
+ }
481
+ }
482
+ `;var ih=`.mappedin-map {
483
+ .mappedin-interactive {
484
+ cursor: grab;
485
+
486
+ &:active {
487
+ cursor: grabbing;
488
+ }
489
+
490
+ &.mappedin-interaction-hover {
491
+ cursor: pointer;
492
+ }
493
+ }
494
+ }
495
+ `;var ah=`.mappedin-map {
496
+ .mappedin-control-container {
497
+ position: absolute;
498
+ left: 0px;
499
+ top: 0px;
500
+ bottom: 0px;
501
+ right: 0px;
502
+ pointer-events: none;
503
+ font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
504
+
505
+ .mappedin-ctrl-top-left,
506
+ .mappedin-ctrl-top-right,
507
+ .mappedin-ctrl-bottom-left,
508
+ .mappedin-ctrl-bottom-right {
509
+ position: absolute;
510
+ pointer-events: none;
511
+ }
512
+
513
+ .mappedin-ctrl-top-left {
514
+ top: 0;
515
+ left: 0;
516
+ }
517
+
518
+ .mappedin-ctrl-top-right {
519
+ top: 0;
520
+ right: 0;
521
+ }
522
+
523
+ .mappedin-ctrl-bottom-left {
524
+ bottom: 0;
525
+ left: 0;
526
+ }
527
+
528
+ .mappedin-ctrl-bottom-right {
529
+ bottom: 0;
530
+ right: 0;
531
+ }
532
+
533
+ .mappedin-ctrl-attrib {
534
+ display: block;
535
+ position: relative;
536
+ pointer-events: auto;
537
+ font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;
538
+ padding: 3px 5px 1px 5px;
539
+ background-color: rgba(255, 255, 255, 0.5);
540
+ margin: 0;
541
+ min-width: 11px;
542
+ min-height: 11px;
543
+ user-select: none;
544
+
545
+ summary.mappedin-ctrl-attrib-button {
546
+ appearance: none;
547
+ list-style: none;
548
+ }
549
+
550
+ summary.mappedin-ctrl-attrib-button::-webkit-details-marker {
551
+ display: none;
552
+ }
553
+
554
+ &.mappedin-compact .mappedin-ctrl-attrib-button,
555
+ &.mappedin-compact-show .mappedin-ctrl-attrib-inner {
556
+ display: inline-block;
557
+ }
558
+
559
+ &.mappedin-compact {
560
+ background-color: transparent;
561
+ }
562
+
563
+ &.mappedin-compact-show {
564
+ min-width: 15px;
565
+ min-height: 15px;
566
+ box-sizing: border-box;
567
+ background-color: rgba(255, 255, 255, 0.5);
568
+ }
569
+ }
570
+
571
+ .mappedin-ctrl-attrib-top-left {
572
+ float: left;
573
+ border-bottom-right-radius: 4px;
574
+ }
575
+
576
+ .mappedin-ctrl-attrib-top-right {
577
+ float: right;
578
+ border-bottom-left-radius: 4px;
579
+ }
580
+
581
+ .mappedin-ctrl-attrib-bottom-left {
582
+ float: left;
583
+ border-top-right-radius: 4px;
584
+ }
585
+
586
+ .mappedin-ctrl-attrib-bottom-right {
587
+ float: right;
588
+ border-top-left-radius: 4px;
589
+ }
590
+ .mappedin-ctrl-attrib-top-left,
591
+ .mappedin-ctrl-attrib-bottom-left {
592
+ padding: 3px 5px 1px 20px;
593
+ }
594
+
595
+ .mappedin-ctrl-attrib-inner {
596
+ display: inline-block;
597
+ margin-right: 12px;
598
+ }
599
+
600
+ .mappedin-ctrl-attrib-inner,
601
+ .mappedin-ctrl-attrib-inner a {
602
+ color: rgba(0, 0, 0, 0.75);
603
+ text-decoration: none;
604
+ }
605
+
606
+ .mappedin-ctrl-attrib-inner-bold,
607
+ .mappedin-ctrl-attrib-inner-bold a {
608
+ font-weight: bold;
609
+ }
610
+
611
+ .mappedin-ctrl-attrib-inner a:hover {
612
+ color: #017ef1;
613
+ text-decoration: underline;
614
+ cursor: pointer;
615
+ }
616
+
617
+ .mappedin-ctrl-attrib-button {
618
+ display: none;
619
+ cursor: pointer;
620
+ position: absolute;
621
+ width: 15px;
622
+ height: 15px;
623
+ box-sizing: border-box;
624
+ border-radius: 50%;
625
+ top: 0;
626
+ right: 2px;
627
+ border: 1px;
628
+ }
629
+ .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,
630
+ .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {
631
+ left: 2px;
632
+ }
633
+ }
634
+ }
635
+ `;var sh='.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}';var lh=`.mappedin-annotation-marker {
636
+ --mappedin-annotation-border-radius: 5px;
637
+ --mappedin-annotation-border-width: 2px;
638
+ --mappedin-annotation-background-color: #ffffff;
639
+ --mappedin-annotation-scale: 0.7;
640
+
641
+ position: relative;
642
+ box-sizing: border-box;
643
+ border-radius: var(--mappedin-annotation-border-radius);
644
+ border: var(--mappedin-annotation-border-width) solid var(--mappedin-annotation-background-color);
645
+
646
+ transform: scale(var(--mappedin-annotation-scale)) translateY(0rem);
647
+ box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);
648
+
649
+ img {
650
+ position: absolute;
651
+ image-rendering: crisp-edges;
652
+ top: 0px;
653
+
654
+ object-fit: contain;
655
+ border-radius: calc(var(--mappedin-annotation-border-radius) - var(--mappedin-annotation-border-width));
656
+ }
657
+ }
658
+ `;f();function sb(o){if(!o)return;let{outdoorView:e,...t}=o,r=e?{headers:e.token?{"x-mappedin-tiles-key":e.token}:void 0,style:e.style,enabled:e.enabled??!!e.token,lowDpi:e.lowDpi}:void 0;return{...t,outdoorView:r}}f();function lb(o){if(!(!o.languages||!Vr()||!globalThis.navigator?.languages?.length))for(let e=0;e<globalThis.navigator.languages.length;e++){let t=o.languages.find(r=>r.code.toLowerCase()===globalThis.navigator.languages[e].toLowerCase());if(t)return{code:t.code,name:t.name}}}function Ps(o,e){let t=e?.languageCode??"",r=e?.fallbackToNavigatorLanguage??!0,n=o?.languages?.find(a=>a.code.toLowerCase()===t.toLowerCase()),i;if(n)i=n;else if(r??!0)try{let a=lb(o);a&&(i=a)}catch(a){C.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",a)}return i??o.defaultLanguage}var cb=[oh,rh,nh,ih,ah,sh,lh],ch;function E7(o){ch=o}var M7=async(o,e)=>{let t,r=To();e&&r.updateByUserOption(e);try{e&&(t=(await Wr({...e,baseAuthUri:r.getBaseAuthUri()})).accessToken)}catch(a){C.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new Vo(o,{outdoorViewToken:t,languagePacks:e?.languagePacks,env:r});return new Ur(n)},ph=!1;function x7(o){ph=o}var dh=!1;function C7(o){dh=o}function nn(){return dh}var pb=async o=>{let e=ph,t,r=To();r.updateByUserOption(o);let n={prefetchTokens:!0,...o,fallbackToNavigatorLanguage:o.fallbackToNavigatorLanguage??!0},i=new kr([n.mapId],n);if("accessToken"in n&&n.accessToken){t=n.accessToken;let{aud:x,sub:A}=$n(t);(ep.some(V=>x.includes(V))||A&&A.startsWith("client"))&&(e=!0,r.setEnterprise(e),i.setEnterprise(e))}else if("key"in n&&"secret"in n){if(n.key.startsWith("mipk_"))throw new Error(`Partner API keys detected!
659
+
660
+ Partner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.`);n.key.startsWith("mik_")||(e=!0,r.setEnterprise(e),i.setEnterprise(e)),n.baseAuthUri=r.getBaseAuthUri();let x;try{x=await i.getAccessTokenAsync(),t=x?.token}catch(A){throw C.warn("Get access token failed",A.message),new Error("Get access token failed: "+A.message)}}else throw new Error("Missing key or secret.");n.layoutId!=null&&(e?n.layoutId!=="draft"&&C.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):C.warn("layoutId is currently unsupported!")),n.baseUri=r.getBaseUri();let a=performance.now(),s,l;if(e){let x={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0",perspective:n.viewId,useDraftData:n.layoutId==="draft"},A=await Fa(x);s=A.compressed,l=A.localePacks}else s=await ka(n,t);let c=performance.now(),{mvf2:p,mvf3:h}=await ei(s,n.mvfVersion),g=performance.now();typeof o.onMVFParsed=="function"&&o.onMVFParsed(p);let T=Kn(p);if(T.length>0?i.setMapIds(T):i.setMapIds([n.mapId]),n.prefetchTokens)try{await i.readySync()}catch(x){C.error("Failed to ready token manager!",x)}nn()&&(e&&C.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),n.mvfVersion!=="3.0.0"&&C.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let I=new Vo(p,{env:r,outdoorViewToken:t,tokenManager:i,enterprise:e,localePacksUrls:l,binaryBundle:s,getMapDataOptions:n,mvf3:h}),E=new Ur(I,{search:o.search});I.Analytics.init({accessToken:t,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0,enterprise:e,...n.analytics,baseUri:r.getAnalyticsBaseUri(),context:n.analytics?.context}),I.Analytics.sendGetMapDataEvent({parseDuration:g-c,downloadDuration:c-a,viewId:n.viewId});let D=I.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:n.fallbackToNavigatorLanguage});if(D)try{await E.changeLanguage(D.code)}catch{}return E},_7=pb,db=async()=>{if(fa===""||ga==="")return!1;let o=[fetch(fa,{mode:"same-origin"}),fetch(ga,{mode:"same-origin"})],[e,t]=[{ok:!1},{ok:!1}];try{[e,t]=await Promise.all(o)}catch{}return{collision:e.ok,maplibre:t.ok}},Ol=new WeakSet,ub=async(o,e,t)=>{let r=performance.now();Ol.has(o)&&C.warn("show3dMap was called on a container that already has an active MapView. Call destroy() on the existing MapView before creating a new one to avoid resource leaks.");let n=$a(t,e);n&&Xa(n),(n.injectStyles??!0)&&th(cb,{id:"mappedin__styles"});let i=tp(e.outdoorViewToken??""),a=Hr(e);n.outdoorView?.style&&a.envControl.updateTileServerBaseUrl(n.outdoorView?.style);let s=!1,l=!1,c=await db();c&&(c.collision||(s=!0),c.maplibre||(l=!0));let p=await ac(o,{center:[e.mapCenter.longitude,e.mapCenter.latitude],bearing:n.bearing,pitch:n.pitch,zoomLevel:n.zoomLevel,backgroundAlpha:n.style?.backgroundAlpha,backgroundColor:n.style?.backgroundColor,outdoorView:!l&&n.outdoorView?.token?{headers:{"x-mappedin-tiles-key":n.outdoorView?.token},style:e.getEnv().tileServerUri,enabled:!!n.outdoorView?.enabled,lowDpi:n.outdoorView?.lowDpi}:void 0,watermark:{...n.watermark,visible:n.watermark?.visible??(!a.enterpriseMode&&!i.remove_watermark),onClick:ch||void 0},attribution:n.attribution,antialias:typeof n.antialiasing=="boolean"?n.antialiasing:!!n.antialiasing?.enabled,accessToken:e.outdoorViewToken,occlusionEnabled:!0,transformImageRequest:a.enterpriseMode?void 0:a.transformImageRequest,naturalBearing:e.naturalBearing,imagePlacementOptions:n.imagePlacementOptions,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:n.onWebGLContextRestored,onWebGLRendererError:n.onWebGLRendererError,useStandaloneCamera:n.useStandaloneCamera??!1,useWorkers:!(n.disableWorkers??!1),useCollisionWorker:!s,disableUpdateStateValidation:n.disableUpdateStateValidation??!1,__EXPERIMENTAL_shadows:n.__EXPERIMENTAL_shadows,outlines:typeof n.style?.outlines=="object"?n.style.outlines:void 0}),h=new Rn(p);return await h.addMap(e,n),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-r,dimension:h.getDimensions(),collisionWorkerDisabled:s,outdoorsWorkerDisabled:l}),Ol.add(o),h.on("destroy",()=>Ol.delete(o)),h},P7=()=>S.env.npm_package_version,O7=ub;export{H as a,xt as b,ko as c,Qt as d,ke as e,gg as f,Ct as g,et as h,Te as i,ct as j,We as k,pt as l,yt as m,Ut as n,fr as o,Ne as p,lt as q,ii as r,ps as s,Xc as t,La as u,ei as v,ap as w,ds as x,sp as y,si as z,li as A,Eo as B,co as C,ai as D,Fs as E,Am as F,Us as G,Hs as H,X1 as I,Rn as J,K1 as K,sb as L,Ps as M,E7 as N,M7 as O,x7 as P,C7 as Q,nn as R,pb as S,_7 as T,db as U,ub as V,P7 as W,O7 as X};