@mappedin/mappedin-js 6.24.0 → 6.25.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.
- package/THIRD_PARTY_LICENSES.txt +15 -14
- package/lib/esm/{GLTFExporter-7JO7KU2J.js → GLTFExporter-2YKLBCPY.js} +1 -1
- package/lib/esm/{GLTFLoader-YNTRF3U5.js → GLTFLoader-VF2YNOHD.js} +1 -1
- package/lib/esm/chunk-2ZEZ2HG5.js +1230 -0
- package/lib/esm/{chunk-EIF63KEB.js → chunk-CO4ZOCZ7.js} +2 -2
- package/lib/esm/{chunk-C3N7HQI7.js → chunk-FYSWNSO7.js} +22 -22
- package/lib/esm/{chunk-VJRVK75J.js → chunk-I5GYZORE.js} +7 -7
- package/lib/esm/{chunk-ITXZXFZZ.js → chunk-R4YYWOA4.js} +1 -1
- package/lib/esm/index.d.ts +221 -10
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-LHEBDO45.js → inspector-RHOYG5KR.js} +2 -2
- package/lib/esm/{internal-4G5ODHLV.js → internal-4S5IPA5O.js} +1 -1
- package/lib/esm/{src-75CCWRAE.js → src-2BZUPZLG.js} +1 -1
- package/lib/esm/{text3d-G7QFRZO4.js → text3d-NPU3WI3W.js} +1 -1
- package/package.json +1 -1
- package/lib/esm/chunk-B3VG275M.js +0 -968
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{A as
|
|
2
|
-
`);var b=d+(u?" ":"\u2502 ");M.left&&s(M.left,b,!1,m,T),M.right&&s(M.right,b,!0,m,T)}}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 T=this._comparator,b=r(d,this._root,T),D=T(d,b.key);return D===0?this._root=b:(D<0?(m.left=b.left,m.right=b,b.left=null):D>0&&(m.right=b.right,m.left=b,b.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 T;if(u===null)return null;u=r(d,u,m);var b=m(d,u.key);return b===0?(u.left===null?T=u.right:(T=r(d,u.left,m),T.right=u.right),this._size--,T):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 T=m(d,u.key);if(T===0)return u;T<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 T=m(d,u.key);if(T===0)return!0;T<0?u=u.left:u=u.right}return!1},M.prototype.forEach=function(d,u){for(var m=this._root,T=[],b=!1;!b;)m!==null?(T.push(m),m=m.left):T.length!==0?(m=T.pop(),d.call(u,m),m=m.right):b=!0;return this},M.prototype.range=function(d,u,m,T){for(var b=[],D=this._comparator,C=this._root,L;b.length!==0||C;)if(C)b.push(C),C=C.left;else{if(C=b.pop(),L=D(C.key,u),L>0)break;if(D(C.key,d)>=0&&m.call(T,C))return this;C=C.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,T=0,b=[];!m;)if(u)b.push(u),u=u.left;else if(b.length>0){if(u=b.pop(),T===d)return u;T++,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 T=this._comparator;u;){var b=T(d.key,u.key);if(b===0)break;b<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 T=this._comparator;u;){var b=T(d.key,u.key);if(b===0)break;b<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 T=d.length,b=this._comparator;if(m&&I(d,u,0,T-1,b),this._root===null)this._root=c(d,u,0,T),this._size=T;else{var D=v(this.toList(),p(d,u),b);T=this._size+T,this._root=g({head:D},0,T)}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 T=this._comparator,b=i(d,this._root,T),D=b.left,C=b.right;T(d,u)<0?C=n(u,m,C,T):D=n(u,m,D,T),this._root=a(D,C,T)},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(T){switch(T.label){case 0:d=this._root,u=[],m=!1,T.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 T.sent(),d=d.right,[3,5];case 4:m=!0,T.label=5;case 5:return[3,1];case 6:return[2]}})},M})();function c(M,d,u,m){var T=m-u;if(T>0){var b=u+Math.floor(T/2),D=M[b],C=d[b],L=new e(D,C);return L.left=c(M,d,u,b),L.right=c(M,d,b+1,m),L}return null}function p(M,d){for(var u=new e(null,null),m=u,T=0;T<M.length;T++)m=m.next=new e(M[T],d[T]);return m.next=null,u.next}function h(M){for(var d=M,u=[],m=!1,T=new e(null,null),b=T;!m;)d?(u.push(d),d=d.left):u.length>0?(d=b=b.next=u.pop(),d=d.right):m=!0;return b.next=null,T.next}function g(M,d,u){var m=u-d;if(m>0){var T=d+Math.floor(m/2),b=g(M,d,T),D=M.head;return D.left=b,M.head=M.head.next,D.right=g(M,T+1,u),D}return null}function v(M,d,u){for(var m=new e(null,null),T=m,b=M,D=d;b!==null&&D!==null;)u(b.key,D.key)<0?(T.next=b,b=b.next):(T.next=D,D=D.next),T=T.next;return b!==null?T.next=b:D!==null&&(T.next=D),m.next}function I(M,d,u,m,T){if(!(u>=m)){for(var b=M[u+m>>1],D=u-1,C=m+1;;){do D++;while(T(M[D],b)<0);do C--;while(T(M[C],b)>0);if(D>=C)break;var L=M[D];M[D]=M[C],M[C]=L,L=d[D],d[D]=d[C],d[C]=L}I(M,d,u,C,T),I(M,d,C+1,m,T)}}let E=(M,d)=>M.ll.x<=d.x&&d.x<=M.ur.x&&M.ll.y<=d.y&&d.y<=M.ur.y,O=(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,T=M.ll.y<d.ll.y?d.ll.y:M.ll.y,b=M.ur.y<d.ur.y?M.ur.y:d.ur.y;return{ll:{x:u,y:T},ur:{x:m,y:b}}},w=Number.EPSILON;w===void 0&&(w=Math.pow(2,-52));let F=w*w,W=(M,d)=>{if(-w<M&&M<w&&-w<d&&d<w)return 0;let u=M-d;return u*u<F*M*d?0:M<d?-1:1};class N{constructor(){this.reset()}reset(){this.xRounder=new B,this.yRounder=new B}round(d,u){return{x:this.xRounder.round(d),y:this.yRounder.round(u)}}}class B{constructor(){this.tree=new l,this.round(0)}round(d){let u=this.tree.add(d),m=this.tree.prev(u);if(m!==null&&W(u.key,m.key)===0)return this.tree.remove(d),m.key;let T=this.tree.next(u);return T!==null&&W(u.key,T.key)===0?(this.tree.remove(d),T.key):d}}let G=new N,A=11102230246251565e-32,j=134217729,te=(3+8*A)*A;function he(M,d,u,m,T){let b,D,C,L,k=d[0],X=m[0],P=0,R=0;X>k==X>-k?(b=k,k=d[++P]):(b=X,X=m[++R]);let U=0;if(P<M&&R<u)for(X>k==X>-k?(D=k+b,C=b-(D-k),k=d[++P]):(D=X+b,C=b-(D-X),X=m[++R]),b=D,C!==0&&(T[U++]=C);P<M&&R<u;)X>k==X>-k?(D=b+k,L=D-b,C=b-(D-L)+(k-L),k=d[++P]):(D=b+X,L=D-b,C=b-(D-L)+(X-L),X=m[++R]),b=D,C!==0&&(T[U++]=C);for(;P<M;)D=b+k,L=D-b,C=b-(D-L)+(k-L),k=d[++P],b=D,C!==0&&(T[U++]=C);for(;R<u;)D=b+X,L=D-b,C=b-(D-L)+(X-L),X=m[++R],b=D,C!==0&&(T[U++]=C);return(b!==0||U===0)&&(T[U++]=b),U}function ge(M,d){let u=d[0];for(let m=1;m<M;m++)u+=d[m];return u}function ie(M){return new Float64Array(M)}let Te=(3+16*A)*A,Be=(2+12*A)*A,Ve=(9+64*A)*A*A,pe=ie(4),$e=ie(8),wt=ie(12),ot=ie(16),ve=ie(4);function mo(M,d,u,m,T,b,D){let C,L,k,X,P,R,U,K,J,ne,Q,de,we,Ee,je,Ae,Qe,ke,rt=M-T,ft=u-T,Ye=d-b,ht=m-b;Ee=rt*ht,R=j*rt,U=R-(R-rt),K=rt-U,R=j*ht,J=R-(R-ht),ne=ht-J,je=K*ne-(Ee-U*J-K*J-U*ne),Ae=Ye*ft,R=j*Ye,U=R-(R-Ye),K=Ye-U,R=j*ft,J=R-(R-ft),ne=ft-J,Qe=K*ne-(Ae-U*J-K*J-U*ne),Q=je-Qe,P=je-Q,pe[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,we=Ee-(de-P)+(Q-P),Q=we-Ae,P=we-Q,pe[1]=we-(Q+P)+(P-Ae),ke=de+Q,P=ke-de,pe[2]=de-(ke-P)+(Q-P),pe[3]=ke;let kt=ge(4,pe),me=Be*D;if(kt>=me||-kt>=me||(P=M-rt,C=M-(rt+P)+(P-T),P=u-ft,k=u-(ft+P)+(P-T),P=d-Ye,L=d-(Ye+P)+(P-b),P=m-ht,X=m-(ht+P)+(P-b),C===0&&L===0&&k===0&&X===0)||(me=Ve*D+te*Math.abs(kt),kt+=rt*X+ht*C-(Ye*k+ft*L),kt>=me||-kt>=me))return kt;Ee=C*ht,R=j*C,U=R-(R-C),K=C-U,R=j*ht,J=R-(R-ht),ne=ht-J,je=K*ne-(Ee-U*J-K*J-U*ne),Ae=L*ft,R=j*L,U=R-(R-L),K=L-U,R=j*ft,J=R-(R-ft),ne=ft-J,Qe=K*ne-(Ae-U*J-K*J-U*ne),Q=je-Qe,P=je-Q,ve[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,we=Ee-(de-P)+(Q-P),Q=we-Ae,P=we-Q,ve[1]=we-(Q+P)+(P-Ae),ke=de+Q,P=ke-de,ve[2]=de-(ke-P)+(Q-P),ve[3]=ke;let So=he(4,pe,4,ve,$e);Ee=rt*X,R=j*rt,U=R-(R-rt),K=rt-U,R=j*X,J=R-(R-X),ne=X-J,je=K*ne-(Ee-U*J-K*J-U*ne),Ae=Ye*k,R=j*Ye,U=R-(R-Ye),K=Ye-U,R=j*k,J=R-(R-k),ne=k-J,Qe=K*ne-(Ae-U*J-K*J-U*ne),Q=je-Qe,P=je-Q,ve[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,we=Ee-(de-P)+(Q-P),Q=we-Ae,P=we-Q,ve[1]=we-(Q+P)+(P-Ae),ke=de+Q,P=ke-de,ve[2]=de-(ke-P)+(Q-P),ve[3]=ke;let _a=he(So,$e,4,ve,wt);Ee=C*X,R=j*C,U=R-(R-C),K=C-U,R=j*X,J=R-(R-X),ne=X-J,je=K*ne-(Ee-U*J-K*J-U*ne),Ae=L*k,R=j*L,U=R-(R-L),K=L-U,R=j*k,J=R-(R-k),ne=k-J,Qe=K*ne-(Ae-U*J-K*J-U*ne),Q=je-Qe,P=je-Q,ve[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,we=Ee-(de-P)+(Q-P),Q=we-Ae,P=we-Q,ve[1]=we-(Q+P)+(P-Ae),ke=de+Q,P=ke-de,ve[2]=de-(ke-P)+(Q-P),ve[3]=ke;let ai=he(_a,wt,4,ve,ot);return ot[ai-1]}function se(M,d,u,m,T,b){let D=(d-b)*(u-T),C=(M-T)*(m-b),L=D-C,k=Math.abs(D+C);return Math.abs(L)>=Te*k?L:-mo(M,d,u,m,T,b,k)}let Et=(M,d)=>M.x*d.y-M.y*d.x,Dt=(M,d)=>M.x*d.x+M.y*d.y,$t=(M,d,u)=>{let m=se(M.x,M.y,d.x,d.y,u.x,u.y);return m>0?-1:m<0?1:0},Ft=M=>Math.sqrt(Dt(M,M)),yo=(M,d,u)=>{let m={x:d.x-M.x,y:d.y-M.y},T={x:u.x-M.x,y:u.y-M.y};return Et(T,m)/Ft(T)/Ft(m)},bo=(M,d,u)=>{let m={x:d.x-M.x,y:d.y-M.y},T={x:u.x-M.x,y:u.y-M.y};return Dt(T,m)/Ft(T)/Ft(m)},Vo=(M,d,u)=>d.y===0?null:{x:M.x+d.x/d.y*(u-M.y),y:u},ir=(M,d,u)=>d.x===0?null:{x:u,y:M.y+d.y/d.x*(u-M.x)},ar=(M,d,u,m)=>{if(d.x===0)return ir(u,m,M.x);if(m.x===0)return ir(M,d,u.x);if(d.y===0)return Vo(u,m,M.y);if(m.y===0)return Vo(M,d,u.y);let T=Et(d,m);if(T==0)return null;let b={x:u.x-M.x,y:u.y-M.y},D=Et(b,d)/T,C=Et(b,m)/T,L=M.x+C*d.x,k=u.x+D*m.x,X=M.y+C*d.y,P=u.y+D*m.y,R=(L+k)/2,U=(X+P)/2;return{x:R,y:U}};class re{static compare(d,u){let m=re.comparePoints(d.point,u.point);return m!==0?m:(d.point!==u.point&&d.link(u),d.isLeft!==u.isLeft?d.isLeft?1:-1:ae.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,T=u.length;m<T;m++){let b=u[m];this.point.events.push(b),b.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 T=u+1;T<d;T++){let b=this.point.events[T];b.consumedBy===void 0&&m.otherSE.point.events===b.otherSE.point.events&&m.segment.consume(b.segment)}}}getAvailableLinkedEvents(){let d=[];for(let u=0,m=this.point.events.length;u<m;u++){let T=this.point.events[u];T!==this&&!T.segment.ringOut&&T.segment.isInResult()&&d.push(T)}return d}getLeftmostComparator(d){let u=new Map,m=T=>{let b=T.otherSE;u.set(T,{sine:yo(this.point,d.point,b.point),cosine:bo(this.point,d.point,b.point)})};return(T,b)=>{u.has(T)||m(T),u.has(b)||m(b);let{sine:D,cosine:C}=u.get(T),{sine:L,cosine:k}=u.get(b);return D>=0&&L>=0?C<k?1:C>k?-1:0:D<0&&L<0?C<k?-1:C>k?1:0:L<D?-1:L>D?1:0}}}let jo=0;class ae{static compare(d,u){let m=d.leftSE.point.x,T=u.leftSE.point.x,b=d.rightSE.point.x,D=u.rightSE.point.x;if(D<m)return 1;if(b<T)return-1;let C=d.leftSE.point.y,L=u.leftSE.point.y,k=d.rightSE.point.y,X=u.rightSE.point.y;if(m<T){if(L<C&&L<k)return 1;if(L>C&&L>k)return-1;let P=d.comparePoint(u.leftSE.point);if(P<0)return 1;if(P>0)return-1;let R=u.comparePoint(d.rightSE.point);return R!==0?R:-1}if(m>T){if(C<L&&C<X)return-1;if(C>L&&C>X)return 1;let P=u.comparePoint(d.leftSE.point);if(P!==0)return P;let R=d.comparePoint(u.rightSE.point);return R<0?1:R>0?-1:1}if(C<L)return-1;if(C>L)return 1;if(b<D){let P=u.comparePoint(d.rightSE.point);if(P!==0)return P}if(b>D){let P=d.comparePoint(u.rightSE.point);if(P<0)return 1;if(P>0)return-1}if(b!==D){let P=k-C,R=b-m,U=X-L,K=D-T;if(P>R&&U<K)return 1;if(P<R&&U>K)return-1}return b>D?1:b<D||k<X?-1:k>X?1:d.id<u.id?-1:d.id>u.id?1:0}constructor(d,u,m,T){this.id=++jo,this.leftSE=d,d.segment=this,d.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=d,this.rings=m,this.windings=T}static fromRing(d,u,m){let T,b,D,C=re.comparePoints(d,u);if(C<0)T=d,b=u,D=1;else if(C>0)T=u,b=d,D=-1;else throw new Error(`Tried to create degenerate segment at [${d.x}, ${d.y}]`);let L=new re(T,!0),k=new re(b,!1);return new ae(L,k,[m],[D])}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,T=this.vector();if(u.x===m.x)return d.x===u.x?0:d.x<u.x?1:-1;let b=(d.y-u.y)/T.y,D=u.x+b*T.x;if(d.x===D)return 0;let C=(d.x-u.x)/T.x,L=u.y+C*T.y;return d.y===L?0:d.y<L?-1:1}getIntersection(d){let u=this.bbox(),m=d.bbox(),T=O(u,m);if(T===null)return null;let b=this.leftSE.point,D=this.rightSE.point,C=d.leftSE.point,L=d.rightSE.point,k=E(u,C)&&this.comparePoint(C)===0,X=E(m,b)&&d.comparePoint(b)===0,P=E(u,L)&&this.comparePoint(L)===0,R=E(m,D)&&d.comparePoint(D)===0;if(X&&k)return R&&!P?D:!R&&P?L:null;if(X)return P&&b.x===L.x&&b.y===L.y?null:b;if(k)return R&&D.x===C.x&&D.y===C.y?null:C;if(R&&P)return null;if(R)return D;if(P)return L;let U=ar(b,this.vector(),C,d.vector());return U===null||!E(T,U)?null:G.round(U.x,U.y)}split(d){let u=[],m=d.events!==void 0,T=new re(d,!0),b=new re(d,!1),D=this.rightSE;this.replaceRightSE(b),u.push(b),u.push(T);let C=new ae(T,D,this.rings.slice(),this.windings.slice());return re.comparePoints(C.leftSE.point,C.rightSE.point)>0&&C.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),m&&(T.checkForConsuming(),b.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 T=ae.compare(u,m);if(T!==0){if(T>0){let b=u;u=m,m=b}if(u.prev===m){let b=u;u=m,m=b}for(let b=0,D=m.rings.length;b<D;b++){let C=m.rings[b],L=m.windings[b],k=u.rings.indexOf(C);k===-1?(u.rings.push(C),u.windings.push(L)):u.windings[k]+=L}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,T=this._afterState.multiPolys;for(let C=0,L=this.rings.length;C<L;C++){let k=this.rings[C],X=this.windings[C],P=u.indexOf(k);P===-1?(u.push(k),m.push(X)):m[P]+=X}let b=[],D=[];for(let C=0,L=u.length;C<L;C++){if(m[C]===0)continue;let k=u[C],X=k.poly;if(D.indexOf(X)===-1)if(k.isExterior)b.push(X);else{D.indexOf(X)===-1&&D.push(X);let P=b.indexOf(k.poly);P!==-1&&b.splice(P,1)}}for(let C=0,L=b.length;C<L;C++){let k=b[C].multiPoly;T.indexOf(k)===-1&&T.push(k)}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(Oe.type){case"union":{let m=d.length===0,T=u.length===0;this._isInResult=m!==T;break}case"intersection":{let m,T;d.length<u.length?(m=d.length,T=u.length):(m=u.length,T=d.length),this._isInResult=T===Oe.numMultiPolys&&m<T;break}case"xor":{let m=Math.abs(d.length-u.length);this._isInResult=m%2===1;break}case"difference":{let m=T=>T.length===1&&T[0].isSubject;this._isInResult=m(d)!==m(u);break}default:throw new Error(`Unrecognized operation type found ${Oe.type}`)}return this._isInResult}}class To{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 T=G.round(d[0][0],d[0][1]);this.bbox={ll:{x:T.x,y:T.y},ur:{x:T.x,y:T.y}};let b=T;for(let D=1,C=d.length;D<C;D++){if(typeof d[D][0]!="number"||typeof d[D][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let L=G.round(d[D][0],d[D][1]);L.x===b.x&&L.y===b.y||(this.segments.push(ae.fromRing(b,L,this)),L.x<this.bbox.ll.x&&(this.bbox.ll.x=L.x),L.y<this.bbox.ll.y&&(this.bbox.ll.y=L.y),L.x>this.bbox.ur.x&&(this.bbox.ur.x=L.x),L.y>this.bbox.ur.y&&(this.bbox.ur.y=L.y),b=L)}(T.x!==b.x||T.y!==b.y)&&this.segments.push(ae.fromRing(b,T,this))}getSweepEvents(){let d=[];for(let u=0,m=this.segments.length;u<m;u++){let T=this.segments[u];d.push(T.leftSE),d.push(T.rightSE)}return d}}class Se{constructor(d,u){if(!Array.isArray(d))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new To(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,T=d.length;m<T;m++){let b=new To(d[m],this,!1);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.interiorRings.push(b)}this.multiPoly=u}getSweepEvents(){let d=this.exteriorRing.getSweepEvents();for(let u=0,m=this.interiorRings.length;u<m;u++){let T=this.interiorRings[u].getSweepEvents();for(let b=0,D=T.length;b<D;b++)d.push(T[b])}return d}}class vo{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,T=d.length;m<T;m++){let b=new Se(d[m],this);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.polys.push(b)}this.isSubject=u}getSweepEvents(){let d=[];for(let u=0,m=this.polys.length;u<m;u++){let T=this.polys[u].getSweepEvents();for(let b=0,D=T.length;b<D;b++)d.push(T[b])}return d}}class Go{static factory(d){let u=[];for(let m=0,T=d.length;m<T;m++){let b=d[m];if(!b.isInResult()||b.ringOut)continue;let D=null,C=b.leftSE,L=b.rightSE,k=[C],X=C.point,P=[];for(;D=C,C=L,k.push(C),C.point!==X;)for(;;){let R=C.getAvailableLinkedEvents();if(R.length===0){let J=k[0].point,ne=k[k.length-1].point;throw new Error(`Unable to complete output ring starting at [${J.x}, ${J.y}]. Last matching segment found ends at [${ne.x}, ${ne.y}].`)}if(R.length===1){L=R[0].otherSE;break}let U=null;for(let J=0,ne=P.length;J<ne;J++)if(P[J].point===C.point){U=J;break}if(U!==null){let J=P.splice(U)[0],ne=k.splice(J.index);ne.unshift(ne[0].otherSE),u.push(new Go(ne.reverse()));continue}P.push({index:k.length,point:C.point});let K=C.getLeftmostComparator(D);L=R.sort(K)[0].otherSE;break}u.push(new Go(k))}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 k=1,X=this.events.length-1;k<X;k++){let P=this.events[k].point,R=this.events[k+1].point;$t(P,d,R)!==0&&(u.push(P),d=P)}if(u.length===1)return null;let m=u[0],T=u[1];$t(m,d,T)===0&&u.shift(),u.push(u[0]);let b=this.isExteriorRing()?1:-1,D=this.isExteriorRing()?0:u.length-1,C=this.isExteriorRing()?u.length:-1,L=[];for(let k=D;k!=C;k+=b)L.push([u[k].x,u[k].y]);return L}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 T=1,b=this.events.length;T<b;T++){let D=this.events[T];re.compare(d,D)>0&&(d=D)}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 At{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 T=this.interiorRings[u].getGeom();T!==null&&d.push(T)}return d}}class ri{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 T=this.polys[u].getGeom();T!==null&&d.push(T)}return d}_composePolys(d){let u=[];for(let m=0,T=d.length;m<T;m++){let b=d[m];if(!b.poly)if(b.isExteriorRing())u.push(new At(b));else{let D=b.enclosingRing();D.poly||u.push(new At(D)),D.poly.addInterior(b)}}return u}}class Yr{constructor(d){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae.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 T=d.isLeft?this.tree.add(u):this.tree.find(u);if(!T)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 b=T,D=T,C,L;for(;C===void 0;)b=this.tree.prev(b),b===null?C=null:b.key.consumedBy===void 0&&(C=b.key);for(;L===void 0;)D=this.tree.next(D),D===null?L=null:D.key.consumedBy===void 0&&(L=D.key);if(d.isLeft){let k=null;if(C){let P=C.getIntersection(u);if(P!==null&&(u.isAnEndpoint(P)||(k=P),!C.isAnEndpoint(P))){let R=this._splitSafely(C,P);for(let U=0,K=R.length;U<K;U++)m.push(R[U])}}let X=null;if(L){let P=L.getIntersection(u);if(P!==null&&(u.isAnEndpoint(P)||(X=P),!L.isAnEndpoint(P))){let R=this._splitSafely(L,P);for(let U=0,K=R.length;U<K;U++)m.push(R[U])}}if(k!==null||X!==null){let P=null;k===null?P=X:X===null?P=k:P=re.comparePoints(k,X)<=0?k:X,this.queue.remove(u.rightSE),m.push(u.rightSE);let R=u.split(P);for(let U=0,K=R.length;U<K;U++)m.push(R[U])}m.length>0?(this.tree.remove(u),m.push(d)):(this.segments.push(u),u.prev=C)}else{if(C&&L){let k=C.getIntersection(L);if(k!==null){if(!C.isAnEndpoint(k)){let X=this._splitSafely(C,k);for(let P=0,R=X.length;P<R;P++)m.push(X[P])}if(!L.isAnEndpoint(k)){let X=this._splitSafely(L,k);for(let P=0,R=X.length;P<R;P++)m.push(X[P])}}}this.tree.remove(u)}return m}_splitSafely(d,u){this.tree.remove(d);let m=d.rightSE;this.queue.remove(m);let T=d.split(u);return T.push(m),d.consumedBy===void 0&&this.tree.add(d),T}}let Zr=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ni=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Yt{run(d,u,m){Oe.type=d,G.reset();let T=[new vo(u,!0)];for(let P=0,R=m.length;P<R;P++)T.push(new vo(m[P],!1));if(Oe.numMultiPolys=T.length,Oe.type==="difference"){let P=T[0],R=1;for(;R<T.length;)O(T[R].bbox,P.bbox)!==null?R++:T.splice(R,1)}if(Oe.type==="intersection")for(let P=0,R=T.length;P<R;P++){let U=T[P];for(let K=P+1,J=T.length;K<J;K++)if(O(U.bbox,T[K].bbox)===null)return[]}let b=new l(re.compare);for(let P=0,R=T.length;P<R;P++){let U=T[P].getSweepEvents();for(let K=0,J=U.length;K<J;K++)if(b.insert(U[K]),b.size>Zr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let D=new Yr(b),C=b.size,L=b.pop();for(;L;){let P=L.key;if(b.size===C){let U=P.segment;throw new Error(`Unable to pop() ${P.isLeft?"left":"right"} SweepEvent [${P.point.x}, ${P.point.y}] from segment #${U.id} [${U.leftSE.point.x}, ${U.leftSE.point.y}] -> [${U.rightSE.point.x}, ${U.rightSE.point.y}] from queue.`)}if(b.size>Zr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(D.segments.length>ni)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let R=D.process(P);for(let U=0,K=R.length;U<K;U++){let J=R[U];J.consumedBy===void 0&&b.insert(J)}C=b.size,L=b.pop()}G.reset();let k=Go.factory(D.segments);return new ri(k).getGeom()}}let Oe=new Yt;var Qr={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 Oe.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 Oe.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 Oe.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 Oe.run("difference",M,u)}};return Qr}))});var zt=_e(It=>{"use strict";f();It.__esModule=!0;It.extend=cf;It.indexOf=Vy;It.escapeExpression=jy;It.isEmpty=Gy;It.createFrame=Uy;It.blockParams=Hy;It.appendContextPath=Wy;var Ly={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},Ny=/[&<>"'`=]/g,Ry=/[&<>"'`=]/;function By(o){return Ly[o]}function cf(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 Sl=Object.prototype.toString;It.toString=Sl;var Il=function(e){return typeof e=="function"};Il(/x/)&&(It.isFunction=Il=function(o){return typeof o=="function"&&Sl.call(o)==="[object Function]"});It.isFunction=Il;var pf=Array.isArray||function(o){return o&&typeof o=="object"?Sl.call(o)==="[object Array]":!1};It.isArray=pf;function Vy(o,e){for(var t=0,r=o.length;t<r;t++)if(o[t]===e)return t;return-1}function jy(o){if(typeof o!="string"){if(o&&o.toHTML)return o.toHTML();if(o==null)return"";if(!o)return o+"";o=""+o}return Ry.test(o)?o.replace(Ny,By):o}function Gy(o){return!o&&o!==0?!0:!!(pf(o)&&o.length===0)}function Uy(o){var e=cf({},o);return e._parent=o,e}function Hy(o,e){return o.path=e,o}function Wy(o,e){return(o?o+".":"")+e}});var Lo=_e((ia,df)=>{"use strict";f();ia.__esModule=!0;var El=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function Ml(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<El.length;l++)this[El[l]]=s[El[l]];Error.captureStackTrace&&Error.captureStackTrace(this,Ml);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{}}Ml.prototype=new Error;ia.default=Ml;df.exports=ia.default});var ff=_e((aa,uf)=>{"use strict";f();aa.__esModule=!0;var xl=zt();aa.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(xl.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=xl.createFrame(t.data);i.contextPath=xl.appendContextPath(t.data.contextPath,t.name),t={data:i}}return n(e,t)})};uf.exports=aa.default});var gf=_e((sa,hf)=>{"use strict";f();sa.__esModule=!0;function zy(o){return o&&o.__esModule?o:{default:o}}var $n=zt(),Xy=Lo(),$y=zy(Xy);sa.default=function(o){o.registerHelper("each",function(e,t){if(!t)throw new $y.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=$n.appendContextPath(t.data.contextPath,t.ids[0])+"."),$n.isFunction(e)&&(e=e.call(this)),t.data&&(s=$n.createFrame(t.data));function c(I,E,O){s&&(s.key=I,s.index=E,s.first=E===0,s.last=!!O,l&&(s.contextPath=l+I)),a=a+r(e[I],{data:s,blockParams:$n.blockParams([e[I],I],[l+I,null])})}if(e&&typeof e=="object")if($n.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](),v=g.next();!v.done;v=g.next())h.push(v.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})};hf.exports=sa.default});var yf=_e((la,mf)=>{"use strict";f();la.__esModule=!0;function Yy(o){return o&&o.__esModule?o:{default:o}}var Zy=Lo(),Jy=Yy(Zy);la.default=function(o){o.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new Jy.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};mf.exports=la.default});var If=_e((ca,vf)=>{"use strict";f();ca.__esModule=!0;function qy(o){return o&&o.__esModule?o:{default:o}}var bf=zt(),Qy=Lo(),Tf=qy(Qy);ca.default=function(o){o.registerHelper("if",function(e,t){if(arguments.length!=2)throw new Tf.default("#if requires exactly one argument");return bf.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||bf.isEmpty(e)?t.inverse(this):t.fn(this)}),o.registerHelper("unless",function(e,t){if(arguments.length!=2)throw new Tf.default("#unless requires exactly one argument");return o.helpers.if.call(this,e,{fn:t.inverse,inverse:t.fn,hash:t.hash})})};vf.exports=ca.default});var Ef=_e((pa,Sf)=>{"use strict";f();pa.__esModule=!0;pa.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)})};Sf.exports=pa.default});var xf=_e((da,Mf)=>{"use strict";f();da.__esModule=!0;da.default=function(o){o.registerHelper("lookup",function(e,t,r){return e&&r.lookupProperty(e,t)})};Mf.exports=da.default});var Cf=_e((ua,_f)=>{"use strict";f();ua.__esModule=!0;function Ky(o){return o&&o.__esModule?o:{default:o}}var Yn=zt(),e1=Lo(),t1=Ky(e1);ua.default=function(o){o.registerHelper("with",function(e,t){if(arguments.length!=2)throw new t1.default("#with requires exactly one argument");Yn.isFunction(e)&&(e=e.call(this));var r=t.fn;if(Yn.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&(n=Yn.createFrame(t.data),n.contextPath=Yn.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:Yn.blockParams([e],[n&&n.contextPath])})})};_f.exports=ua.default});var _l=_e(fa=>{"use strict";f();fa.__esModule=!0;fa.registerDefaultHelpers=m1;fa.moveHelperToHooks=y1;function tr(o){return o&&o.__esModule?o:{default:o}}var o1=ff(),r1=tr(o1),n1=gf(),i1=tr(n1),a1=yf(),s1=tr(a1),l1=If(),c1=tr(l1),p1=Ef(),d1=tr(p1),u1=xf(),f1=tr(u1),h1=Cf(),g1=tr(h1);function m1(o){r1.default(o),i1.default(o),s1.default(o),c1.default(o),d1.default(o),f1.default(o),g1.default(o)}function y1(o,e,t){o.helpers[e]&&(o.hooks[e]=o.helpers[e],t||(o.helpers[e]=void 0))}});var Of=_e((ha,Pf)=>{"use strict";f();ha.__esModule=!0;var b1=zt();ha.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=b1.extend({},l,t.partials);var c=e(a,s);return r.partials=l,c}),t.partials[n.args[0]]=n.fn,i})};Pf.exports=ha.default});var wf=_e(Cl=>{"use strict";f();Cl.__esModule=!0;Cl.registerDefaultDecorators=S1;function T1(o){return o&&o.__esModule?o:{default:o}}var v1=Of(),I1=T1(v1);function S1(o){I1.default(o)}});var Pl=_e((ga,Df)=>{"use strict";f();ga.__esModule=!0;var E1=zt(),jr={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var t=E1.indexOf(jr.methodMap,e.toLowerCase());t>=0?e=t:e=parseInt(e,10)}return e},log:function(e){if(e=jr.lookupLevel(e),typeof console<"u"&&jr.lookupLevel(jr.level)<=e){var t=jr.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)}}};ga.default=jr;Df.exports=ga.default});var Ol=_e(Zn=>{"use strict";f();Zn.__esModule=!0;Zn.createProtoAccessControl=C1;Zn.resultIsAllowed=P1;Zn.resetLoggedProperties=w1;function M1(o){return o&&o.__esModule?o:{default:o}}var Ff=zt(),x1=Pl(),_1=M1(x1),ma=Object.create(null);function C1(o){var e=Object.create(null);e.__proto__=!1,Ff.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,Ff.extend(t,o.allowedProtoMethods),{properties:{whitelist:e,defaultValue:o.allowProtoPropertiesByDefault},methods:{whitelist:t,defaultValue:o.allowProtoMethodsByDefault}}}function P1(o,e,t){return Af(typeof o=="function"?e.methods:e.properties,t)}function Af(o,e){return o.whitelist[e]!==void 0?o.whitelist[e]===!0:o.defaultValue!==void 0?o.defaultValue:(O1(e),!1)}function O1(o){ma[o]!==!0&&(ma[o]=!0,_1.default.log("error",'Handlebars: Access has been denied to resolve the property "'+o+`" because it is not an "own property" of its parent.
|
|
1
|
+
import{A as Bc,a as gi,b as mi,c as on,d as Qt,e as Ho,f as mc,g as yi,h as Mo,i as pr,j as dr,k as yc,l as Tc,m as Aa,n as vc,o as Ic,p as Fa,q as Sc,r as Ec,s as Mc,t as ja,w as Rc}from"./chunk-2ZEZ2HG5.js";import{$ as Ac,B as we,C as bc,Dc as Nc,F as ka,Ha as Lc,J as xc,K as _c,L as Cc,M as Pc,P as so,Q as ur,R as La,S as Oc,T as Dc,U as wc,V as Na,W as Ra,X as Ba,Y as Va,ca as bi,e as x,f as oe,fa as Ga,g as ui,ga as Ua,h as dc,ha as Fc,ia as kc,j as gt,ka as ag,l as lr,la as Ha,m as fi,n as tn,q as hi,r as uc,t as fc,u as qt,v as wa,x as hc,y as gc,z as cr}from"./chunk-I5GYZORE.js";import{a as f,b as S}from"./chunk-CO4ZOCZ7.js";import{b as _e,d as di}from"./chunk-PWEV3AFA.js";var Cs=_e((xs,_s)=>{f();(function(o,e){typeof xs=="object"&&typeof _s<"u"?_s.exports=e():typeof define=="function"&&define.amd?define(e):(o=typeof globalThis<"u"?globalThis:o||self,o.polygonClipping=e())})(xs,(function(){"use strict";function o(M,d){var u={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},m,T,b,w;return w={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function C(k){return function(X){return L([k,X])}}function L(k){if(m)throw new TypeError("Generator is already executing.");for(;u;)try{if(m=1,T&&(b=k[0]&2?T.return:k[0]?T.throw||((b=T.return)&&b.call(T),0):T.next)&&!(b=b.call(T,k[1])).done)return b;switch(T=0,b&&(k=[k[0]&2,b.value]),k[0]){case 0:case 1:b=k;break;case 4:return u.label++,{value:k[1],done:!1};case 5:u.label++,T=k[1],k=[0];continue;case 7:k=u.ops.pop(),u.trys.pop();continue;default:if(b=u.trys,!(b=b.length>0&&b[b.length-1])&&(k[0]===6||k[0]===2)){u=0;continue}if(k[0]===3&&(!b||k[1]>b[0]&&k[1]<b[3])){u.label=k[1];break}if(k[0]===6&&u.label<b[1]){u.label=b[1],b=k;break}if(b&&u.label<b[2]){u.label=b[2],u.ops.push(k);break}b[2]&&u.ops.pop(),u.trys.pop();continue}k=d.call(M,u)}catch(X){k=[6,X],T=0}finally{m=b=0}if(k[0]&5)throw k[1];return{value:k[0]?k[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),T=m,b=m;;){var w=u(M,d.key);if(w<0){if(d.left===null)break;if(u(M,d.left.key)<0){var C=d.left;if(d.left=C.right,C.right=d,d=C,d.left===null)break}b.left=d,b=d,d=d.left}else if(w>0){if(d.right===null)break;if(u(M,d.right.key)>0){var C=d.right;if(d.right=C.left,C.left=d,d=C,d.right===null)break}T.right=d,T=d,d=d.right}else break}return T.right=d.left,b.left=d.right,d.left=m.right,d.right=m.left,d}function n(M,d,u,m){var T=new e(M,d);if(u===null)return T.left=T.right=null,T;u=r(M,u,m);var b=m(M,u.key);return b<0?(T.left=u.left,T.right=u,u.left=null):b>=0&&(T.right=u.right,T.left=u,u.right=null),T}function i(M,d,u){var m=null,T=null;if(d){d=r(M,d,u);var b=u(d.key,M);b===0?(m=d.left,T=d.right):b<0?(T=d.right,d.right=null,m=d):(m=d.left,d.left=null,T=d)}return{left:m,right:T}}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,T){if(M){m(""+d+(u?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+T(M)+`
|
|
2
|
+
`);var b=d+(u?" ":"\u2502 ");M.left&&s(M.left,b,!1,m,T),M.right&&s(M.right,b,!0,m,T)}}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 T=this._comparator,b=r(d,this._root,T),w=T(d,b.key);return w===0?this._root=b:(w<0?(m.left=b.left,m.right=b,b.left=null):w>0&&(m.right=b.right,m.left=b,b.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 T;if(u===null)return null;u=r(d,u,m);var b=m(d,u.key);return b===0?(u.left===null?T=u.right:(T=r(d,u.left,m),T.right=u.right),this._size--,T):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 T=m(d,u.key);if(T===0)return u;T<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 T=m(d,u.key);if(T===0)return!0;T<0?u=u.left:u=u.right}return!1},M.prototype.forEach=function(d,u){for(var m=this._root,T=[],b=!1;!b;)m!==null?(T.push(m),m=m.left):T.length!==0?(m=T.pop(),d.call(u,m),m=m.right):b=!0;return this},M.prototype.range=function(d,u,m,T){for(var b=[],w=this._comparator,C=this._root,L;b.length!==0||C;)if(C)b.push(C),C=C.left;else{if(C=b.pop(),L=w(C.key,u),L>0)break;if(w(C.key,d)>=0&&m.call(T,C))return this;C=C.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,T=0,b=[];!m;)if(u)b.push(u),u=u.left;else if(b.length>0){if(u=b.pop(),T===d)return u;T++,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 T=this._comparator;u;){var b=T(d.key,u.key);if(b===0)break;b<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 T=this._comparator;u;){var b=T(d.key,u.key);if(b===0)break;b<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 T=d.length,b=this._comparator;if(m&&I(d,u,0,T-1,b),this._root===null)this._root=c(d,u,0,T),this._size=T;else{var w=v(this.toList(),p(d,u),b);T=this._size+T,this._root=g({head:w},0,T)}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 T=this._comparator,b=i(d,this._root,T),w=b.left,C=b.right;T(d,u)<0?C=n(u,m,C,T):w=n(u,m,w,T),this._root=a(w,C,T)},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(T){switch(T.label){case 0:d=this._root,u=[],m=!1,T.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 T.sent(),d=d.right,[3,5];case 4:m=!0,T.label=5;case 5:return[3,1];case 6:return[2]}})},M})();function c(M,d,u,m){var T=m-u;if(T>0){var b=u+Math.floor(T/2),w=M[b],C=d[b],L=new e(w,C);return L.left=c(M,d,u,b),L.right=c(M,d,b+1,m),L}return null}function p(M,d){for(var u=new e(null,null),m=u,T=0;T<M.length;T++)m=m.next=new e(M[T],d[T]);return m.next=null,u.next}function h(M){for(var d=M,u=[],m=!1,T=new e(null,null),b=T;!m;)d?(u.push(d),d=d.left):u.length>0?(d=b=b.next=u.pop(),d=d.right):m=!0;return b.next=null,T.next}function g(M,d,u){var m=u-d;if(m>0){var T=d+Math.floor(m/2),b=g(M,d,T),w=M.head;return w.left=b,M.head=M.head.next,w.right=g(M,T+1,u),w}return null}function v(M,d,u){for(var m=new e(null,null),T=m,b=M,w=d;b!==null&&w!==null;)u(b.key,w.key)<0?(T.next=b,b=b.next):(T.next=w,w=w.next),T=T.next;return b!==null?T.next=b:w!==null&&(T.next=w),m.next}function I(M,d,u,m,T){if(!(u>=m)){for(var b=M[u+m>>1],w=u-1,C=m+1;;){do w++;while(T(M[w],b)<0);do C--;while(T(M[C],b)>0);if(w>=C)break;var L=M[w];M[w]=M[C],M[C]=L,L=d[w],d[w]=d[C],d[C]=L}I(M,d,u,C,T),I(M,d,C+1,m,T)}}let E=(M,d)=>M.ll.x<=d.x&&d.x<=M.ur.x&&M.ll.y<=d.y&&d.y<=M.ur.y,O=(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,T=M.ll.y<d.ll.y?d.ll.y:M.ll.y,b=M.ur.y<d.ur.y?M.ur.y:d.ur.y;return{ll:{x:u,y:T},ur:{x:m,y:b}}},D=Number.EPSILON;D===void 0&&(D=Math.pow(2,-52));let A=D*D,W=(M,d)=>{if(-D<M&&M<D&&-D<d&&d<D)return 0;let u=M-d;return u*u<A*M*d?0:M<d?-1:1};class N{constructor(){this.reset()}reset(){this.xRounder=new B,this.yRounder=new B}round(d,u){return{x:this.xRounder.round(d),y:this.yRounder.round(u)}}}class B{constructor(){this.tree=new l,this.round(0)}round(d){let u=this.tree.add(d),m=this.tree.prev(u);if(m!==null&&W(u.key,m.key)===0)return this.tree.remove(d),m.key;let T=this.tree.next(u);return T!==null&&W(u.key,T.key)===0?(this.tree.remove(d),T.key):d}}let G=new N,F=11102230246251565e-32,j=134217729,te=(3+8*F)*F;function he(M,d,u,m,T){let b,w,C,L,k=d[0],X=m[0],P=0,R=0;X>k==X>-k?(b=k,k=d[++P]):(b=X,X=m[++R]);let U=0;if(P<M&&R<u)for(X>k==X>-k?(w=k+b,C=b-(w-k),k=d[++P]):(w=X+b,C=b-(w-X),X=m[++R]),b=w,C!==0&&(T[U++]=C);P<M&&R<u;)X>k==X>-k?(w=b+k,L=w-b,C=b-(w-L)+(k-L),k=d[++P]):(w=b+X,L=w-b,C=b-(w-L)+(X-L),X=m[++R]),b=w,C!==0&&(T[U++]=C);for(;P<M;)w=b+k,L=w-b,C=b-(w-L)+(k-L),k=d[++P],b=w,C!==0&&(T[U++]=C);for(;R<u;)w=b+X,L=w-b,C=b-(w-L)+(X-L),X=m[++R],b=w,C!==0&&(T[U++]=C);return(b!==0||U===0)&&(T[U++]=b),U}function ge(M,d){let u=d[0];for(let m=1;m<M;m++)u+=d[m];return u}function ie(M){return new Float64Array(M)}let ve=(3+16*F)*F,Be=(2+12*F)*F,Ve=(9+64*F)*F*F,pe=ie(4),Et=ie(8),Dt=ie(12),$e=ie(16),ye=ie(4);function $t(M,d,u,m,T,b,w){let C,L,k,X,P,R,U,K,Z,ne,Q,de,De,Ee,je,Fe,Qe,ke,ot=M-T,ft=u-T,Ye=d-b,ht=m-b;Ee=ot*ht,R=j*ot,U=R-(R-ot),K=ot-U,R=j*ht,Z=R-(R-ht),ne=ht-Z,je=K*ne-(Ee-U*Z-K*Z-U*ne),Fe=Ye*ft,R=j*Ye,U=R-(R-Ye),K=Ye-U,R=j*ft,Z=R-(R-ft),ne=ft-Z,Qe=K*ne-(Fe-U*Z-K*Z-U*ne),Q=je-Qe,P=je-Q,pe[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,De=Ee-(de-P)+(Q-P),Q=De-Fe,P=De-Q,pe[1]=De-(Q+P)+(P-Fe),ke=de+Q,P=ke-de,pe[2]=de-(ke-P)+(Q-P),pe[3]=ke;let kt=ge(4,pe),me=Be*w;if(kt>=me||-kt>=me||(P=M-ot,C=M-(ot+P)+(P-T),P=u-ft,k=u-(ft+P)+(P-T),P=d-Ye,L=d-(Ye+P)+(P-b),P=m-ht,X=m-(ht+P)+(P-b),C===0&&L===0&&k===0&&X===0)||(me=Ve*w+te*Math.abs(kt),kt+=ot*X+ht*C-(Ye*k+ft*L),kt>=me||-kt>=me))return kt;Ee=C*ht,R=j*C,U=R-(R-C),K=C-U,R=j*ht,Z=R-(R-ht),ne=ht-Z,je=K*ne-(Ee-U*Z-K*Z-U*ne),Fe=L*ft,R=j*L,U=R-(R-L),K=L-U,R=j*ft,Z=R-(R-ft),ne=ft-Z,Qe=K*ne-(Fe-U*Z-K*Z-U*ne),Q=je-Qe,P=je-Q,ye[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,De=Ee-(de-P)+(Q-P),Q=De-Fe,P=De-Q,ye[1]=De-(Q+P)+(P-Fe),ke=de+Q,P=ke-de,ye[2]=de-(ke-P)+(Q-P),ye[3]=ke;let So=he(4,pe,4,ye,Et);Ee=ot*X,R=j*ot,U=R-(R-ot),K=ot-U,R=j*X,Z=R-(R-X),ne=X-Z,je=K*ne-(Ee-U*Z-K*Z-U*ne),Fe=Ye*k,R=j*Ye,U=R-(R-Ye),K=Ye-U,R=j*k,Z=R-(R-k),ne=k-Z,Qe=K*ne-(Fe-U*Z-K*Z-U*ne),Q=je-Qe,P=je-Q,ye[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,De=Ee-(de-P)+(Q-P),Q=De-Fe,P=De-Q,ye[1]=De-(Q+P)+(P-Fe),ke=de+Q,P=ke-de,ye[2]=de-(ke-P)+(Q-P),ye[3]=ke;let _a=he(So,Et,4,ye,Dt);Ee=C*X,R=j*C,U=R-(R-C),K=C-U,R=j*X,Z=R-(R-X),ne=X-Z,je=K*ne-(Ee-U*Z-K*Z-U*ne),Fe=L*k,R=j*L,U=R-(R-L),K=L-U,R=j*k,Z=R-(R-k),ne=k-Z,Qe=K*ne-(Fe-U*Z-K*Z-U*ne),Q=je-Qe,P=je-Q,ye[0]=je-(Q+P)+(P-Qe),de=Ee+Q,P=de-Ee,De=Ee-(de-P)+(Q-P),Q=De-Fe,P=De-Q,ye[1]=De-(Q+P)+(P-Fe),ke=de+Q,P=ke-de,ye[2]=de-(ke-P)+(Q-P),ye[3]=ke;let ai=he(_a,Dt,4,ye,$e);return $e[ai-1]}function se(M,d,u,m,T,b){let w=(d-b)*(u-T),C=(M-T)*(m-b),L=w-C,k=Math.abs(w+C);return Math.abs(L)>=ve*k?L:-$t(M,d,u,m,T,b,k)}let Mt=(M,d)=>M.x*d.y-M.y*d.x,wt=(M,d)=>M.x*d.x+M.y*d.y,Yt=(M,d,u)=>{let m=se(M.x,M.y,d.x,d.y,u.x,u.y);return m>0?-1:m<0?1:0},At=M=>Math.sqrt(wt(M,M)),yo=(M,d,u)=>{let m={x:d.x-M.x,y:d.y-M.y},T={x:u.x-M.x,y:u.y-M.y};return Mt(T,m)/At(T)/At(m)},bo=(M,d,u)=>{let m={x:d.x-M.x,y:d.y-M.y},T={x:u.x-M.x,y:u.y-M.y};return wt(T,m)/At(T)/At(m)},Vo=(M,d,u)=>d.y===0?null:{x:M.x+d.x/d.y*(u-M.y),y:u},ir=(M,d,u)=>d.x===0?null:{x:u,y:M.y+d.y/d.x*(u-M.x)},ar=(M,d,u,m)=>{if(d.x===0)return ir(u,m,M.x);if(m.x===0)return ir(M,d,u.x);if(d.y===0)return Vo(u,m,M.y);if(m.y===0)return Vo(M,d,u.y);let T=Mt(d,m);if(T==0)return null;let b={x:u.x-M.x,y:u.y-M.y},w=Mt(b,d)/T,C=Mt(b,m)/T,L=M.x+C*d.x,k=u.x+w*m.x,X=M.y+C*d.y,P=u.y+w*m.y,R=(L+k)/2,U=(X+P)/2;return{x:R,y:U}};class re{static compare(d,u){let m=re.comparePoints(d.point,u.point);return m!==0?m:(d.point!==u.point&&d.link(u),d.isLeft!==u.isLeft?d.isLeft?1:-1:ae.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,T=u.length;m<T;m++){let b=u[m];this.point.events.push(b),b.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 T=u+1;T<d;T++){let b=this.point.events[T];b.consumedBy===void 0&&m.otherSE.point.events===b.otherSE.point.events&&m.segment.consume(b.segment)}}}getAvailableLinkedEvents(){let d=[];for(let u=0,m=this.point.events.length;u<m;u++){let T=this.point.events[u];T!==this&&!T.segment.ringOut&&T.segment.isInResult()&&d.push(T)}return d}getLeftmostComparator(d){let u=new Map,m=T=>{let b=T.otherSE;u.set(T,{sine:yo(this.point,d.point,b.point),cosine:bo(this.point,d.point,b.point)})};return(T,b)=>{u.has(T)||m(T),u.has(b)||m(b);let{sine:w,cosine:C}=u.get(T),{sine:L,cosine:k}=u.get(b);return w>=0&&L>=0?C<k?1:C>k?-1:0:w<0&&L<0?C<k?-1:C>k?1:0:L<w?-1:L>w?1:0}}}let jo=0;class ae{static compare(d,u){let m=d.leftSE.point.x,T=u.leftSE.point.x,b=d.rightSE.point.x,w=u.rightSE.point.x;if(w<m)return 1;if(b<T)return-1;let C=d.leftSE.point.y,L=u.leftSE.point.y,k=d.rightSE.point.y,X=u.rightSE.point.y;if(m<T){if(L<C&&L<k)return 1;if(L>C&&L>k)return-1;let P=d.comparePoint(u.leftSE.point);if(P<0)return 1;if(P>0)return-1;let R=u.comparePoint(d.rightSE.point);return R!==0?R:-1}if(m>T){if(C<L&&C<X)return-1;if(C>L&&C>X)return 1;let P=u.comparePoint(d.leftSE.point);if(P!==0)return P;let R=d.comparePoint(u.rightSE.point);return R<0?1:R>0?-1:1}if(C<L)return-1;if(C>L)return 1;if(b<w){let P=u.comparePoint(d.rightSE.point);if(P!==0)return P}if(b>w){let P=d.comparePoint(u.rightSE.point);if(P<0)return 1;if(P>0)return-1}if(b!==w){let P=k-C,R=b-m,U=X-L,K=w-T;if(P>R&&U<K)return 1;if(P<R&&U>K)return-1}return b>w?1:b<w||k<X?-1:k>X?1:d.id<u.id?-1:d.id>u.id?1:0}constructor(d,u,m,T){this.id=++jo,this.leftSE=d,d.segment=this,d.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=d,this.rings=m,this.windings=T}static fromRing(d,u,m){let T,b,w,C=re.comparePoints(d,u);if(C<0)T=d,b=u,w=1;else if(C>0)T=u,b=d,w=-1;else throw new Error(`Tried to create degenerate segment at [${d.x}, ${d.y}]`);let L=new re(T,!0),k=new re(b,!1);return new ae(L,k,[m],[w])}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,T=this.vector();if(u.x===m.x)return d.x===u.x?0:d.x<u.x?1:-1;let b=(d.y-u.y)/T.y,w=u.x+b*T.x;if(d.x===w)return 0;let C=(d.x-u.x)/T.x,L=u.y+C*T.y;return d.y===L?0:d.y<L?-1:1}getIntersection(d){let u=this.bbox(),m=d.bbox(),T=O(u,m);if(T===null)return null;let b=this.leftSE.point,w=this.rightSE.point,C=d.leftSE.point,L=d.rightSE.point,k=E(u,C)&&this.comparePoint(C)===0,X=E(m,b)&&d.comparePoint(b)===0,P=E(u,L)&&this.comparePoint(L)===0,R=E(m,w)&&d.comparePoint(w)===0;if(X&&k)return R&&!P?w:!R&&P?L:null;if(X)return P&&b.x===L.x&&b.y===L.y?null:b;if(k)return R&&w.x===C.x&&w.y===C.y?null:C;if(R&&P)return null;if(R)return w;if(P)return L;let U=ar(b,this.vector(),C,d.vector());return U===null||!E(T,U)?null:G.round(U.x,U.y)}split(d){let u=[],m=d.events!==void 0,T=new re(d,!0),b=new re(d,!1),w=this.rightSE;this.replaceRightSE(b),u.push(b),u.push(T);let C=new ae(T,w,this.rings.slice(),this.windings.slice());return re.comparePoints(C.leftSE.point,C.rightSE.point)>0&&C.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),m&&(T.checkForConsuming(),b.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 T=ae.compare(u,m);if(T!==0){if(T>0){let b=u;u=m,m=b}if(u.prev===m){let b=u;u=m,m=b}for(let b=0,w=m.rings.length;b<w;b++){let C=m.rings[b],L=m.windings[b],k=u.rings.indexOf(C);k===-1?(u.rings.push(C),u.windings.push(L)):u.windings[k]+=L}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,T=this._afterState.multiPolys;for(let C=0,L=this.rings.length;C<L;C++){let k=this.rings[C],X=this.windings[C],P=u.indexOf(k);P===-1?(u.push(k),m.push(X)):m[P]+=X}let b=[],w=[];for(let C=0,L=u.length;C<L;C++){if(m[C]===0)continue;let k=u[C],X=k.poly;if(w.indexOf(X)===-1)if(k.isExterior)b.push(X);else{w.indexOf(X)===-1&&w.push(X);let P=b.indexOf(k.poly);P!==-1&&b.splice(P,1)}}for(let C=0,L=b.length;C<L;C++){let k=b[C].multiPoly;T.indexOf(k)===-1&&T.push(k)}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(Oe.type){case"union":{let m=d.length===0,T=u.length===0;this._isInResult=m!==T;break}case"intersection":{let m,T;d.length<u.length?(m=d.length,T=u.length):(m=u.length,T=d.length),this._isInResult=T===Oe.numMultiPolys&&m<T;break}case"xor":{let m=Math.abs(d.length-u.length);this._isInResult=m%2===1;break}case"difference":{let m=T=>T.length===1&&T[0].isSubject;this._isInResult=m(d)!==m(u);break}default:throw new Error(`Unrecognized operation type found ${Oe.type}`)}return this._isInResult}}class To{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 T=G.round(d[0][0],d[0][1]);this.bbox={ll:{x:T.x,y:T.y},ur:{x:T.x,y:T.y}};let b=T;for(let w=1,C=d.length;w<C;w++){if(typeof d[w][0]!="number"||typeof d[w][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let L=G.round(d[w][0],d[w][1]);L.x===b.x&&L.y===b.y||(this.segments.push(ae.fromRing(b,L,this)),L.x<this.bbox.ll.x&&(this.bbox.ll.x=L.x),L.y<this.bbox.ll.y&&(this.bbox.ll.y=L.y),L.x>this.bbox.ur.x&&(this.bbox.ur.x=L.x),L.y>this.bbox.ur.y&&(this.bbox.ur.y=L.y),b=L)}(T.x!==b.x||T.y!==b.y)&&this.segments.push(ae.fromRing(b,T,this))}getSweepEvents(){let d=[];for(let u=0,m=this.segments.length;u<m;u++){let T=this.segments[u];d.push(T.leftSE),d.push(T.rightSE)}return d}}class Se{constructor(d,u){if(!Array.isArray(d))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new To(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,T=d.length;m<T;m++){let b=new To(d[m],this,!1);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.interiorRings.push(b)}this.multiPoly=u}getSweepEvents(){let d=this.exteriorRing.getSweepEvents();for(let u=0,m=this.interiorRings.length;u<m;u++){let T=this.interiorRings[u].getSweepEvents();for(let b=0,w=T.length;b<w;b++)d.push(T[b])}return d}}class vo{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,T=d.length;m<T;m++){let b=new Se(d[m],this);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.polys.push(b)}this.isSubject=u}getSweepEvents(){let d=[];for(let u=0,m=this.polys.length;u<m;u++){let T=this.polys[u].getSweepEvents();for(let b=0,w=T.length;b<w;b++)d.push(T[b])}return d}}class Go{static factory(d){let u=[];for(let m=0,T=d.length;m<T;m++){let b=d[m];if(!b.isInResult()||b.ringOut)continue;let w=null,C=b.leftSE,L=b.rightSE,k=[C],X=C.point,P=[];for(;w=C,C=L,k.push(C),C.point!==X;)for(;;){let R=C.getAvailableLinkedEvents();if(R.length===0){let Z=k[0].point,ne=k[k.length-1].point;throw new Error(`Unable to complete output ring starting at [${Z.x}, ${Z.y}]. Last matching segment found ends at [${ne.x}, ${ne.y}].`)}if(R.length===1){L=R[0].otherSE;break}let U=null;for(let Z=0,ne=P.length;Z<ne;Z++)if(P[Z].point===C.point){U=Z;break}if(U!==null){let Z=P.splice(U)[0],ne=k.splice(Z.index);ne.unshift(ne[0].otherSE),u.push(new Go(ne.reverse()));continue}P.push({index:k.length,point:C.point});let K=C.getLeftmostComparator(w);L=R.sort(K)[0].otherSE;break}u.push(new Go(k))}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 k=1,X=this.events.length-1;k<X;k++){let P=this.events[k].point,R=this.events[k+1].point;Yt(P,d,R)!==0&&(u.push(P),d=P)}if(u.length===1)return null;let m=u[0],T=u[1];Yt(m,d,T)===0&&u.shift(),u.push(u[0]);let b=this.isExteriorRing()?1:-1,w=this.isExteriorRing()?0:u.length-1,C=this.isExteriorRing()?u.length:-1,L=[];for(let k=w;k!=C;k+=b)L.push([u[k].x,u[k].y]);return L}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 T=1,b=this.events.length;T<b;T++){let w=this.events[T];re.compare(d,w)>0&&(d=w)}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 Ft{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 T=this.interiorRings[u].getGeom();T!==null&&d.push(T)}return d}}class ri{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 T=this.polys[u].getGeom();T!==null&&d.push(T)}return d}_composePolys(d){let u=[];for(let m=0,T=d.length;m<T;m++){let b=d[m];if(!b.poly)if(b.isExteriorRing())u.push(new Ft(b));else{let w=b.enclosingRing();w.poly||u.push(new Ft(w)),w.poly.addInterior(b)}}return u}}class Yr{constructor(d){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae.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 T=d.isLeft?this.tree.add(u):this.tree.find(u);if(!T)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 b=T,w=T,C,L;for(;C===void 0;)b=this.tree.prev(b),b===null?C=null:b.key.consumedBy===void 0&&(C=b.key);for(;L===void 0;)w=this.tree.next(w),w===null?L=null:w.key.consumedBy===void 0&&(L=w.key);if(d.isLeft){let k=null;if(C){let P=C.getIntersection(u);if(P!==null&&(u.isAnEndpoint(P)||(k=P),!C.isAnEndpoint(P))){let R=this._splitSafely(C,P);for(let U=0,K=R.length;U<K;U++)m.push(R[U])}}let X=null;if(L){let P=L.getIntersection(u);if(P!==null&&(u.isAnEndpoint(P)||(X=P),!L.isAnEndpoint(P))){let R=this._splitSafely(L,P);for(let U=0,K=R.length;U<K;U++)m.push(R[U])}}if(k!==null||X!==null){let P=null;k===null?P=X:X===null?P=k:P=re.comparePoints(k,X)<=0?k:X,this.queue.remove(u.rightSE),m.push(u.rightSE);let R=u.split(P);for(let U=0,K=R.length;U<K;U++)m.push(R[U])}m.length>0?(this.tree.remove(u),m.push(d)):(this.segments.push(u),u.prev=C)}else{if(C&&L){let k=C.getIntersection(L);if(k!==null){if(!C.isAnEndpoint(k)){let X=this._splitSafely(C,k);for(let P=0,R=X.length;P<R;P++)m.push(X[P])}if(!L.isAnEndpoint(k)){let X=this._splitSafely(L,k);for(let P=0,R=X.length;P<R;P++)m.push(X[P])}}}this.tree.remove(u)}return m}_splitSafely(d,u){this.tree.remove(d);let m=d.rightSE;this.queue.remove(m);let T=d.split(u);return T.push(m),d.consumedBy===void 0&&this.tree.add(d),T}}let Jr=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ni=typeof S<"u"&&S.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Jt{run(d,u,m){Oe.type=d,G.reset();let T=[new vo(u,!0)];for(let P=0,R=m.length;P<R;P++)T.push(new vo(m[P],!1));if(Oe.numMultiPolys=T.length,Oe.type==="difference"){let P=T[0],R=1;for(;R<T.length;)O(T[R].bbox,P.bbox)!==null?R++:T.splice(R,1)}if(Oe.type==="intersection")for(let P=0,R=T.length;P<R;P++){let U=T[P];for(let K=P+1,Z=T.length;K<Z;K++)if(O(U.bbox,T[K].bbox)===null)return[]}let b=new l(re.compare);for(let P=0,R=T.length;P<R;P++){let U=T[P].getSweepEvents();for(let K=0,Z=U.length;K<Z;K++)if(b.insert(U[K]),b.size>Jr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let w=new Yr(b),C=b.size,L=b.pop();for(;L;){let P=L.key;if(b.size===C){let U=P.segment;throw new Error(`Unable to pop() ${P.isLeft?"left":"right"} SweepEvent [${P.point.x}, ${P.point.y}] from segment #${U.id} [${U.leftSE.point.x}, ${U.leftSE.point.y}] -> [${U.rightSE.point.x}, ${U.rightSE.point.y}] from queue.`)}if(b.size>Jr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(w.segments.length>ni)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let R=w.process(P);for(let U=0,K=R.length;U<K;U++){let Z=R[U];Z.consumedBy===void 0&&b.insert(Z)}C=b.size,L=b.pop()}G.reset();let k=Go.factory(w.segments);return new ri(k).getGeom()}}let Oe=new Jt;var Qr={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 Oe.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 Oe.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 Oe.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 Oe.run("difference",M,u)}};return Qr}))});var zt=_e(It=>{"use strict";f();It.__esModule=!0;It.extend=pf;It.indexOf=jy;It.escapeExpression=Gy;It.isEmpty=Uy;It.createFrame=Hy;It.blockParams=Wy;It.appendContextPath=zy;var Ny={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},Ry=/[&<>"'`=]/g,By=/[&<>"'`=]/;function Vy(o){return Ny[o]}function pf(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 El=Object.prototype.toString;It.toString=El;var Sl=function(e){return typeof e=="function"};Sl(/x/)&&(It.isFunction=Sl=function(o){return typeof o=="function"&&El.call(o)==="[object Function]"});It.isFunction=Sl;var df=Array.isArray||function(o){return o&&typeof o=="object"?El.call(o)==="[object Array]":!1};It.isArray=df;function jy(o,e){for(var t=0,r=o.length;t<r;t++)if(o[t]===e)return t;return-1}function Gy(o){if(typeof o!="string"){if(o&&o.toHTML)return o.toHTML();if(o==null)return"";if(!o)return o+"";o=""+o}return By.test(o)?o.replace(Ry,Vy):o}function Uy(o){return!o&&o!==0?!0:!!(df(o)&&o.length===0)}function Hy(o){var e=pf({},o);return e._parent=o,e}function Wy(o,e){return o.path=e,o}function zy(o,e){return(o?o+".":"")+e}});var Lo=_e((ia,uf)=>{"use strict";f();ia.__esModule=!0;var Ml=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function xl(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<Ml.length;l++)this[Ml[l]]=s[Ml[l]];Error.captureStackTrace&&Error.captureStackTrace(this,xl);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{}}xl.prototype=new Error;ia.default=xl;uf.exports=ia.default});var hf=_e((aa,ff)=>{"use strict";f();aa.__esModule=!0;var _l=zt();aa.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(_l.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=_l.createFrame(t.data);i.contextPath=_l.appendContextPath(t.data.contextPath,t.name),t={data:i}}return n(e,t)})};ff.exports=aa.default});var mf=_e((sa,gf)=>{"use strict";f();sa.__esModule=!0;function Xy(o){return o&&o.__esModule?o:{default:o}}var $n=zt(),$y=Lo(),Yy=Xy($y);sa.default=function(o){o.registerHelper("each",function(e,t){if(!t)throw new Yy.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=$n.appendContextPath(t.data.contextPath,t.ids[0])+"."),$n.isFunction(e)&&(e=e.call(this)),t.data&&(s=$n.createFrame(t.data));function c(I,E,O){s&&(s.key=I,s.index=E,s.first=E===0,s.last=!!O,l&&(s.contextPath=l+I)),a=a+r(e[I],{data:s,blockParams:$n.blockParams([e[I],I],[l+I,null])})}if(e&&typeof e=="object")if($n.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](),v=g.next();!v.done;v=g.next())h.push(v.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})};gf.exports=sa.default});var bf=_e((la,yf)=>{"use strict";f();la.__esModule=!0;function Jy(o){return o&&o.__esModule?o:{default:o}}var Zy=Lo(),qy=Jy(Zy);la.default=function(o){o.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new qy.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};yf.exports=la.default});var Sf=_e((ca,If)=>{"use strict";f();ca.__esModule=!0;function Qy(o){return o&&o.__esModule?o:{default:o}}var Tf=zt(),Ky=Lo(),vf=Qy(Ky);ca.default=function(o){o.registerHelper("if",function(e,t){if(arguments.length!=2)throw new vf.default("#if requires exactly one argument");return Tf.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||Tf.isEmpty(e)?t.inverse(this):t.fn(this)}),o.registerHelper("unless",function(e,t){if(arguments.length!=2)throw new vf.default("#unless requires exactly one argument");return o.helpers.if.call(this,e,{fn:t.inverse,inverse:t.fn,hash:t.hash})})};If.exports=ca.default});var Mf=_e((pa,Ef)=>{"use strict";f();pa.__esModule=!0;pa.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)})};Ef.exports=pa.default});var _f=_e((da,xf)=>{"use strict";f();da.__esModule=!0;da.default=function(o){o.registerHelper("lookup",function(e,t,r){return e&&r.lookupProperty(e,t)})};xf.exports=da.default});var Pf=_e((ua,Cf)=>{"use strict";f();ua.__esModule=!0;function e1(o){return o&&o.__esModule?o:{default:o}}var Yn=zt(),t1=Lo(),o1=e1(t1);ua.default=function(o){o.registerHelper("with",function(e,t){if(arguments.length!=2)throw new o1.default("#with requires exactly one argument");Yn.isFunction(e)&&(e=e.call(this));var r=t.fn;if(Yn.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&(n=Yn.createFrame(t.data),n.contextPath=Yn.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:n,blockParams:Yn.blockParams([e],[n&&n.contextPath])})})};Cf.exports=ua.default});var Cl=_e(fa=>{"use strict";f();fa.__esModule=!0;fa.registerDefaultHelpers=y1;fa.moveHelperToHooks=b1;function tr(o){return o&&o.__esModule?o:{default:o}}var r1=hf(),n1=tr(r1),i1=mf(),a1=tr(i1),s1=bf(),l1=tr(s1),c1=Sf(),p1=tr(c1),d1=Mf(),u1=tr(d1),f1=_f(),h1=tr(f1),g1=Pf(),m1=tr(g1);function y1(o){n1.default(o),a1.default(o),l1.default(o),p1.default(o),u1.default(o),h1.default(o),m1.default(o)}function b1(o,e,t){o.helpers[e]&&(o.hooks[e]=o.helpers[e],t||(o.helpers[e]=void 0))}});var Df=_e((ha,Of)=>{"use strict";f();ha.__esModule=!0;var T1=zt();ha.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=T1.extend({},l,t.partials);var c=e(a,s);return r.partials=l,c}),t.partials[n.args[0]]=n.fn,i})};Of.exports=ha.default});var wf=_e(Pl=>{"use strict";f();Pl.__esModule=!0;Pl.registerDefaultDecorators=E1;function v1(o){return o&&o.__esModule?o:{default:o}}var I1=Df(),S1=v1(I1);function E1(o){S1.default(o)}});var Ol=_e((ga,Af)=>{"use strict";f();ga.__esModule=!0;var M1=zt(),jr={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if(typeof e=="string"){var t=M1.indexOf(jr.methodMap,e.toLowerCase());t>=0?e=t:e=parseInt(e,10)}return e},log:function(e){if(e=jr.lookupLevel(e),typeof console<"u"&&jr.lookupLevel(jr.level)<=e){var t=jr.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)}}};ga.default=jr;Af.exports=ga.default});var Dl=_e(Jn=>{"use strict";f();Jn.__esModule=!0;Jn.createProtoAccessControl=P1;Jn.resultIsAllowed=O1;Jn.resetLoggedProperties=w1;function x1(o){return o&&o.__esModule?o:{default:o}}var Ff=zt(),_1=Ol(),C1=x1(_1),ma=Object.create(null);function P1(o){var e=Object.create(null);e.__proto__=!1,Ff.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,Ff.extend(t,o.allowedProtoMethods),{properties:{whitelist:e,defaultValue:o.allowProtoPropertiesByDefault},methods:{whitelist:t,defaultValue:o.allowProtoMethodsByDefault}}}function O1(o,e,t){return kf(typeof o=="function"?e.methods:e.properties,t)}function kf(o,e){return o.whitelist[e]!==void 0?o.whitelist[e]===!0:o.defaultValue!==void 0?o.defaultValue:(D1(e),!1)}function D1(o){ma[o]!==!0&&(ma[o]=!0,C1.default.log("error",'Handlebars: Access has been denied to resolve the property "'+o+`" because it is not an "own property" of its parent.
|
|
3
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 w1(){Object.keys(ma).forEach(function(o){delete ma[o]})}});var
|
|
4
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function w1(){Object.keys(ma).forEach(function(o){delete ma[o]})}});var kl=_e(ao=>{"use strict";f();ao.__esModule=!0;ao.HandlebarsEnvironment=Fl;function Lf(o){return o&&o.__esModule?o:{default:o}}var or=zt(),A1=Lo(),wl=Lf(A1),F1=Cl(),k1=wf(),L1=Ol(),ya=Lf(L1),N1=Dl(),R1="4.7.9";ao.VERSION=R1;var B1=8;ao.COMPILER_REVISION=B1;var V1=7;ao.LAST_COMPATIBLE_COMPILER_REVISION=V1;var j1={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"};ao.REVISION_CHANGES=j1;var Al="[object Object]";function Fl(o,e,t){this.helpers=o||{},this.partials=e||{},this.decorators=t||{},F1.registerDefaultHelpers(this),k1.registerDefaultDecorators(this)}Fl.prototype={constructor:Fl,logger:ya.default,log:ya.default.log,registerHelper:function(e,t){if(or.toString.call(e)===Al){if(t)throw new wl.default("Arg not supported with multiple helpers");or.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(or.toString.call(e)===Al)or.extend(this.partials,e);else{if(typeof t>"u")throw new wl.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(or.toString.call(e)===Al){if(t)throw new wl.default("Arg not supported with multiple decorators");or.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){N1.resetLoggedProperties()}};var G1=ya.default.log;ao.log=G1;ao.createFrame=or.createFrame;ao.logger=ya.default});var Rf=_e((ba,Nf)=>{"use strict";f();ba.__esModule=!0;function Ll(o){this.string=o}Ll.prototype.toString=Ll.prototype.toHTML=function(){return""+this.string};ba.default=Ll;Nf.exports=ba.default});var Bf=_e(Nl=>{"use strict";f();Nl.__esModule=!0;Nl.wrapHelper=U1;function U1(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 Wf=_e(No=>{"use strict";f();No.__esModule=!0;No.checkRevision=Y1;No.template=J1;No.wrapProgram=Ta;No.resolvePartial=Z1;No.invokePartial=q1;No.noop=Uf;function H1(o){return o&&o.__esModule?o:{default:o}}function W1(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 z1=zt(),Gr=W1(z1),X1=Lo(),go=H1(X1),mo=kl(),Vf=Cl(),$1=Bf(),jf=Dl();function Y1(o){var e=o&&o[0]||1,t=mo.COMPILER_REVISION;if(!(e>=mo.LAST_COMPATIBLE_COMPILER_REVISION&&e<=mo.COMPILER_REVISION))if(e<mo.LAST_COMPATIBLE_COMPILER_REVISION){var r=mo.REVISION_CHANGES[t],n=mo.REVISION_CHANGES[e];throw new go.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 go.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 J1(o,e){if(!e)throw new go.default("No environment passed to template");if(!o||!o.main)throw new go.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=Gr.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
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)||Vf.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:Gr.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],v=this.fn(s);return l||h||p||c?g=Ta(this,s,v,l,c,p,h):g||(g=this.programs[s]=Ta(this,s,v)),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=Gr.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=q1(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=Uf(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={};jf(s,e.helpers,n),jf(s,a.helpers,n),n.helpers=s,o.usePartial&&(n.partials=n.mergeIfNeeded(a.partials,e.partials)),(o.usePartial||o.useDecorators)&&(n.decorators=Gr.extend({},e.decorators,a.decorators)),n.hooks={},n.protoAccessControl=Vf.createProtoAccessControl(a);var l=a.allowCallsToHelperMissing||t;Bf.moveHelperToHooks(n,"helperMissing",l),Bf.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 Ta(n,a,o[a],s,0,l,c)},i}function Ta(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=Uf(t,s,o,a,r,i),s.program=e,s.depth=a?a.length:0,s.blockParams=n||0,s}function Z1(o,e,t){return o?!o.call&&!t.name&&(t.name=o,o=va(t.partials,o)):t.name==="@partial-block"?o=va(t.data,"partial-block"):o=va(t.partials,t.name),o}function J1(o,e,t){var r=va(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!==Gf&&(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=Gr.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 Gf(){return""}function va(o,e){if(o&&Object.prototype.hasOwnProperty.call(o,e))return o[e]}function q1(o,e){return(!e||!("root"in e))&&(e=e?go.createFrame(e):{},e.root=o),e}function Uf(o,e,t,r,n,i){if(o.decorator){var a={};e=o.decorator(e,a,t,r&&r[0],n,i,r),Gr.extend(e,a)}return e}function jf(o,e,t){e&&Object.keys(e).forEach(function(r){var n=e[r];o[r]=Q1(n,t)})}function Q1(o,e){var t=e.lookupProperty;return X1.wrapHelper(o,function(r){return r.lookupProperty=t,r})}});var zf=_e((Ia,Wf)=>{"use strict";f();Ia.__esModule=!0;Ia.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}};Wf.exports=Ia.default});var Jf=_e((Sa,Zf)=>{"use strict";f();Sa.__esModule=!0;function Rl(o){return o&&o.__esModule?o:{default:o}}function Bl(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 K1=Al(),Xf=Bl(K1),eb=Nf(),tb=Rl(eb),ob=Lo(),rb=Rl(ob),nb=zt(),Nl=Bl(nb),ib=Hf(),$f=Bl(ib),ab=zf(),sb=Rl(ab);function Yf(){var o=new Xf.HandlebarsEnvironment;return Nl.extend(o,Xf),o.SafeString=tb.default,o.Exception=rb.default,o.Utils=Nl,o.escapeExpression=Nl.escapeExpression,o.VM=$f,o.template=function(e){return $f.template(e,o)},o}var Jn=Yf();Jn.create=Yf;sb.default(Jn);Jn.default=Jn;Sa.default=Jn;Zf.exports=Sa.default});var Qf=_e((g4,qf)=>{f();qf.exports=Jf().default});f();f();f();f();f();var Bc="mi-session-data",Vc="mi-local-data",rn="id",nn="deviceId",Mt=class o{static#e;#t;#o;constructor(){try{let e=sessionStorage.getItem(Bc);e?this.#t=JSON.parse(e):this.#t={[rn]:oe()}}catch{this.#t={[rn]:oe()}}try{let e=localStorage.getItem(Vc);e?this.#o=JSON.parse(e):this.#o={[nn]:oe()}}catch{this.#o={[nn]:oe()}}this.#t[rn]||(this.#t[rn]=oe()),this.#o[nn]||(this.#o[nn]=oe())}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(Bc,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(Vc,JSON.stringify(this.#o)),!0}catch{return!1}}loadLocalData(e){let t=this.#o[e];if(t!=null)return t}};f();f();var fr=o=>o!=null;var ag=(function(){let e=globalThis.fetch;return{fetch(...t){if(!fr(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}}})(),jc=ag.fetch;var zc=["websdk","web","webv2","kiosk","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk","minimap"],Gc=zc[0],Xc="https://api-gateway.mappedin.com/track-analytics/a/",$c="deny-watchposition",Yc="load-mapview",Zc="load-mapdata",Jc="change-language",qc="query-directions";var hr=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&&Mt.getInstance().saveSessionData("id",e.sessionId),e.deviceId&&Mt.getInstance().saveLocalData("deviceId",e.deviceId)}#r(e){let t=e.baseUri??Xc;return{baseUri:t,analyticsBaseUrl:Wa({...e,baseUri:t}),version:e.version||S?.env?.npm_package_version||"v6",deviceId:e.deviceId||Uc(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||Hc(),platformString:e.platformString||"",context:Wc(e.context)||Gc,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=Wa({...this.#t,mapId:t.mapId})),t.context&&(t.context=Wc(t.context)),t.baseUri&&(t.analyticsBaseUrl=Wa({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||Gc}getSessionId(){return this.getState().sessionId||this.#e.sessionId||Hc()}getDeviceId(){return this.getState().deviceId||this.#e.deviceId||Uc()}sendAnalyticEvent(e,t={}){let r=this.getState(),n=sg(r.analyticsBaseUrl,e),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(r.logEvents&&x.log("Analytics.track",n,i),!r.sendEvents)return Promise.resolve();if(!this.authReady)return!r.key&&!r.secret&&!r.accessToken?void 0:x.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}`),jc(n,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(e,t){if(cg.includes(e))return x.warn(`${e} event is sent internally.`),Promise.resolve();let r=lg.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(r,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent(Zc,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent(Jc,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent($c)}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=pc((e,t,r)=>{let n={start:e,end:t,type:"location_to_location"};return r!==void 0&&(n.accessible=r),this.sendAnalyticEvent(qc,n)},2500);sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};function Wa({mapId:o,baseUri:e=Xc}){return`${e}${o}/`}function Uc(){return Mt.getInstance().loadLocalData("deviceId")}function Hc(){return Mt.getInstance().loadSessionData("id")}function sg(o,e){return o+e}function Wc(o){return zc.find(e=>e===o)}var lg=["$select-location","$select-category","$query-suggest","$query-search"],cg=[Yc,Zc,qc,$c,Jc],DT=new hr,an=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 sn=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 x.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(e,t)}catch(r){return x.error("Search.query failed due to",r),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return x.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(e,t)}catch(r){return x.error("Search.suggest failed due to",r),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-4G5ODHLV.js").then(({InternalSearch:e})=>new e(this.#e))),this.#t.on("language-change",this.#o),await this.searchInstance)}};var Qc={"enterprise-location":"location-profile","enterprise-category":"location-category"},Kc={"location-profile":"enterprise-location","location-category":"enterprise-category"},ep=new WeakMap,za=class{#e;#t;Analytics;Search;Query;internal;constructor(e,{search:t}={}){this.#e=new gt,this.#t=e,ep.set(this,e),this.Analytics=new an(e.Analytics),this.Query=e.Query,this.internal=e,this.Search=new sn(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 Qc?x.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is a Maker map (API key starts with 'mik_'). Use '${Qc[e]}' instead. See https://developer.mappedin.com/web-sdk/getting-started`):r&&e in Kc&&x.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is an Enterprise map. Use '${Kc[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})}},ln=za;function cn(o){let e=ep.get(o);if(!e)throw new Error("MapDataInternal not found");return e}f();f();f();f();f();function gr(o){return o.endsWith("/")?o:`${o}/`}f();var mr="https://app.mappedin.com/",tp="https://auth.mappedin.com/",op=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"}),pg=Object.freeze({...op,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),dg=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"}),ug=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"}),fg=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"}),hg={eu:dg,us:op,"us-enterprise":pg,"us-staging-enterprise":ug,"us-staging-self-serve":fg};function rp(o){return hg[o]}f();f();var gg=o=>{let e=Date.now();return o-e},Ti=(o,e)=>gg(o)<=e*60*1e3;var ip=10,ap=ip*60*1e3,np="accessTokens",mg="mik_";function sp(o){return typeof o=="string"&&o.startsWith(mg)}async function pn(o,e=!1,t=!1){let r=`${o.key}`,n=Mt.getInstance(),i=n?.loadSessionData(np)||{},a=Math.floor(Date.now()/1e3);if(!t&&i[r]&&!Ti(i[r].expiresTimestamp*1e3,ip))return i[r];let s=e?await yg(o,a):await bg(o,a),l={...i,[r]:s};return n?.saveSessionData(np,l),s}async function yg(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri??tp}oauth2/token`;let r;try{r=await mt()(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 bg(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri?gr(o.baseAuthUri):mr}api/v1/api-key/token`;let r;try{r=await mt()(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 cp=10,pp=cp*60*1e3,lp="miSasTokens";async function Xa(o,e){let t=`${e}__${o.mapId}`,r=Mt.getInstance(),n=r?.loadSessionData(lp)||{};if(n[t]&&!Ti(n[t].expires,cp))return n[t];let i=await Tg(o,e),a={...n,[t]:{token:i.token,expires:new Date(i.expires).getTime()}};return r?.saveSessionData(lp,a),i}async function Tg(o,e){let t=`${o.baseUri?gr(o.baseUri):mr}api/v1/venue/${o.mapId}/sas-token`,r=await mt()(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 yt=Uint8Array,Wo=Uint16Array,dp=Uint32Array,up=new yt([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]),fp=new yt([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]),vg=new yt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hp=function(o,e){for(var t=new Wo(31),r=0;r<31;++r)t[r]=e+=1<<o[r-1];for(var n=new dp(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]},gp=hp(up,2),mp=gp[0],Ig=gp[1];mp[28]=258,Ig[258]=28;var yp=hp(fp,0),Sg=yp[0],y0=yp[1],Ja=new Wo(32768);for(ue=0;ue<32768;++ue)so=(ue&43690)>>>1|(ue&21845)<<1,so=(so&52428)>>>2|(so&13107)<<2,so=(so&61680)>>>4|(so&3855)<<4,Ja[ue]=((so&65280)>>>8|(so&255)<<8)>>>1;var so,ue,dn=(function(o,e,t){for(var r=o.length,n=0,i=new Wo(e);n<r;++n)o[n]&&++i[o[n]-1];var a=new Wo(e);for(n=0;n<e;++n)a[n]=a[n-1]+i[n-1]<<1;var s;if(t){s=new Wo(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[Ja[h]>>>l]=c}else for(s=new Wo(r),n=0;n<r;++n)o[n]&&(s[n]=Ja[a[o[n]-1]++]>>>15-o[n]);return s}),un=new yt(288);for(ue=0;ue<144;++ue)un[ue]=8;var ue;for(ue=144;ue<256;++ue)un[ue]=9;var ue;for(ue=256;ue<280;++ue)un[ue]=7;var ue;for(ue=280;ue<288;++ue)un[ue]=8;var ue,bp=new yt(32);for(ue=0;ue<32;++ue)bp[ue]=5;var ue;var Eg=dn(un,9,1);var Mg=dn(bp,5,1),$a=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},Lt=function(o,e,t){var r=e/8|0;return(o[r]|o[r+1]<<8)>>(e&7)&t},Ya=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},xg=function(o){return(o+7)/8|0},Qa=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?Wo:o.BYTES_PER_ELEMENT==4?dp:yt)(t-e);return r.set(o.subarray(e,t)),r};var _g=["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||_g[o]);if(r.code=o,Error.captureStackTrace&&Error.captureStackTrace(r,Nt),!t)throw r;return r},Cg=function(o,e,t){var r=o.length;if(!r||t&&t.f&&!t.l)return e||new yt(0);var n=!e||t,i=!t||t.i;t||(t={}),e||(e=new yt(r*3));var a=function(Ft){var yo=e.length;if(Ft>yo){var bo=new yt(Math.max(yo*2,Ft));bo.set(e),e=bo}},s=t.f||0,l=t.p||0,c=t.b||0,p=t.l,h=t.d,g=t.m,v=t.n,I=r*8;do{if(!p){s=Lt(o,l,1);var E=Lt(o,l+1,3);if(l+=3,E)if(E==1)p=Eg,h=Mg,g=9,v=5;else if(E==2){var W=Lt(o,l,31)+257,N=Lt(o,l+10,15)+4,B=W+Lt(o,l+5,31)+1;l+=14;for(var G=new yt(B),A=new yt(19),j=0;j<N;++j)A[vg[j]]=Lt(o,l+j*3,7);l+=N*3;for(var te=$a(A),he=(1<<te)-1,ge=dn(A,te,1),j=0;j<B;){var ie=ge[Lt(o,l,he)];l+=ie&15;var O=ie>>>4;if(O<16)G[j++]=O;else{var Te=0,Be=0;for(O==16?(Be=3+Lt(o,l,3),l+=2,Te=G[j-1]):O==17?(Be=3+Lt(o,l,7),l+=3):O==18&&(Be=11+Lt(o,l,127),l+=7);Be--;)G[j++]=Te}}var Ve=G.subarray(0,W),pe=G.subarray(W);g=$a(Ve),v=$a(pe),p=dn(Ve,g,1),h=dn(pe,v,1)}else Nt(1);else{var O=xg(l)+4,w=o[O-4]|o[O-3]<<8,F=O+w;if(F>r){i&&Nt(0);break}n&&a(c+w),e.set(o.subarray(O,F),c),t.b=c+=w,t.p=l=F*8,t.f=s;continue}if(l>I){i&&Nt(0);break}}n&&a(c+131072);for(var $e=(1<<g)-1,wt=(1<<v)-1,ot=l;;ot=l){var Te=p[Ya(o,l)&$e],ve=Te>>>4;if(l+=Te&15,l>I){i&&Nt(0);break}if(Te||Nt(2),ve<256)e[c++]=ve;else if(ve==256){ot=l,p=null;break}else{var mo=ve-254;if(ve>264){var j=ve-257,se=up[j];mo=Lt(o,l,(1<<se)-1)+mp[j],l+=se}var Et=h[Ya(o,l)&wt],Dt=Et>>>4;Et||Nt(3),l+=Et&15;var pe=Sg[Dt];if(Dt>3){var se=fp[Dt];pe+=Ya(o,l)&(1<<se)-1,l+=se}if(l>I){i&&Nt(0);break}n&&a(c+131072);for(var $t=c+mo;c<$t;c+=4)e[c]=e[c-pe],e[c+1]=e[c+1-pe],e[c+2]=e[c+2-pe],e[c+3]=e[c+3-pe];c=$t}}t.l=p,t.p=ot,t.b=c,t.f=s,p&&(s=1,t.m=g,t.d=h,t.n=v)}while(!s);return c==e.length?e:Qa(e,0,c)};var Pg=new yt(0);var Qt=function(o,e){return o[e]|o[e+1]<<8},Rt=function(o,e){return(o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24)>>>0},Za=function(o,e){return Rt(o,e)+Rt(o,e+4)*4294967296};function Og(o,e){return Cg(o,e)}var qa=typeof TextDecoder<"u"&&new TextDecoder,wg=0;try{qa.decode(Pg,{stream:!0}),wg=1}catch{}var Dg=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,Qa(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 Fg(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(qa)return qa.decode(o);var n=Dg(o),i=n[0],a=n[1];return a.length&&Nt(8),i}}var Ag=function(o,e){return e+30+Qt(o,e+26)+Qt(o,e+28)},kg=function(o,e,t){var r=Qt(o,e+28),n=Fg(o.subarray(e+46,e+46+r),!(Qt(o,e+8)&2048)),i=e+46+r,a=Rt(o,e+20),s=t&&a==4294967295?Lg(o,i):[a,Rt(o,e+24),Rt(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]},Lg=function(o,e){for(;Qt(o,e)!=1;e+=4+Qt(o,e+2));return[Za(o,e+12),Za(o,e+4),Za(o,e+20)]};function Ka(o,e){for(var t={},r=o.length-22;Rt(o,r)!=101010256;--r)(!r||o.length-r>65558)&&Nt(13);var n=Qt(o,r+8);if(!n)return{};var i=Rt(o,r+16),a=i==4294967295||n==65535;if(a){var s=Rt(o,r-12);a=Rt(o,s)==101075792,a&&(n=Rt(o,s+32),i=Rt(o,s+48))}for(var l=e&&e.filter,c=0;c<n;++c){var p=kg(o,i,a),h=p[0],g=p[1],v=p[2],I=p[3],E=p[4],O=p[5],w=Ag(o,O);i=E,(!l||l({name:I,size:g,originalSize:v,compression:h}))&&(h?h==8?t[I]=Og(o.subarray(w,w+g),new yt(v)):Nt(14,"unknown compression type "+h):t[I]=Qa(o,w,w+g))}return t}var Tp=globalThis.fetch,Rg=S?.env?.npm_package_version;function mt(){if(Tp==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Tp}async function Bg(o){return typeof o=="function"?o():o}var es={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Ip(o){let e={...es,...o};return e.headers={...e.headers,"mappedin-sdk-version":Rg},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 Vg(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 jg(o,e,t=!1){let r=Vg(o,e,t),n=await mt()(r.url,r.req);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return n.json()}var Gg=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 x.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){x.warn(`Perspective ${r} is missing url or locale_packs!`);continue}t[r]={url:i,locale_packs:a}}return t};async function Ug(o,e="exports/mvf/1/bundle"){let t=Ip({baseUri:"https://api-gateway.mappedin.com/",...es,...o}),r=`${t.baseUri+e}?venue=${t.venue}&version=${t.version??"2.0.0"}`;t.headers["Content-Type"]="application/zip";let n=await jg(t,r),i=n.url,a=n.locale_packs,s=t.perspective??es.perspective,l=Gg(n);if(s!=null&&s!==""&&l!=null){let c=l[s];c==null?x.warn(`Perspective ${s} not found in response! Loading default perspective instead.`):(x.log(`Loading perspective "${s}"`),i=c.url,a=c.locale_packs)}return{url:i,localePacks:a,updated_at:n.updated_at}}var yr=(function(){let o;return()=>(o||(o=new TextDecoder),o)})();async function ts(o,{signal:e}){let t=await(await mt()(o,{signal:e})).arrayBuffer();return new Uint8Array(t)}async function br(o){let e=Ka(o),t={};if(e["enterprise/"]!=null){t.enterprise={};let r=e["enterprise/locations.json"];r&&(t.enterprise.locations=JSON.parse(yr().decode(r)));let n=e["enterprise/locationInstances.json"];n&&(t.enterprise.locationInstances=JSON.parse(yr().decode(n)));let i=e["enterprise/categories.json"];i&&(t.enterprise.categories=JSON.parse(yr().decode(i)))}return e["floorstack.json"]&&(t["floorstack.json"]=JSON.parse(yr().decode(e["floorstack.json"]))),e["floor.geojson"]&&(t["floor.geojson"]=JSON.parse(yr().decode(e["floor.geojson"]))),e["manifest.json"]&&(t["manifest.geojson"]=JSON.parse(yr().decode(e["manifest.json"]))),t}async function Sp(o,{signal:e}){try{let t=await(await mt()(o,{signal:e})).arrayBuffer();if(e.aborted)return;let r=new Uint8Array(t);return await br(r)}catch(t){let r=new Error("downloadLanguagePack failed");throw r.cause=t,r}}function Hg(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 os(o){return new Promise(async(e,t)=>{try{let r=Hg(o),{url:n,localePacks:i}=await Ug(o,r),a=await mt()(n).then(l=>l.arrayBuffer()),s=new Uint8Array(a);e({compressed:s,localePacks:i})}catch(r){t(r)}})}async function rs(o,e){return new Promise(async(t,r)=>{try{let{url:n}=await Wg(o,e),i=await mt()(n).then(s=>s.arrayBuffer()),a=new Uint8Array(i);t(a)}catch(n){r(n)}})}async function Wg(o,e){if(o.bundleUri!=null)return{url:await Bg(o.bundleUri),updated_at:""};if(e==null||e==="")throw new Error("Missing access token.");let t=new URL(`${o.baseUri?gr(o.baseUri):mr}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 mt()(t.toString(),{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return r.json()}function Ep(o){return Fa(o)}function zg(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 ns(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=Ka(o);if(!zg(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"){x.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 xo(){let o="us",e={};function t(){return Xg(rp(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 Xg(o,e){return{...o,...e}}var vi=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_",""))},Ii=o=>o?.cms!=null,vp=async o=>{let e=performance.now(),t,r=vc.decompressUnsafeSync(o);r.isOk()?t=r.unwrap():x.error("MVFv3 decompression failed!");let n;if(t)try{n=Tc(t)}catch(i){x.error("MVFv3 to MVFv2 conversion failed!",i)}if(x.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 Si(o,e="2.0.0"){switch(e){case"2.0.0":case"2.0.0-c":try{let t=performance.now(),r=await ns(o),n=Fa(r);return x.log(`Parsed MVFv2 in ${performance.now()-t}ms`),{mvf2:n}}catch{return x.error("MVFv2 parsing failed! Trying MVFv3."),vp(o)}case"3.0.0":return vp(o);default:throw new Error(`Unsupported MVF version: ${e}`)}}f();f();function $g(o,e,t){t===void 0&&(t={});for(var r=Mo(o),n=pr(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")),Yg(n[i],n[i+1],r,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function Yg(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,v=c-s,I=p-l,E=h*I-g*v;if(n!==null){if(Math.abs(E)>n)return!1}else if(E!==0)return!1;if(r){if(r==="start")return Math.abs(v)>=Math.abs(I)?v>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(v)>=Math.abs(I)?v>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(v)>=Math.abs(I)?v>0?s<i&&i<c:c<i&&i<s:I>0?l<a&&a<p:p<a&&a<l}else return Math.abs(v)>=Math.abs(I)?v>0?s<=i&&i<=c:c<=i&&i<=s:I>0?l<=a&&a<=p:p<=a&&a<=l;return!1}var Mp=$g;f();function Zg(o,e){e===void 0&&(e={});var t=cr(o),r=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return lr([r,n],e.properties,e)}var Tr=Zg;f();f();function Jg(o,e,t){t===void 0&&(t={});var r=Mo(o),n=Mo(e),i=Jt(n[1]-r[1]),a=Jt(n[0]-r[0]),s=Jt(r[1]),l=Jt(n[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return dc(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),t.units)}var _o=Jg;function Ei(o,e){return e===void 0&&(e={}),hc(o,function(t,r){var n=r.geometry.coordinates;return t+_o(n[0],n[1],e)},0)}f();f();f();function Mi(o,e,t){if(t===void 0&&(t={}),t.final===!0)return qg(o,e);var r=Mo(o),n=Mo(e),i=Jt(r[0]),a=Jt(n[0]),s=Jt(r[1]),l=Jt(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 uc(Math.atan2(c,p))}function qg(o,e){var t=Mi(e,o);return t=(t+180)%360,t}function Qg(o,e,t){t===void 0&&(t={});var r=lr([1/0,1/0],{dist:1/0}),n=0;return fc(o,function(i){for(var a=pr(i),s=0;s<a.length-1;s++){var l=lr(a[s]);l.properties.dist=_o(e,l,t);var c=lr(a[s+1]);c.properties.dist=_o(e,c,t);var p=_o(l,c,t),h=Math.max(l.properties.dist,c.properties.dist),g=Mi(l,c),v=Aa(e,h,g+90,t),I=Aa(e,h,g-90,t),E=Ic(tn([v.geometry.coordinates,I.geometry.coordinates]),tn([l.geometry.coordinates,c.geometry.coordinates])),O=null;E.features.length>0&&(O=E.features[0],O.properties.dist=_o(e,O,t),O.properties.location=n+_o(l,O,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),O&&O.properties.dist<r.properties.dist&&(r=O,r.properties.index=s),n+=p}}),r}var fn=Qg;function Kg(o,e,t){var r=pr(t);if(mc(t)!=="LineString")throw new Error("line must be a LineString");var n=fn(t,o),i=fn(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),tn(s,t.properties)}var is=Kg;var em=1e-7;function as(o){return{type:"Point",coordinates:o}}function tm(o,e){let{coordinates:t}=e.geometry,{coordinates:r}=o.geometry,n=t.map(i=>fn(o,as(i)));return r.reduce((i,a)=>{let s=is(as(a),n[0],o),l=is(as(a),n[1],o),c=Ei(s)<Ei(l)?s:l;return c.properties={...o.properties,entrances:[]},i.concat([c])},[])}function ss(o,e){return e.reduce((t,r)=>{let n={epsilon:em},i=t.obstructions.findIndex(s=>Mp(Tr(r),s,n)),a=t.obstructions[i];if(a){let[s,l]=tm(a,r);t.entrances.push(r),t.obstructions.splice(i,1,s,l)}return t},{obstructions:[o],entrances:[]})}f();f();f();var Le=class{id;constructor(e){this.id=e}};f();f();var ls=class o{static __type="coordinate";__type=o.__type;id=oe();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]}},z=ls;function cs(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 om=/^https?:\/\/cdn(-staging)?\.mappedin\.com(\/|$)/;function xp(o){return om.test(o)}function _p(o){return!!o.split("?")[1]?.includes("sv=")}function Ke(o,e){let t=o?.properties?.id||"unknown";if(o.geometry==null)return x.error(`Cannot get the center coordinate for "${t}" because it has no geometry.`),new z({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 z({latitude:l,longitude:s,floorId:e})}else if(o.geometry.type==="Point"){let[r,n]=o.geometry.coordinates;return new z({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 z({latitude:i,longitude:n,floorId:e})}}}catch{}try{let[r,n]=Tr(o).geometry.coordinates;return new z({latitude:n,longitude:r,floorId:e})}catch(r){return x.error(`Failed to get center coordinate for "${t}" ${r instanceof Error?r.stack:""}`),new z({latitude:0,longitude:0,floorId:e})}}function Cp(o,e){return e&&(o.flags[e.index]&1<<e.bit)!==0}function xi(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 ps=class o extends Le{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=Ke(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&&Cp({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=ps;f();f();f();f();var ds=class o extends Le{static __type="hyperlink";__type=o.__type;#e={};#t;static is(e){return e.__type===o.__type}constructor(e){super(String(oe())),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]}},zo=ds;f();f();function hn(o){return typeof o=="string"?o:o?.id??""}function Pp(o){return Array.isArray(o)&&Number.isFinite(o[0])&&Number.isFinite(o[1])}var rm=/^https:\/\/cdn\.mappedin\.com\/category-symbols\/.+$/,nm=/^https:\/\/cdn-staging\.mappedin\.net\/category-symbols\/.+$/,im=o=>rm.test(o)||nm.test(o),am=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,sm=/^https:\/\/cdn-staging\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,lm=o=>im(o)?!1:am.test(o)||sm.test(o),vr=o=>{if(!lm(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 us(o){return o.reduce((e,t,r)=>r===0?e:e+qt(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 fs(o){return o!=null&&typeof o=="object"&&"name"in o&&o.name!=null&&typeof o.name=="string"&&o.name!==""}function Op(o){return lo(o)&&fs(o)}var hs=class o extends Le{static __type="image";__type=o.__type;#e={};#t;#o;static is(e){return e.__type===o.__type}constructor(e){super(String(oe())),this.#t=e.mvfData,this.#o=e.mapData}get url(){let e=this.#t.url;if(this.#o.tokenManager==null)return e;let t=vr(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"&&x.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]}},Kt=hs;f();var Bt=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=cr(this.geoJSON),this.#e)}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};var Ne=class extends Bt{#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 Kt({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 zo({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 bt=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=vr(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"&&x.error("Error getting SAS token for image",{error:r,url:this.#t}),this.#t}}};f();f();function Co(o){let e;if(z.is(o))e=o;else if(ct.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(Ze.is(o))if(o.coordinates.length>0)e=o.coordinates[0];else return;else if("center"in o&&z.is(o.center))e=o.center;else if("coordinate"in o&&z.is(o.coordinate))e=o.coordinate;else return;return e}f();f();var gn={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},eo="ExteriorWalls",Po="Walls",wp=0,Ir="InteriorDoors",Sr="ExteriorDoors",Er="InteriorDoorsLayer",Mr="ExteriorDoorsLayer",Ce="GeometryLayer",mn="Focusable-",to="LabelsLayer",Vt="MarkersLayer",yn="FootprintLayer",Xo="OcclusionLayer",$o="AreasLayer",xr="ImagesLayer",Yo="FacadesLayer",oo="PathsLayer",jt="ModelsLayer",Zo="Text3DLayer",cm="geometryText",pm="floortext";function Dp(o){return`${Zo}-${o}`}function Oo(o){return`${cm}-${o}`}function _r(o){return`${pm}-${o}`}var Fp=["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"],dm={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var um=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors"]),fm=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function gs(o){o.outdoorView?.enabled&&!o.outdoorView?.token&&x.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function ms(o,e){let t=o?.outdoorView?.token||e.outdoorViewToken,r={...gn,...o,outdoorView:{enabled:o?.outdoorView?.enabled===void 0?!!t:o?.outdoorView?.enabled,layersHiddenByGeometry:gn.outdoorView?.layersHiddenByGeometry,...o?.outdoorView},bearing:o?.bearing??e.naturalBearing??0,imagePlacementOptions:{...gn.imagePlacementOptions,...o?.imagePlacementOptions},multiFloorView:{...gn.multiFloorView,...o?.multiFloorView},disableUpdateStateValidation:o?.disableUpdateStateValidation??!1};return t&&r.outdoorView&&(r.outdoorView.token=t),r}function Ap(o){let e={remove_watermark:!1};if(o)try{let t=gi(o);Object.assign(e,t.capabilities)}catch(t){x.error("Error decoding capabilities from token",t)}return e}function kp(o){let e=Object.fromEntries(Object.entries(o).filter(([t])=>um.has(t)));return e.outdoorView&&(e.outdoorView=Object.fromEntries(Object.entries(e.outdoorView).filter(([t])=>fm.has(t)))),e}var ys=class o extends Ne{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=Ke(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.#n();return t?[...e,t]:e}#n(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new bt(`${this.id}-polygon-image-${oe()}`,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(){}},_t=ys;f();var bs=class o extends Ne{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=Ke(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]}},it=bs;f();var Ts=class o extends Ne{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 gm(this.#r.properties.kind)}get enterpriseLocations(){return this.#o.enterpriseLocations!=null?this.#o.enterpriseLocations:(this.#o.enterpriseLocations=xi(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.#n();return t?[...e,t]:e}#n(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new bt(`${this.id}-polygon-image-${oe()}`,e.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get center(){return this.#o.center==null&&(this.#o.center=Ke(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]}},hm=["room","hallway","exterior","void","gate","otb"];function gm(o){if(o==null||o==="default")return"room";let e=o.toLowerCase();return hm.includes(e)?e:"room"}var xe=Ts;f();var vs=class o extends Bt{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=Ke(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]}},pt=vs;f();var Is=class o extends Ne{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(fr)}get floors(){return this.coordinates.map(e=>e.floorId?this.#e.getById("floor",e.floorId):void 0).filter(fr)}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]}},Ze=Is;f();var Ss=class o extends Ne{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=xi(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=Ke(this.#r,this.#t)),this.#o.center}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#n();return t?[...e,t]:e}#n(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new bt(`${this.id}-polygon-image-${oe()}`,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}},dt=Ss;f();var Es=class o extends Ne{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=Ke(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}},Tt=Es;f();var Ms=class o extends Ne{static __type="annotation";__type=o.__type;#e;#t;#o={};#r;#n;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.#n=t.symbol??{url:"",name:""}}#i(){let[e,t]=this.#r.properties.symbolId.split("--");return{group:e,type:t}}get group(){return this.#i().group}get type(){return this.#i().type}get coordinate(){return this.#o.coordinate==null&&(this.#o.coordinate=Ke(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.#n.name||""}get icon(){return this.#o.icon==null&&(this.#o.icon=super.icon||new Kt({mvfData:{url:this.#n.url,altText:this.#n.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]}},Gt=Ms;f();f();var Lp=di(Cs(),1);function mm(o,e,t){t===void 0&&(t={});var r=dr(o),n=dr(e),i=Lp.default.union(r.coordinates,n.coordinates);return i.length===0?null:i.length===1?fi(i[0],t.properties):hi(i,t.properties)}var _i=mm;var Ps=class o extends Bt{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}#n(e){return this.#e.getPropTranslation(this.__type,e,this.id,this.#o[e])}get type(){return this.#o.type}get name(){let e=this.#n("name");return typeof e=="string"?e:""}get shortName(){let e=this.#n("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&&x.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;if(e)return this.#t.defaultFloor=e,this.#t.defaultFloor;let t=this.floors;if(t.length!==0)return this.#t.defaultFloor=t.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r),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=_i(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]}},Cr=Ps;f();var Os=class o extends Bt{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 De("No geometry found for facade!");let t=Tr(e);this.#r.center=new z({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}}},Ge=Os;f();var ym=new Set(["wall","area"]),bm=new Set(["desk-entrance"]),Tm=o=>{let e={};for(let t of o?.locations??[])e[t.id]=t;return{mvf3LocationsById:e}},vm=(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 Pi(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}},Im=(o,e)=>{let t={},r={},n={},i={},a={},s={},l={},c={},p={},h=globalThis.Object.keys(o.space);for(let g of h){let v=o.space[g];if(v!=null){for(let I of v.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)),!Lm(I))if(I.properties.kind==="poi"||I.geometry.type==="Point"&&I.properties.kind==null){let E=new Tt(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")x.warn("Encountered a point space with an unknown kind!",I.properties.kind);else{let E=new xe(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}},Sm=(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}},Em=(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(ym.has(c.properties.kind?.toLowerCase()??""))continue;let p=new dt(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}},Mm=(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 pt(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 pt(e,{mvfData:{properties:i}});t[i.id]=a}return{floorsById:t,floorsByExternalId:r,mvfFloorsById:n}},xm=(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 Cr(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 Ge(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}},_m=(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 Ze(e,{mvfData:a});return t[a.id]=s,i},{});return{connectionsById:t,mvfConnectionsById:r,mvfConnectionsByNodeId:n}},Cm=(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 it(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}},Pm=(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)}}}}},Om=(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)}}}}},wm=(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}}})}},Dm=(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)}}},Fm=(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 Gt(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}},Am=(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 _t(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}},km=(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((F,W)=>(F[W.id]=W,F),{}),s={},l={},c={},p={},h={},g={},v=o.enterprise?.venue||{},I={},E={},O={};for(let F of o.enterprise?.categories??[]){let W=new Ci(e,{mvfData:F});s[F.id]=W,F.externalId&&(l[F.externalId]==null&&(l[F.externalId]=[]),l[F.externalId].push(W)),c[F.id]=F,F.locations.forEach(N=>{h[N]==null&&(h[N]=[]),h[N].push(F.id)})}let w={};for(let F of o.enterprise?.locationInstances??[]){let W=a[F.parent],N=Object.keys(W),B={};for(let j of N)B[j]=void 0;let G={...B,polygons:[],nodes:[],...F};w[G.parent]==null&&(w[G.parent]=[]);let A=new ct(e,{mvfData:G,categoryIds:o.enterprise?.categoryPriorities?.[G.id]||h[G.id],parentId:F.parent});w[G.parent].push(A);for(let j of F.polygons??[])O[j.id]=A;I[G.id]=F,E[G.id]=A,F.externalId&&(i[F.externalId]==null&&(i[F.externalId]=[]),i[F.externalId].push(A))}for(let F of o.enterprise?.locations??[]){let W=new ct(e,{mvfData:F,categoryIds:o.enterprise?.categoryPriorities?.[F.id]||h[F.id],locationInstances:w[F.id]});n[F.id]=W,F.externalId&&(i[F.externalId]==null&&(i[F.externalId]=[]),i[F.externalId].push(W)),F.nodes.forEach(N=>{g[N.id]==null&&(g[N.id]=[]),g[N.id].push(F.id)});for(let N of F.polygons)p[N.id]==null&&(p[N.id]=[]),p[N.id].push(F)}if(e.enterpriseMode===!0){for(let F in e.mvfConnectionsById){let W={},N=e.mvfConnectionsById[F],B={id:F,externalId:N.externalId,kind:"enterprise."+N.type,destinationNodes:[],flags:N.flags,type:N.type,nodes:N.nodes,accessible:N.accessible,extra:N.extra,details:N.details};for(let G of e.mvfConnectionsById[F].nodes){let A=e.nodesById[G];A!=null&&(W[A.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[A.coordinate.longitude,A.coordinate.latitude]},properties:B})}Object.keys(W).length>0&&(t[F]=new Ze(e,{mvfData:B}),N.externalId&&(r[N.externalId]==null&&(r[N.externalId]=[]),r[N.externalId].push(t[F])))}e.connectionsById=t}return{connectionsByExternalId:r,locationIdsByNodeId:g,mvfLocationsByGeometryId:p,mvfLocationsById:a,mvfCategoriesById:c,locationsById:n,locationInstancesById:E,instanceLocationsByPolygonId:O,locationsByExternalId:i,mvfLocationInstancesById:I,categoriesById:s,categoriesByExternalId:l,venue:v}},Rp=(o,e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}=Sm(e,o),{connectionsById:s,mvfConnectionsById:l,mvfConnectionsByNodeId:c}=_m(e,o),{spacesById:p,spacesByExternalId:h,poisById:g,poisByExternalId:v,mvfSpacesById:I,objectEntranceNodeIdsByObstructionId:E,mvfSpacesByFloorId:O,mvfPoisByFloorId:w}=Im(e,o),{objectsById:F,objectsByExternalId:W,mvfObstructionById:N,obstructionIdByEntranceId:B}=Em(e,o),{floorsById:G,floorsByExternalId:A,mvfFloorsById:j}=Mm(e,o),{floorStacksById:te,floorStacksByExternalId:he,mvfFloorStacksById:ge,facadesById:ie,facadesBySpaceId:Te}=xm(e,o),{doorsById:Be,doorsByExternalId:Ve,doorsByNodeId:pe,mvfEntrancesById:$e,mvfEntrancesByFloorId:wt}=Cm(e,o),{annotationsById:ot,mvfAnnotationsById:ve,mvfAnnotationsByFloorId:mo}=Fm(e,o),{areasById:se,areasByExternalId:Et,mvfAreasById:Dt}=Am(e,o);Om(e,I,N,Dt),Pm(e,I,N),wm(e,I),Dm(e,I,N);let{mvf3LocationsById:$t}=Tm(t),{locationCategoriesByParentId:Ft,locationProfilesById:yo,locationCategoriesById:bo,locationProfilesByExternalId:Vo,locationProfilesByCategoryId:ir,locationProfilesByAttachedFeatureId:ar}=vm(o,e,$t),{entranceNodeIdsBySpaceId:re,spaceIdsByNodeId:jo,objectIdsByNodeId:ae,destinationNodesIdsBySpaceId:To}=km(I,pe);return{spacesById:p,spacesByExternalId:h,nodesById:r,nodesByExternalId:n,objectsById:F,objectsByExternalId:W,floorsById:G,floorsByExternalId:A,floorStacksById:te,floorStacksByExternalId:he,facadesById:ie,facadesBySpaceId:Te,connectionsById:s,doorsById:Be,doorsByExternalId:Ve,doorsByNodeId:pe,poisById:g,poisByExternalId:v,annotationsById:ot,areasById:se,areasByExternalId:Et,objectEntranceNodeIdsByObstructionId:E,obstructionIdByEntranceId:B,locationProfilesById:yo,locationCategoriesById:bo,locationProfilesByExternalId:Vo,locationProfilesByCategoryId:ir,locationCategoriesByParentId:Ft,mvfSpacesById:I,mvfNodesById:i,mvfObstructionById:N,mvfFloorsById:j,mvfFloorStacksById:ge,mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfEntrancesById:$e,mvfAnnotationsById:ve,mvfNodesByFloorId:a,mvfSpacesByFloorId:O,mvfPoisByFloorId:w,mvfAreasById:Dt,mvfEntrancesByFloorId:wt,mvfAnnotationsByFloorId:mo,locationProfilesByAttachedFeatureId:ar,entranceNodeIdsBySpaceId:re,spaceIdsByNodeId:jo,objectIdsByNodeId:ae,destinationNodesIdsBySpaceId:To,mvf3LocationsById:$t}};function Lm(o){return!["Polygon","MultiPolygon"].includes(o.geometry.type)&&"kind"in o.properties&&o.properties.kind==null||o.properties.kind?.includes("connection")||bm.has(o.properties.kind??"")}f();var Nm=new Set(["polygons"]),ws=class o extends Le{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)!Nm.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]}},ct=ws;f();var Rm=new Set,Ds=class o extends Le{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)!Rm.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]}},Ci=Ds;f();var Bm=new Set,Fs=class o extends Le{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)!Bm.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]}},As=Fs;f();f();f();f();f();var Bp=(i=>(i.Departure="Departure",i.TakeConnection="TakeConnection",i.ExitConnection="ExitConnection",i.Turn="Turn",i.Arrival="Arrival",i))(Bp||{}),ks=(a=>(a.Straight="Straight",a.Right="Right",a.SlightRight="SlightRight",a.Left="Left",a.SlightLeft="SlightLeft",a.Back="Back",a))(ks||{}),Vp=(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))(Vp||{}),Oi=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(Oi||{}),wi=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(wi||{});f();function jp(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}=gc(a),c=s(e),p=s(t),h=p.x-c.x,g=p.y-c.y,v=i-n,I=Math.sqrt(h*h+g*g+v*v);if(I<=r*2)return null;let E=r/I,O={x:c.x+h*E,y:c.y+g*E},w=l(O.x,O.y),F=e[2]!==void 0?e[2]+v*E:void 0,W={x:p.x-h*E,y:p.y-g*E},N=l(W.x,W.y),B=t[2]!==void 0?t[2]-v*E:void 0;return{fromPosition:F!==void 0?[w.lon,w.lat,F]:[w.lon,w.lat],toPosition:B!==void 0?[N.lon,N.lat,B]:[N.lon,N.lat]}}function Ls(o,e,t,r,n){let i=jp({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 vt(o){return o.verticalOffset===0?[o.longitude,o.latitude]:[o.longitude,o.latitude,o.verticalOffset]}function Gm(o){return new Map(o.map(e=>{let{properties:t}=e,{id:r}=t;return[r,e]}))}var Bs=(o,e)=>{let t=Gm(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}=ss(n,a);i=l.map(c=>c.geometry.coordinates),r.entrances.features.push(...s)}r.walls.geometry.coordinates.push(...i)}return r};function Up(o,e){return((e-o+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function Hp(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 Wp(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 zp(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 Pr(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 Vs=(o,e)=>{let r=(e.currentMap?.currentFloor).layers.get(Ce);switch(o){case"interior-walls":return r?.layers.get(Po);case"exterior-walls":return r?.layers.get(eo);case"interior-doors":return r?.layers.get(Ir);case"exterior-doors":return r?.layers.get(Sr);default:return typeof o=="string"?o:o?.id}};function js(o){return new Promise(e=>{o.onComplete(e),o.onStop(e)})}function Xp(o){return o.bbox?o.bbox:cr(o)}function Or(o,e,t){return o.floorId&&e.has(o.floorId)?e.get(o.floorId):t}function wr(o){if(xe.is(o)||dt.is(o))return o.id}function $p(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 Yp(o,e){let t=o.properties.path.split("/"),r=t[t.length-1].split(".")[0],n=atob(r);return"img_"+ui(n).toString()+"-"+e}function Ns(o="auto",e,t=1,r){return o!=="auto"?o*t:e!=null?e*t:r!=null?r*t:3*t}function Gp(o,e,t,r){if(o.maxHeight!=null&&o.maxHeight>0)return Ns(e,o.maxHeight,t,r);let n=Ns(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 Zp(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=Gp(h,e,t,r);if(!n){let v=h.elevation-c-1;v>0&&(s+=v*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=Gp(h,e,t,r),v=-(s+g);l.set(h.elevation,{altitude:v,visualHeight:g}),s+=g}return l}function Jp(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),v=g?.visualHeight??Ns(t,void 0,r,n),I=h*v,E=g?.altitude??0;s.push({altitude:E-I,height:I,floorAboveElevation:p.elevation,missingCount:h})}l=p.elevation}return s}function Di(o,e){let t=e(o.center);return{center:new z({latitude:t[1],longitude:t[0]}),radius:o.radius}}function qp(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 Qp=Math.PI*.1,wo=class{id;#e={};#t;#o;constructor(e,t,r,n,i){this.id=i?.id??oe(),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 z(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 z(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;#n;#i;#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.#n=p,this.#i=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.#n=p,this.#i=c}else this.#r==="take"?(l.push(this.#c("ExitConnection",a,i,this.#n,this.#i)),this.#r="exit",this.#n=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?-Up(e.properties.angle,t.properties.angle):0;return Math.abs(i)>=Qp?{type:"Turn",bearing:Hp(i,Qp),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 Kp(o){return lo(o)?"navigationTarget"in o&&o.navigationTarget!=null:!1}var Um={lineOfSight:!0,mode:"absolute-distance",maxResults:1};function ed(o){return{...Um,lineOfSight:!o}}var Ie=new WeakMap;function Fi(o,e,t){let r=ed(t),i=e.Query.__LEGACY_NEAREST_SYNC(o,e.getByType("node"),r)?.[0]?.feature.id;return i?[i]:[]}async function Ai(o,e,t){let r=ed(t),i=(await e.Query.nearest(o,e.getByType("node"),r))?.[0]?.feature.id;return i?[i]:[]}function Hm(o,e,t){let r=[];for(let n of o.navigationTarget){let i=Do(n,e,t);r.push(...i)}return r}async function Wm(o,e,t){let r=[];for(let n of o.navigationTarget){let i=await Fo(n,e,t);r.push(...i)}return r}function td(o,e){let r=e?.getMVFFeatureById("entrance",o.id)?.properties.node;return r?[r]:[]}function od(o,e){return e?.getMVFFeatureById("area",o.id)?.properties.destinationNodes??[]}function rd(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 zm(o,e,t){let r=[];for(let n of o.coordinates){let i=Fi(n,e,t);i.length>0&&r.push(i[0])}return r}async function Xm(o,e,t){let r=[];for(let n of o.coordinates){let i=await Ai(n,e,t);i.length>0&&r.push(i[0])}return r}function nd(o,e){return e?.objectEntranceNodeIdsByObstructionId[o.id]??[]}function id(o,e){return o.spaces.flatMap(t=>e?.getMVFFeatureById("space",t.id)?.properties.destinationNodes??[]).filter(t=>typeof t=="string")}function ad(o){return o.nodes.map(e=>e.id)}function Do(o,e,t){if(Ie.has(o))return Ie.get(o);if(co.is(o)){let r=Hm(o,e,t);return Ie.set(o,r),r}else if(Gt.is(o)){let r=Fi(o,e,t);return Ie.set(o,r),r}else if(z.is(o)){let r=Fi(o,e,t);return Ie.set(o,r),r}else{if(Tt.is(o))return Fi(o,e,t);if(it.is(o)){let r=td(o,e);return Ie.set(o,r),r}else if(_t.is(o)){let r=od(o,e);return Ie.set(o,r),r}else if(xe.is(o)){let r=rd(o,e);return Ie.set(o,r),r}else if(Ze.is(o)){let r=zm(o,e,t);return Ie.set(o,r),r}else if(dt.is(o)){let r=nd(o,e);return Ie.set(o,r),r}else if(Ge.is(o)){let r=id(o,e);return Ie.set(o,r),r}else if(ct.is(o)){let r=ad(o);return Ie.set(o,r),r}else if(xt.is(o)){let r=[o.id];return Ie.set(o,r),r}else return[]}}async function Fo(o,e,t){if(Ie.has(o))return Ie.get(o);if(co.is(o)){let r=await Wm(o,e,t);return Ie.set(o,r),r}else if(Gt.is(o)){let r=await Ai(o,e,t);return Ie.set(o,r),r}else if(z.is(o)){let r=await Ai(o,e,t);return Ie.set(o,r),r}else if(Tt.is(o)){let r=await Ai(o,e,t);return Ie.set(o,r),r}else if(it.is(o)){let r=td(o,e);return Ie.set(o,r),r}else if(_t.is(o)){let r=od(o,e);return Ie.set(o,r),r}else if(xe.is(o)){let r=rd(o,e);return Ie.set(o,r),r}else if(Ze.is(o)){let r=await Xm(o,e,t);return Ie.set(o,r),r}else if(dt.is(o)){let r=nd(o,e);return Ie.set(o,r),r}else{if(Ge.is(o))return id(o,e);if(ct.is(o)){let r=ad(o);return Ie.set(o,r),r}else if(xt.is(o)){let r=[o.id];return Ie.set(o,r),r}else return[]}}function sd(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 ld(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 ct.is(n)&&(n=sd(n,r)),n}function cd(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 ct.is(n)&&(n=sd(n,r)),n}function Gs(o){if(z.is(o))return o;if(!(!Kp(o)||Array.isArray(o.navigationTarget)||!z.is(o.navigationTarget)))return o.navigationTarget}var Dr=class{navigator;connections;constructor({nodes:e,geojsonCollection:t,connections:r,groupBy:n,multiplicativeDistanceWeightScaling:i,flagDeclarations:a,getDoorByNodeId:s}){this.navigator=new Ec({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)),xe.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)),xe.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 Fo(p,n,n.enterpriseMode));for(let p of t)a.set(p,await Fo(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,Do(p,n,n.enterpriseMode)])),a=new Map(t.map(p=>[p,Do(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(w=>!r.includes(w)&&!n.includes(w)),c=new Map,p={...i.connectionIdWeightMap};for(let w of i.excludedConnections)p[w.id]=1/0;for(let w in p){let F=a.getById("connection",w);F&&this.#t(F,p[w],c)}let g=(i.smoothing.__EXPERIMENTAL_METHOD??"greedy-los")!=="greedy-los",v=this.navigator.getDirections({zones:i.zones.map(w=>({geometry:w.geometry,cost:w.cost,map:w.floor?.id})),originIds:r,from:g?pd(e):[],to:g?pd(t):[],destinationNodeIds:n,disabledConnectionNodeIds:l,simplify:i.smoothing,overrideEdgeWeights:c,multiplicativeDistanceWeightScaling:!a.enterpriseMode,includeNonPublic:i.includeNonPublic});this.addCoordinateDirections(v,e,t);let I=ld(v,e,s),E=cd(v,t,s),O=new wo(v,a,I,E);if(!(O.distance===0&&new Set([...r,...n]).size===r.length+n.length))return O};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=Gs(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=Gs(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 $m(o){if(z.is(o))return o.floorId;if(xe.is(o)||it.is(o)||Tt.is(o)||Gt.is(o)||dt.is(o)||_t.is(o)||xt.is(o))return o.floor.id;if((Ze.is(o)||ct.is(o))&&o.coordinates.length>0)return o.coordinates[0].floorId;if(Ge.is(o)&&o.spaces.length>0)return o.spaces[0].floor.id}function pd(o){return o.reduce((e,t)=>{let r=Co(t);if(!r)return e;let n=$m(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 Jo from"zod";var Fr=50,Us=1,Hs=!1,dd=Jo.object({limit:Jo.enum(["same-floor","same-elevation","all-floors"]).optional(),mode:Jo.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:Jo.boolean().optional().or(Jo.literal("auto")),maxDistance:Jo.number().optional(),maxResults:Jo.number().optional()}),ud={lineOfSight:Hs,mode:"travel-distance",maxDistance:Fr,limit:"same-floor",maxResults:Us},bn=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}__LEGACY_NEAREST_SYNC=(e,t,r)=>{let n={...ud,...r};try{dd.parse(n)}catch(p){x.error(p);return}let i=Co(e);if(!i)return;let a=this.#o(i,n),s=[],l={},c=[];for(let p of t){let h=Do(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.#i(e,a,c,l,n),s.sort((p,h)=>p.distance-h.distance)};async nearest(e,t,r){let n={...ud,...r};try{dd.parse(n)}catch(h){x.error(h);return}let i=Co(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(Fo(h,this.#e,this.#e.enterpriseMode).then(g=>{if(g)for(let v of g)l[v]||(l[v]=[]),l[v].push(h),c.push(v)}));await Promise.all(p),s=await this.#n(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??Fr,n?.lineOfSight==="auto"?Hs: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};#n=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??Fr,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??Fr)-c,s,r,!1,i?.maxResults??Us);for(let g of h)for(let v of n[g.feature.properties.id])p.has(v.id)||(a.push({distance:g.distance+c,feature:v}),p.add(v.id))}}return a};#i=(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??Fr,maxResults:1})?.[0].feature),l){let c=this.#e.directions.navigator.findNearestNodesOnGraph(l.id,i?.maxDistance??Fr,s,r,i?.lineOfSight==="auto"?Hs:i?.lineOfSight,i?.maxResults??Us);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 ki=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:Sc(e,r)}};f();f();f();f();function fd(o){let e=+this._x.call(null,o),t=+this._y.call(null,o);return hd(this.cover(e,t),e,t,o)}function hd(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,v,I,E,O,w,F;if(!i)return o._root=a,o;for(;i.length;)if((E=e>=(h=(s+c)/2))?s=h:c=h,(O=t>=(g=(l+p)/2))?l=g:p=g,n=i,!(i=i[w=O<<1|E]))return n[w]=a,o;if(v=+o._x.call(null,i.data),I=+o._y.call(null,i.data),e===v&&t===I)return a.next=i,n?n[w]=a:o._root=a,o;do n=n?n[w]=new Array(4):o._root=new Array(4),(E=e>=(h=(s+c)/2))?s=h:c=h,(O=t>=(g=(l+p)/2))?l=g:p=g;while((w=O<<1|E)===(F=(I>=g)<<1|v>=h));return n[F]=i,n[w]=a,o}function gd(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)hd(this,a[t],s[t],o[t]);return this}f();function md(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 yd(){var o=[];return this.visit(function(e){if(!e.length)do o.push(e.data);while(e=e.next)}),o}f();function bd(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 Ue(o,e,t,r,n){this.node=o,this.x0=e,this.y0=t,this.x1=r,this.y1=n}function Td(o,e,t){var r,n=this._x0,i=this._y0,a,s,l,c,p=this._x1,h=this._y1,g=[],v=this._root,I,E;for(v&&g.push(new Ue(v,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(!(!(v=I.node)||(a=I.x0)>p||(s=I.y0)>h||(l=I.x1)<n||(c=I.y1)<i))if(v.length){var O=(a+l)/2,w=(s+c)/2;g.push(new Ue(v[3],O,w,l,c),new Ue(v[2],a,w,O,c),new Ue(v[1],O,s,l,w),new Ue(v[0],a,s,O,w)),(E=(e>=w)<<1|o>=O)&&(I=g[g.length-1],g[g.length-1]=g[g.length-1-E],g[g.length-1-E]=I)}else{var F=o-+this._x.call(null,v.data),W=e-+this._y.call(null,v.data),N=F*F+W*W;if(N<t){var B=Math.sqrt(t=N);n=o-B,i=e-B,p=o+B,h=e+B,r=v.data}}return r}f();function vd(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,v,I,E,O,w;if(!t)return this;if(t.length)for(;;){if((I=p>=(g=(a+l)/2))?a=g:l=g,(E=h>=(v=(s+c)/2))?s=v:c=v,e=t,!(t=t[O=E<<1|I]))return this;if(!t.length)break;(e[O+1&3]||e[O+2&3]||e[O+3&3])&&(r=e,w=O)}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[O]=i:delete e[O],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[w]=t:this._root=t),this):(this._root=i,this)}function Id(o){for(var e=0,t=o.length;e<t;++e)this.remove(o[e]);return this}f();function Sd(){return this._root}f();function Ed(){var o=0;return this.visit(function(e){if(!e.length)do++o;while(e=e.next)}),o}f();function Md(o){var e=[],t,r=this._root,n,i,a,s,l;for(r&&e.push(new Ue(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 Ue(n,c,p,s,l)),(n=r[2])&&e.push(new Ue(n,i,p,c,l)),(n=r[1])&&e.push(new Ue(n,c,a,s,p)),(n=r[0])&&e.push(new Ue(n,i,a,c,p))}return this}f();function xd(o){var e=[],t=[],r;for(this._root&&e.push(new Ue(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 Ue(i,a,s,p,h)),(i=n[1])&&e.push(new Ue(i,p,s,l,h)),(i=n[2])&&e.push(new Ue(i,a,h,p,c)),(i=n[3])&&e.push(new Ue(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 _d(o){return o[0]}function Cd(o){return arguments.length?(this._x=o,this):this._x}f();function Pd(o){return o[1]}function Od(o){return arguments.length?(this._y=o,this):this._y}function Tn(o,e,t){var r=new Ws(e??_d,t??Pd,NaN,NaN,NaN,NaN);return o==null?r:r.addAll(o)}function Ws(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 wd(o){for(var e={data:o.data},t=e;o=o.next;)t=t.next={data:o.data};return e}var at=Tn.prototype=Ws.prototype;at.copy=function(){var o=new Ws(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=wd(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]=wd(r));return o};at.add=fd;at.addAll=gd;at.cover=md;at.data=yd;at.extent=bd;at.find=Td;at.remove=vd;at.removeAll=Id;at.root=Sd;at.size=Ed;at.visit=Md;at.visitAfter=xd;at.x=Cd;at.y=Od;f();function zs(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,v]=s[l];e(c,p,h,g,v)||zs(o,e,c,p,h,g,v)}}return!1}var Dd=1e3,Ym=.1,Zm=5,Jm=1.5,Li=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=Dd;else r=Dd;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=Zm,v=Math.max(a,this.getMaxSearchRadiusForFloorId(t,n));for(;h.length<l&&g<=v;){let I=this.#o(e,c,i,g,a,p);I.sort((E,O)=>E.distance-O.distance);for(let E of I){if(h.length>=l)break;s?this.#r.directions.navigator.hasLineOfSight(e,E.node.geometry.coordinates,n,Ym)&&h.push(E):h.push(E)}g=g*Jm}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,v=[];return zs(t,(I,E,O,w,F)=>{let W=E>=p||O>=g||w<c||F<h;if("data"in I){let N=I;for(;N;){let B=N.data,G=B.properties.parentId||B.properties.id;if(r.includes(G)&&!a.has(G)){a.add(G);let A=qt(e,B.geometry.coordinates);A<=i&&v.push({node:B,distance:A})}N=N.next}}return W}),v}#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]=Tn();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;case"object":case"location-profile":case"connection":case"area":case"facade":i=this.#n(this.#r.getByType(e),r);break}return i?.length>0&&n.addAll(i),n}#n(e,t){let r=[];for(let n of e){let i=Do(n,this.#r,this.#r.enterpriseMode);for(let a=0;a<i.length;a++){let s=this.#r.mvfNodesById[i[a]];s&&(s.properties.floor??s.properties.map)===t&&r.push({...s,properties:{...s.properties,id:s.properties.id,parentId:n.id}})}}return r}#i;constructor(e,t){this.#r=e,this.#i=t}};f();f();f();f();function Ni(o,e,t=0,r=o.length-1,n=qm){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),v=Math.max(t,Math.floor(e-c*h/l+g)),I=Math.min(r,Math.floor(e+(l-c)*h/l+g));Ni(o,e,v,I,n)}let i=o[e],a=t,s=r;for(vn(o,t,e),n(o[r],i)>0&&vn(o,t,r);a<s;){for(vn(o,a,s),a++,s--;n(o[a],i)<0;)a++;for(;n(o[s],i)>0;)s--}n(o[t],i)===0?vn(o,t,s):(s++,vn(o,s,r)),s<=e&&(t=s+1),e<=s&&(r=s-1)}}function vn(o,e,t){let r=o[e];o[e]=o[t],o[t]=r}function qm(o,e){return o<e?-1:o>e?1:0}var En=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(!Bi(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;Bi(e,l)&&(t.leaf?r.push(s):$s(e,l)?this._all(s,r):i.push(s))}t=i.pop()}return r}collides(e){let t=this.data;if(!Bi(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(Bi(e,a)){if(t.leaf||$s(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=kr([]),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=Qm(e,r.children,t);if(p!==-1)return r.children.splice(p,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&$s(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=kr(e.slice(t,r+1)),Ar(s,this.toBBox),s;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),s=kr([]),s.leaf=!1,s.height=n;let l=Math.ceil(i/a),c=l*Math.ceil(Math.sqrt(a));Fd(e,t,r,c,this.compareMinX);for(let p=t;p<=r;p+=c){let h=Math.min(p+c-1,r);Fd(e,p,h,l,this.compareMinY);for(let g=p;g<=h;g+=l){let v=Math.min(g+l-1,h);s.children.push(this._build(e,g,v,n-1))}}return Ar(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=Xs(c),h=ty(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),Sn(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=kr(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,Ar(r,this.toBBox),Ar(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,t){this.data=kr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ar(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=In(e,0,s,this.toBBox),c=In(e,s,r,this.toBBox),p=oy(l,c),h=Xs(l)+Xs(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:Km,i=e.leaf?this.compareMinY:ey,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=In(e,0,t,i),s=In(e,r-t,r,i),l=Ri(a)+Ri(s);for(let c=t;c<r-t;c++){let p=e.children[c];Sn(a,e.leaf?i(p):p),l+=Ri(a)}for(let c=r-t-1;c>=t;c--){let p=e.children[c];Sn(s,e.leaf?i(p):p),l+=Ri(s)}return l}_adjustParentBBoxes(e,t,r){for(let n=r;n>=0;n--)Sn(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():Ar(e[t],this.toBBox)}};function Qm(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 Ar(o,e){In(o,0,o.children.length,e,o)}function In(o,e,t,r,n){n||(n=kr(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];Sn(n,o.leaf?r(a):a)}return n}function Sn(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 Km(o,e){return o.minX-e.minX}function ey(o,e){return o.minY-e.minY}function Xs(o){return(o.maxX-o.minX)*(o.maxY-o.minY)}function Ri(o){return o.maxX-o.minX+(o.maxY-o.minY)}function ty(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 oy(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 $s(o,e){return o.minX<=e.minX&&o.minY<=e.minY&&e.maxX<=o.maxX&&e.maxY<=o.maxY}function Bi(o,e){return e.minX<=o.maxX&&e.minY<=o.maxY&&e.maxX>=o.minX&&e.maxY>=o.minY}function kr(o){return{children:o,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Fd(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;Ni(o,a,e,t,n),i.push(e,a,a,t)}}var Vi=class extends En{#e;constructor(e){super(),this.#e=e}toBBox=e=>{let t=e.geoJSONBoundingBox;t==null&&x.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 ji=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 Vi(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 Ad(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 Mn=class{#e;#t;#o;#r;constructor(e){let t=Ad(e.mapCenter.longitude,e.mapCenter.latitude);this.#o=new Li(e,t),this.#r=new ji(e,t),this.#e=new bn(e,this.#o),this.#t=new ki(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 Gi=class{#e;constructor(e){this.#e=e||[]}get raw(){return this.#e}};var Ys=class o extends Le{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 zo({mvfData:n})):r==="pictures"?this.images=t.mvf2Data.pictures.map(n=>n.url?new Kt({mvfData:{...n,url:n.url??""},mapData:this.#e}):void 0).filter(n=>n!=null):r==="website"?t.mvf2Data.website&&(this.website=new zo({mvfData:t.mvf2Data.website})):r==="icon"?t.mvf2Data.icon&&(this.icon=new Kt({mvfData:{url:t.mvf2Data.icon},mapData:this.#e})):r==="logo"?t.mvf2Data.logo&&(this.logoImage=new Kt({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 Gi(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=Ys;f();var Zs=class o extends Le{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}}},Pi=Zs;var Js=.75;function ry(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:oe()}});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:oe()}});return e}function ny(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=ry(r);for(let s of a)i.push(s)}e[n]={voids:{type:"FeatureCollection",features:i}}}return e}var qo=class extends gt{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??xo();if(this.envControl=r,this.binaryBundle=t?.binaryBundle,this.Analytics=new hr,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=Rp(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=ny(e),this.enterpriseMode||xn()){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 As(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]=cs(l)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new Dr({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 Mn(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 z(0,0,"initializing");get mapCenter(){return this.#o.floorId==="initializing"&&(this.#o=new z(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=ui(i+e+r+t.toString());if(this.propTranslationCache.has(c))return this.propTranslationCache.get(c);let p=bc(n,l,["id"]);return this.propTranslationCache.set(c,p),p}return l}return l}}return n}findPreferredLanguage(e){if(!this.venue)return;let t=qs(this.venue,e);return e?.languageCode!=null&&e.languageCode.toLowerCase()!==t.code.toLowerCase()&&x.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){x.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){x.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){x.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){x.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 Sp(a,{signal:s.signal})}catch(c){x.error(`Failed to download language pack for language code "${n.code}".`,c);return}if(!l||s.signal.aborted)return;i=cs(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=kd(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],v=this.directions.getDirectionsSync(c,g,l,this);if(!v){x.error("getDirections failed due to missing directions for one of the segments");return}c=g,p.push(v)}return p}else{let c=Array.isArray(e)?e:[e],p=Array.isArray(t)?t:[t];if(Array.isArray(p[0])){x.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){x.error("Unable to get directions",h);return}}};getDirections=async(e,t,r)=>{let{accessible:n=!1}=r||{},i=kd(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])){x.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){x.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=Co(e),n=Co(t);return qt([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(!xp(e))return{url:e};if(_p(e))return{url:e};let t=vr(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 x.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 ts(this.localePacksUrls[n.code],{signal:r.signal}),a=await br(i);a&&t.push({language:{code:n.code,name:n.name},localePack:a})}}catch(i){x.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){x.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 ts(this.localePacksUrls[n.code],{signal:r.signal});i&&t.push({language:{code:n.code,name:n.name},localePack:i})}}catch(i){x.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 kd=(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??Js,__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??Js,__EXPERIMENTAL_METHOD:"rdp",mustIncludeDoorBufferNodes:typeof r=="object"&&r.__EXPERIMENTAL_METHOD==="rdp"?r.__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES:void 0}:{enabled:i,radius:a??Js,__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 ro=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 Qo=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 Ao=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=us(this.coordinates),this.#e)}get focusTarget(){return this.coordinates}toJSON(){return{__type:o.__type,id:this.id,coordinates:this.coordinates,isConnectionSegment:this.isConnectionSegment,distance:this.distance}}},Ct=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 Ao(i.toString(),a))}get distance(){return this.#e?this.#e:(this.#e=us(this.coordinates),this.#e)}toJSON(){return{__type:o.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};f();var iy=7,_n=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t?.precision??iy}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=mi(e.latitude,this.#t),r=mi(e.longitude,this.#t);return new z({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 mi(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 ay=new Map([["search-16x16",`<svg viewBox="0 0 16 16">
|
|
6
|
+
`)}return c}else throw new go.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 go.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)||jf.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:Gr.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],v=this.fn(s);return l||h||p||c?g=Ta(this,s,v,l,c,p,h):g||(g=this.programs[s]=Ta(this,s,v)),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=Gr.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=Q1(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=Hf(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={};Gf(s,e.helpers,n),Gf(s,a.helpers,n),n.helpers=s,o.usePartial&&(n.partials=n.mergeIfNeeded(a.partials,e.partials)),(o.usePartial||o.useDecorators)&&(n.decorators=Gr.extend({},e.decorators,a.decorators)),n.hooks={},n.protoAccessControl=jf.createProtoAccessControl(a);var l=a.allowCallsToHelperMissing||t;Vf.moveHelperToHooks(n,"helperMissing",l),Vf.moveHelperToHooks(n,"blockHelperMissing",l)}},i._child=function(a,s,l,c){if(o.useBlockParams&&!l)throw new go.default("must pass block params");if(o.useDepths&&!c)throw new go.default("must pass parent depths");return Ta(n,a,o[a],s,0,l,c)},i}function Ta(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=Hf(t,s,o,a,r,i),s.program=e,s.depth=a?a.length:0,s.blockParams=n||0,s}function Z1(o,e,t){return o?!o.call&&!t.name&&(t.name=o,o=va(t.partials,o)):t.name==="@partial-block"?o=va(t.data,"partial-block"):o=va(t.partials,t.name),o}function q1(o,e,t){var r=va(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!==Uf&&(function(){t.data=mo.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=mo.createFrame(l.data),l.data["partial-block"]=r,i(s,l)},i.partials&&(t.partials=Gr.extend({},t.partials,i.partials))})(),o===void 0&&n&&(o=n),o===void 0)throw new go.default("The partial "+t.name+" could not be found");if(o instanceof Function)return o(e,t)}function Uf(){return""}function va(o,e){if(o&&Object.prototype.hasOwnProperty.call(o,e))return o[e]}function Q1(o,e){return(!e||!("root"in e))&&(e=e?mo.createFrame(e):{},e.root=o),e}function Hf(o,e,t,r,n,i){if(o.decorator){var a={};e=o.decorator(e,a,t,r&&r[0],n,i,r),Gr.extend(e,a)}return e}function Gf(o,e,t){e&&Object.keys(e).forEach(function(r){var n=e[r];o[r]=K1(n,t)})}function K1(o,e){var t=e.lookupProperty;return $1.wrapHelper(o,function(r){return r.lookupProperty=t,r})}});var Xf=_e((Ia,zf)=>{"use strict";f();Ia.__esModule=!0;Ia.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}};zf.exports=Ia.default});var qf=_e((Sa,Zf)=>{"use strict";f();Sa.__esModule=!0;function Bl(o){return o&&o.__esModule?o:{default:o}}function Vl(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 eb=kl(),$f=Vl(eb),tb=Rf(),ob=Bl(tb),rb=Lo(),nb=Bl(rb),ib=zt(),Rl=Vl(ib),ab=Wf(),Yf=Vl(ab),sb=Xf(),lb=Bl(sb);function Jf(){var o=new $f.HandlebarsEnvironment;return Rl.extend(o,$f),o.SafeString=ob.default,o.Exception=nb.default,o.Utils=Rl,o.escapeExpression=Rl.escapeExpression,o.VM=Yf,o.template=function(e){return Yf.template(e,o)},o}var Zn=Jf();Zn.create=Jf;lb.default(Zn);Zn.default=Zn;Sa.default=Zn;Zf.exports=Sa.default});var Kf=_e((m4,Qf)=>{f();Qf.exports=qf().default});f();f();f();f();f();var Vc="mi-session-data",jc="mi-local-data",rn="id",nn="deviceId",xt=class o{static#e;#t;#o;constructor(){try{let e=sessionStorage.getItem(Vc);e?this.#t=JSON.parse(e):this.#t={[rn]:oe()}}catch{this.#t={[rn]:oe()}}try{let e=localStorage.getItem(jc);e?this.#o=JSON.parse(e):this.#o={[nn]:oe()}}catch{this.#o={[nn]:oe()}}this.#t[rn]||(this.#t[rn]=oe()),this.#o[nn]||(this.#o[nn]=oe())}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(Vc,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(jc,JSON.stringify(this.#o)),!0}catch{return!1}}loadLocalData(e){let t=this.#o[e];if(t!=null)return t}};f();f();var fr=o=>o!=null;var sg=(function(){let e=globalThis.fetch;return{fetch(...t){if(!fr(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}}})(),Gc=sg.fetch;var Xc=["websdk","web","webv2","kiosk","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke","reactsdk","minimap"],Uc=Xc[0],$c="https://api-gateway.mappedin.com/track-analytics/a/",Yc="deny-watchposition",Jc="load-mapview",Zc="load-mapdata",qc="change-language",Qc="query-directions";var hr=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&&xt.getInstance().saveSessionData("id",e.sessionId),e.deviceId&&xt.getInstance().saveLocalData("deviceId",e.deviceId)}#r(e){let t=e.baseUri??$c;return{baseUri:t,analyticsBaseUrl:Wa({...e,baseUri:t}),version:e.version||S?.env?.npm_package_version||"v6",deviceId:e.deviceId||Hc(),accessToken:e.accessToken,mapId:e.mapId,sessionId:e.sessionId||Wc(),platformString:e.platformString||"",context:zc(e.context)||Uc,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=Wa({...this.#t,mapId:t.mapId})),t.context&&(t.context=zc(t.context)),t.baseUri&&(t.analyticsBaseUrl=Wa({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||Uc}getSessionId(){return this.getState().sessionId||this.#e.sessionId||Wc()}getDeviceId(){return this.getState().deviceId||this.#e.deviceId||Hc()}sendAnalyticEvent(e,t={}){let r=this.getState(),n=lg(r.analyticsBaseUrl,e),i={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(r.logEvents&&x.log("Analytics.track",n,i),!r.sendEvents)return Promise.resolve();if(!this.authReady)return!r.key&&!r.secret&&!r.accessToken?void 0:x.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}`),Gc(n,{method:"POST",mode:"cors",headers:i,body:JSON.stringify(a)})}capture(e,t){if(pg.includes(e))return x.warn(`${e} event is sent internally.`),Promise.resolve();let r=cg.includes(e)?e.slice(1):e;return this.sendAnalyticEvent(r,t)}sendGetMapDataEvent(e){return this.sendAnalyticEvent(Zc,e)}sendChangeLanguageEvent(e){return this.sendAnalyticEvent(qc,e)}sendWatchPositionDenied(){return this.sendAnalyticEvent(Yc)}sendMapViewLoadedEvent({firstRenderDuration:e,dimension:t,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n}){return this.sendAnalyticEvent(Jc,{type:"3d",firstRenderDuration:e,width:t.width,height:t.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:r,outdoorsWorkerDisabled:n})}sendGetDirectionsEvent=dc((e,t,r)=>{let n={start:e,end:t,type:"location_to_location"};return r!==void 0&&(n.accessible=r),this.sendAnalyticEvent(Qc,n)},2500);sendBlueDotEvents(e){if(!((e==="found-floor"||e==="found-position")&&this.oneTimeEventsSent.has(e)))return this.oneTimeEventsSent.add(e),this.sendAnalyticEvent(e)}};function Wa({mapId:o,baseUri:e=$c}){return`${e}${o}/`}function Hc(){return xt.getInstance().loadLocalData("deviceId")}function Wc(){return xt.getInstance().loadSessionData("id")}function lg(o,e){return o+e}function zc(o){return Xc.find(e=>e===o)}var cg=["$select-location","$select-category","$query-suggest","$query-search"],pg=[Jc,Zc,Qc,Yc,qc],AT=new hr,an=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 sn=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 x.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(e,t)}catch(r){return x.error("Search.query failed due to",r),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(e,t={}){if(this.enabled||await this.enable(),!this.searchInstance)return x.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(e,t)}catch(r){return x.error("Search.suggest failed due to",r),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-4S5IPA5O.js").then(({InternalSearch:e})=>new e(this.#e))),this.#t.on("language-change",this.#o),await this.searchInstance)}};var Kc={"enterprise-location":"location-profile","enterprise-category":"location-category"},ep={"location-profile":"enterprise-location","location-category":"enterprise-category"},tp=new WeakMap,za=class{#e;#t;Analytics;Search;Query;internal;constructor(e,{search:t}={}){this.#e=new gt,this.#t=e,tp.set(this,e),this.Analytics=new an(e.Analytics),this.Query=e.Query,this.internal=e,this.Search=new sn(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 Kc?x.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is a Maker map (API key starts with 'mik_'). Use '${Kc[e]}' instead. See https://developer.mappedin.com/web-sdk/getting-started`):r&&e in ep&&x.warn(`MappedinSDK: getByType('${e}') returned 0 results. This is an Enterprise map. Use '${ep[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})}},ln=za;function cn(o){let e=tp.get(o);if(!e)throw new Error("MapDataInternal not found");return e}f();f();f();f();f();function gr(o){return o.endsWith("/")?o:`${o}/`}f();var mr="https://app.mappedin.com/",op="https://auth.mappedin.com/",rp=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"}),dg=Object.freeze({...rp,baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"}),ug=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"}),fg=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"}),hg=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"}),gg={eu:ug,us:rp,"us-enterprise":dg,"us-staging-enterprise":fg,"us-staging-self-serve":hg};function np(o){return gg[o]}f();f();var mg=o=>{let e=Date.now();return o-e},Ti=(o,e)=>mg(o)<=e*60*1e3;var ap=10,sp=ap*60*1e3,ip="accessTokens",yg="mik_";function lp(o){return typeof o=="string"&&o.startsWith(yg)}async function pn(o,e=!1,t=!1){let r=`${o.key}`,n=xt.getInstance(),i=n?.loadSessionData(ip)||{},a=Math.floor(Date.now()/1e3);if(!t&&i[r]&&!Ti(i[r].expiresTimestamp*1e3,ap))return i[r];let s=e?await bg(o,a):await Tg(o,a),l={...i,[r]:s};return n?.saveSessionData(ip,l),s}async function bg(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri??op}oauth2/token`;let r;try{r=await mt()(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 Tg(o,e){let t;o.customAuthUri?t=o.customAuthUri:t=`${o.baseAuthUri?gr(o.baseAuthUri):mr}api/v1/api-key/token`;let r;try{r=await mt()(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 pp=10,dp=pp*60*1e3,cp="miSasTokens";async function Xa(o,e){let t=`${e}__${o.mapId}`,r=xt.getInstance(),n=r?.loadSessionData(cp)||{};if(n[t]&&!Ti(n[t].expires,pp))return n[t];let i=await vg(o,e),a={...n,[t]:{token:i.token,expires:new Date(i.expires).getTime()}};return r?.saveSessionData(cp,a),i}async function vg(o,e){let t=`${o.baseUri?gr(o.baseUri):mr}api/v1/venue/${o.mapId}/sas-token`,r=await mt()(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 yt=Uint8Array,Wo=Uint16Array,up=Uint32Array,fp=new yt([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]),hp=new yt([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]),Ig=new yt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gp=function(o,e){for(var t=new Wo(31),r=0;r<31;++r)t[r]=e+=1<<o[r-1];for(var n=new up(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]},mp=gp(fp,2),yp=mp[0],Sg=mp[1];yp[28]=258,Sg[258]=28;var bp=gp(hp,0),Eg=bp[0],b0=bp[1],Za=new Wo(32768);for(ue=0;ue<32768;++ue)lo=(ue&43690)>>>1|(ue&21845)<<1,lo=(lo&52428)>>>2|(lo&13107)<<2,lo=(lo&61680)>>>4|(lo&3855)<<4,Za[ue]=((lo&65280)>>>8|(lo&255)<<8)>>>1;var lo,ue,dn=(function(o,e,t){for(var r=o.length,n=0,i=new Wo(e);n<r;++n)o[n]&&++i[o[n]-1];var a=new Wo(e);for(n=0;n<e;++n)a[n]=a[n-1]+i[n-1]<<1;var s;if(t){s=new Wo(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[Za[h]>>>l]=c}else for(s=new Wo(r),n=0;n<r;++n)o[n]&&(s[n]=Za[a[o[n]-1]++]>>>15-o[n]);return s}),un=new yt(288);for(ue=0;ue<144;++ue)un[ue]=8;var ue;for(ue=144;ue<256;++ue)un[ue]=9;var ue;for(ue=256;ue<280;++ue)un[ue]=7;var ue;for(ue=280;ue<288;++ue)un[ue]=8;var ue,Tp=new yt(32);for(ue=0;ue<32;++ue)Tp[ue]=5;var ue;var Mg=dn(un,9,1);var xg=dn(Tp,5,1),$a=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},Lt=function(o,e,t){var r=e/8|0;return(o[r]|o[r+1]<<8)>>(e&7)&t},Ya=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},_g=function(o){return(o+7)/8|0},Qa=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?Wo:o.BYTES_PER_ELEMENT==4?up:yt)(t-e);return r.set(o.subarray(e,t)),r};var Cg=["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||Cg[o]);if(r.code=o,Error.captureStackTrace&&Error.captureStackTrace(r,Nt),!t)throw r;return r},Pg=function(o,e,t){var r=o.length;if(!r||t&&t.f&&!t.l)return e||new yt(0);var n=!e||t,i=!t||t.i;t||(t={}),e||(e=new yt(r*3));var a=function(At){var yo=e.length;if(At>yo){var bo=new yt(Math.max(yo*2,At));bo.set(e),e=bo}},s=t.f||0,l=t.p||0,c=t.b||0,p=t.l,h=t.d,g=t.m,v=t.n,I=r*8;do{if(!p){s=Lt(o,l,1);var E=Lt(o,l+1,3);if(l+=3,E)if(E==1)p=Mg,h=xg,g=9,v=5;else if(E==2){var W=Lt(o,l,31)+257,N=Lt(o,l+10,15)+4,B=W+Lt(o,l+5,31)+1;l+=14;for(var G=new yt(B),F=new yt(19),j=0;j<N;++j)F[Ig[j]]=Lt(o,l+j*3,7);l+=N*3;for(var te=$a(F),he=(1<<te)-1,ge=dn(F,te,1),j=0;j<B;){var ie=ge[Lt(o,l,he)];l+=ie&15;var O=ie>>>4;if(O<16)G[j++]=O;else{var ve=0,Be=0;for(O==16?(Be=3+Lt(o,l,3),l+=2,ve=G[j-1]):O==17?(Be=3+Lt(o,l,7),l+=3):O==18&&(Be=11+Lt(o,l,127),l+=7);Be--;)G[j++]=ve}}var Ve=G.subarray(0,W),pe=G.subarray(W);g=$a(Ve),v=$a(pe),p=dn(Ve,g,1),h=dn(pe,v,1)}else Nt(1);else{var O=_g(l)+4,D=o[O-4]|o[O-3]<<8,A=O+D;if(A>r){i&&Nt(0);break}n&&a(c+D),e.set(o.subarray(O,A),c),t.b=c+=D,t.p=l=A*8,t.f=s;continue}if(l>I){i&&Nt(0);break}}n&&a(c+131072);for(var Et=(1<<g)-1,Dt=(1<<v)-1,$e=l;;$e=l){var ve=p[Ya(o,l)&Et],ye=ve>>>4;if(l+=ve&15,l>I){i&&Nt(0);break}if(ve||Nt(2),ye<256)e[c++]=ye;else if(ye==256){$e=l,p=null;break}else{var $t=ye-254;if(ye>264){var j=ye-257,se=fp[j];$t=Lt(o,l,(1<<se)-1)+yp[j],l+=se}var Mt=h[Ya(o,l)&Dt],wt=Mt>>>4;Mt||Nt(3),l+=Mt&15;var pe=Eg[wt];if(wt>3){var se=hp[wt];pe+=Ya(o,l)&(1<<se)-1,l+=se}if(l>I){i&&Nt(0);break}n&&a(c+131072);for(var Yt=c+$t;c<Yt;c+=4)e[c]=e[c-pe],e[c+1]=e[c+1-pe],e[c+2]=e[c+2-pe],e[c+3]=e[c+3-pe];c=Yt}}t.l=p,t.p=$e,t.b=c,t.f=s,p&&(s=1,t.m=g,t.d=h,t.n=v)}while(!s);return c==e.length?e:Qa(e,0,c)};var Og=new yt(0);var Kt=function(o,e){return o[e]|o[e+1]<<8},Rt=function(o,e){return(o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24)>>>0},Ja=function(o,e){return Rt(o,e)+Rt(o,e+4)*4294967296};function Dg(o,e){return Pg(o,e)}var qa=typeof TextDecoder<"u"&&new TextDecoder,wg=0;try{qa.decode(Og,{stream:!0}),wg=1}catch{}var Ag=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,Qa(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 Fg(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(qa)return qa.decode(o);var n=Ag(o),i=n[0],a=n[1];return a.length&&Nt(8),i}}var kg=function(o,e){return e+30+Kt(o,e+26)+Kt(o,e+28)},Lg=function(o,e,t){var r=Kt(o,e+28),n=Fg(o.subarray(e+46,e+46+r),!(Kt(o,e+8)&2048)),i=e+46+r,a=Rt(o,e+20),s=t&&a==4294967295?Ng(o,i):[a,Rt(o,e+24),Rt(o,e+42)],l=s[0],c=s[1],p=s[2];return[Kt(o,e+10),l,c,n,i+Kt(o,e+30)+Kt(o,e+32),p]},Ng=function(o,e){for(;Kt(o,e)!=1;e+=4+Kt(o,e+2));return[Ja(o,e+12),Ja(o,e+4),Ja(o,e+20)]};function Ka(o,e){for(var t={},r=o.length-22;Rt(o,r)!=101010256;--r)(!r||o.length-r>65558)&&Nt(13);var n=Kt(o,r+8);if(!n)return{};var i=Rt(o,r+16),a=i==4294967295||n==65535;if(a){var s=Rt(o,r-12);a=Rt(o,s)==101075792,a&&(n=Rt(o,s+32),i=Rt(o,s+48))}for(var l=e&&e.filter,c=0;c<n;++c){var p=Lg(o,i,a),h=p[0],g=p[1],v=p[2],I=p[3],E=p[4],O=p[5],D=kg(o,O);i=E,(!l||l({name:I,size:g,originalSize:v,compression:h}))&&(h?h==8?t[I]=Dg(o.subarray(D,D+g),new yt(v)):Nt(14,"unknown compression type "+h):t[I]=Qa(o,D,D+g))}return t}var vp=globalThis.fetch,Bg=S?.env?.npm_package_version;function mt(){if(vp==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return vp}async function Vg(o){return typeof o=="function"?o():o}var es={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Sp(o){let e={...es,...o};return e.headers={...e.headers,"mappedin-sdk-version":Bg},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 jg(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 Gg(o,e,t=!1){let r=jg(o,e,t),n=await mt()(r.url,r.req);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return n.json()}var Ug=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 x.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){x.warn(`Perspective ${r} is missing url or locale_packs!`);continue}t[r]={url:i,locale_packs:a}}return t};async function Hg(o,e="exports/mvf/1/bundle"){let t=Sp({baseUri:"https://api-gateway.mappedin.com/",...es,...o}),r=`${t.baseUri+e}?venue=${t.venue}&version=${t.version??"2.0.0"}`;t.headers["Content-Type"]="application/zip";let n=await Gg(t,r),i=n.url,a=n.locale_packs,s=t.perspective??es.perspective,l=Ug(n);if(s!=null&&s!==""&&l!=null){let c=l[s];c==null?x.warn(`Perspective ${s} not found in response! Loading default perspective instead.`):(x.log(`Loading perspective "${s}"`),i=c.url,a=c.locale_packs)}return{url:i,localePacks:a,updated_at:n.updated_at}}var yr=(function(){let o;return()=>(o||(o=new TextDecoder),o)})();async function ts(o,{signal:e}){let t=await(await mt()(o,{signal:e})).arrayBuffer();return new Uint8Array(t)}async function br(o){let e=Ka(o),t={};if(e["enterprise/"]!=null){t.enterprise={};let r=e["enterprise/locations.json"];r&&(t.enterprise.locations=JSON.parse(yr().decode(r)));let n=e["enterprise/locationInstances.json"];n&&(t.enterprise.locationInstances=JSON.parse(yr().decode(n)));let i=e["enterprise/categories.json"];i&&(t.enterprise.categories=JSON.parse(yr().decode(i)))}return e["floorstack.json"]&&(t["floorstack.json"]=JSON.parse(yr().decode(e["floorstack.json"]))),e["floor.geojson"]&&(t["floor.geojson"]=JSON.parse(yr().decode(e["floor.geojson"]))),e["manifest.json"]&&(t["manifest.geojson"]=JSON.parse(yr().decode(e["manifest.json"]))),t}async function Ep(o,{signal:e}){try{let t=await(await mt()(o,{signal:e})).arrayBuffer();if(e.aborted)return;let r=new Uint8Array(t);return await br(r)}catch(t){let r=new Error("downloadLanguagePack failed");throw r.cause=t,r}}function Wg(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 os(o){return new Promise(async(e,t)=>{try{let r=Wg(o),{url:n,localePacks:i}=await Hg(o,r),a=await mt()(n).then(l=>l.arrayBuffer()),s=new Uint8Array(a);e({compressed:s,localePacks:i})}catch(r){t(r)}})}async function rs(o,e){return new Promise(async(t,r)=>{try{let{url:n}=await zg(o,e),i=await mt()(n).then(s=>s.arrayBuffer()),a=new Uint8Array(i);t(a)}catch(n){r(n)}})}async function zg(o,e){if(o.bundleUri!=null)return{url:await Vg(o.bundleUri),updated_at:""};if(e==null||e==="")throw new Error("Missing access token.");let t=new URL(`${o.baseUri?gr(o.baseUri):mr}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 mt()(t.toString(),{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return r.json()}function Mp(o){return Aa(o)}function Xg(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 ns(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=Ka(o);if(!Xg(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"){x.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 xo(){let o="us",e={};function t(){return $g(np(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 $g(o,e){return{...o,...e}}var vi=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_",""))},Ii=o=>o?.cms!=null,Ip=async o=>{let e=performance.now(),t,r=Ic.decompressUnsafeSync(o);r.isOk()?t=r.unwrap():x.error("MVFv3 decompression failed!");let n;if(t)try{n=vc(t)}catch(i){x.error("MVFv3 to MVFv2 conversion failed!",i)}if(x.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 Si(o,e="2.0.0"){switch(e){case"2.0.0":case"2.0.0-c":try{let t=performance.now(),r=await ns(o),n=Aa(r);return x.log(`Parsed MVFv2 in ${performance.now()-t}ms`),{mvf2:n}}catch{return x.error("MVFv2 parsing failed! Trying MVFv3."),Ip(o)}case"3.0.0":return Ip(o);default:throw new Error(`Unsupported MVF version: ${e}`)}}f();f();function Yg(o,e,t){t===void 0&&(t={});for(var r=Mo(o),n=pr(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")),Jg(n[i],n[i+1],r,a,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function Jg(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,v=c-s,I=p-l,E=h*I-g*v;if(n!==null){if(Math.abs(E)>n)return!1}else if(E!==0)return!1;if(r){if(r==="start")return Math.abs(v)>=Math.abs(I)?v>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(v)>=Math.abs(I)?v>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(v)>=Math.abs(I)?v>0?s<i&&i<c:c<i&&i<s:I>0?l<a&&a<p:p<a&&a<l}else return Math.abs(v)>=Math.abs(I)?v>0?s<=i&&i<=c:c<=i&&i<=s:I>0?l<=a&&a<=p:p<=a&&a<=l;return!1}var xp=Yg;f();function Zg(o,e){e===void 0&&(e={});var t=cr(o),r=(t[0]+t[2])/2,n=(t[1]+t[3])/2;return lr([r,n],e.properties,e)}var Tr=Zg;f();f();function qg(o,e,t){t===void 0&&(t={});var r=Mo(o),n=Mo(e),i=qt(n[1]-r[1]),a=qt(n[0]-r[0]),s=qt(r[1]),l=qt(n[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return uc(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),t.units)}var _o=qg;function Ei(o,e){return e===void 0&&(e={}),gc(o,function(t,r){var n=r.geometry.coordinates;return t+_o(n[0],n[1],e)},0)}f();f();f();function Mi(o,e,t){if(t===void 0&&(t={}),t.final===!0)return Qg(o,e);var r=Mo(o),n=Mo(e),i=qt(r[0]),a=qt(n[0]),s=qt(r[1]),l=qt(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 fc(Math.atan2(c,p))}function Qg(o,e){var t=Mi(e,o);return t=(t+180)%360,t}function Kg(o,e,t){t===void 0&&(t={});var r=lr([1/0,1/0],{dist:1/0}),n=0;return hc(o,function(i){for(var a=pr(i),s=0;s<a.length-1;s++){var l=lr(a[s]);l.properties.dist=_o(e,l,t);var c=lr(a[s+1]);c.properties.dist=_o(e,c,t);var p=_o(l,c,t),h=Math.max(l.properties.dist,c.properties.dist),g=Mi(l,c),v=Fa(e,h,g+90,t),I=Fa(e,h,g-90,t),E=Sc(tn([v.geometry.coordinates,I.geometry.coordinates]),tn([l.geometry.coordinates,c.geometry.coordinates])),O=null;E.features.length>0&&(O=E.features[0],O.properties.dist=_o(e,O,t),O.properties.location=n+_o(l,O,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),O&&O.properties.dist<r.properties.dist&&(r=O,r.properties.index=s),n+=p}}),r}var fn=Kg;function em(o,e,t){var r=pr(t);if(yc(t)!=="LineString")throw new Error("line must be a LineString");var n=fn(t,o),i=fn(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),tn(s,t.properties)}var is=em;var tm=1e-7;function as(o){return{type:"Point",coordinates:o}}function om(o,e){let{coordinates:t}=e.geometry,{coordinates:r}=o.geometry,n=t.map(i=>fn(o,as(i)));return r.reduce((i,a)=>{let s=is(as(a),n[0],o),l=is(as(a),n[1],o),c=Ei(s)<Ei(l)?s:l;return c.properties={...o.properties,entrances:[]},i.concat([c])},[])}function ss(o,e){return e.reduce((t,r)=>{let n={epsilon:tm},i=t.obstructions.findIndex(s=>xp(Tr(r),s,n)),a=t.obstructions[i];if(a){let[s,l]=om(a,r);t.entrances.push(r),t.obstructions.splice(i,1,s,l)}return t},{obstructions:[o],entrances:[]})}f();f();f();var Le=class{id;constructor(e){this.id=e}};f();f();var ls=class o{static __type="coordinate";__type=o.__type;id=oe();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]}},z=ls;function cs(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 rm=/^https?:\/\/cdn(-staging)?\.mappedin\.com(\/|$)/;function _p(o){return rm.test(o)}function Cp(o){return!!o.split("?")[1]?.includes("sv=")}function Ke(o,e){let t=o?.properties?.id||"unknown";if(o.geometry==null)return x.error(`Cannot get the center coordinate for "${t}" because it has no geometry.`),new z({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 z({latitude:l,longitude:s,floorId:e})}else if(o.geometry.type==="Point"){let[r,n]=o.geometry.coordinates;return new z({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 z({latitude:i,longitude:n,floorId:e})}}}catch{}try{let[r,n]=Tr(o).geometry.coordinates;return new z({latitude:n,longitude:r,floorId:e})}catch(r){return x.error(`Failed to get center coordinate for "${t}" ${r instanceof Error?r.stack:""}`),new z({latitude:0,longitude:0,floorId:e})}}function Pp(o,e){return e&&(o.flags[e.index]&1<<e.bit)!==0}function xi(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 ps=class o extends Le{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=Ke(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&&Pp({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]}},_t=ps;f();f();f();f();var ds=class o extends Le{static __type="hyperlink";__type=o.__type;#e={};#t;static is(e){return e.__type===o.__type}constructor(e){super(String(oe())),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]}},zo=ds;f();f();function hn(o){return typeof o=="string"?o:o?.id??""}function Op(o){return Array.isArray(o)&&Number.isFinite(o[0])&&Number.isFinite(o[1])}var nm=/^https:\/\/cdn\.mappedin\.com\/category-symbols\/.+$/,im=/^https:\/\/cdn-staging\.mappedin\.net\/category-symbols\/.+$/,am=o=>nm.test(o)||im.test(o),sm=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,lm=/^https:\/\/cdn-staging\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,cm=o=>am(o)?!1:sm.test(o)||lm.test(o),vr=o=>{if(!cm(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 us(o){return o.reduce((e,t,r)=>r===0?e:e+Qt(o[r-1].toGeoJSON().coordinates,t.toGeoJSON().coordinates),0)}function co(o){return o!=null&&typeof o=="object"&&"__type"in o&&o.__type!==null&&typeof o.__type=="string"}function fs(o){return o!=null&&typeof o=="object"&&"name"in o&&o.name!=null&&typeof o.name=="string"&&o.name!==""}function Dp(o){return co(o)&&fs(o)}var hs=class o extends Le{static __type="image";__type=o.__type;#e={};#t;#o;static is(e){return e.__type===o.__type}constructor(e){super(String(oe())),this.#t=e.mvfData,this.#o=e.mapData}get url(){let e=this.#t.url;if(this.#o.tokenManager==null)return e;let t=vr(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"&&x.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]}},eo=hs;f();var Bt=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=cr(this.geoJSON),this.#e)}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};var Ne=class extends Bt{#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 eo({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 zo({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 bt=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=vr(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"&&x.error("Error getting SAS token for image",{error:r,url:this.#t}),this.#t}}};f();f();function Co(o){let e;if(z.is(o))e=o;else if(ct.is(o))e=o.coordinates[0];else if(po.is(o))if(o.spaces.length>0)e=o.spaces[0].center;else return;else if(Je.is(o))if(o.coordinates.length>0)e=o.coordinates[0];else return;else if("center"in o&&z.is(o.center))e=o.center;else if("coordinate"in o&&z.is(o.coordinate))e=o.coordinate;else return;return e}f();f();var gn={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},to="ExteriorWalls",Po="Walls",wp=0,Ir="InteriorDoors",Sr="ExteriorDoors",Er="InteriorDoorsLayer",Mr="ExteriorDoorsLayer",Ce="GeometryLayer",mn="Focusable-",oo="LabelsLayer",Vt="MarkersLayer",yn="FootprintLayer",Xo="OcclusionLayer",$o="AreasLayer",xr="ImagesLayer",Yo="FacadesLayer",ro="PathsLayer",jt="ModelsLayer",Jo="Text3DLayer",pm="geometryText",dm="floortext";function Ap(o){return`${Jo}-${o}`}function Oo(o){return`${pm}-${o}`}function _r(o){return`${dm}-${o}`}var Fp=["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"],um={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var fm=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors"]),hm=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function gs(o){o.outdoorView?.enabled&&!o.outdoorView?.token&&x.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}function ms(o,e){let t=o?.outdoorView?.token||e.outdoorViewToken,r={...gn,...o,outdoorView:{enabled:o?.outdoorView?.enabled===void 0?!!t:o?.outdoorView?.enabled,layersHiddenByGeometry:gn.outdoorView?.layersHiddenByGeometry,...o?.outdoorView},bearing:o?.bearing??e.naturalBearing??0,imagePlacementOptions:{...gn.imagePlacementOptions,...o?.imagePlacementOptions},multiFloorView:{...gn.multiFloorView,...o?.multiFloorView},disableUpdateStateValidation:o?.disableUpdateStateValidation??!1};return t&&r.outdoorView&&(r.outdoorView.token=t),r}function kp(o){let e={remove_watermark:!1};if(o)try{let t=gi(o);Object.assign(e,t.capabilities)}catch(t){x.error("Error decoding capabilities from token",t)}return e}function Lp(o){let e=Object.fromEntries(Object.entries(o).filter(([t])=>fm.has(t)));return e.outdoorView&&(e.outdoorView=Object.fromEntries(Object.entries(e.outdoorView).filter(([t])=>hm.has(t)))),e}var ys=class o extends Ne{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=Ke(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.#n();return t?[...e,t]:e}#n(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new bt(`${this.id}-polygon-image-${oe()}`,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=ys;f();var bs=class o extends Ne{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=Ke(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]}},nt=bs;f();var Ts=class o extends Ne{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 mm(this.#r.properties.kind)}get enterpriseLocations(){return this.#o.enterpriseLocations!=null?this.#o.enterpriseLocations:(this.#o.enterpriseLocations=xi(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.#n();return t?[...e,t]:e}#n(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new bt(`${this.id}-polygon-image-${oe()}`,e.image.path,this,this.#e.tokenManager)),this.#o.polygonImage}get center(){return this.#o.center==null&&(this.#o.center=Ke(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]}},gm=["room","hallway","exterior","void","gate","otb"];function mm(o){if(o==null||o==="default")return"room";let e=o.toLowerCase();return gm.includes(e)?e:"room"}var xe=Ts;f();var vs=class o extends Bt{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=Ke(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]}},pt=vs;f();var Is=class o extends Ne{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(fr)}get floors(){return this.coordinates.map(e=>e.floorId?this.#e.getById("floor",e.floorId):void 0).filter(fr)}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]}},Je=Is;f();var Ss=class o extends Ne{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=xi(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=Ke(this.#r,this.#t)),this.#o.center}get images3D(){let e=this.#e.floorImagesByAnchorId.get(this.id)??[],t=this.#n();return t?[...e,t]:e}#n(){let e=this.#r.properties;if(e.image!=null)return this.#o.polygonImage==null&&(this.#o.polygonImage=new bt(`${this.id}-polygon-image-${oe()}`,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}},dt=Ss;f();var Es=class o extends Ne{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=Ke(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}},Tt=Es;f();var Ms=class o extends Ne{static __type="annotation";__type=o.__type;#e;#t;#o={};#r;#n;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.#n=t.symbol??{url:"",name:""}}#i(){let[e,t]=this.#r.properties.symbolId.split("--");return{group:e,type:t}}get group(){return this.#i().group}get type(){return this.#i().type}get coordinate(){return this.#o.coordinate==null&&(this.#o.coordinate=Ke(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.#n.name||""}get icon(){return this.#o.icon==null&&(this.#o.icon=super.icon||new eo({mvfData:{url:this.#n.url,altText:this.#n.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]}},Gt=Ms;f();f();var Np=di(Cs(),1);function ym(o,e,t){t===void 0&&(t={});var r=dr(o),n=dr(e),i=Np.default.union(r.coordinates,n.coordinates);return i.length===0?null:i.length===1?fi(i[0],t.properties):hi(i,t.properties)}var _i=ym;var Ps=class o extends Bt{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}#n(e){return this.#e.getPropTranslation(this.__type,e,this.id,this.#o[e])}get type(){return this.#o.type}get name(){let e=this.#n("name");return typeof e=="string"?e:""}get shortName(){let e=this.#n("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&&x.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;if(e)return this.#t.defaultFloor=e,this.#t.defaultFloor;let t=this.floors;if(t.length!==0)return this.#t.defaultFloor=t.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r),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=_i(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]}},Cr=Ps;f();var Os=class o extends Bt{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 we("No geometry found for facade!");let t=Tr(e);this.#r.center=new z({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}}},Ge=Os;f();var bm=new Set(["wall","area"]),Tm=new Set(["desk-entrance"]),vm=o=>{let e={};for(let t of o?.locations??[])e[t.id]=t;return{mvf3LocationsById:e}},Im=(o,e,t)=>{let r={},n={},i={},a={},s={},l={};for(let c of e["location.json"]||[]){let p=new po(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 Pi(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}},Sm=(o,e)=>{let t={},r={},n={},i={},a={},s={},l={},c={},p={},h=globalThis.Object.keys(o.space);for(let g of h){let v=o.space[g];if(v!=null){for(let I of v.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)),!Nm(I))if(I.properties.kind==="poi"||I.geometry.type==="Point"&&I.properties.kind==null){let E=new Tt(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")x.warn("Encountered a point space with an unknown kind!",I.properties.kind);else{let E=new xe(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}},Em=(o,e)=>{let t={},r={},n={},i={};for(let a of o["node.geojson"].features){n[a.properties.id]=a;let s=new _t(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}},Mm=(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(bm.has(c.properties.kind?.toLowerCase()??""))continue;let p=new dt(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}},xm=(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 pt(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 pt(e,{mvfData:{properties:i}});t[i.id]=a}return{floorsById:t,floorsByExternalId:r,mvfFloorsById:n}},_m=(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 Cr(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 Ge(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}},Cm=(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 Je(e,{mvfData:a});return t[a.id]=s,i},{});return{connectionsById:t,mvfConnectionsById:r,mvfConnectionsByNodeId:n}},Pm=(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 nt(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}},Om=(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)}}}}},Dm=(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)}}}}},wm=(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}}})}},Am=(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)}}},Fm=(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 Gt(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}},km=(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}},Lm=(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}},Rp=(o,e)=>{let t={},r={},n={},i={},a=(o.enterprise?.locations??[]).reduce((A,W)=>(A[W.id]=W,A),{}),s={},l={},c={},p={},h={},g={},v=o.enterprise?.venue||{},I={},E={},O={};for(let A of o.enterprise?.categories??[]){let W=new Ci(e,{mvfData:A});s[A.id]=W,A.externalId&&(l[A.externalId]==null&&(l[A.externalId]=[]),l[A.externalId].push(W)),c[A.id]=A,A.locations.forEach(N=>{h[N]==null&&(h[N]=[]),h[N].push(A.id)})}let D={};for(let A of o.enterprise?.locationInstances??[]){let W=a[A.parent],N=Object.keys(W),B={};for(let j of N)B[j]=void 0;let G={...B,polygons:[],nodes:[],...A};D[G.parent]==null&&(D[G.parent]=[]);let F=new ct(e,{mvfData:G,categoryIds:o.enterprise?.categoryPriorities?.[G.id]||h[G.id],parentId:A.parent});D[G.parent].push(F);for(let j of A.polygons??[])O[j.id]=F;I[G.id]=A,E[G.id]=F,A.externalId&&(i[A.externalId]==null&&(i[A.externalId]=[]),i[A.externalId].push(F))}for(let A of o.enterprise?.locations??[]){let W=new ct(e,{mvfData:A,categoryIds:o.enterprise?.categoryPriorities?.[A.id]||h[A.id],locationInstances:D[A.id]});n[A.id]=W,A.externalId&&(i[A.externalId]==null&&(i[A.externalId]=[]),i[A.externalId].push(W)),A.nodes.forEach(N=>{g[N.id]==null&&(g[N.id]=[]),g[N.id].push(A.id)});for(let N of A.polygons)p[N.id]==null&&(p[N.id]=[]),p[N.id].push(A)}if(e.enterpriseMode===!0){for(let A in e.mvfConnectionsById){let W={},N=e.mvfConnectionsById[A],B={id:A,externalId:N.externalId,kind:"enterprise."+N.type,destinationNodes:[],flags:N.flags,type:N.type,nodes:N.nodes,accessible:N.accessible,extra:N.extra,details:N.details};for(let G of e.mvfConnectionsById[A].nodes){let F=e.nodesById[G];F!=null&&(W[F.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[F.coordinate.longitude,F.coordinate.latitude]},properties:B})}Object.keys(W).length>0&&(t[A]=new Je(e,{mvfData:B}),N.externalId&&(r[N.externalId]==null&&(r[N.externalId]=[]),r[N.externalId].push(t[A])))}e.connectionsById=t}return{connectionsByExternalId:r,locationIdsByNodeId:g,mvfLocationsByGeometryId:p,mvfLocationsById:a,mvfCategoriesById:c,locationsById:n,locationInstancesById:E,instanceLocationsByPolygonId:O,locationsByExternalId:i,mvfLocationInstancesById:I,categoriesById:s,categoriesByExternalId:l,venue:v}},Bp=(o,e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}=Em(e,o),{connectionsById:s,mvfConnectionsById:l,mvfConnectionsByNodeId:c}=Cm(e,o),{spacesById:p,spacesByExternalId:h,poisById:g,poisByExternalId:v,mvfSpacesById:I,objectEntranceNodeIdsByObstructionId:E,mvfSpacesByFloorId:O,mvfPoisByFloorId:D}=Sm(e,o),{objectsById:A,objectsByExternalId:W,mvfObstructionById:N,obstructionIdByEntranceId:B}=Mm(e,o),{floorsById:G,floorsByExternalId:F,mvfFloorsById:j}=xm(e,o),{floorStacksById:te,floorStacksByExternalId:he,mvfFloorStacksById:ge,facadesById:ie,facadesBySpaceId:ve}=_m(e,o),{doorsById:Be,doorsByExternalId:Ve,doorsByNodeId:pe,mvfEntrancesById:Et,mvfEntrancesByFloorId:Dt}=Pm(e,o),{annotationsById:$e,mvfAnnotationsById:ye,mvfAnnotationsByFloorId:$t}=Fm(e,o),{areasById:se,areasByExternalId:Mt,mvfAreasById:wt}=km(e,o);Dm(e,I,N,wt),Om(e,I,N),wm(e,I),Am(e,I,N);let{mvf3LocationsById:Yt}=vm(t),{locationCategoriesByParentId:At,locationProfilesById:yo,locationCategoriesById:bo,locationProfilesByExternalId:Vo,locationProfilesByCategoryId:ir,locationProfilesByAttachedFeatureId:ar}=Im(o,e,Yt),{entranceNodeIdsBySpaceId:re,spaceIdsByNodeId:jo,objectIdsByNodeId:ae,destinationNodesIdsBySpaceId:To}=Lm(I,pe);return{spacesById:p,spacesByExternalId:h,nodesById:r,nodesByExternalId:n,objectsById:A,objectsByExternalId:W,floorsById:G,floorsByExternalId:F,floorStacksById:te,floorStacksByExternalId:he,facadesById:ie,facadesBySpaceId:ve,connectionsById:s,doorsById:Be,doorsByExternalId:Ve,doorsByNodeId:pe,poisById:g,poisByExternalId:v,annotationsById:$e,areasById:se,areasByExternalId:Mt,objectEntranceNodeIdsByObstructionId:E,obstructionIdByEntranceId:B,locationProfilesById:yo,locationCategoriesById:bo,locationProfilesByExternalId:Vo,locationProfilesByCategoryId:ir,locationCategoriesByParentId:At,mvfSpacesById:I,mvfNodesById:i,mvfObstructionById:N,mvfFloorsById:j,mvfFloorStacksById:ge,mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfEntrancesById:Et,mvfAnnotationsById:ye,mvfNodesByFloorId:a,mvfSpacesByFloorId:O,mvfPoisByFloorId:D,mvfAreasById:wt,mvfEntrancesByFloorId:Dt,mvfAnnotationsByFloorId:$t,locationProfilesByAttachedFeatureId:ar,entranceNodeIdsBySpaceId:re,spaceIdsByNodeId:jo,objectIdsByNodeId:ae,destinationNodesIdsBySpaceId:To,mvf3LocationsById:Yt}};function Nm(o){return!["Polygon","MultiPolygon"].includes(o.geometry.type)&&"kind"in o.properties&&o.properties.kind==null||o.properties.kind?.includes("connection")||Tm.has(o.properties.kind??"")}f();var Rm=new Set(["polygons"]),Ds=class o extends Le{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)!Rm.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]}},ct=Ds;f();var Bm=new Set,ws=class o extends Le{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)!Bm.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]}},Ci=ws;f();var Vm=new Set,As=class o extends Le{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)!Vm.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]}},Fs=As;f();f();f();f();f();var Vp=(i=>(i.Departure="Departure",i.TakeConnection="TakeConnection",i.ExitConnection="ExitConnection",i.Turn="Turn",i.Arrival="Arrival",i))(Vp||{}),ks=(a=>(a.Straight="Straight",a.Right="Right",a.SlightRight="SlightRight",a.Left="Left",a.SlightLeft="SlightLeft",a.Back="Back",a))(ks||{}),jp=(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))(jp||{}),Oi=(t=>(t.Exterior="exterior-walls",t.Interior="interior-walls",t))(Oi||{}),Di=(t=>(t.Interior="interior-doors",t.Exterior="exterior-doors",t))(Di||{});f();function Gp(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}=mc(a),c=s(e),p=s(t),h=p.x-c.x,g=p.y-c.y,v=i-n,I=Math.sqrt(h*h+g*g+v*v);if(I<=r*2)return null;let E=r/I,O={x:c.x+h*E,y:c.y+g*E},D=l(O.x,O.y),A=e[2]!==void 0?e[2]+v*E:void 0,W={x:p.x-h*E,y:p.y-g*E},N=l(W.x,W.y),B=t[2]!==void 0?t[2]-v*E:void 0;return{fromPosition:A!==void 0?[D.lon,D.lat,A]:[D.lon,D.lat],toPosition:B!==void 0?[N.lon,N.lat,B]:[N.lon,N.lat]}}function Ls(o,e,t,r,n){let i=Gp({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 vt(o){return o.verticalOffset===0?[o.longitude,o.latitude]:[o.longitude,o.latitude,o.verticalOffset]}function Um(o){return new Map(o.map(e=>{let{properties:t}=e,{id:r}=t;return[r,e]}))}var Bs=(o,e)=>{let t=Um(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}=ss(n,a);i=l.map(c=>c.geometry.coordinates),r.entrances.features.push(...s)}r.walls.geometry.coordinates.push(...i)}return r};function Hp(o,e){return((e-o+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}function Wp(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 zp(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 Xp(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 Pr(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 Vs=(o,e)=>{let r=(e.currentMap?.currentFloor).layers.get(Ce);switch(o){case"interior-walls":return r?.layers.get(Po);case"exterior-walls":return r?.layers.get(to);case"interior-doors":return r?.layers.get(Ir);case"exterior-doors":return r?.layers.get(Sr);default:return typeof o=="string"?o:o?.id}};function js(o){return new Promise(e=>{o.onComplete(e),o.onStop(e)})}function $p(o){return o.bbox?o.bbox:cr(o)}function Or(o,e,t){return o.floorId&&e.has(o.floorId)?e.get(o.floorId):t}function Dr(o){if(xe.is(o)||dt.is(o))return o.id}function Yp(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 Jp(o,e){let t=o.properties.path.split("/"),r=t[t.length-1].split(".")[0],n=atob(r);return"img_"+ui(n).toString()+"-"+e}function Ns(o="auto",e,t=1,r){return o!=="auto"?o*t:e!=null?e*t:r!=null?r*t:3*t}function Up(o,e,t,r){if(o.maxHeight!=null&&o.maxHeight>0)return Ns(e,o.maxHeight,t,r);let n=Ns(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 Zp(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=Up(h,e,t,r);if(!n){let v=h.elevation-c-1;v>0&&(s+=v*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=Up(h,e,t,r),v=-(s+g);l.set(h.elevation,{altitude:v,visualHeight:g}),s+=g}return l}function qp(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),v=g?.visualHeight??Ns(t,void 0,r,n),I=h*v,E=g?.altitude??0;s.push({altitude:E-I,height:I,floorAboveElevation:p.elevation,missingCount:h})}l=p.elevation}return s}function wi(o,e){let t=e(o.center);return{center:new z({latitude:t[1],longitude:t[0]}),radius:o.radius}}function Qp(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 Kp=Math.PI*.1,Do=class{id;#e={};#t;#o;constructor(e,t,r,n,i){this.id=i?.id??oe(),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 z(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 z(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;#n;#i;#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.#n=p,this.#i=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.#n=p,this.#i=c}else this.#r==="take"?(l.push(this.#c("ExitConnection",a,i,this.#n,this.#i)),this.#r="exit",this.#n=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?-Hp(e.properties.angle,t.properties.angle):0;return Math.abs(i)>=Kp?{type:"Turn",bearing:Wp(i,Kp),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 ed(o){return co(o)?"navigationTarget"in o&&o.navigationTarget!=null:!1}var Hm={lineOfSight:!0,mode:"absolute-distance",maxResults:1};function td(o){return{...Hm,lineOfSight:!o}}var Ie=new WeakMap;function Ai(o,e,t){let r=td(t),i=e.Query.__LEGACY_NEAREST_SYNC(o,e.getByType("node"),r)?.[0]?.feature.id;return i?[i]:[]}async function Fi(o,e,t){let r=td(t),i=(await e.Query.nearest(o,e.getByType("node"),r))?.[0]?.feature.id;return i?[i]:[]}function Wm(o,e,t){let r=[];for(let n of o.navigationTarget){let i=wo(n,e,t);r.push(...i)}return r}async function zm(o,e,t){let r=[];for(let n of o.navigationTarget){let i=await Ao(n,e,t);r.push(...i)}return r}function od(o,e){let r=e?.getMVFFeatureById("entrance",o.id)?.properties.node;return r?[r]:[]}function rd(o,e){return e?.getMVFFeatureById("area",o.id)?.properties.destinationNodes??[]}function nd(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 Xm(o,e,t){let r=[];for(let n of o.coordinates){let i=Ai(n,e,t);i.length>0&&r.push(i[0])}return r}async function $m(o,e,t){let r=[];for(let n of o.coordinates){let i=await Fi(n,e,t);i.length>0&&r.push(i[0])}return r}function id(o,e){return e?.objectEntranceNodeIdsByObstructionId[o.id]??[]}function ad(o,e){return o.spaces.flatMap(t=>e?.getMVFFeatureById("space",t.id)?.properties.destinationNodes??[]).filter(t=>typeof t=="string")}function sd(o){return o.nodes.map(e=>e.id)}function wo(o,e,t){if(Ie.has(o))return Ie.get(o);if(po.is(o)){let r=Wm(o,e,t);return Ie.set(o,r),r}else if(Gt.is(o)){let r=Ai(o,e,t);return Ie.set(o,r),r}else if(z.is(o)){let r=Ai(o,e,t);return Ie.set(o,r),r}else{if(Tt.is(o))return Ai(o,e,t);if(nt.is(o)){let r=od(o,e);return Ie.set(o,r),r}else if(Ct.is(o)){let r=rd(o,e);return Ie.set(o,r),r}else if(xe.is(o)){let r=nd(o,e);return Ie.set(o,r),r}else if(Je.is(o)){let r=Xm(o,e,t);return Ie.set(o,r),r}else if(dt.is(o)){let r=id(o,e);return Ie.set(o,r),r}else if(Ge.is(o)){let r=ad(o,e);return Ie.set(o,r),r}else if(ct.is(o)){let r=sd(o);return Ie.set(o,r),r}else if(_t.is(o)){let r=[o.id];return Ie.set(o,r),r}else return[]}}async function Ao(o,e,t){if(Ie.has(o))return Ie.get(o);if(po.is(o)){let r=await zm(o,e,t);return Ie.set(o,r),r}else if(Gt.is(o)){let r=await Fi(o,e,t);return Ie.set(o,r),r}else if(z.is(o)){let r=await Fi(o,e,t);return Ie.set(o,r),r}else if(Tt.is(o)){let r=await Fi(o,e,t);return Ie.set(o,r),r}else if(nt.is(o)){let r=od(o,e);return Ie.set(o,r),r}else if(Ct.is(o)){let r=rd(o,e);return Ie.set(o,r),r}else if(xe.is(o)){let r=nd(o,e);return Ie.set(o,r),r}else if(Je.is(o)){let r=await $m(o,e,t);return Ie.set(o,r),r}else if(dt.is(o)){let r=id(o,e);return Ie.set(o,r),r}else{if(Ge.is(o))return ad(o,e);if(ct.is(o)){let r=sd(o);return Ie.set(o,r),r}else if(_t.is(o)){let r=[o.id];return Ie.set(o,r),r}else return[]}}function ld(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 cd(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 ct.is(n)&&(n=ld(n,r)),n}function pd(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 ct.is(n)&&(n=ld(n,r)),n}function Gs(o){if(z.is(o))return o;if(!(!ed(o)||Array.isArray(o.navigationTarget)||!z.is(o.navigationTarget)))return o.navigationTarget}var wr=class{navigator;connections;constructor({nodes:e,geojsonCollection:t,connections:r,groupBy:n,multiplicativeDistanceWeightScaling:i,flagDeclarations:a,getDoorByNodeId:s}){this.navigator=new Mc({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)),xe.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)),xe.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 Ao(p,n,n.enterpriseMode));for(let p of t)a.set(p,await Ao(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,wo(p,n,n.enterpriseMode)])),a=new Map(t.map(p=>[p,wo(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(D=>!r.includes(D)&&!n.includes(D)),c=new Map,p={...i.connectionIdWeightMap};for(let D of i.excludedConnections)p[D.id]=1/0;for(let D in p){let A=a.getById("connection",D);A&&this.#t(A,p[D],c)}let g=(i.smoothing.__EXPERIMENTAL_METHOD??"greedy-los")!=="greedy-los",v=this.navigator.getDirections({zones:i.zones.map(D=>({geometry:D.geometry,cost:D.cost,map:D.floor?.id})),originIds:r,from:g?dd(e):[],to:g?dd(t):[],destinationNodeIds:n,disabledConnectionNodeIds:l,simplify:i.smoothing,overrideEdgeWeights:c,multiplicativeDistanceWeightScaling:!a.enterpriseMode,includeNonPublic:i.includeNonPublic});this.addCoordinateDirections(v,e,t);let I=cd(v,e,s),E=pd(v,t,s),O=new Do(v,a,I,E);if(!(O.distance===0&&new Set([...r,...n]).size===r.length+n.length))return O};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=Gs(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=Gs(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 Ym(o){if(z.is(o))return o.floorId;if(xe.is(o)||nt.is(o)||Tt.is(o)||Gt.is(o)||dt.is(o)||Ct.is(o)||_t.is(o))return o.floor.id;if((Je.is(o)||ct.is(o))&&o.coordinates.length>0)return o.coordinates[0].floorId;if(Ge.is(o)&&o.spaces.length>0)return o.spaces[0].floor.id}function dd(o){return o.reduce((e,t)=>{let r=Co(t);if(!r)return e;let n=Ym(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 Zo from"zod";var Ar=50,Us=1,Hs=!1,ud=Zo.object({limit:Zo.enum(["same-floor","same-elevation","all-floors"]).optional(),mode:Zo.enum(["travel-distance","absolute-distance"]).optional(),lineOfSight:Zo.boolean().optional().or(Zo.literal("auto")),maxDistance:Zo.number().optional(),maxResults:Zo.number().optional()}),fd={lineOfSight:Hs,mode:"travel-distance",maxDistance:Ar,limit:"same-floor",maxResults:Us},bn=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}__LEGACY_NEAREST_SYNC=(e,t,r)=>{let n={...fd,...r};try{ud.parse(n)}catch(p){x.error(p);return}let i=Co(e);if(!i)return;let a=this.#o(i,n),s=[],l={},c=[];for(let p of t){let h=wo(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.#i(e,a,c,l,n),s.sort((p,h)=>p.distance-h.distance)};async nearest(e,t,r){let n={...fd,...r};try{ud.parse(n)}catch(h){x.error(h);return}let i=Co(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(Ao(h,this.#e,this.#e.enterpriseMode).then(g=>{if(g)for(let v of g)l[v]||(l[v]=[]),l[v].push(h),c.push(v)}));await Promise.all(p),s=await this.#n(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??Ar,n?.lineOfSight==="auto"?Hs: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};#n=async(e,t,r,n,i)=>{let a=[];for(let s of t){let l,c=0;if(!_t.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??Ar,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??Ar)-c,s,r,!1,i?.maxResults??Us);for(let g of h)for(let v of n[g.feature.properties.id])p.has(v.id)||(a.push({distance:g.distance+c,feature:v}),p.add(v.id))}}return a};#i=(e,t,r,n,i)=>{let a=[];for(let s of t){let l;if(_t.is(e)||(l=this.__LEGACY_NEAREST_SYNC(e,this.#e.getByType("node"),{lineOfSight:i?.lineOfSight??!0,mode:"absolute-distance",maxDistance:i?.maxDistance??Ar,maxResults:1})?.[0].feature),l){let c=this.#e.directions.navigator.findNearestNodesOnGraph(l.id,i?.maxDistance??Ar,s,r,i?.lineOfSight==="auto"?Hs:i?.lineOfSight,i?.maxResults??Us);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 ki=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:Ec(e,r)}};f();f();f();f();function hd(o){let e=+this._x.call(null,o),t=+this._y.call(null,o);return gd(this.cover(e,t),e,t,o)}function gd(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,v,I,E,O,D,A;if(!i)return o._root=a,o;for(;i.length;)if((E=e>=(h=(s+c)/2))?s=h:c=h,(O=t>=(g=(l+p)/2))?l=g:p=g,n=i,!(i=i[D=O<<1|E]))return n[D]=a,o;if(v=+o._x.call(null,i.data),I=+o._y.call(null,i.data),e===v&&t===I)return a.next=i,n?n[D]=a:o._root=a,o;do n=n?n[D]=new Array(4):o._root=new Array(4),(E=e>=(h=(s+c)/2))?s=h:c=h,(O=t>=(g=(l+p)/2))?l=g:p=g;while((D=O<<1|E)===(A=(I>=g)<<1|v>=h));return n[A]=i,n[D]=a,o}function md(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)gd(this,a[t],s[t],o[t]);return this}f();function yd(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 bd(){var o=[];return this.visit(function(e){if(!e.length)do o.push(e.data);while(e=e.next)}),o}f();function Td(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 Ue(o,e,t,r,n){this.node=o,this.x0=e,this.y0=t,this.x1=r,this.y1=n}function vd(o,e,t){var r,n=this._x0,i=this._y0,a,s,l,c,p=this._x1,h=this._y1,g=[],v=this._root,I,E;for(v&&g.push(new Ue(v,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(!(!(v=I.node)||(a=I.x0)>p||(s=I.y0)>h||(l=I.x1)<n||(c=I.y1)<i))if(v.length){var O=(a+l)/2,D=(s+c)/2;g.push(new Ue(v[3],O,D,l,c),new Ue(v[2],a,D,O,c),new Ue(v[1],O,s,l,D),new Ue(v[0],a,s,O,D)),(E=(e>=D)<<1|o>=O)&&(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,v.data),W=e-+this._y.call(null,v.data),N=A*A+W*W;if(N<t){var B=Math.sqrt(t=N);n=o-B,i=e-B,p=o+B,h=e+B,r=v.data}}return r}f();function Id(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,v,I,E,O,D;if(!t)return this;if(t.length)for(;;){if((I=p>=(g=(a+l)/2))?a=g:l=g,(E=h>=(v=(s+c)/2))?s=v:c=v,e=t,!(t=t[O=E<<1|I]))return this;if(!t.length)break;(e[O+1&3]||e[O+2&3]||e[O+3&3])&&(r=e,D=O)}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[O]=i:delete e[O],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(r?r[D]=t:this._root=t),this):(this._root=i,this)}function Sd(o){for(var e=0,t=o.length;e<t;++e)this.remove(o[e]);return this}f();function Ed(){return this._root}f();function Md(){var o=0;return this.visit(function(e){if(!e.length)do++o;while(e=e.next)}),o}f();function xd(o){var e=[],t,r=this._root,n,i,a,s,l;for(r&&e.push(new Ue(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 Ue(n,c,p,s,l)),(n=r[2])&&e.push(new Ue(n,i,p,c,l)),(n=r[1])&&e.push(new Ue(n,c,a,s,p)),(n=r[0])&&e.push(new Ue(n,i,a,c,p))}return this}f();function _d(o){var e=[],t=[],r;for(this._root&&e.push(new Ue(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 Ue(i,a,s,p,h)),(i=n[1])&&e.push(new Ue(i,p,s,l,h)),(i=n[2])&&e.push(new Ue(i,a,h,p,c)),(i=n[3])&&e.push(new Ue(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 Cd(o){return o[0]}function Pd(o){return arguments.length?(this._x=o,this):this._x}f();function Od(o){return o[1]}function Dd(o){return arguments.length?(this._y=o,this):this._y}function Tn(o,e,t){var r=new Ws(e??Cd,t??Od,NaN,NaN,NaN,NaN);return o==null?r:r.addAll(o)}function Ws(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 wd(o){for(var e={data:o.data},t=e;o=o.next;)t=t.next={data:o.data};return e}var it=Tn.prototype=Ws.prototype;it.copy=function(){var o=new Ws(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=wd(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]=wd(r));return o};it.add=hd;it.addAll=md;it.cover=yd;it.data=bd;it.extent=Td;it.find=vd;it.remove=Id;it.removeAll=Sd;it.root=Ed;it.size=Md;it.visit=xd;it.visitAfter=_d;it.x=Pd;it.y=Dd;f();function zs(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,v]=s[l];e(c,p,h,g,v)||zs(o,e,c,p,h,g,v)}}return!1}var Ad=1e3,Jm=.1,Zm=5,qm=1.5,Li=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=Ad;else r=Ad;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=Zm,v=Math.max(a,this.getMaxSearchRadiusForFloorId(t,n));for(;h.length<l&&g<=v;){let I=this.#o(e,c,i,g,a,p);I.sort((E,O)=>E.distance-O.distance);for(let E of I){if(h.length>=l)break;s?this.#r.directions.navigator.hasLineOfSight(e,E.node.geometry.coordinates,n,Jm)&&h.push(E):h.push(E)}g=g*qm}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,v=[];return zs(t,(I,E,O,D,A)=>{let W=E>=p||O>=g||D<c||A<h;if("data"in I){let N=I;for(;N;){let B=N.data,G=B.properties.parentId||B.properties.id;if(r.includes(G)&&!a.has(G)){a.add(G);let F=Qt(e,B.geometry.coordinates);F<=i&&v.push({node:B,distance:F})}N=N.next}}return W}),v}#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]=Tn();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;case"object":case"location-profile":case"connection":case"area":case"facade":i=this.#n(this.#r.getByType(e),r);break}return i?.length>0&&n.addAll(i),n}#n(e,t){let r=[];for(let n of e){let i=wo(n,this.#r,this.#r.enterpriseMode);for(let a=0;a<i.length;a++){let s=this.#r.mvfNodesById[i[a]];s&&(s.properties.floor??s.properties.map)===t&&r.push({...s,properties:{...s.properties,id:s.properties.id,parentId:n.id}})}}return r}#i;constructor(e,t){this.#r=e,this.#i=t}};f();f();f();f();function Ni(o,e,t=0,r=o.length-1,n=Qm){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),v=Math.max(t,Math.floor(e-c*h/l+g)),I=Math.min(r,Math.floor(e+(l-c)*h/l+g));Ni(o,e,v,I,n)}let i=o[e],a=t,s=r;for(vn(o,t,e),n(o[r],i)>0&&vn(o,t,r);a<s;){for(vn(o,a,s),a++,s--;n(o[a],i)<0;)a++;for(;n(o[s],i)>0;)s--}n(o[t],i)===0?vn(o,t,s):(s++,vn(o,s,r)),s<=e&&(t=s+1),e<=s&&(r=s-1)}}function vn(o,e,t){let r=o[e];o[e]=o[t],o[t]=r}function Qm(o,e){return o<e?-1:o>e?1:0}var En=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(!Bi(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;Bi(e,l)&&(t.leaf?r.push(s):$s(e,l)?this._all(s,r):i.push(s))}t=i.pop()}return r}collides(e){let t=this.data;if(!Bi(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(Bi(e,a)){if(t.leaf||$s(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=kr([]),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=Km(e,r.children,t);if(p!==-1)return r.children.splice(p,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&$s(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=kr(e.slice(t,r+1)),Fr(s,this.toBBox),s;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),s=kr([]),s.leaf=!1,s.height=n;let l=Math.ceil(i/a),c=l*Math.ceil(Math.sqrt(a));Fd(e,t,r,c,this.compareMinX);for(let p=t;p<=r;p+=c){let h=Math.min(p+c-1,r);Fd(e,p,h,l,this.compareMinY);for(let g=p;g<=h;g+=l){let v=Math.min(g+l-1,h);s.children.push(this._build(e,g,v,n-1))}}return Fr(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=Xs(c),h=oy(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),Sn(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=kr(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,Fr(r,this.toBBox),Fr(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,t){this.data=kr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Fr(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=In(e,0,s,this.toBBox),c=In(e,s,r,this.toBBox),p=ry(l,c),h=Xs(l)+Xs(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:ey,i=e.leaf?this.compareMinY:ty,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=In(e,0,t,i),s=In(e,r-t,r,i),l=Ri(a)+Ri(s);for(let c=t;c<r-t;c++){let p=e.children[c];Sn(a,e.leaf?i(p):p),l+=Ri(a)}for(let c=r-t-1;c>=t;c--){let p=e.children[c];Sn(s,e.leaf?i(p):p),l+=Ri(s)}return l}_adjustParentBBoxes(e,t,r){for(let n=r;n>=0;n--)Sn(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():Fr(e[t],this.toBBox)}};function Km(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 Fr(o,e){In(o,0,o.children.length,e,o)}function In(o,e,t,r,n){n||(n=kr(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];Sn(n,o.leaf?r(a):a)}return n}function Sn(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 ey(o,e){return o.minX-e.minX}function ty(o,e){return o.minY-e.minY}function Xs(o){return(o.maxX-o.minX)*(o.maxY-o.minY)}function Ri(o){return o.maxX-o.minX+(o.maxY-o.minY)}function oy(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 ry(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 $s(o,e){return o.minX<=e.minX&&o.minY<=e.minY&&e.maxX<=o.maxX&&e.maxY<=o.maxY}function Bi(o,e){return e.minX<=o.maxX&&e.minY<=o.maxY&&e.maxX>=o.minX&&e.maxY>=o.minY}function kr(o){return{children:o,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Fd(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;Ni(o,a,e,t,n),i.push(e,a,a,t)}}var Vi=class extends En{#e;constructor(e){super(),this.#e=e}toBBox=e=>{let t=e.geoJSONBoundingBox;t==null&&x.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 ji=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 Vi(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 kd(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 Mn=class{#e;#t;#o;#r;constructor(e){let t=kd(e.mapCenter.longitude,e.mapCenter.latitude);this.#o=new Li(e,t),this.#r=new ji(e,t),this.#e=new bn(e,this.#o),this.#t=new ki(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 Gi=class{#e;constructor(e){this.#e=e||[]}get raw(){return this.#e}};var Ys=class o extends Le{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 zo({mvfData:n})):r==="pictures"?this.images=t.mvf2Data.pictures.map(n=>n.url?new eo({mvfData:{...n,url:n.url??""},mapData:this.#e}):void 0).filter(n=>n!=null):r==="website"?t.mvf2Data.website&&(this.website=new zo({mvfData:t.mvf2Data.website})):r==="icon"?t.mvf2Data.icon&&(this.icon=new eo({mvfData:{url:t.mvf2Data.icon},mapData:this.#e})):r==="logo"?t.mvf2Data.logo&&(this.logoImage=new eo({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 Gi(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}}},po=Ys;f();var Js=class o extends Le{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}}},Pi=Js;var Zs=.75;function ny(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:oe()}});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:oe()}});return e}function iy(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=ny(r);for(let s of a)i.push(s)}e[n]={voids:{type:"FeatureCollection",features:i}}}return e}var qo=class extends gt{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??xo();if(this.envControl=r,this.binaryBundle=t?.binaryBundle,this.Analytics=new hr,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=Bp(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=iy(e),this.enterpriseMode||xn()){let i=Rp(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 Fs(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]=cs(l)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new wr({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 Mn(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 z(0,0,"initializing");get mapCenter(){return this.#o.floorId==="initializing"&&(this.#o=new z(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=ui(i+e+r+t.toString());if(this.propTranslationCache.has(c))return this.propTranslationCache.get(c);let p=Tc(n,l,["id"]);return this.propTranslationCache.set(c,p),p}return l}return l}}return n}findPreferredLanguage(e){if(!this.venue)return;let t=qs(this.venue,e);return e?.languageCode!=null&&e.languageCode.toLowerCase()!==t.code.toLowerCase()&&x.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){x.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){x.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){x.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){x.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 Ep(a,{signal:s.signal})}catch(c){x.error(`Failed to download language pack for language code "${n.code}".`,c);return}if(!l||s.signal.aborted)return;i=cs(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=Ld(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],v=this.directions.getDirectionsSync(c,g,l,this);if(!v){x.error("getDirections failed due to missing directions for one of the segments");return}c=g,p.push(v)}return p}else{let c=Array.isArray(e)?e:[e],p=Array.isArray(t)?t:[t];if(Array.isArray(p[0])){x.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){x.error("Unable to get directions",h);return}}};getDirections=async(e,t,r)=>{let{accessible:n=!1}=r||{},i=Ld(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])){x.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){x.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=Co(e),n=Co(t);return Qt([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(!_p(e))return{url:e};if(Cp(e))return{url:e};let t=vr(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 x.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 ts(this.localePacksUrls[n.code],{signal:r.signal}),a=await br(i);a&&t.push({language:{code:n.code,name:n.name},localePack:a})}}catch(i){x.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){x.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 ts(this.localePacksUrls[n.code],{signal:r.signal});i&&t.push({language:{code:n.code,name:n.name},localePack:i})}}catch(i){x.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 Ld=(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??Zs,__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??Zs,__EXPERIMENTAL_METHOD:"rdp",mustIncludeDoorBufferNodes:typeof r=="object"&&r.__EXPERIMENTAL_METHOD==="rdp"?r.__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES:void 0}:{enabled:i,radius:a??Zs,__EXPERIMENTAL_METHOD:s}};f();f();f();f();f();var uo=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 no=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 Qo=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 Fo=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=us(this.coordinates),this.#e)}get focusTarget(){return this.coordinates}toJSON(){return{__type:o.__type,id:this.id,coordinates:this.coordinates,isConnectionSegment:this.isConnectionSegment,distance:this.distance}}},Pt=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 Fo(i.toString(),a))}get distance(){return this.#e?this.#e:(this.#e=us(this.coordinates),this.#e)}toJSON(){return{__type:o.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};f();var ay=7,_n=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t?.precision??ay}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=mi(e.latitude,this.#t),r=mi(e.longitude,this.#t);return new z({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 mi(this.#e.zoomLevel,5)}};f();var fo=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 ho=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 sy=new Map([["search-16x16",`<svg viewBox="0 0 16 16">
|
|
7
7
|
<path
|
|
8
8
|
fillRule="evenodd"
|
|
9
9
|
clipRule="evenodd"
|
|
@@ -197,7 +197,7 @@ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-contr
|
|
|
197
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
198
|
stroke="none"
|
|
199
199
|
/>
|
|
200
|
-
</svg>`]]),
|
|
200
|
+
</svg>`]]),ly=/<svg([^>]*)>/g;function Nd(o,e,t){let r=sy.get(o);return r?r.replace(ly,`<svg$1 style="fill:${e}; width:${t}px; height:${t}px">`):""}var cy=o=>`
|
|
201
201
|
<div class="pin-shadow" style="background: ${o}"></div>
|
|
202
202
|
<svg width="${20*.9}px" height="${48*.9}px" viewBox="0 0 20 48">
|
|
203
203
|
<path
|
|
@@ -207,7 +207,7 @@ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-contr
|
|
|
207
207
|
strokeWidth="2"
|
|
208
208
|
/>
|
|
209
209
|
</svg>
|
|
210
|
-
`,
|
|
210
|
+
`,py=o=>`
|
|
211
211
|
<div class="pin-shadow" style="background: ${o}"></div>
|
|
212
212
|
<svg width="36" height="42" viewBox="-2 -2 40 46">
|
|
213
213
|
<path
|
|
@@ -221,14 +221,14 @@ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-contr
|
|
|
221
221
|
fill="${o}"
|
|
222
222
|
/>
|
|
223
223
|
</svg>
|
|
224
|
-
`,Qs="#722ED1",Ks="#1890FF",
|
|
225
|
-
${o==="departure"?
|
|
226
|
-
</div>`,
|
|
224
|
+
`,Qs="#722ED1",Ks="#1890FF",Rd=({type:o="departure",color:e=Ks,animated:t})=>`<div class="${t===!1?"":"dropped-pin-wrapper"}">
|
|
225
|
+
${o==="departure"?cy(e):py(e)}
|
|
226
|
+
</div>`,dy=o=>{switch(o){case"default":return 28;case"selection":return 28;case"navigation":return 32}},Bd=({type:o="stairs",color:e=Qs,direction:t="up",animated:r})=>{let n=dy("default"),i=n/2+2,a=t&&t!=="none";return`<div class="mappedin-connection-marker">
|
|
227
227
|
<div class="connection-circle"
|
|
228
228
|
role="button"
|
|
229
229
|
style="background:${e}; width:${n}px; height:${n}px;"
|
|
230
230
|
>
|
|
231
|
-
${
|
|
231
|
+
${Nd("connection-"+o+"-16x16","white",i)||""}
|
|
232
232
|
</div>
|
|
233
233
|
${a?`<div style="margin-left: -${n*.2}px;">
|
|
234
234
|
<div class="${r===!1?"":"bouncey"}">
|
|
@@ -248,13 +248,13 @@ See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-contr
|
|
|
248
248
|
</div>
|
|
249
249
|
</div>
|
|
250
250
|
</div>`:""}
|
|
251
|
-
</div>`};f();var Bd=63710088e-1,Ui=new WeakMap,Vd=async o=>new Promise(e=>setTimeout(e,o));function Lr(o,e,t){let r=o.distance;if(r===0)return 0;let n=fy(o,e,t);return n?(r-n.distance)/r:0}function Hi(o,e){if(o.coordinates.length===0)return[];if(Ui.has(o)&&Ui.get(o).has(e))return Ui.get(o).get(e);let t=o.coordinates.map(r=>Nr(r,e));return Ui.set(o,new Map([[e,t]])),t}function Nr(o,e){let t=e.latitude,r=e.longitude,n=o.latitude-t,i=o.longitude-r,a=Math.PI*Bd/180,s=a*Math.cos(t*Math.PI/180),l=i*s,c=n*a;return{x:l,y:c}}function dy(o,e,t){if(o.length===0)return;let r=t??e,n,i=1/0,a=Nr(e,r);for(let s=0;s<o.length;s++){let l=o[s],c=Hi(l,r);for(let p=0;p<c.length-1;p++){let h=c[p],g=c[p+1],v=Cn(h,g,a),I=Ho(a,v);I<i&&(i=I,n=v)}}if(n)return uy(n,r)}function Cn(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 uy(o,e){let r=Math.PI*Bd/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 z({latitude:s,longitude:l,floorId:e.floorId,verticalOffset:e.verticalOffset})}function fy(o,e,t){let r=dy([o],e,t);if(!r)return;let n=Hi(o,t),i=Nr(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=Cn(p,h,i),v=Ho(g,i);v<1&&v<s&&(s=v,a=c)}if(a===-1){let c=0,p=1/0;for(let h=0;h<n.length;h++){let g=n[h],v=Ho(g,i);v<p&&(p=v,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 Ao(`${o.id}_remaining`,l)}function jd(o,e,t){if(o.length===0)return;let r,n=1/0,i=Nr(e,t);for(let a of o){let s=Hi(a,t),l=1/0;for(let c=0;c<s.length-1;c++){let p=s[c],h=s[c+1],g=Cn(p,h,i),v=Ho(g,i);v<l&&(l=v),v<n&&(n=v,r=a)}}return r}function Gd(o,e){let t=o.getState(e);return t?.type==="path"?t.displayArrowsOnPath:!1}function Pn(o,e,t,r){return{highlightStartFraction:t.startHighlightFraction,highlightEndFraction:t.endHighlightFraction,highlightColor:r?.color??"red",highlightWidthMultiplier:r?.widthMultiplier??1,highlightDisplayArrowsOnPath:r?.displayArrowsOnPath??Gd(o,e)}}function On(o,e){return{highlightStartFraction:0,highlightEndFraction:0,highlightCompleteFraction:0,highlightDisplayArrowsOnPath:Gd(o,e)}}function wn(o,e,t,r){let n,i,a=1/0,s=1/0,l=Nr(e,r),c=Nr(t,r);for(let B of o)for(let G of B.segments){if(G.isConnectionSegment)continue;let A=G.coordinates[0]?.floorId,j=A===e.floorId,te=A===t.floorId;if(!j&&!te)continue;let he=Hi(G,r);if(j){let ge=1/0;for(let ie=0;ie<he.length-1;ie++){let Te=he[ie],Be=he[ie+1],Ve=Cn(Te,Be,l),pe=Ho(Ve,l);pe<ge&&(ge=pe)}ge<a&&(a=ge,n=G)}if(te){let ge=1/0;for(let ie=0;ie<he.length-1;ie++){let Te=he[ie],Be=he[ie+1],Ve=Cn(Te,Be,c),pe=Ho(Ve,c);pe<ge&&(ge=pe)}ge<s&&(s=ge,i=G)}}if(!n||!i)return;let p=[];if(n.id===i.id){let B=Lr(n,e,r),G=Lr(i,t,r);return p.push({segment:n,startHighlightFraction:Math.min(B,G),endHighlightFraction:Math.max(B,G)}),p}let h=o.flatMap(B=>B.segments),g=h.findIndex(B=>B.id===n.id),v=h.findIndex(B=>B.id===i.id),I=g>v,E=I?v:g,O=I?g:v,w=I?i.id:n.id,F=I?n.id:i.id,W=I?t:e,N=I?e:t;for(let B=E;B<=O;B++){let G=h[B];G.id===w?p.push({segment:G,startHighlightFraction:Lr(G,W,r),endHighlightFraction:1}):G.id===F?p.push({segment:G,startHighlightFraction:0,endHighlightFraction:Lr(G,N,r)}):p.push({segment:G,startHighlightFraction:0,endHighlightFraction:1})}return p}function Ud([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),O=o*E,w=e,F=t*E,W=r,N=n*E,B=i,G=F-O,A=W-w,j=G*G+A*A;if(j===0)return;if(p=((N-O)*G+(B-w)*A)/j,p<=0)h=[o,e];else if(p>=1)h=[t,r];else{let te=O+p*G,he=w+p*A;h=[te/E,he]}}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=qt([n,i],h),v;if(a){let I=n-h[0],E=i-h[1],O=Math.sqrt(I*I+E*E),w=Math.sqrt(s*s+l*l);if(O>0&&w>0){let W=(I*s+E*l)/(O*w);v=Math.acos(Math.abs(W))*(180/Math.PI)}}return{proportion:a?p:Math.max(0,Math.min(1,p)),intersection:h,distance:g,angle:v}}function Hd(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 hy=10;function gy(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 Wi=class{#e;#t;#o;#r=new Set;#n=new Set;#i;#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.#n.size>0||this.#i!==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??hy,i;for(let N of r.segments){if(N.isConnectionSegment)continue;let B=N.coordinates;for(let G=0;G<B.length-1;G++){let A=B[G],j=B[G+1];if(e.floorId&&!(A.floorId===e.floorId&&j.floorId===e.floorId))continue;let te=Ud([A.longitude,A.latitude],[j.longitude,j.latitude],[e.longitude,e.latitude],!0);te&&(!i||te.distance<i.distance)&&(i={path:r,segment:N,edgeIndex:G,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,v=g.findIndex(N=>N.id===c.id);if(this.#i?.id!==c.id){this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let N=this.#s;if(v>N)for(let B=Math.max(0,N+1);B<=v;B++){let G=g[B];this.#r.has(G)||(this.#e.updateState(G,{visible:!1}),this.#r.add(G))}else if(v<N)for(let B=v+1;B<=N&&B<g.length;B++){let G=g[B];this.#r.has(G)&&(this.#e.updateState(G,{visible:!0}),this.#r.delete(G))}this.#i=c,this.#s=v}else this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let E=c.coordinates,O=E.slice(p+1,E.length),w=new z({latitude:h[1],longitude:h[0],floorId:e.floorId}),F=Hd(w,O,2.5);F.length===0&&O.length>0&&(F=[O[O.length-1]]);let W;if(a)W=[e,w,...F],this.#t=this.#e.createTetheredPath(W,{...this.#e.options.pathOptions,animateDrawing:!1,__EXPERIMENTAL_SMOOTHING_TENSION:.15,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:1.5,...t.tetherPathOptions});else{let N=this.#h(w,e,n);if(W=[N,w,...F],this.#t=this.#e.createTetheredPath(W,{...this.#e.options.pathOptions,animateDrawing:!1,__EXPERIMENTAL_SMOOTHING_TENSION:.15,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:1.5,...t.tetherPathOptions}),s==="tether-and-dash"){let B=gy(t.outsideThresholdPathStyle??"dashed-boxes");this.#o=this.#e.createTetheredPath([e,N],{...this.#e.options.pathOptions,animateDrawing:!1,...B,...t?.outsideThresholdPathOptions})}}return t.hideMarkersOutsideThreshold?this.#e.markers.forEach(N=>{let B=N?.marker;if(!B)return;let G=this.#d(B.coordinate,O,g,v);this.#e.updateState(B,{enabled:G}),G?this.#n.delete(B):this.#n.add(B)}):this.#n.size>0&&this.#l(),W}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.#i=void 0,this.#s=-1,this.#l()}#l(){for(let e of this.#n)this.#e.updateState(e,{enabled:!0});this.#n.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=qt([e.longitude,e.latitude],[t.longitude,t.latitude]);if(r>=n)return new z({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 z({latitude:a,longitude:s,floorId:e.floorId})}};f();var zi=class{#e;#t=new Set;#o;#r=-1;#n=0;#i;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.#n)}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.#i&&this.#i!==r.id&&this.#s(this.#i),this.#i=r.id;let i=this.#e.getMapCenter(),a=r.segments.filter(g=>{if(g.isConnectionSegment)return!1;let v=g.coordinates[0]?.floorId;return!e.floorId||v===e.floorId}),s=jd(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 v=Math.max(0,g+1);v<c;v++){let I=l[v];this.#t.has(I)||(this.#e.updateState(I,{travelledEndFraction:1,travelledColor:n}),this.#t.add(I))}if(g>=0&&g<c){let v=l[g];this.#t.has(v)||(this.#e.updateState(v,{travelledEndFraction:1,travelledColor:n}),this.#t.add(v))}}else if(c<g){for(let v=c+1;v<=g&&v<l.length;v++){let I=l[v];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=Lr(s,e,i);return this.#n=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.#n=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.#n=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.#n=0,this.#i=void 0}};var Wd=.01,zd=.02,Xi=0,Xd={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},my={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},ko={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:Xd,inactivePathOptions:my,markerOptions:{departureColor:Ks,destinationColor:Qs},animatePathDrawing:!0};function Rr(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 yy={...ko,connectionPathOptions:Rr(Xd)},Dn=class{#e=new Map;#t=new Map;#o=new Map;#r;#n;#i=yy;#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 Wi({get activePath(){return t.#l},get options(){return t.#i},get markers(){return t.#e},updateState:(r,n)=>this.#r.updateState(r,n),createTetheredPath:(r,n)=>this.#C(r,n),removeTetheredPath:r=>this.#S(r)}),this.#f=new zi({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 markers(){let e=[];return this.#e.forEach(t=>{t&&e.push({marker:t.marker,type:t.type})}),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){x.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#a[e]){x.warn(`Direction #${e} does not exist`);return}let r=this.#d.get(t);if(!r){x.warn("The direction is not a part of muli-direcional path");return}this.#v(r)}setActivePath(e){if(!this.#a.length){x.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#h.get(e)){x.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:zd});else this.#r.updateState(t,{verticalOffset:Wd})}}setActivePathByDirections(e){if(!this.#a.length){x.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){x.warn("[setActivePathByDirections] Cannot find directions for id");return}t=this.#d.get(r)}if(!t){x.warn("[setActivePathByDirections] Cannot find path for directions");return}this.#v(t)}clearHighlightedPathSection(){this.#n=void 0;for(let e of this.paths)for(let t of e.segments)this.#r.updateState(t,On(this.#r.core,t.id));for(let e of this.#o.values())for(let t of e.segments)this.#r.updateState(t,On(this.#r.core,t.id))}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=this.activePath;if(!a)return;let s=wn([a],e,t,i);if(!s)return;this.clearHighlightedPathSection(),this.#n={from:e,to:t,options:r};for(let p of s)this.#r.updateState(p.segment,Pn(this.#r.core,p.segment.id,p,r));let l=()=>{},c=new Promise(p=>{l=p});if(s.length>0){let p=new ao({fraction:0}).to({fraction:1},n).onUpdate(h=>{for(let g of s)this.#r.updateState(g.segment,{highlightCompleteFraction:h.fraction})}).onComplete(()=>{this.#r.tweenGroup().remove(p),l()});this.#r.tweenGroup().add(p),p.start()}return{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];if(this.#a=r,a?.floorId&&this.#i.setMapToDeparture&&this.#r.setFloor(a.floorId),n.coordinates.length<2){x.warn("Directions must have at least 2 coordinates");return}this.#i.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){x.warn("Directions must have at least 2 coordinates");return}let c=s===Xi,p=c?this.#i.pathOptions:this.#i.inactivePathOptions,h=this.#b(c?"active":"inactive"),g={...Rr(p),animateDrawing:this.#i.animatePathDrawing,verticalOffset:h},v=this.#E(l.coordinates,{...p,animateDrawing:this.#i.animatePathDrawing,verticalOffset:h},g);this.#d.set(l,v),this.#h.set(v,l),this.#i.createMarkers?.connection&&this.#_(l.instructions,"connection"),c&&(this.#l=this.#d.get(this.#a[Xi]),this.#r.externalPubSub.on("click",this.#I))}this.#i.createMarkers?.destination&&this.#g("destination",i.instructions[i.instructions.length-1]),this.#r.mapObjects.forEach(s=>{s.processFloorChange(s.currentFloorId,s.currentFloorStackId)}),this.#T()}#E(e,t,r){let n=t.id?.toString()??oe(),i=this.#r.currentMap.Paths.add(e,t,r),a=new Ct(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}#C(e,t){let r=t.id?.toString()??oe(),n=this.#r.currentMap.Paths.add(e,t),i=new Ct(r,n.animation,e,n.paths);return this.#o.set(r,i),this.#P(i),i}#P(e){if(!this.#n)return;let{from:t,to:r,options:n}=this.#n,i=this.#r.getMapData().mapCenter,a=wn([e],t,r,i);if(a)for(let s of a)this.#r.updateState(s.segment,{...Pn(this.#r.core,s.segment.id,s,n),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.#i.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 ro(i.id.toString(),a,e.coordinate)}#b(e){return e==="active"?zd+(this.#i.pathOptions?.verticalOffset??0):Wd+(this.#i.inactivePathOptions?.verticalOffset??0)}#w(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 Vd(500),n||!e.length){i();return}if(t.coordinates.length<2){x.warn("Directions must have at least 2 coordinates"),i();return}this.#i.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){x.warn("Directions must have at least 2 coordinates"),i();return}let l=a===Xi,c=l?this.#i.pathOptions:this.#i.inactivePathOptions,p=this.#b(l?"active":"inactive"),h={...Rr(c),animateDrawing:this.#i.animatePathDrawing,verticalOffset:p},g=this.#E(s.coordinates,{...c,animateDrawing:this.#i.animatePathDrawing,verticalOffset:p},h);if(this.#d.set(s,g),this.#h.set(g,s),l&&(this.#l=this.#d.get(this.#a[Xi]),this.#r.externalPubSub.on("click",this.#I)),S.env.NODE_ENV!=="test"&&await g.animation,n){i();return}this.#i.createMarkers?.connection&&this.#_(s.instructions,"connection")}if(this.#i.createMarkers?.destination&&this.#g("destination",r.instructions[r.instructions.length-1]),n){i();return}this.#r.mapObjects.forEach(a=>{a.processFloorChange(a.currentFloorId,a.currentFloorStackId)}),this.#T(),i()}),cancel:()=>{n=!0}},this.#s.promise}#x(e){let t={...ko.pathOptions,...e.pathOptions};this.#i={setMapOnConnectionClick:e.setMapOnConnectionClick??ko.setMapOnConnectionClick,setMapToDeparture:e.setMapToDeparture??ko.setMapToDeparture,pathOptions:t,inactivePathOptions:{...ko.inactivePathOptions,...e.inactivePathOptions},connectionPathOptions:Rr(t),createMarkers:{...ko.createMarkers,...e.createMarkers},markerOptions:{...ko.markerOptions,...e.markerOptions},animatePathDrawing:e.animatePathDrawing??ko.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,markers:this.markers})}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.#i.setMapToDeparture&&this.#r.setFloor(i.floorId),this.#w(r)}#v(e){this.#l=e,this.#p==="tethered"?this.#u.clear():this.#p==="travelled"&&this.#f.resetTravelledOnOtherPaths();let t=Rr(this.#i.pathOptions),r=Rr(this.#i.inactivePathOptions);this.#a.forEach(n=>{let i=this.#d.get(n);if(i){let a=i.id===this.#l.id,s={...a?this.#i.pathOptions:this.#i.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.#i.markerOptions.departureColor:this.#i.markerOptions.destinationColor,n;typeof this.#i.createMarkers?.connection=="function"?(n=this.#i.createMarkers.connection(t),this.#r.updateState(n,{interactive:!0})):n=this.#M(t,Rd({type:t.action.connection?.type??t.action.connectionType,color:r,direction:t.action.direction,animated:this.#i.markerOptions.animated}),!0),this.#e.set(n.id,{instruction:t,marker:n,type:e})}else{let r=e==="departure"?this.#i.markerOptions.departureColor:this.#i.markerOptions.destinationColor,n;typeof this.#i.createMarkers?.departure=="function"&&e==="departure"?n=this.#i.createMarkers.departure(t):typeof this.#i.createMarkers?.destination=="function"&&e==="destination"?n=this.#i.createMarkers.destination(t):n=this.#M(t,Nd({type:e,color:r,animated:this.#i.markerOptions.animated})),this.#e.set(n.id,{instruction:t,marker:n,type:e})}}#_(e,t){e.filter(n=>this.#m(n.action)).forEach(n=>{this.#g(t,n)})}#I=e=>{if(this.#i.createMarkers?.connection&&e.markers!=null&&e.markers.length>0){let{instruction:t}=this.#e.get(e.markers[0].id);t?.action.toFloor&&(this.#i.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.#n=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,e.currentFloorStackId)}),this.#T()}};f();var Fn=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 z(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 z.is(e)&&e.floorId!=null?this.#e.getState(e.floorId)?.altitude??t:pt.is(e)?this.#e.getState(e.id)?.altitude??t:"floor"in e&&pt.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(z.is(i)){let a=this.#o(i);t.push([i.longitude,i.latitude,a])}else if(i?.id!=null){if(Cr.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;Da(c.geoJSON,v=>{t.push([v[0],v[1],h]),g!==h&&t.push([v[0],v[1],g])})}continue}let a=this.#o(i);if(pt.is(i)&&this.#t.getMapDataInternal()?.enterpriseMode){t.push(i.id);continue}else if("geoJSON"in i&&i.geoJSON.geometry.coordinates.length>0){Da(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 Pp(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 z(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 Di(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 An=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):(x.error("There is no map to export. Please load a map first."),new Blob)}};f();var kn=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:wr(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 $d=di(Cs(),1);function by(o,e){var t=dr(o),r=dr(e),n=o.properties||{},i=$d.default.difference(t.coordinates,r.coordinates);return i.length===0?null:i.length===1?fi(i[0],n):hi(i,n)}var Yd=by;var Zd=.2,Jd=.1,Ko=kc.UNDERGROUND_MASK,Ty=!1;function qd(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 Qd(o,e){let t=[];if(o.type==="Polygon"){let r=qd(o.coordinates[0]);r&&t.push(r)}else if(o.type==="MultiPolygon")for(let r of o.coordinates){let n=qd(r[0]);n&&t.push(n)}return{type:"Feature",geometry:{type:"MultiLineString",coordinates:t},properties:e||{}}}var Ln=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=no;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(`${yn}-${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=Qd(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:Jd,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=Ko),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=Qd(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:Jd,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=Ko),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=Ko);let r=el(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=el(t),e?.length>0&&(t=vy(t,e));let r="front";this.ceilingId=`Ceiling-${this.config.floorId}`;let n={color:this.footprintColor,height:-Zd,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=Ko),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=_i(t,n);i&&(t=i)}catch{}t=el(t),this.basementMaskId=`Footprint-Basement-Mask-${this.config.floorId}`;let r={color:Kd(-1),altitude:0,visible:!0,height:.01,outline:!1,__EXPERIMENTAL_maskEnabled:!0,__EXPERIMENTAL_maskMode:"mask",__EXPERIMENTAL_maskId:Ko};if(this.renderer.addFeatureCollection(this.basementMaskId,{features:[{...t,properties:{id:`Footprint-Basement-Mask-Geometry-${this.config.floorId}`}}]},r,void 0,"outdoors-container"),Ty){let n={color:Kd(-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??Zd,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 el(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 vy(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=Yd(r,i)}catch(a){x.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 Kd=o=>o===0?"red":o===-1?"blue":o===-2?"green":"black";var Iy={color:"#ffffff",opacity:1},no={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},eu={opacity:.25,color:"#a7d1ec",height:.8,width:.05,cap:"square"},tu=.1,tl={color:"red",opacity:.2,height:no.height+.1,visible:!0,borderVisible:!1},ou=.5,et=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})}},ru=0,Nn=class{id;name;elevation;maxHeight;containerId;externalId;metadata;shortName;subtitle;occluderId;geometryContainer;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){x.warn(`Attempting to get bounding box with no footprint for floor ${this.id}`);return}return this.#e=Xp(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&&x.warn(`Floor ${this.id} exists in the data but contains no geometry.`),this.loaded=!0;let t=this.renderer.addGroupContainer(`${to}-${this.id}`,{},this.id);this.layers.set(to,new et(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer(`${Vt}-${this.id}`,{},this.id);this.layers.set(Vt,new et(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer(`${Ce}-${this.id}`,{},this.id);this.geometryContainer=n,this.layers.set(Ce,new et(this.renderer,n.id.toString()));let i=this.renderer.addGroupContainer(`${oo}-${this.id}`,{},this.id);this.layers.set(oo,new et(this.renderer,i.id.toString()));let a=this.renderer.addGroupContainer(`${jt}-${this.id}`,{},this.id);this.layers.set(jt,new et(this.renderer,a.id.toString()));let s=this.renderer.addGroupContainer(Dp(this.id),{},this.id);if(this.layers.set(Zo,new et(this.renderer,s.id.toString())),this.renderer.addGroupContainer(Oo(this.id),{},s.id.toString()),this.renderer.addGroupContainer(_r(this.id),{},s.id.toString()),this.multiFloorView?.__EXPERIMENTAL_DEBUG_showVoids){let l=0;for(let c of this.voids)this.renderer.addFeatureCollection(`Void-${this.id}-${l}`,{features:[c]},{color:"red"},void 0,n),l++}if(this.multiFloorView?.__EXPERIMENTAL_DEBUG_showOpenToBelow){let l=0;for(let c of this.spacesOpenToBelow)this.renderer.addFeatureCollection(`SpacesOpenToBelow-${this.id}-${l}`,{features:[c]},{color:"blue"},void 0,n),l++}if(this.spaces!=null&&this.spaces.features.length>0){let l=[],c=new Map,p=this.multiFloorView?.__EXPERIMENTAL_excludeSpaceIdsInAutoHeightCalculation,h=p!=null&&p.length>0?new Set(p):void 0;for(let I of this.spaces.features){if(I.geometry.type!=="Polygon")continue;let E=I.properties.kind?.toLowerCase();if(E==="void"||E==="otb")continue;let O=this.styleMap[I.properties.id];if(O!=null&&"height"in O&&O?.height!=null&&(h==null||!h.has(I.properties.id))){let F=(O.altitude??0)+O.height;(this._computedMaxHeight==null||F>this._computedMaxHeight)&&(this._computedMaxHeight=F)}let w=this.mapDataInternal?.facadesBySpaceId[I.properties.id];if(w){let F=c.get(w.id);F==null&&(F=[],c.set(w.id,F)),F.push(I)}else l.push(I)}let g=this.renderer.addGroupContainer(`spaces-${this.id}`,{},n),v=this.renderer.addFeatureCollection(`Spaces-${this.id}-0`,{features:l},I=>I?.properties?.id!=null&&this.styleMap[I.properties.id]!=null?Pr(this.styleMap[I.properties.id],this.options):Iy,void 0,g);if(this.layers.get(Ce).layers.set("Spaces",v.id.toString()),c.size>0){let I=this.renderer.addGroupContainer(`${Yo}-${this.id}`,{},this.id);this.layers.set(Yo,new et(this.renderer,I.id.toString()));for(let[E,O]of c){let w=this.renderer.addGroupContainer(E,{focusable:!0},I),F=this.renderer.addGroupContainer(`${E}-geometry`,{},w),W=zp(O,this.styleMap),N=0;for(let[B,G]of W){let A={...Pr(B,this.options),focusable:e,renderOrder:3},j=this.renderer.addFeatureCollection(`Facades-${this.id}-${E}-${N}`,{features:G},()=>A,void 0,F);N++;let te=B.id||j.id.toString();this.layers.get(Yo).layers.set(`${E}-${te}`,j.id.toString()),this.facadesByStyleId.has(te)?this.facadesByStyleId.get(te)?.push(E):this.facadesByStyleId.set(te,[E])}}}}if(this.footprint?.geometry!=null&&this.footprint.geometry.coordinates.length>0&&this.styleMap!=null&&(this.footprintObject=new Ln(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(yn,new et(this.renderer,this.footprintObject.layer.id.toString())),this.footprint=qp(this.footprint)),this.obstructions!=null&&this.obstructions.features.length>0){let l=this.obstructions.features.filter(F=>F.geometry.type==="Polygon"&&(F.properties.kind==="object"||F.properties.kind==="unknown")),c=this.renderer.addGroupContainer(`objects-${this.id}`,{},n),p=0,h=this.renderer.addFeatureCollection(`Objects-${this.id}-${p}`,{features:l},({properties:F})=>F.id!=null&&this.styleMap[F.id]!=null?Pr(this.styleMap[F.id],this.options):no,void 0,c);p++;let g=c.id.toString();this.layers.get(Ce).layers.set(g,h.id.toString());let v=this.obstructions.features.filter(F=>F.geometry.type==="LineString"&&F.properties.kind?.toLowerCase()==="wall"&&F.properties.footprintComponent===!1),I=this.obstructions.features.filter(F=>F.geometry.type==="LineString"&&F.properties.kind?.toLowerCase()==="wall"&&F.properties.footprintComponent===!0),E=this.entrances,O=no,w=no;if(v!=null&&v.length>0){let F=this.styleMap[v[0].properties?.id];F!=null&&(O={...F}),w=O;let{walls:W,entrances:N}=Bs(v,E?.features||[]),B=Math.max(O.height-.11,ou),G={...eu,height:B},A=this.renderer.addGroupContainer(`${Er}-${this.id}`,{visible:!1,altitude:tu},n);this.layers.set(Er,new et(this.renderer,A.id.toString()));let j=this.renderer.addFeatureCollection(`InteriorDoors-${this.id}`,N,()=>G,void 0,A);this.layers.get(Ce).layers.set(Ir,j.id.toString());let te=Pr(O,this.options),he=this.renderer.addFeatureCollection(`Walls-${this.id}`,{features:[W]},te,void 0,n);this.layers.get(Ce).layers.set(Po,he.id.toString())}if(I!=null&&I.length>0){let F=this.styleMap[I[0].properties?.id];F!=null&&(w={...F,id:eo});let{walls:W,entrances:N}=Bs(I,E?.features||[]),B=Math.max(w.height-.11,ou),G={...eu,height:B},A=this.renderer.addGroupContainer(`${Mr}-${this.id}`,{visible:!1,altitude:tu},n);this.layers.set(Mr,new et(this.renderer,A.id.toString()));let j=this.renderer.addFeatureCollection(`ExteriorDoors-${this.id}`,N,()=>G,void 0,A);this.layers.get(Ce).layers.set(Sr,j.id.toString());let te=Pr(w,this.options),he=this.renderer.addFeatureCollection(`ExteriorWalls-${this.id}`,{features:[W]},te,void 0,n);this.layers.get(Ce).layers.set(eo,he.id.toString())}}if(this.floorImages!=null){let l=this.renderer.addGroupContainer(`images-${this.id}`,{},this.id);for(let c of this.floorImages.features||[]){let p="anchorId"in c.properties?c.properties.anchorId:null,h=p==null,g=p!=null&&this.mapDataInternal!=null&&this.mapDataInternal.pointsOfInterestById[p]!=null;if(h||g){let v=Yp(c,ru),E=((c.properties.rotation??0)%360+360)%360;if(g){let O=new z({latitude:c.geometry.coordinates[1],longitude:c.geometry.coordinates[0],floorId:this.id});this.mapDataInternal.Query.at(O).then(w=>{let F=0;for(let W of w)if(xe.is(W)){let N=this.renderer.getState(W.id)?.height??0;N>F&&(F=N)}this.mapObject.api.Image3D.add(new z({latitude:c.geometry.coordinates[1],longitude:c.geometry.coordinates[0],floorId:this.id,verticalOffset:F}),c.properties.path,{id:v,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...c.properties,rotation:E})})}else this.mapObject.api.Image3D.add(new z({latitude:c.geometry.coordinates[1],longitude:c.geometry.coordinates[0],floorId:this.id}),c.properties.path,{id:v,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...c.properties,rotation:E});ru++}}this.layers.set(xr,new et(this.renderer,l.id.toString()))}if(this.floorText!=null){let l=_r(this.id);for(let c of this.floorText.features||[]){let p=0;"geometryId"in c.properties?p=this.renderer.getState(c.properties.geometryId)?.height??0:p=c.properties.verticalOffset??0,this.renderer.addText3D(oe(),{...c,properties:{...c.properties,verticalOffset:p}},{appearance:{flipToFaceCamera:!1}},l)}}if(this.areas!=null){let l=this.renderer.addGroupContainer(`areas-${this.id}`,{},this.id);this.layers.set($o,new et(this.renderer,l.id.toString()));let c=this.renderer.addFeatureCollection(`Areas-${this.id}`,{features:this.areas.features},()=>({color:tl.color,height:tl.height}),void 0,l);for(let p of this.areas.features||[])this.renderer.setState(p.properties.id,{...tl,visible:!1});this.layers.get($o).layers.set(c.id.toString(),c.id.toString())}return e&&!this.hasFacadeGeometry&&this.addFocusFootprint(),this.renderer.render(),this};addOccluder(){if(this.footprint?.geometry==null)return;let e=this.renderer.addGroupContainer(`${Xo}-${this.id}`,{},this.id),t=new et(this.renderer,e.id.toString());this.layers.set(Xo,t),this.occluderId=this.renderer.addOccluder(this.footprint,t.containerId)}addFocusFootprint(){let e=this.footprint?.geometry;if(e==null)return;let t={type:"FeatureCollection",features:[{type:"Feature",geometry:e,properties:{}}]},r=this.renderer.addFeatureCollection(`${mn}${this.id}`,t,{opacity:0,height:1,color:"white",focusable:!0},void 0,this.geometryContainer),n=this.renderer.getState(r.id);for(let i of n.children)this.renderer.setState(i,{interactive:"pass-through"})}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 Ln(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=no;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 et(this.renderer,this.footprintObject.layer.id.toString());this.layers.set(yn,e)}setGeometryTextBatchVisible(e){this.#t(Oo(this.id),e)}setFloorTextBatchVisible(e){this.#t(_r(this.id),e)}#t(e,t){let r=this.renderer.getInternalState().geometry3DMap.get(e);r&&r instanceof Lc&&this.renderer.getSystems().text3DSystem.setBatchVisible(r,t)}};f();f();var Sy=5,Ey="#ffffff";function My(o,e){return typeof o=="string"?o:o[e]??Ey}function xy(o){return o.spacesOpenToBelow.length>0}function ol(o,e,t){return t?o.find(r=>r.elevation>e):o.find(r=>r.elevation===e+1)}function rl(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,v]of r)g<e.elevation&&v.altitude<c&&(c=v.altitude);let p=l-c+Sy,h=o.sort((g,v)=>g.elevation-v.elevation);for(let g of h){let v=r.get(g.elevation),I=v?.visualHeight??0,E=v?.altitude??0,O=n.opacity??(g.elevation<0?1:.4),w=!1;if(a){let j=g.elevation<e.elevation?ol(o,g.elevation,n.disableGapFilling):void 0;w=j?xy(j):!1}let F={maskEnabled:g.elevation<0,maskId:Ko,maskEffect:"reveal",maskMode:"masked-object"},W=a?g.elevation===e.elevation||w:!1,N=a?g.elevation<e.elevation:g.elevation===e.elevation&&g.elevation<0,B=(e.elevation>=0?g.elevation===0:g.elevation===e.elevation)&&g.floorStack?.type?.toLowerCase()!=="outdoor",G={color:My(n.color,g.id),ceilingVisible:g.elevation<e.elevation,visible:N,basementMaskEnabled:B,outline:n.outline,ceilingThickness:.5,height:I,opacity:O},A={floor:g,state:{type:"floor",altitude:E,visible:W,geometry:a?{visible:W,...F,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}:{...F,visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:G,occlusion:{enabled:!1},areas:{visible:!1},text3d:{visible:!0,geometryText:{visible:!1},floorText:{visible:W}},images:{visible:!1,collisionsEnabled:g.id===e.id},paths:{visible:!1},models:{visible:!1}}};i.floorStates.push(A),g.id===e.id?(A.state.visible=!0,A.state.images.visible=!0,A.state.paths.visible=!0,A.state.geometry.visible=!0,A.state.models.visible=!0,A.state.labels.enabled=!0,A.state.markers.enabled=!0,A.state.occlusion.enabled=!0,A.state.areas.visible=!0,A.state.text3d.geometryText.visible=!0,A.state.text3d.floorText.visible=!0,g.elevation<0&&(A.state.footprint.height=-E,A.state.footprint.visible=!0,i.outdoorOpacity=.2)):t.includes(g.id)&&g.elevation<e.elevation?(A.state.visible=!0,A.state.geometry.visible=w||O<1,A.state.models.visible=!0,A.state.paths.visible=!0,A.state.markers.enabled=!0,A.state.occlusion.enabled=!0,A.state.footprint.visible=!0,A.state.footprint.height=I,g.elevation<0&&(i.outdoorOpacity=.2)):e.elevation>0&&g.elevation<e.elevation&&g.elevation>=0&&(A.state.visible=!0,A.state.footprint.visible=!0,A.state.footprint.height=I)}return i}var Rn=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 De(`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)){x.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((r,n)=>r.elevation-n.elevation);for(let r of this.floorObjects)r.load(this.facade!=null),!this.isOutdoors&&!r.hasFacadeGeometry&&r.footprint!=null&&r.addOccluder();if(this.altitudeMap=Zp(this.floorObjects,e?.floorGap,e?.floorGapMultiplier,e?.floorGapFallback,e?.__EXPERIMENTAL_disableGapFilling),e?.enabled)for(let r of this.floorObjects){let n=this.altitudeMap.get(r.elevation);n&&this.renderer.setState(r.id,{altitude:n.altitude})}if(this.isOutdoors||!e?.enabled)return;let t=e?.__EXPERIMENTAL_disableGapFilling===!0;for(let r of this.floorObjects){let n=ol(this.floorObjects,r.elevation,t),i=[];if(r.spacesOpenToBelowEnabled){for(let s of r.voids)i.push(s);if(n)for(let s of n.spacesOpenToBelow)i.push(s)}let a=r.elevation<0;r.spacesOpenToBelowEnabled&&i.length>0||a?(r.buildCeiling(i),r.buildFootprint()):r.buildExtrudedPolygon(),r.elevation<=0&&r.buildBasementMask()}if(!e.__EXPERIMENTAL_disableGapFilling){let r=Jp(this.floorObjects,this.altitudeMap,e.floorGap,e.floorGapMultiplier,e.floorGapFallback);for(let n of r){let i=this.floorObjectsByElevation.get(n.floorAboveElevation);if(!i)continue;let a=i.spacesOpenToBelow;i.buildGapFootprint(n.height,a)}}}};f();import Y from"zod";f();import{z as nu}from"zod";function iu(o){try{let e=o.shape;if("type"in e){let t=e.type;if(t instanceof nu.ZodOptional&&(t=t._def.innerType),"value"in t)return String(t.value);if(t instanceof nu.ZodDefault&&"value"in t._def.innerType)return String(t._def.innerType.value)}return"unknown"}catch{return"unknown"}}function au(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 su(o,e){let t=Object.entries(o);if(t.length>0){let r=t.map(([n,i])=>`${n}: ${i.join(", ")}`).join("; ");x.warn(`${t.length} invalid field(s) in ${e??"unknown"} state: [${r}]`)}}function fe(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=au(r);t?.warn&&su(n,iu(o));let i={};for(let a of Object.keys(e))!(a in n)&&a in o.shape&&(i[a]=e[a]);return i}function He(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=au(r);su(n,iu(o))}return e}var lu="path",Pt={color:"#4b90e2",width:1,completeFraction:0,visible:!0,interactive:!1,verticalOffset:.1,xrayOpacity:.25,__EXPERIMENTAL_SMOOTHING_TENSION:La.tension,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:La.cornerRadius,dashed:!1,__EXPERIMENTAL_ENDCAP_EXTENSION:[.5,.5],__EXPERIMENTAL_BILLBOARDING:80,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:!1},nl=Y.object({type:Y.literal(lu).default(lu),color:Y.string().default(Pt.color),width:Y.union([Y.number(),Y.string().regex(ka),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(ka)).nonempty()]),easing:Y.string().optional()})]),completeFraction:Y.number().default(Pt.completeFraction),visible:Y.boolean().default(Pt.visible),interactive:Y.boolean().default(Pt.interactive),verticalOffset:Y.number().default(Pt.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),highlightDisplayArrowsOnPath:Y.boolean().default(!1),xrayOpacity:Y.number().min(0).max(1).default(Pt.xrayOpacity),travelledEndFraction:Y.number().default(0),travelledColor:Y.string().default("#999"),__EXPERIMENTAL_SMOOTHING_TENSION:Y.number().default(Pt.__EXPERIMENTAL_SMOOTHING_TENSION),__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:Y.number().default(Pt.__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS),dashed:Y.boolean().default(Pt.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(Pt.__EXPERIMENTAL_ENDCAP_EXTENSION),__EXPERIMENTAL_BILLBOARDING:Y.union([Y.boolean(),Y.number().min(0).max(90)]).default(Pt.__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(Pt.__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()}),il=nl.partial(),f5=Y.strictObject(nl.shape);function cu(o){let{color:e,visible:t,interactive:r,width:n,verticalOffset:i,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:p,highlightCompleteFraction:h,highlightDisplayArrowsOnPath:g,travelledEndFraction:v,travelledColor:I,xrayOpacity:E,xrayStyle:O,smoothingTension:w,smoothingCornerRadius:F,dashed:W,dashLength:N,dashGap:B,dashRelativeToWidth:G,dashSize:A,gapSize:j,dashAbsolute:te,dashMeters:he,gapMeters:ge,__EXPERIMENTAL_GEOMETRY:ie,__EXPERIMENTAL_ENDCAP_EXTENSION:Te,__EXPERIMENTAL_BILLBOARDING:Be,__EXPERIMENTAL_BORDER:Ve,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:pe}=o,$e={};E!==void 0&&($e.opacity=E),O?.color!==void 0&&($e.color=O.color),O?.tint!==void 0&&($e.tint=O.tint),O?.dithering!==void 0&&($e.dithering=O.dithering);let wt=Object.keys($e).length>0?$e:void 0,ot;return te?ot={__EXPERIMENTAL_DASH_MODE:"absolute",__EXPERIMENTAL_DASH_METERS:he,__EXPERIMENTAL_GAP_METERS:ge}:G?ot={__EXPERIMENTAL_DASH_MODE:"width-scaling",__EXPERIMENTAL_DASH_SIZE:A,__EXPERIMENTAL_GAP_SIZE:j}:ot={__EXPERIMENTAL_DASH_MODE:"length-scaling",__EXPERIMENTAL_DASH_LENGTH:N,__EXPERIMENTAL_DASH_GAP:B},He(nl,{color:e,visible:t,interactive:r,width:n,verticalOffset:i,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:p,highlightCompleteFraction:h,highlightDisplayArrowsOnPath:g,travelledEndFraction:v,travelledColor:I,xrayOpacity:E,__EXPERIMENTAL_XRAY_STYLE:wt,__EXPERIMENTAL_SMOOTHING_TENSION:w,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:F,dashed:W,__EXPERIMENTAL_DASH_OPTIONS:ot,__EXPERIMENTAL_GEOMETRY:ie,__EXPERIMENTAL_ENDCAP_EXTENSION:Te,__EXPERIMENTAL_BILLBOARDING:Be,__EXPERIMENTAL_BORDER:Ve,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:pe})}function Br(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 Bn=class extends gt{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 De(`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){x.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){x.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 De(`Floor with id "${this.currentFloorId}" not found`);return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e,t){if(this.api.manualFloorVisibility===!0)return;let r=this.api.getMapDataInternal()?.getById("floor",e),n=this.api.getMapDataInternal()?.getById("floor-stack",t);if(r&&n){let i=r.floorStack.id===n?.id,a=this.api.getMapDataInternal()?.getById("floor-stack",r.floorStack.id);if(this.#n?.enabled&&a){if(!i)for(let l of this.floorStacksById.values())l.id!==a.id&&l.floorObjects.forEach(c=>{c.setVisible(!1)});let s=rl(a.floors,r,this.api.Navigation?.floors?.map(l=>l.id)||[],this.getFloorStackAltitudeData(a.id),{color:this.#n.footprintColor??no.color,opacity:this.#n.footprintOpacity,outline:this.#n.footprintOutline??!0,disableGapFilling:this.#n.__EXPERIMENTAL_disableGapFilling===!0,spacesOpenToBelowEnabled:this.#n.spacesOpenToBelowEnabled??!1,spacesOpenToBelowVisualEffectEnabled:this.#n.spacesOpenToBelowVisualEffectEnabled,spacesOpenToBelowVisualEffectDarkenAmount:this.#n.spacesOpenToBelowVisualEffectDarkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#n.spacesOpenToBelowVisualEffectDarkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:this.#n.spacesOpenToBelowVisualEffectDesaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#n.spacesOpenToBelowVisualEffectDesaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:this.#n.spacesOpenToBelowVisualEffectWashOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#n.spacesOpenToBelowVisualEffectWashOutUseDepth});if(this.api?.Outdoor?.setOpacity(s.outdoorOpacity),s.floorStates.forEach(l=>{if(l.floor){let c=this.api.getMapData()?.getById("floor",l.floor.id);c&&this.api.updateState(c,l.state)}}),this.#n.updateCameraElevationOnFloorChange){let l=this.getFloorStackAltitudeData(a.id);this.api.Camera.setElevation(l.get(r.elevation)?.altitude??0)}}else for(let s of this.floorStacksById.values())s.floorObjects.forEach(l=>{l.id!==e&&l.setVisible(!1)})}}updateMultiFloorViewEffects(e){this.#n={...this.#n,...e},this.processFloorChange(this.currentFloorId,this.currentFloorStackId)}getMultiFloorViewEffects(){return{spacesOpenToBelowVisualEffectEnabled:this.#n.spacesOpenToBelowVisualEffectEnabled??!0,spacesOpenToBelowVisualEffectDarkenAmount:this.#n.spacesOpenToBelowVisualEffectDarkenAmount??.2,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#n.spacesOpenToBelowVisualEffectDarkenUseDepth??!0,spacesOpenToBelowVisualEffectDesaturateAmount:this.#n.spacesOpenToBelowVisualEffectDesaturateAmount??0,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#n.spacesOpenToBelowVisualEffectDesaturateUseDepth??!0,spacesOpenToBelowVisualEffectWashOutAmount:this.#n.spacesOpenToBelowVisualEffectWashOutAmount??0,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#n.spacesOpenToBelowVisualEffectWashOutUseDepth??!1}}#e;setFloor(e,t){if(this.currentFloorId===e)return;let r=this.floorsById.get(e);if(!r){x.error(`Invalid floor passed to setFloor (${e}), the floor was not changed. Current floor is still ${this.currentFloor.id}`);return}let n=this.currentFloorId,i=this.currentFloorStackId;this.currentFloorId=e,this.currentFloorStackId=r.floorStackId,this.publish("floor-change-start",{previousFloorId:n,floorId:e,reason:t}),this.#e&&(x.warn(`setFloor(${e}) called while a previous setFloor handler is in-flight; the earlier change will be discarded`),this.#e.abort(),this.#e=void 0);let a=this.api.__EXPERIMENTAL__floorHandler;if(typeof a=="function"){let s=this.api.getMapDataInternal(),l=s?.getById("floor",e);if(!l){x.error("setFloor: unable to resolve public Floor; bypassing override handler and committing synchronously"),this.#o(e,r,i,n,t);return}let c=s?.getById("floor",n);r.setVisible(!0);let p=new AbortController,h=a(l,{reason:t,previousFloor:c,signal:p.signal}),g=h!=null&&typeof h.then=="function"?h:void 0;if(!g){this.#r(e,n,t);return}this.#e=p,this.#t(g,p,e,n,t)}else this.#o(e,r,i,n,t)}#t(e,t,r,n,i){e.catch(a=>{x.error("setFloor override handler threw \u2014 completing floor change anyway",a)}).finally(()=>{if(t.signal.aborted){x.warn(`setFloor(${r}) discarded \u2014 superseded by a newer floor change`);return}this.#e===t&&(this.#e=void 0),this.#r(r,n,i)})}#o(e,t,r,n,i){this.currentFloorStack&&this.processFloorChange(e,r),t.setVisible(!0),this.#r(e,n,i)}#r(e,t,r){this.updateOutdoorPathLayerVisibility(),this.publish("floor-change",{reason:r,floorId:e,previousFloorId:t})}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(oo);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(jt),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:oe(),rotation:r.rotation,scale:c.scale,interactive:r.interactive},geometry:{type:"Point",coordinates:vt(h)}}))},c,{parent:l?.containerId??s?.id});if(p==null)throw new De("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??oe(),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=Or(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(Vt),c=this.renderer.addMarker2D(vt(e),t,{...s,occluderId:n?.occluderId,attachTo:i},l?.containerId);if(!c)throw new De("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){x.error(`Failed to retrieve state for Marker with id "${e}".`);return}if(n.type!=="marker"){x.error(`Geometry with id "${e}" is not of type "marker".`);return}this.renderer.setState(n,{position:t,parent:i?.layers.get(Vt)?.containerId})},animateTo:(e,t,r,n)=>{let i=this.renderer.getState(e),a=r?this.floorsById.get(r):this.currentFloor;if(!i)return x.error(`Failed to retrieve state for Marker with id "${e}".`),Promise.resolve();if(i.type!=="marker")return x.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(ur[s.easing]).onUpdate(({lon:c,lat:p})=>{if(!this.renderer.getState(e))this.cancelAnimation(e);else{let g=a?.layers.get(Vt)?.containerId;g&&this.Markers.setPosition(e,[c,p],g)}}).start();return this.renderer.getInternalTweenGroup().add(l),this.renderer.render(),this.animations.set(e,l),js(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-"+oe(),{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){x.warn("Enterprise mode is not enabled, skipping label creation");return}let n=pu(this.renderer,e,t,r);if(n)return{textInfo:n,target:e}},labelAll:(e={})=>{if(!this.api.getMapDataInternal()?.enterpriseMode)return x.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=pu(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=Or(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:vt(e)}},g=oe();return this.renderer.addText3D(g,h,{appearance:{...i,fontSize:a,color:s,font:l||void 0}},Oo(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},v=(n?this.floorsById.get(n):this.currentFloor).layers.get(to);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:wr(s)},xe.is(s)?s.id:v?.containerId);I&&e(I.id,s.name,s)}})}},add:(e,t,r={})=>{let{attachTo:n,...i}=r,a=Or(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),s=a.layers.get(to),l=this.renderer.addLabel2D(vt(e),t,{...i,occluderId:a.occluderId,attachTo:n},s?.containerId);if(!l)throw new De("label creating failed");return l},remove:({entityId:e})=>{this.renderer.remove(e)},removeAll:()=>{}};Paths={add:(e,t,r)=>{let n=t?Br(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:v}=p;h!==s&&(l++,s=h),a[l]==null&&a.push({floorId:h,coordinates:[]});let I=p.floorId===h?p:new z({longitude:v,latitude:g,floorId:h});a[l].coordinates.push(I)}let c=a.reduce((p,{floorId:h,coordinates:g},v)=>{if(v!==0){let O=a[v-1],w=O.coordinates[O.coordinates.length-1],F=g[0],W=vt(w),N=vt(F),B=this.floorsById.get(O.floorId),G=this.floorsById.get(h),A=B?.floorStackId,j=G?.floorStackId,te=A?this.getFloorStackAltitudeData(A):void 0,he=j?this.getFloorStackAltitudeData(j):void 0,ge=te?.get(B?.elevation??0)?.altitude??0,ie=he?.get(G?.elevation??0)?.altitude??0,Te=r?.__EXPERIMENTAL_JUNCTION_INSET??0;Ls(W,N,Te,ge,ie);let Be=r?Br(r):n,Ve=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:O.floorId},geometry:{type:"Point",coordinates:W}},{type:"Feature",properties:{parentId:h},geometry:{type:"Point",coordinates:N}}]},Be,this.id);Ve&&(i&&this.renderer.setState(Ve.id,{completeFraction:0}),p.push({...Ve,coordinates:[w,F]}))}if(g.length<2)return p;let I=this.floorsById.get(h)?.layers.get(oo)?.containerId,E=this.renderer.addPath({type:"FeatureCollection",features:g.map(O=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:vt(O)}}))},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 v=$p(g,h,this.api);p.push(new ao({fraction:0}).to({fraction:1},v?t?.drawDuration??1500:0).onUpdate(I=>{this.renderer.setState(g.id,{completeFraction:I.fraction})}))}),p.forEach((g,v)=>{v<p.length-1&&g.chain(p[v+1]),this.renderer.getInternalTweenGroup().add(g)}),p[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),p[0]),{paths:c,animation:js(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)})}};#n={enabled:!1,floorGap:"auto",updateCameraElevationOnFloorChange:!0,footprintColor:no.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=Wp(this.mvf["styles.json"]||{});if(this.styleMap=i,this.#n={...this.#n,...r?.multiFloorView},!t){this.id!=="outdoors-container"&&x.warn(`Map (${this.id}) created with no data.`);let l=new Rn({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 Nn(l.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,this.#n,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 De("MVF does not contain any Floor Stacks.");for(let l of a){let c=new Rn(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 Nn(c.id,h,this,this.#n,r??{},this.mvf,i,t);this.floorsById.set(g.id,g),c.addFloor(g)}}if(c.floorObjects.length<1){x.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=hn(r.initialFloor);l&&this.floorsById.has(l)?s=l:x.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.#n)}};function pu(o,e,t,r){return o.labelText3D(e.id,t??e.name,{...r,parentId:Oo(e.floor.id)})}f();var Vn=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:wr(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 ro(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){x.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){x.error("Cannot determine the current map.");return}let i=this.#e.get(e.id);if(!i){x.error(`Cannot find the Marker with id "${e.id}".`);return}n.Markers.setPosition(i.entityId,vt(r),r.floorId??n.currentFloorId),i.marker.updateTarget(t)}animateTo(e,t,r){let n=t.anchorTarget;if(!n)return x.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return x.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,vt(n),n.floorId??i.currentFloorId,r)):(x.error(`Cannot find the Marker with id "${e.id}".`),Promise.resolve())}};f();var jn=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(vt(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 bt(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 Gn=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 x.error("Cannot determine coordinate from options."),l;let p=Or(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=oe();a.Models.add(p,l,{...r,url:t,floorId:c,verticalOffset:l[0].verticalOffset+(r?.verticalOffset??0)}).forEach(g=>{let v=new Qo(g.toString(),p,l[0]);this.#e.set(v.id,{model:v,entityId:g.toString(),groupId:p}),s.push(v)})}),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 z({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 Un=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 Ct(t?.id||oe(),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=wn([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(()=>{let h=this.currentMap?.api.core;if(h)for(let g of a)this.currentMap?.api.updateState(g.segment,Pn(h,g.segment.id,g,n))}).onComplete(()=>{l(),this.currentMap?.api.removeTween(p)});return this.currentMap?.api.tweenGroup().add(p),p.start(),{animation:c}}clearHighlightedPathSection(e){let t=this.currentMap?.api.core;if(t)for(let r of e.segments)this.currentMap?.api.updateState(r,On(t,r.id))}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 Hn=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 Wn=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(Ce))continue;let n=r.layers.get(Ce);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===Po&&!(eo in e)){let s=n.layers.get(eo);s&&"color"in e[t]&&this.currentMap?.renderer.setState(s,{color:e[t].color})}if(!r.layers.has(Yo))continue;let i=r.layers.get(Yo),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 al={opacity:1},_y=["flyTo","jumpTo","easeTo","panTo","panBy","zoomTo","zoomIn","zoomOut","setZoom","setCenter","setCenterClampedToGround","setCenterElevation","setBearing","setPitch","setRoll","rotateTo","resetNorth","resetNorthPitch","snapToNorth","setPadding","fitBounds","fitScreenCoordinates"],Cy=new Set(_y),Vr=class{#e;#t=[];#o={opacity:"initial"};#r={opacity:new Map};#n=new Set;#i=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")??al.opacity,e.getPaintProperty(r.id,"text-opacity")??al.opacity]):this.#r.opacity.set(r.id,[e.getPaintProperty(r.id,`${r.type}-opacity`)??al.opacity,void 0])))})}#c(){Object.values(this.#r).forEach(e=>e.clear())}setStyle(e){if(this.#e.map){this.#e.map?.setStyle(e),this.#n.size&&(this.#n.clear(),this.hide()),this.#c(),this.#s(this.#e.map),this.setOpacity(this.#o.opacity),this.#e.map?.moveLayer(Pc),this.#t.length>1&&x.error(`Outdoor.setStyle: ${this.#t.length} hiddenOutdoorGeometry entries; multi-map covering is not supported yet (only the last map's footprints will be reapplied).`);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.#i.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"&&(Cy.has(s)?r[s]=(...c)=>(n.has(s)||(n.add(s),x.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.#i.set(e,r),r}get enabled(){return!!this.#e.map}get visible(){return this.#n.size===0}show(){let e=this.#e.map;if(!e)return;let t=e.getStyle().layers;t&&(t.forEach(r=>{this.#n.has(r.id)&&e.setLayoutProperty(r.id,"visibility","visible")}),this.#n.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.#n.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){x.warn("Error setting opacity:",s)}})})}};f();function Py(){Dc(!1)}var zn=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(xe.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(!z.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 x.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 Ut from"zod";var du="doors",sl=Ut.object({type:Ut.literal(du).default(du),color:Ut.string().default("#ffffff"),topColor:Ut.string().optional(),texture:Ut.object({url:Ut.string().optional()}).optional(),topTexture:Ut.object({url:Ut.string().optional()}).optional(),visible:Ut.boolean().default(!1),opacity:Ut.number().default(1)}),$i=sl.partial(),y_=Ut.strictObject(sl.shape);function uu(o,e){let{color:t,topColor:r,texture:n,topTexture:i,opacity:a}=o,s=e?.visible??!1;return He(sl,{visible:s,color:t,topColor:r,opacity:a,texture:n?{url:n}:void 0,topTexture:i?{url:i}:void 0})}function ll(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 fu(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 Xn}from"zod";var hu="facade",cl=Xn.object({type:Xn.literal(hu).default(hu),opacity:Xn.number().default(1),visible:Xn.boolean().default(!0)}),gu=cl.partial(),S_=Xn.strictObject(cl.shape);function mu(o){return He(cl,{opacity:o.opacity,visible:o.visible})}f();import{z as $}from"zod";var Ht="floor",yu=`${Ht}.footprint`,bu=`${Ht}.geometry`,Tu=`${Ht}.labels`,vu=`${Ht}.markers`,Iu=`${Ht}.images`,Su=`${Ht}.occlusion`,Eu=`${Ht}.paths`,Mu=`${Ht}.areas`,xu=`${Ht}.models`,er=$.object({type:$.literal(yu).default(yu),altitude:$.number().default(0),visible:$.boolean().default(!1),height:$.number().default(0),opacity:$.number().default(1),side:$.enum(["double","front","back"]).default("double"),color:$.string().default("#ffffff"),ceilingVisible:$.boolean().default(!0),basementMaskEnabled:$.boolean().default(!1),outline:$.boolean().default(!0),ceilingThickness:$.number().default(.2)}),O_=er.partial(),Yi=$.object({type:$.literal(bu).default(bu),opacity:$.number().default(1),visible:$.boolean().default(!0),maskId:$.number().nullable().default(null),maskEffect:$.enum(["hide","reveal"]).default("hide"),maskMode:$.enum(["mask","masked-object"]).default("mask"),maskEnabled:$.boolean().default(!1),effectStart:$.number().default(0),effectDistance:$.number().default(0),darkenAmount:$.number().default(0),darkenUseDepth:$.boolean().default(!0),desaturateAmount:$.number().default(0),desaturateUseDepth:$.boolean().default(!0),washOutAmount:$.number().default(0),washOutUseDepth:$.boolean().default(!1)}),Cu=Yi.partial(),Zi=$.object({type:$.literal(Tu).default(Tu),enabled:$.boolean().default(!0)}),Pu=Zi.partial(),Ji=$.object({type:$.literal(vu).default(vu),enabled:$.boolean().default(!0)}),Ou=Ji.partial(),qi=$.object({type:$.literal(Iu).default(Iu),visible:$.boolean().default(!0),collisionsEnabled:$.boolean().default(!1)}),wu=qi.partial(),Qi=$.object({type:$.literal(Su).default(Su),enabled:$.boolean().default(!0)}),Du=Qi.partial(),Ki=$.object({type:$.literal(Eu).default(Eu),visible:$.boolean().default(!0)}),Fu=Ki.partial(),ea=$.object({type:$.literal(Ht).default(Ht),visible:$.boolean().default(!1),altitude:$.number().default(0)}),ta=$.object({type:$.literal(Mu).default(Mu),visible:$.boolean().default(!0)}),Au=ta.partial(),Oy=$.object({visible:$.boolean().default(!0)}),wy=$.object({visible:$.boolean().default(!0)}),oa=$.object({visible:$.boolean().default(!0),geometryText:Oy.default({visible:!0}),floorText:wy.default({visible:!0})}),ku=oa.partial(),ra=$.object({type:$.literal(xu).default(xu),visible:$.boolean().default(!0)}),Lu=ra.partial(),Dy=$.object({...ea.shape,geometry:Yi,labels:Zi,markers:Ji,images:qi,footprint:er,occlusion:Qi,paths:Ki,areas:ta,text3d:oa,models:ra}),Nu=ea.partial(),w_=$.object({...ea.shape,geometry:Yi.partial(),labels:Zi.partial(),markers:Ji.partial(),images:qi.partial(),footprint:er.partial(),occlusion:Qi.partial(),paths:Ki.partial(),areas:ta.partial(),text3d:oa.partial(),models:ra.partial()}).partial(),D_=$.strictObject({...ea.shape,geometry:$.strictObject(Yi.shape),labels:$.strictObject(Zi.shape),markers:$.strictObject(Ji.shape),images:$.strictObject(qi.shape),footprint:$.strictObject(er.shape),occlusion:$.strictObject(Qi.shape),paths:$.strictObject(Ki.shape),areas:$.strictObject(ta.shape),text3d:$.strictObject(oa.shape),models:$.strictObject(ra.shape)});function _u(o,e){let t=o?.getInternalState().geometry3DMap.get(e);if(t?.type!=="group-container")return!0;let r=t,n=o?.getSystems().text3DSystem;return n?.getBatchedText(r)?.visible??n?.getBatchVisible(r)??!0}function Ru(o,e,t){if(!e){x.error("Floor is not defined. Cannot get floor state.");return}let r=e.layers.get(Ce),n=r?t?.getState(r.containerId):void 0,i=e.layers.get(to),a=e.layers.get(Vt),s=e.footprintObject?.getState(),l=e.layers.get(Xo),c=l?t?.getState(l.containerId):void 0,p=e.layers.get(xr),h=p?t?.getState(p.containerId):void 0,g=!1;if(r?.layers)for(let ge of r.layers.values()){let ie=t?.getState(ge);if(ie?.children?.[0]){g=t?.getState(ie.children[0])?.enableImageCollisions??!1;break}}let v=e.layers.get(oo),I=v?t?.getState(v.containerId):void 0,E=e.layers.get($o),O=E?t?.getState(E.containerId):void 0,w=e.layers.get(jt),F=w?t?.getState(w.containerId):void 0,W=!0,N=!0,B=!0,G=!0;for(let[,ge]of r.layers){let ie=t?.getState(ge);ie?.maskId||(W=!1),ie?.maskEffect||(N=!1),ie?.maskMode||(B=!1),ie?.maskEnabled||(G=!1)}let A=e.layers.get(Zo),j=A?t?.getState(A.containerId):void 0,te=_u(t,Oo(e.id)),he=_u(t,_r(e.id));return He(Dy,{geometry:{opacity:n?.opacity,visible:n?.visible,maskId:W,maskEffect:N,maskMode:B,maskEnabled:G},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:O?.visible},text3d:{visible:j?.visible,geometryText:{visible:te},floorText:{visible:he}},models:{visible:F?.visible},visible:o.visible,altitude:o.altitude})}f();import{z as be}from"zod";var Bu="geometry",pl=be.object({type:be.literal(Bu).default(Bu),visible:be.boolean().default(!0),color:be.union([be.string(),be.literal("initial")]).default("#ffffff"),topColor:be.union([be.string(),be.literal("initial")]).optional(),hoverColor:be.union([be.string(),be.literal("initial")]).optional(),interactive:be.union([be.boolean(),be.literal("pass-through")]).default(!1),opacity:be.number().default(1),height:be.number().default(0),altitude:be.number().default(0),texture:be.object({url:be.string()}).optional(),topTexture:be.object({url:be.string()}).optional(),flipImageToFaceCamera:be.boolean().default(!1),enableImageCollisions:be.boolean().default(!1),borderVisible:be.boolean().default(!1),borderColor:be.string().optional(),borderWidth:be.number().optional()}),dl=pl.partial(),N_=be.strictObject(pl.shape);function Vu(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:v,borderColor:I,borderWidth:E}=o;return He(pl,{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:v,borderColor:I,borderWidth:E})}function ju(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 Ot from"zod";var ul="label",Fy=Ot.object({type:Ot.literal(ul).default(ul),text:Ot.string(),rank:Ot.custom(o=>bi.safeParse(o).success||o==="initial"),appearance:Ot.custom(o=>Fc.safeParse(o).success),interactive:Ot.boolean().default(!1),enabled:Ot.boolean().default(!0),textPlacement:Ot.union([Ot.enum(Ga),Ot.array(Ot.enum(Ga))]).default(Ua),occlude:Ot.boolean().default(!0)}),Gu=Fy.partial();function Uu(o){let{text:e,enabled:t,options:r}=o;return{type:ul,text:e??"",appearance:Ac(r?.appearance??{}),rank:r?.rank??"medium",enabled:t??!0,interactive:r?.interactive??!1,textPlacement:r?.textPlacement??Ua,occlude:r?.occlude??!0}}function Hu(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 Pe from"zod";var fl="marker",Ay=Pe.object({type:Pe.literal(fl).default(fl),rank:Pe.custom(o=>bi.safeParse(o).success||o==="initial"),placement:Pe.union([Pe.enum(Ha),Pe.array(Pe.enum(Ha))]).optional(),interactive:Pe.union([Pe.boolean(),Pe.literal("pointer-events-auto")]).default(!1),dynamicResize:Pe.boolean().default(!0),enabled:Pe.boolean().default(!0),zIndex:Pe.number().optional(),lowPriorityPin:Pe.object({enabled:Pe.boolean().optional(),size:Pe.number().positive().optional(),color:Pe.string().optional()}).optional(),element:Pe.custom(o=>o instanceof HTMLElement,{error:"Must be an HTMLElement instance"}),contentHTML:Pe.string(),occlude:Pe.boolean().default(!0),animated:Pe.boolean().default(!0)}),Wu=Ay.omit({element:!0}).partial();function zu(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 z({latitude:c?.[1]??0,longitude:c?.[0]??0,floorId:h?.toString()})),{type:fl,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 Xu(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 Re}from"zod";var $u="shape",hl=Re.object({type:Re.literal($u).default($u),visible:Re.boolean().default(!0),altitude:Re.number().default(0),color:Re.string().default("#ffffff"),hoverColor:Re.string().optional(),height:Re.number().default(0),opacity:Re.number().default(1),interactive:Re.union([Re.boolean(),Re.literal("pass-through")]).default(!1),bevel:Re.object({enabled:Re.boolean().optional(),thickness:Re.number().optional(),size:Re.number().optional(),offset:Re.number().optional(),segments:Re.number().optional()}).optional(),position:Re.custom(o=>z.is(o))}),gl=hl.partial(),Q_=Re.strictObject(hl.shape);function Yu(o){let{children:e,bevel:t,position:r}=o;if(e==null||e.length<1){x.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 He(hl,{altitude:p,visible:c,color:n,hoverColor:i,height:l,opacity:a,interactive:s,bevel:t,position:new z({latitude:r[1],longitude:r[0],verticalOffset:p??0})})}function Zu(o){let e=fe(gl,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 na from"zod";var Ju="text3d",qu=na.object({type:na.literal(Ju).default(Ju),position:na.custom(o=>o instanceof z,{error:"Must be a Coordinate instance"})}),Qu=_c.extend({...qu.shape}),Ku=Cc.extend({...qu.shape}).partial(),iC=na.strictObject(Qu.shape);function ef(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:v,strokeOpacity:I,strokeColor:E,fillOpacity:O,hoverColor:w,rotation:F,content:W}=o;return He(Qu,{position:new z({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:v,strokeOpacity:I,strokeColor:E,fillOpacity:O,hoverColor:w,rotation:F,content:W})}f();import ut from"zod";var tf="walls",ml=ut.object({type:ut.literal(tf).default(tf),color:ut.string().default("#ffffff"),topColor:ut.string().optional(),texture:ut.object({url:ut.string()}).or(ut.undefined()),topTexture:ut.object({url:ut.string()}).or(ut.undefined()),visible:ut.boolean().default(!0),height:ut.number().default(0),opacity:ut.number().default(1)}),yl=ml.partial(),pC=ut.strictObject(ml.shape);function of(o){let{color:e,topColor:t,texture:r,topTexture:n,visible:i,height:a,opacity:s}=o;return He(ml,{visible:i,color:e,topColor:t,texture:r?{url:r}:void 0,topTexture:n?{url:n}:void 0,height:a,opacity:s})}function bl(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 Wt}from"zod";var Tl="image3d",ky=Wt.object({type:Wt.literal(Tl).default(Tl),visible:Wt.boolean().default(!0),opacity:Wt.number().min(0).max(1).default(1),position:Wt.custom(o=>o instanceof z,{error:"Must be a Coordinate instance"}),width:Wt.number().default(1),height:Wt.number().default(1),rotation:Wt.number().default(0),verticalOffset:Wt.number().default(0),flipImagesToFaceCamera:Wt.boolean().default(!1),interactive:Wt.boolean().default(!1)}),rf=ky.partial();function nf(o){let{position:e}=o;return{type:Tl,visible:o.visible??!0,opacity:o.opacity??1,position:new z({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 ce}from"zod";var af="model",vl=Mc.extend({type:ce.literal(af).default(af),color:ce.string().optional(),position:ce.custom(o=>z.is(o),{error:"Expected a Coordinate"}),visible:ce.boolean().default(!0),rotation:ce.tuple([ce.number(),ce.number(),ce.number()]).default([0,0,0]),scale:ce.tuple([ce.number(),ce.number(),ce.number()]).default([1,1,1]),verticalOffset:ce.number().default(0),opacity:ce.number().default(1),material:ce.record(ce.string(),xc).optional(),interactive:ce.boolean().default(!1),clippingPlaneZOffset:ce.custom(o=>typeof o=="number"&&!Number.isNaN(o),{message:"Must be a valid number (including Infinity)"}).default(1/0),clippingPlaneTopColor:ce.string().default("#E67B5B"),clippingPlaneTopVisible:ce.boolean().default(!0)}),sf=vl.extend({scale:ce.union([ce.number(),ce.tuple([ce.number(),ce.number(),ce.number()])]),rotation:ce.union([ce.number(),ce.tuple([ce.number(),ce.number(),ce.number()])])}).partial(),SC=ce.strictObject(vl.shape);function lf(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:v}=o,I=typeof p=="object"?p?.id?.toString():p?.toString(),E=`${jt}-`,O=I?.startsWith(E)?I.slice(E.length):I;return He(vl,{color:e,position:new z({latitude:t?.[1]??0,longitude:t?.[0]??0,verticalOffset:t?.[2],floorId:O}),rotation:r,scale:n,visible:i,interactive:a,opacity:s,material:l,verticalOffset:c,clippingPlaneZOffset:h,clippingPlaneTopColor:g,clippingPlaneTopVisible:v})}f();f();f();var Ur=di(Qf());Ur.registerHelper({});Ur.registerPartial({});var Kf=Ur.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'>
|
|
251
|
+
</div>`};f();var Vd=63710088e-1,Ui=new WeakMap,jd=async o=>new Promise(e=>setTimeout(e,o));function Lr(o,e,t){let r=o.distance;if(r===0)return 0;let n=hy(o,e,t);return n?(r-n.distance)/r:0}function Hi(o,e){if(o.coordinates.length===0)return[];if(Ui.has(o)&&Ui.get(o).has(e))return Ui.get(o).get(e);let t=o.coordinates.map(r=>Nr(r,e));return Ui.set(o,new Map([[e,t]])),t}function Nr(o,e){let t=e.latitude,r=e.longitude,n=o.latitude-t,i=o.longitude-r,a=Math.PI*Vd/180,s=a*Math.cos(t*Math.PI/180),l=i*s,c=n*a;return{x:l,y:c}}function uy(o,e,t){if(o.length===0)return;let r=t??e,n,i=1/0,a=Nr(e,r);for(let s=0;s<o.length;s++){let l=o[s],c=Hi(l,r);for(let p=0;p<c.length-1;p++){let h=c[p],g=c[p+1],v=Cn(h,g,a),I=Ho(a,v);I<i&&(i=I,n=v)}}if(n)return fy(n,r)}function Cn(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 fy(o,e){let r=Math.PI*Vd/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 z({latitude:s,longitude:l,floorId:e.floorId,verticalOffset:e.verticalOffset})}function hy(o,e,t){let r=uy([o],e,t);if(!r)return;let n=Hi(o,t),i=Nr(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=Cn(p,h,i),v=Ho(g,i);v<1&&v<s&&(s=v,a=c)}if(a===-1){let c=0,p=1/0;for(let h=0;h<n.length;h++){let g=n[h],v=Ho(g,i);v<p&&(p=v,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 Fo(`${o.id}_remaining`,l)}function Gd(o,e,t){if(o.length===0)return;let r,n=1/0,i=Nr(e,t);for(let a of o){let s=Hi(a,t),l=1/0;for(let c=0;c<s.length-1;c++){let p=s[c],h=s[c+1],g=Cn(p,h,i),v=Ho(g,i);v<l&&(l=v),v<n&&(n=v,r=a)}}return r}function Ud(o,e){let t=o.getState(e);return t?.type==="path"?t.displayArrowsOnPath:!1}function Pn(o,e,t,r){return{highlightStartFraction:t.startHighlightFraction,highlightEndFraction:t.endHighlightFraction,highlightColor:r?.color??"red",highlightWidthMultiplier:r?.widthMultiplier??1,highlightDisplayArrowsOnPath:r?.displayArrowsOnPath??Ud(o,e)}}function On(o,e){return{highlightStartFraction:0,highlightEndFraction:0,highlightCompleteFraction:0,highlightDisplayArrowsOnPath:Ud(o,e)}}function Dn(o,e,t,r){let n,i,a=1/0,s=1/0,l=Nr(e,r),c=Nr(t,r);for(let B of o)for(let G of B.segments){if(G.isConnectionSegment)continue;let F=G.coordinates[0]?.floorId,j=F===e.floorId,te=F===t.floorId;if(!j&&!te)continue;let he=Hi(G,r);if(j){let ge=1/0;for(let ie=0;ie<he.length-1;ie++){let ve=he[ie],Be=he[ie+1],Ve=Cn(ve,Be,l),pe=Ho(Ve,l);pe<ge&&(ge=pe)}ge<a&&(a=ge,n=G)}if(te){let ge=1/0;for(let ie=0;ie<he.length-1;ie++){let ve=he[ie],Be=he[ie+1],Ve=Cn(ve,Be,c),pe=Ho(Ve,c);pe<ge&&(ge=pe)}ge<s&&(s=ge,i=G)}}if(!n||!i)return;let p=[];if(n.id===i.id){let B=Lr(n,e,r),G=Lr(i,t,r);return p.push({segment:n,startHighlightFraction:Math.min(B,G),endHighlightFraction:Math.max(B,G)}),p}let h=o.flatMap(B=>B.segments),g=h.findIndex(B=>B.id===n.id),v=h.findIndex(B=>B.id===i.id),I=g>v,E=I?v:g,O=I?g:v,D=I?i.id:n.id,A=I?n.id:i.id,W=I?t:e,N=I?e:t;for(let B=E;B<=O;B++){let G=h[B];G.id===D?p.push({segment:G,startHighlightFraction:Lr(G,W,r),endHighlightFraction:1}):G.id===A?p.push({segment:G,startHighlightFraction:0,endHighlightFraction:Lr(G,N,r)}):p.push({segment:G,startHighlightFraction:0,endHighlightFraction:1})}return p}function Hd([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),O=o*E,D=e,A=t*E,W=r,N=n*E,B=i,G=A-O,F=W-D,j=G*G+F*F;if(j===0)return;if(p=((N-O)*G+(B-D)*F)/j,p<=0)h=[o,e];else if(p>=1)h=[t,r];else{let te=O+p*G,he=D+p*F;h=[te/E,he]}}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=Qt([n,i],h),v;if(a){let I=n-h[0],E=i-h[1],O=Math.sqrt(I*I+E*E),D=Math.sqrt(s*s+l*l);if(O>0&&D>0){let W=(I*s+E*l)/(O*D);v=Math.acos(Math.abs(W))*(180/Math.PI)}}return{proportion:a?p:Math.max(0,Math.min(1,p)),intersection:h,distance:g,angle:v}}function Wd(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 gy=10;function my(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 Wi=class{#e;#t;#o;#r=new Set;#n=new Set;#i;#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.#n.size>0||this.#i!==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??gy,i;for(let N of r.segments){if(N.isConnectionSegment)continue;let B=N.coordinates;for(let G=0;G<B.length-1;G++){let F=B[G],j=B[G+1];if(e.floorId&&!(F.floorId===e.floorId&&j.floorId===e.floorId))continue;let te=Hd([F.longitude,F.latitude],[j.longitude,j.latitude],[e.longitude,e.latitude],!0);te&&(!i||te.distance<i.distance)&&(i={path:r,segment:N,edgeIndex:G,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,v=g.findIndex(N=>N.id===c.id);if(this.#i?.id!==c.id){this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let N=this.#s;if(v>N)for(let B=Math.max(0,N+1);B<=v;B++){let G=g[B];this.#r.has(G)||(this.#e.updateState(G,{visible:!1}),this.#r.add(G))}else if(v<N)for(let B=v+1;B<=N&&B<g.length;B++){let G=g[B];this.#r.has(G)&&(this.#e.updateState(G,{visible:!0}),this.#r.delete(G))}this.#i=c,this.#s=v}else this.#t&&(this.#e.removeTetheredPath(this.#t),this.#t=void 0);let E=c.coordinates,O=E.slice(p+1,E.length),D=new z({latitude:h[1],longitude:h[0],floorId:e.floorId}),A=Wd(D,O,2.5);A.length===0&&O.length>0&&(A=[O[O.length-1]]);let W;if(a)W=[e,D,...A],this.#t=this.#e.createTetheredPath(W,{...this.#e.options.pathOptions,animateDrawing:!1,__EXPERIMENTAL_SMOOTHING_TENSION:.15,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:1.5,...t.tetherPathOptions});else{let N=this.#h(D,e,n);if(W=[N,D,...A],this.#t=this.#e.createTetheredPath(W,{...this.#e.options.pathOptions,animateDrawing:!1,__EXPERIMENTAL_SMOOTHING_TENSION:.15,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:1.5,...t.tetherPathOptions}),s==="tether-and-dash"){let B=my(t.outsideThresholdPathStyle??"dashed-boxes");this.#o=this.#e.createTetheredPath([e,N],{...this.#e.options.pathOptions,animateDrawing:!1,...B,...t?.outsideThresholdPathOptions})}}return t.hideMarkersOutsideThreshold?this.#e.markers.forEach(N=>{let B=N?.marker;if(!B)return;let G=this.#d(B.coordinate,O,g,v);this.#e.updateState(B,{enabled:G}),G?this.#n.delete(B):this.#n.add(B)}):this.#n.size>0&&this.#l(),W}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.#i=void 0,this.#s=-1,this.#l()}#l(){for(let e of this.#n)this.#e.updateState(e,{enabled:!0});this.#n.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=Qt([e.longitude,e.latitude],[t.longitude,t.latitude]);if(r>=n)return new z({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 z({latitude:a,longitude:s,floorId:e.floorId})}};f();var zi=class{#e;#t=new Set;#o;#r=-1;#n=0;#i;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.#n)}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.#i&&this.#i!==r.id&&this.#s(this.#i),this.#i=r.id;let i=this.#e.getMapCenter(),a=r.segments.filter(g=>{if(g.isConnectionSegment)return!1;let v=g.coordinates[0]?.floorId;return!e.floorId||v===e.floorId}),s=Gd(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 v=Math.max(0,g+1);v<c;v++){let I=l[v];this.#t.has(I)||(this.#e.updateState(I,{travelledEndFraction:1,travelledColor:n}),this.#t.add(I))}if(g>=0&&g<c){let v=l[g];this.#t.has(v)||(this.#e.updateState(v,{travelledEndFraction:1,travelledColor:n}),this.#t.add(v))}}else if(c<g){for(let v=c+1;v<=g&&v<l.length;v++){let I=l[v];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=Lr(s,e,i);return this.#n=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.#n=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.#n=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.#n=0,this.#i=void 0}};var zd=.01,Xd=.02,Xi=0,$d={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},yy={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",width:{on:"zoom-level",input:[17,22],output:[2,.5]},displayArrowsOnPath:!1,animateArrowsOnPath:!1},ko={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:$d,inactivePathOptions:yy,markerOptions:{departureColor:Ks,destinationColor:Qs},animatePathDrawing:!0};function Rr(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_WIDTH!==void 0&&(e.width=o.__EXPERIMENTAL__CONNECTION_WIDTH),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_DASH_STYLE!==void 0&&(e.__EXPERIMENTAL_DASH_OPTIONS={__EXPERIMENTAL_DASH_MODE:"width-scaling",...e.__EXPERIMENTAL_DASH_OPTIONS,__EXPERIMENTAL_DASH_STYLE:o.__EXPERIMENTAL__CONNECTION_DASH_STYLE}),o.__EXPERIMENTAL__CONNECTION_ANIMATE_ARROWS_ON_PATH!==void 0&&(e.animateArrowsOnPath=o.__EXPERIMENTAL__CONNECTION_ANIMATE_ARROWS_ON_PATH),o.__EXPERIMENTAL__CONNECTION_DISPLAY_ARROWS_ON_PATH!==void 0&&(e.displayArrowsOnPath=o.__EXPERIMENTAL__CONNECTION_DISPLAY_ARROWS_ON_PATH),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 by={...ko,connectionPathOptions:Rr($d)},wn=class{#e=new Map;#t=new Map;#o=new Map;#r;#n;#i=by;#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 Wi({get activePath(){return t.#l},get options(){return t.#i},get markers(){return t.#e},updateState:(r,n)=>this.#r.updateState(r,n),createTetheredPath:(r,n)=>this.#C(r,n),removeTetheredPath:r=>this.#S(r)}),this.#f=new zi({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 markers(){let e=[];return this.#e.forEach(t=>{t&&e.push({marker:t.marker,type:t.type})}),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){x.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#a[e]){x.warn(`Direction #${e} does not exist`);return}let r=this.#d.get(t);if(!r){x.warn("The direction is not a part of muli-direcional path");return}this.#v(r)}setActivePath(e){if(!this.#a.length){x.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!this.#h.get(e)){x.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:Xd});else this.#r.updateState(t,{verticalOffset:zd})}}setActivePathByDirections(e){if(!this.#a.length){x.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){x.warn("[setActivePathByDirections] Cannot find directions for id");return}t=this.#d.get(r)}if(!t){x.warn("[setActivePathByDirections] Cannot find path for directions");return}this.#v(t)}clearHighlightedPathSection(){this.#n=void 0;for(let e of this.paths)for(let t of e.segments)this.#r.updateState(t,On(this.#r.core,t.id));for(let e of this.#o.values())for(let t of e.segments)this.#r.updateState(t,On(this.#r.core,t.id))}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=this.activePath;if(!a)return;let s=Dn([a],e,t,i);if(!s)return;this.clearHighlightedPathSection(),this.#n={from:e,to:t,options:r};for(let p of s)this.#r.updateState(p.segment,Pn(this.#r.core,p.segment.id,p,r));let l=()=>{},c=new Promise(p=>{l=p});if(s.length>0){let p=new so({fraction:0}).to({fraction:1},n).onUpdate(h=>{for(let g of s)this.#r.updateState(g.segment,{highlightCompleteFraction:h.fraction})}).onComplete(()=>{this.#r.tweenGroup().remove(p),l()});this.#r.tweenGroup().add(p),p.start()}return{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];if(this.#a=r,a?.floorId&&this.#i.setMapToDeparture&&this.#r.setFloor(a.floorId),n.coordinates.length<2){x.warn("Directions must have at least 2 coordinates");return}this.#i.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){x.warn("Directions must have at least 2 coordinates");return}let c=s===Xi,p=c?this.#i.pathOptions:this.#i.inactivePathOptions,h=this.#b(c?"active":"inactive"),g={...Rr(p),animateDrawing:this.#i.animatePathDrawing,verticalOffset:h},v=this.#E(l.coordinates,{...p,animateDrawing:this.#i.animatePathDrawing,verticalOffset:h},g);this.#d.set(l,v),this.#h.set(v,l),this.#i.createMarkers?.connection&&this.#_(l.instructions,"connection"),c&&(this.#l=this.#d.get(this.#a[Xi]),this.#r.externalPubSub.on("click",this.#I))}this.#i.createMarkers?.destination&&this.#g("destination",i.instructions[i.instructions.length-1]),this.#r.mapObjects.forEach(s=>{s.processFloorChange(s.currentFloorId,s.currentFloorStackId)}),this.#T()}#E(e,t,r){let n=t.id?.toString()??oe(),i=this.#r.currentMap.Paths.add(e,t,r),a=new Pt(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}#C(e,t){let r=t.id?.toString()??oe(),n=this.#r.currentMap.Paths.add(e,t),i=new Pt(r,n.animation,e,n.paths);return this.#o.set(r,i),this.#P(i),i}#P(e){if(!this.#n)return;let{from:t,to:r,options:n}=this.#n,i=this.#r.getMapData().mapCenter,a=Dn([e],t,r,i);if(a)for(let s of a)this.#r.updateState(s.segment,{...Pn(this.#r.core,s.segment.id,s,n),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.#i.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 no(i.id.toString(),a,e.coordinate)}#b(e){return e==="active"?Xd+(this.#i.pathOptions?.verticalOffset??0):zd+(this.#i.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 jd(500),n||!e.length){i();return}if(t.coordinates.length<2){x.warn("Directions must have at least 2 coordinates"),i();return}this.#i.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){x.warn("Directions must have at least 2 coordinates"),i();return}let l=a===Xi,c=l?this.#i.pathOptions:this.#i.inactivePathOptions,p=this.#b(l?"active":"inactive"),h={...Rr(c),animateDrawing:this.#i.animatePathDrawing,verticalOffset:p},g=this.#E(s.coordinates,{...c,animateDrawing:this.#i.animatePathDrawing,verticalOffset:p},h);if(this.#d.set(s,g),this.#h.set(g,s),l&&(this.#l=this.#d.get(this.#a[Xi]),this.#r.externalPubSub.on("click",this.#I)),S.env.NODE_ENV!=="test"&&await g.animation,n){i();return}this.#i.createMarkers?.connection&&this.#_(s.instructions,"connection")}if(this.#i.createMarkers?.destination&&this.#g("destination",r.instructions[r.instructions.length-1]),n){i();return}this.#r.mapObjects.forEach(a=>{a.processFloorChange(a.currentFloorId,a.currentFloorStackId)}),this.#T(),i()}),cancel:()=>{n=!0}},this.#s.promise}#x(e){let t={...ko.pathOptions,...e.pathOptions};this.#i={setMapOnConnectionClick:e.setMapOnConnectionClick??ko.setMapOnConnectionClick,setMapToDeparture:e.setMapToDeparture??ko.setMapToDeparture,pathOptions:t,inactivePathOptions:{...ko.inactivePathOptions,...e.inactivePathOptions},connectionPathOptions:Rr(t),createMarkers:{...ko.createMarkers,...e.createMarkers},markerOptions:{...ko.markerOptions,...e.markerOptions},animatePathDrawing:e.animatePathDrawing??ko.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,markers:this.markers})}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.#i.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=Rr(this.#i.pathOptions),r=Rr(this.#i.inactivePathOptions);this.#a.forEach(n=>{let i=this.#d.get(n);if(i){let a=i.id===this.#l.id,s={...a?this.#i.pathOptions:this.#i.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.#i.markerOptions.departureColor:this.#i.markerOptions.destinationColor,n;typeof this.#i.createMarkers?.connection=="function"?(n=this.#i.createMarkers.connection(t),this.#r.updateState(n,{interactive:!0})):n=this.#M(t,Bd({type:t.action.connection?.type??t.action.connectionType,color:r,direction:t.action.direction,animated:this.#i.markerOptions.animated}),!0),this.#e.set(n.id,{instruction:t,marker:n,type:e})}else{let r=e==="departure"?this.#i.markerOptions.departureColor:this.#i.markerOptions.destinationColor,n;typeof this.#i.createMarkers?.departure=="function"&&e==="departure"?n=this.#i.createMarkers.departure(t):typeof this.#i.createMarkers?.destination=="function"&&e==="destination"?n=this.#i.createMarkers.destination(t):n=this.#M(t,Rd({type:e,color:r,animated:this.#i.markerOptions.animated})),this.#e.set(n.id,{instruction:t,marker:n,type:e})}}#_(e,t){e.filter(n=>this.#m(n.action)).forEach(n=>{this.#g(t,n)})}#I=e=>{if(this.#i.createMarkers?.connection&&e.markers!=null&&e.markers.length>0){let{instruction:t}=this.#e.get(e.markers[0].id);t?.action.toFloor&&(this.#i.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.#n=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,e.currentFloorStackId)}),this.#T()}};f();var An=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 z(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 z.is(e)&&e.floorId!=null?this.#e.getState(e.floorId)?.altitude??t:pt.is(e)?this.#e.getState(e.id)?.altitude??t:"floor"in e&&pt.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(z.is(i)){let a=this.#o(i);t.push([i.longitude,i.latitude,a])}else if(i?.id!=null){if(Cr.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;wa(c.geoJSON,v=>{t.push([v[0],v[1],h]),g!==h&&t.push([v[0],v[1],g])})}continue}let a=this.#o(i);if(pt.is(i)&&this.#t.getMapDataInternal()?.enterpriseMode){t.push(i.id);continue}else if("geoJSON"in i&&i.geoJSON.geometry.coordinates.length>0){wa(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 Op(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 z(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 wi(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 Fn=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):(x.error("There is no map to export. Please load a map first."),new Blob)}};f();var kn=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:Dr(e),rank:r?.rank==null||r?.rank==="initial"?"medium":r.rank}),s=new uo(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 uo(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 Yd=di(Cs(),1);function Ty(o,e){var t=dr(o),r=dr(e),n=o.properties||{},i=Yd.default.difference(t.coordinates,r.coordinates);return i.length===0?null:i.length===1?fi(i[0],n):hi(i,n)}var Jd=Ty;var Zd=.2,qd=.1,Ko=Lc.UNDERGROUND_MASK,vy=!1;function Qd(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 Kd(o,e){let t=[];if(o.type==="Polygon"){let r=Qd(o.coordinates[0]);r&&t.push(r)}else if(o.type==="MultiPolygon")for(let r of o.coordinates){let n=Qd(r[0]);n&&t.push(n)}return{type:"Feature",geometry:{type:"MultiLineString",coordinates:t},properties:e||{}}}var Ln=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=io;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(`${yn}-${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=Kd(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:qd,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=Ko),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=Kd(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:qd,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=Ko),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=Ko);let r=el(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=el(t),e?.length>0&&(t=Iy(t,e));let r="front";this.ceilingId=`Ceiling-${this.config.floorId}`;let n={color:this.footprintColor,height:-Zd,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=Ko),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=_i(t,n);i&&(t=i)}catch{}t=el(t),this.basementMaskId=`Footprint-Basement-Mask-${this.config.floorId}`;let r={color:eu(-1),altitude:0,visible:!0,height:.01,outline:!1,__EXPERIMENTAL_maskEnabled:!0,__EXPERIMENTAL_maskMode:"mask",__EXPERIMENTAL_maskId:Ko};if(this.renderer.addFeatureCollection(this.basementMaskId,{features:[{...t,properties:{id:`Footprint-Basement-Mask-Geometry-${this.config.floorId}`}}]},r,void 0,"outdoors-container"),vy){let n={color:eu(-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??Zd,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 el(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 Iy(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=Jd(r,i)}catch(a){x.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 eu=o=>o===0?"red":o===-1?"blue":o===-2?"green":"black";var Sy={color:"#ffffff",opacity:1},io={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},tu={opacity:.25,color:"#a7d1ec",height:.8,width:.05,cap:"square"},ou=.1,tl={color:"red",opacity:.2,height:io.height+.1,visible:!0,borderVisible:!1},ru=.5,et=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})}},nu=0,Nn=class{id;name;elevation;maxHeight;containerId;externalId;metadata;shortName;subtitle;occluderId;geometryContainer;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){x.warn(`Attempting to get bounding box with no footprint for floor ${this.id}`);return}return this.#e=$p(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&&x.warn(`Floor ${this.id} exists in the data but contains no geometry.`),this.loaded=!0;let t=this.renderer.addGroupContainer(`${oo}-${this.id}`,{},this.id);this.layers.set(oo,new et(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer(`${Vt}-${this.id}`,{},this.id);this.layers.set(Vt,new et(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer(`${Ce}-${this.id}`,{},this.id);this.geometryContainer=n,this.layers.set(Ce,new et(this.renderer,n.id.toString()));let i=this.renderer.addGroupContainer(`${ro}-${this.id}`,{},this.id);this.layers.set(ro,new et(this.renderer,i.id.toString()));let a=this.renderer.addGroupContainer(`${jt}-${this.id}`,{},this.id);this.layers.set(jt,new et(this.renderer,a.id.toString()));let s=this.renderer.addGroupContainer(Ap(this.id),{},this.id);if(this.layers.set(Jo,new et(this.renderer,s.id.toString())),this.renderer.addGroupContainer(Oo(this.id),{},s.id.toString()),this.renderer.addGroupContainer(_r(this.id),{},s.id.toString()),this.multiFloorView?.__EXPERIMENTAL_DEBUG_showVoids){let l=0;for(let c of this.voids)this.renderer.addFeatureCollection(`Void-${this.id}-${l}`,{features:[c]},{color:"red"},void 0,n),l++}if(this.multiFloorView?.__EXPERIMENTAL_DEBUG_showOpenToBelow){let l=0;for(let c of this.spacesOpenToBelow)this.renderer.addFeatureCollection(`SpacesOpenToBelow-${this.id}-${l}`,{features:[c]},{color:"blue"},void 0,n),l++}if(this.spaces!=null&&this.spaces.features.length>0){let l=[],c=new Map,p=this.multiFloorView?.__EXPERIMENTAL_excludeSpaceIdsInAutoHeightCalculation,h=p!=null&&p.length>0?new Set(p):void 0;for(let I of this.spaces.features){if(I.geometry.type!=="Polygon")continue;let E=I.properties.kind?.toLowerCase();if(E==="void"||E==="otb")continue;let O=this.styleMap[I.properties.id];if(O!=null&&"height"in O&&O?.height!=null&&(h==null||!h.has(I.properties.id))){let A=(O.altitude??0)+O.height;(this._computedMaxHeight==null||A>this._computedMaxHeight)&&(this._computedMaxHeight=A)}let D=this.mapDataInternal?.facadesBySpaceId[I.properties.id];if(D){let A=c.get(D.id);A==null&&(A=[],c.set(D.id,A)),A.push(I)}else l.push(I)}let g=this.renderer.addGroupContainer(`spaces-${this.id}`,{},n),v=this.renderer.addFeatureCollection(`Spaces-${this.id}-0`,{features:l},I=>I?.properties?.id!=null&&this.styleMap[I.properties.id]!=null?Pr(this.styleMap[I.properties.id],this.options):Sy,void 0,g);if(this.layers.get(Ce).layers.set("Spaces",v.id.toString()),c.size>0){let I=this.renderer.addGroupContainer(`${Yo}-${this.id}`,{},this.id);this.layers.set(Yo,new et(this.renderer,I.id.toString()));for(let[E,O]of c){let D=this.renderer.addGroupContainer(E,{focusable:!0},I),A=this.renderer.addGroupContainer(`${E}-geometry`,{},D),W=Xp(O,this.styleMap),N=0;for(let[B,G]of W){let F={...Pr(B,this.options),focusable:e,renderOrder:3},j=this.renderer.addFeatureCollection(`Facades-${this.id}-${E}-${N}`,{features:G},()=>F,void 0,A);N++;let te=B.id||j.id.toString();this.layers.get(Yo).layers.set(`${E}-${te}`,j.id.toString()),this.facadesByStyleId.has(te)?this.facadesByStyleId.get(te)?.push(E):this.facadesByStyleId.set(te,[E])}}}}if(this.footprint?.geometry!=null&&this.footprint.geometry.coordinates.length>0&&this.styleMap!=null&&(this.footprintObject=new Ln(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(yn,new et(this.renderer,this.footprintObject.layer.id.toString())),this.footprint=Qp(this.footprint)),this.obstructions!=null&&this.obstructions.features.length>0){let l=this.obstructions.features.filter(A=>A.geometry.type==="Polygon"&&(A.properties.kind==="object"||A.properties.kind==="unknown")),c=this.renderer.addGroupContainer(`objects-${this.id}`,{},n),p=0,h=this.renderer.addFeatureCollection(`Objects-${this.id}-${p}`,{features:l},({properties:A})=>A.id!=null&&this.styleMap[A.id]!=null?Pr(this.styleMap[A.id],this.options):io,void 0,c);p++;let g=c.id.toString();this.layers.get(Ce).layers.set(g,h.id.toString());let v=this.obstructions.features.filter(A=>A.geometry.type==="LineString"&&A.properties.kind?.toLowerCase()==="wall"&&A.properties.footprintComponent===!1),I=this.obstructions.features.filter(A=>A.geometry.type==="LineString"&&A.properties.kind?.toLowerCase()==="wall"&&A.properties.footprintComponent===!0),E=this.entrances,O=io,D=io;if(v!=null&&v.length>0){let A=this.styleMap[v[0].properties?.id];A!=null&&(O={...A}),D=O;let{walls:W,entrances:N}=Bs(v,E?.features||[]),B=Math.max(O.height-.11,ru),G={...tu,height:B},F=this.renderer.addGroupContainer(`${Er}-${this.id}`,{visible:!1,altitude:ou},n);this.layers.set(Er,new et(this.renderer,F.id.toString()));let j=this.renderer.addFeatureCollection(`InteriorDoors-${this.id}`,N,()=>G,void 0,F);this.layers.get(Ce).layers.set(Ir,j.id.toString());let te=Pr(O,this.options),he=this.renderer.addFeatureCollection(`Walls-${this.id}`,{features:[W]},te,void 0,n);this.layers.get(Ce).layers.set(Po,he.id.toString())}if(I!=null&&I.length>0){let A=this.styleMap[I[0].properties?.id];A!=null&&(D={...A,id:to});let{walls:W,entrances:N}=Bs(I,E?.features||[]),B=Math.max(D.height-.11,ru),G={...tu,height:B},F=this.renderer.addGroupContainer(`${Mr}-${this.id}`,{visible:!1,altitude:ou},n);this.layers.set(Mr,new et(this.renderer,F.id.toString()));let j=this.renderer.addFeatureCollection(`ExteriorDoors-${this.id}`,N,()=>G,void 0,F);this.layers.get(Ce).layers.set(Sr,j.id.toString());let te=Pr(D,this.options),he=this.renderer.addFeatureCollection(`ExteriorWalls-${this.id}`,{features:[W]},te,void 0,n);this.layers.get(Ce).layers.set(to,he.id.toString())}}if(this.floorImages!=null){let l=this.renderer.addGroupContainer(`images-${this.id}`,{},this.id);for(let c of this.floorImages.features||[]){let p="anchorId"in c.properties?c.properties.anchorId:null,h=p==null,g=p!=null&&this.mapDataInternal!=null&&this.mapDataInternal.pointsOfInterestById[p]!=null;if(h||g){let v=Jp(c,nu),E=((c.properties.rotation??0)%360+360)%360;if(g){let O=new z({latitude:c.geometry.coordinates[1],longitude:c.geometry.coordinates[0],floorId:this.id});this.mapDataInternal.Query.at(O).then(D=>{let A=0;for(let W of D)if(xe.is(W)){let N=this.renderer.getState(W.id)?.height??0;N>A&&(A=N)}this.mapObject.api.Image3D.add(new z({latitude:c.geometry.coordinates[1],longitude:c.geometry.coordinates[0],floorId:this.id,verticalOffset:A}),c.properties.path,{id:v,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...c.properties,rotation:E})})}else this.mapObject.api.Image3D.add(new z({latitude:c.geometry.coordinates[1],longitude:c.geometry.coordinates[0],floorId:this.id}),c.properties.path,{id:v,flipImageToFaceCamera:this.options.flipImagesToFaceCamera??!0,...c.properties,rotation:E});nu++}}this.layers.set(xr,new et(this.renderer,l.id.toString()))}if(this.floorText!=null){let l=_r(this.id);for(let c of this.floorText.features||[]){let p=0;"geometryId"in c.properties?p=this.renderer.getState(c.properties.geometryId)?.height??0:p=c.properties.verticalOffset??0,this.renderer.addText3D(oe(),{...c,properties:{...c.properties,verticalOffset:p}},{appearance:{flipToFaceCamera:!1}},l)}}if(this.areas!=null){let l=this.renderer.addGroupContainer(`areas-${this.id}`,{},this.id);this.layers.set($o,new et(this.renderer,l.id.toString()));let c=this.renderer.addFeatureCollection(`Areas-${this.id}`,{features:this.areas.features},()=>({color:tl.color,height:tl.height}),void 0,l);for(let p of this.areas.features||[])this.renderer.setState(p.properties.id,{...tl,visible:!1});this.layers.get($o).layers.set(c.id.toString(),c.id.toString())}return e&&!this.hasFacadeGeometry&&this.addFocusFootprint(),this.renderer.render(),this};addOccluder(){if(this.footprint?.geometry==null)return;let e=this.renderer.addGroupContainer(`${Xo}-${this.id}`,{},this.id),t=new et(this.renderer,e.id.toString());this.layers.set(Xo,t),this.occluderId=this.renderer.addOccluder(this.footprint,t.containerId)}addFocusFootprint(){let e=this.footprint?.geometry;if(e==null)return;let t={type:"FeatureCollection",features:[{type:"Feature",geometry:e,properties:{}}]},r=this.renderer.addFeatureCollection(`${mn}${this.id}`,t,{opacity:0,height:1,color:"white",focusable:!0},void 0,this.geometryContainer),n=this.renderer.getState(r.id);for(let i of n.children)this.renderer.setState(i,{interactive:"pass-through"})}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 Ln(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=io;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 et(this.renderer,this.footprintObject.layer.id.toString());this.layers.set(yn,e)}setGeometryTextBatchVisible(e){this.#t(Oo(this.id),e)}setFloorTextBatchVisible(e){this.#t(_r(this.id),e)}#t(e,t){let r=this.renderer.getInternalState().geometry3DMap.get(e);r&&r instanceof Nc&&this.renderer.getSystems().text3DSystem.setBatchVisible(r,t)}};f();f();var Ey=5,My="#ffffff";function xy(o,e){return typeof o=="string"?o:o[e]??My}function _y(o){return o.spacesOpenToBelow.length>0}function ol(o,e,t){return t?o.find(r=>r.elevation>e):o.find(r=>r.elevation===e+1)}function rl(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,v]of r)g<e.elevation&&v.altitude<c&&(c=v.altitude);let p=l-c+Ey,h=o.sort((g,v)=>g.elevation-v.elevation);for(let g of h){let v=r.get(g.elevation),I=v?.visualHeight??0,E=v?.altitude??0,O=n.opacity??(g.elevation<0?1:.4),D=!1;if(a){let j=g.elevation<e.elevation?ol(o,g.elevation,n.disableGapFilling):void 0;D=j?_y(j):!1}let A={maskEnabled:g.elevation<0,maskId:Ko,maskEffect:"reveal",maskMode:"masked-object"},W=a?g.elevation===e.elevation||D:!1,N=a?g.elevation<e.elevation:g.elevation===e.elevation&&g.elevation<0,B=(e.elevation>=0?g.elevation===0:g.elevation===e.elevation)&&g.floorStack?.type?.toLowerCase()!=="outdoor",G={color:xy(n.color,g.id),ceilingVisible:g.elevation<e.elevation,visible:N,basementMaskEnabled:B,outline:n.outline,ceilingThickness:.5,height:I,opacity:O},F={floor:g,state:{type:"floor",altitude:E,visible:W,geometry:a?{visible:W,...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:G,occlusion:{enabled:!1},areas:{visible:!1},text3d:{visible:!0,geometryText:{visible:!1},floorText:{visible:W}},images:{visible:!1,collisionsEnabled:g.id===e.id},paths:{visible:!1},models:{visible:!1}}};i.floorStates.push(F),g.id===e.id?(F.state.visible=!0,F.state.images.visible=!0,F.state.paths.visible=!0,F.state.geometry.visible=!0,F.state.models.visible=!0,F.state.labels.enabled=!0,F.state.markers.enabled=!0,F.state.occlusion.enabled=!0,F.state.areas.visible=!0,F.state.text3d.geometryText.visible=!0,F.state.text3d.floorText.visible=!0,g.elevation<0&&(F.state.footprint.height=-E,F.state.footprint.visible=!0,i.outdoorOpacity=.2)):t.includes(g.id)&&g.elevation<e.elevation?(F.state.visible=!0,F.state.geometry.visible=D||O<1,F.state.models.visible=!0,F.state.paths.visible=!0,F.state.markers.enabled=!0,F.state.occlusion.enabled=!0,F.state.footprint.visible=!0,F.state.footprint.height=I,g.elevation<0&&(i.outdoorOpacity=.2)):e.elevation>0&&g.elevation<e.elevation&&g.elevation>=0&&(F.state.visible=!0,F.state.footprint.visible=!0,F.state.footprint.height=I)}return i}var Rn=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 we(`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)){x.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((r,n)=>r.elevation-n.elevation);for(let r of this.floorObjects)r.load(this.facade!=null),!this.isOutdoors&&!r.hasFacadeGeometry&&r.footprint!=null&&r.addOccluder();if(this.altitudeMap=Zp(this.floorObjects,e?.floorGap,e?.floorGapMultiplier,e?.floorGapFallback,e?.__EXPERIMENTAL_disableGapFilling),e?.enabled)for(let r of this.floorObjects){let n=this.altitudeMap.get(r.elevation);n&&this.renderer.setState(r.id,{altitude:n.altitude})}if(this.isOutdoors||!e?.enabled)return;let t=e?.__EXPERIMENTAL_disableGapFilling===!0;for(let r of this.floorObjects){let n=ol(this.floorObjects,r.elevation,t),i=[];if(r.spacesOpenToBelowEnabled){for(let s of r.voids)i.push(s);if(n)for(let s of n.spacesOpenToBelow)i.push(s)}let a=r.elevation<0;r.spacesOpenToBelowEnabled&&i.length>0||a?(r.buildCeiling(i),r.buildFootprint()):r.buildExtrudedPolygon(),r.elevation<=0&&r.buildBasementMask()}if(!e.__EXPERIMENTAL_disableGapFilling){let r=qp(this.floorObjects,this.altitudeMap,e.floorGap,e.floorGapMultiplier,e.floorGapFallback);for(let n of r){let i=this.floorObjectsByElevation.get(n.floorAboveElevation);if(!i)continue;let a=i.spacesOpenToBelow;i.buildGapFootprint(n.height,a)}}}};f();import Y from"zod";f();import{z as iu}from"zod";function au(o){try{let e=o.shape;if("type"in e){let t=e.type;if(t instanceof iu.ZodOptional&&(t=t._def.innerType),"value"in t)return String(t.value);if(t instanceof iu.ZodDefault&&"value"in t._def.innerType)return String(t._def.innerType.value)}return"unknown"}catch{return"unknown"}}function su(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 lu(o,e){let t=Object.entries(o);if(t.length>0){let r=t.map(([n,i])=>`${n}: ${i.join(", ")}`).join("; ");x.warn(`${t.length} invalid field(s) in ${e??"unknown"} state: [${r}]`)}}function fe(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=su(r);t?.warn&&lu(n,au(o));let i={};for(let a of Object.keys(e))!(a in n)&&a in o.shape&&(i[a]=e[a]);return i}function He(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=su(r);lu(n,au(o))}return e}var cu="path",at={color:"#4b90e2",width:1,completeFraction:0,visible:!0,interactive:!1,verticalOffset:.1,xrayOpacity:.25,__EXPERIMENTAL_SMOOTHING_TENSION:La.tension,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:La.cornerRadius,dashed:!1,dashDiscrete:!1,dashCornerRadius:1,__EXPERIMENTAL_ENDCAP_EXTENSION:[.5,.5],__EXPERIMENTAL_BILLBOARDING:80,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:!1},nl={__EXPERIMENTAL_DASH_STYLE:Y.enum(["mask","discrete"]).default("mask"),__EXPERIMENTAL_DASH_CORNER_RADIUS:Y.number().min(0).max(1).default(at.dashCornerRadius)},il=Y.object({type:Y.literal(cu).default(cu),color:Y.string().default(at.color),width:Y.union([Y.number(),Y.string().regex(ka),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(ka)).nonempty()]),easing:Y.string().optional()})]),completeFraction:Y.number().default(at.completeFraction),visible:Y.boolean().default(at.visible),interactive:Y.boolean().default(at.interactive),verticalOffset:Y.number().default(at.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),highlightDisplayArrowsOnPath:Y.boolean().default(!1),xrayOpacity:Y.number().min(0).max(1).default(at.xrayOpacity),travelledEndFraction:Y.number().default(0),travelledColor:Y.string().default("#999"),__EXPERIMENTAL_SMOOTHING_TENSION:Y.number().default(at.__EXPERIMENTAL_SMOOTHING_TENSION),__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:Y.number().default(at.__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS),dashed:Y.boolean().default(at.dashed),dashDiscrete:Y.boolean().default(at.dashDiscrete),dashCornerRadius:Y.number().min(0).max(1).default(at.dashCornerRadius),__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),...nl}),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),...nl}),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),...nl})]).optional(),__EXPERIMENTAL_GEOMETRY:Y.enum(["tube","ribbon"]).default("tube"),__EXPERIMENTAL_ENDCAP_EXTENSION:Y.tuple([Y.number(),Y.number()]).default(at.__EXPERIMENTAL_ENDCAP_EXTENSION),__EXPERIMENTAL_BILLBOARDING:Y.union([Y.boolean(),Y.number().min(0).max(90)]).default(at.__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(at.__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()}),al=il.partial(),h_=Y.strictObject(il.shape);function pu(o){let{color:e,visible:t,interactive:r,width:n,verticalOffset:i,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:p,highlightCompleteFraction:h,highlightDisplayArrowsOnPath:g,travelledEndFraction:v,travelledColor:I,xrayOpacity:E,xrayStyle:O,smoothingTension:D,smoothingCornerRadius:A,dashed:W,dashDiscrete:N,dashCornerRadius:B,dashLength:G,dashGap:F,dashRelativeToWidth:j,dashSize:te,gapSize:he,dashAbsolute:ge,dashMeters:ie,gapMeters:ve,__EXPERIMENTAL_GEOMETRY:Be,__EXPERIMENTAL_ENDCAP_EXTENSION:Ve,__EXPERIMENTAL_BILLBOARDING:pe,__EXPERIMENTAL_BORDER:Et,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:Dt}=o,$e={};E!==void 0&&($e.opacity=E),O?.color!==void 0&&($e.color=O.color),O?.tint!==void 0&&($e.tint=O.tint),O?.dithering!==void 0&&($e.dithering=O.dithering);let ye=Object.keys($e).length>0?$e:void 0,$t={__EXPERIMENTAL_DASH_STYLE:N?"discrete":"mask",__EXPERIMENTAL_DASH_CORNER_RADIUS:B,...ge?{__EXPERIMENTAL_DASH_MODE:"absolute",__EXPERIMENTAL_DASH_METERS:ie,__EXPERIMENTAL_GAP_METERS:ve}:j?{__EXPERIMENTAL_DASH_MODE:"width-scaling",__EXPERIMENTAL_DASH_SIZE:te,__EXPERIMENTAL_GAP_SIZE:he}:{__EXPERIMENTAL_DASH_MODE:"length-scaling",__EXPERIMENTAL_DASH_LENGTH:G,__EXPERIMENTAL_DASH_GAP:F}};return He(il,{color:e,visible:t,interactive:r,width:n,verticalOffset:i,completeFraction:a,highlightStartFraction:s,highlightEndFraction:l,highlightColor:c,highlightWidthMultiplier:p,highlightCompleteFraction:h,highlightDisplayArrowsOnPath:g,travelledEndFraction:v,travelledColor:I,xrayOpacity:E,__EXPERIMENTAL_XRAY_STYLE:ye,__EXPERIMENTAL_SMOOTHING_TENSION:D,__EXPERIMENTAL_SMOOTHING_CORNER_RADIUS:A,dashed:W,dashDiscrete:N,dashCornerRadius:B,__EXPERIMENTAL_DASH_OPTIONS:$t,__EXPERIMENTAL_GEOMETRY:Be,__EXPERIMENTAL_ENDCAP_EXTENSION:Ve,__EXPERIMENTAL_BILLBOARDING:pe,__EXPERIMENTAL_BORDER:Et,__EXPERIMENTAL_PREVENT_SELF_OVERLAP:Dt})}function Br(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)),r.__EXPERIMENTAL_DASH_STYLE!==void 0&&(e.dashDiscrete=r.__EXPERIMENTAL_DASH_STYLE==="discrete"),r.__EXPERIMENTAL_DASH_CORNER_RADIUS!==void 0&&(e.dashCornerRadius=r.__EXPERIMENTAL_DASH_CORNER_RADIUS))}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 Bn=class extends gt{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 we(`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){x.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){x.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 we(`Floor with id "${this.currentFloorId}" not found`);return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e,t){if(this.api.manualFloorVisibility===!0)return;let r=this.api.getMapDataInternal()?.getById("floor",e),n=this.api.getMapDataInternal()?.getById("floor-stack",t);if(r&&n){let i=r.floorStack.id===n?.id,a=this.api.getMapDataInternal()?.getById("floor-stack",r.floorStack.id);if(this.#n?.enabled&&a){if(!i)for(let l of this.floorStacksById.values())l.id!==a.id&&l.floorObjects.forEach(c=>{c.setVisible(!1)});let s=rl(a.floors,r,this.api.Navigation?.floors?.map(l=>l.id)||[],this.getFloorStackAltitudeData(a.id),{color:this.#n.footprintColor??io.color,opacity:this.#n.footprintOpacity,outline:this.#n.footprintOutline??!0,disableGapFilling:this.#n.__EXPERIMENTAL_disableGapFilling===!0,spacesOpenToBelowEnabled:this.#n.spacesOpenToBelowEnabled??!1,spacesOpenToBelowVisualEffectEnabled:this.#n.spacesOpenToBelowVisualEffectEnabled,spacesOpenToBelowVisualEffectDarkenAmount:this.#n.spacesOpenToBelowVisualEffectDarkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#n.spacesOpenToBelowVisualEffectDarkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:this.#n.spacesOpenToBelowVisualEffectDesaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#n.spacesOpenToBelowVisualEffectDesaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:this.#n.spacesOpenToBelowVisualEffectWashOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#n.spacesOpenToBelowVisualEffectWashOutUseDepth});if(this.api?.Outdoor?.setOpacity(s.outdoorOpacity),s.floorStates.forEach(l=>{if(l.floor){let c=this.api.getMapData()?.getById("floor",l.floor.id);c&&this.api.updateState(c,l.state)}}),this.#n.updateCameraElevationOnFloorChange){let l=this.getFloorStackAltitudeData(a.id);this.api.Camera.setElevation(l.get(r.elevation)?.altitude??0)}}else for(let s of this.floorStacksById.values())s.floorObjects.forEach(l=>{l.id!==e&&l.setVisible(!1)})}}updateMultiFloorViewEffects(e){this.#n={...this.#n,...e},this.processFloorChange(this.currentFloorId,this.currentFloorStackId)}getMultiFloorViewEffects(){return{spacesOpenToBelowVisualEffectEnabled:this.#n.spacesOpenToBelowVisualEffectEnabled??!0,spacesOpenToBelowVisualEffectDarkenAmount:this.#n.spacesOpenToBelowVisualEffectDarkenAmount??.2,spacesOpenToBelowVisualEffectDarkenUseDepth:this.#n.spacesOpenToBelowVisualEffectDarkenUseDepth??!0,spacesOpenToBelowVisualEffectDesaturateAmount:this.#n.spacesOpenToBelowVisualEffectDesaturateAmount??0,spacesOpenToBelowVisualEffectDesaturateUseDepth:this.#n.spacesOpenToBelowVisualEffectDesaturateUseDepth??!0,spacesOpenToBelowVisualEffectWashOutAmount:this.#n.spacesOpenToBelowVisualEffectWashOutAmount??0,spacesOpenToBelowVisualEffectWashOutUseDepth:this.#n.spacesOpenToBelowVisualEffectWashOutUseDepth??!1}}#e;setFloor(e,t){if(this.currentFloorId===e)return;let r=this.floorsById.get(e);if(!r){x.error(`Invalid floor passed to setFloor (${e}), the floor was not changed. Current floor is still ${this.currentFloor.id}`);return}let n=this.currentFloorId,i=this.currentFloorStackId;this.currentFloorId=e,this.currentFloorStackId=r.floorStackId,this.publish("floor-change-start",{previousFloorId:n,floorId:e,reason:t}),this.#e&&(x.warn(`setFloor(${e}) called while a previous setFloor handler is in-flight; the earlier change will be discarded`),this.#e.abort(),this.#e=void 0);let a=this.api.__EXPERIMENTAL__floorHandler;if(typeof a=="function"){let s=this.api.getMapDataInternal(),l=s?.getById("floor",e);if(!l){x.error("setFloor: unable to resolve public Floor; bypassing override handler and committing synchronously"),this.#o(e,r,i,n,t);return}let c=s?.getById("floor",n);r.setVisible(!0);let p=new AbortController,h=a(l,{reason:t,previousFloor:c,signal:p.signal}),g=h!=null&&typeof h.then=="function"?h:void 0;if(!g){this.#r(e,n,t);return}this.#e=p,this.#t(g,p,e,n,t)}else this.#o(e,r,i,n,t)}#t(e,t,r,n,i){e.catch(a=>{x.error("setFloor override handler threw \u2014 completing floor change anyway",a)}).finally(()=>{if(t.signal.aborted){x.warn(`setFloor(${r}) discarded \u2014 superseded by a newer floor change`);return}this.#e===t&&(this.#e=void 0),this.#r(r,n,i)})}#o(e,t,r,n,i){this.currentFloorStack&&this.processFloorChange(e,r),t.setVisible(!0),this.#r(e,n,i)}#r(e,t,r){this.updateOutdoorPathLayerVisibility(),this.publish("floor-change",{reason:r,floorId:e,previousFloorId:t})}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(ro);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(jt),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:oe(),rotation:r.rotation,scale:c.scale,interactive:r.interactive},geometry:{type:"Point",coordinates:vt(h)}}))},c,{parent:l?.containerId??s?.id});if(p==null)throw new we("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??oe(),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=Or(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(Vt),c=this.renderer.addMarker2D(vt(e),t,{...s,occluderId:n?.occluderId,attachTo:i},l?.containerId);if(!c)throw new we("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){x.error(`Failed to retrieve state for Marker with id "${e}".`);return}if(n.type!=="marker"){x.error(`Geometry with id "${e}" is not of type "marker".`);return}this.renderer.setState(n,{position:t,parent:i?.layers.get(Vt)?.containerId})},animateTo:(e,t,r,n)=>{let i=this.renderer.getState(e),a=r?this.floorsById.get(r):this.currentFloor;if(!i)return x.error(`Failed to retrieve state for Marker with id "${e}".`),Promise.resolve();if(i.type!=="marker")return x.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 so({lon:i.position[0],lat:i.position[1]}).to({lon:t[0],lat:t[1]},s.duration).easing(ur[s.easing]).onUpdate(({lon:c,lat:p})=>{if(!this.renderer.getState(e))this.cancelAnimation(e);else{let g=a?.layers.get(Vt)?.containerId;g&&this.Markers.setPosition(e,[c,p],g)}}).start();return this.renderer.getInternalTweenGroup().add(l),this.renderer.render(),this.animations.set(e,l),js(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-"+oe(),{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){x.warn("Enterprise mode is not enabled, skipping label creation");return}let n=du(this.renderer,e,t,r);if(n)return{textInfo:n,target:e}},labelAll:(e={})=>{if(!this.api.getMapDataInternal()?.enterpriseMode)return x.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=du(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=Or(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:vt(e)}},g=oe();return this.renderer.addText3D(g,h,{appearance:{...i,fontSize:a,color:s,font:l||void 0}},Oo(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},v=(n?this.floorsById.get(n):this.currentFloor).layers.get(oo);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:Dr(s)},xe.is(s)?s.id:v?.containerId);I&&e(I.id,s.name,s)}})}},add:(e,t,r={})=>{let{attachTo:n,...i}=r,a=Or(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),s=a.layers.get(oo),l=this.renderer.addLabel2D(vt(e),t,{...i,occluderId:a.occluderId,attachTo:n},s?.containerId);if(!l)throw new we("label creating failed");return l},remove:({entityId:e})=>{this.renderer.remove(e)},removeAll:()=>{}};Paths={add:(e,t,r)=>{let n=t?Br(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:v}=p;h!==s&&(l++,s=h),a[l]==null&&a.push({floorId:h,coordinates:[]});let I=p.floorId===h?p:new z({longitude:v,latitude:g,floorId:h});a[l].coordinates.push(I)}let c=a.reduce((p,{floorId:h,coordinates:g},v)=>{if(v!==0){let O=a[v-1],D=O.coordinates[O.coordinates.length-1],A=g[0],W=vt(D),N=vt(A),B=this.floorsById.get(O.floorId),G=this.floorsById.get(h),F=B?.floorStackId,j=G?.floorStackId,te=F?this.getFloorStackAltitudeData(F):void 0,he=j?this.getFloorStackAltitudeData(j):void 0,ge=te?.get(B?.elevation??0)?.altitude??0,ie=he?.get(G?.elevation??0)?.altitude??0,ve=r?.__EXPERIMENTAL_JUNCTION_INSET??0;Ls(W,N,ve,ge,ie);let Be=r?Br(r):n,Ve=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:O.floorId},geometry:{type:"Point",coordinates:W}},{type:"Feature",properties:{parentId:h},geometry:{type:"Point",coordinates:N}}]},Be,this.id);Ve&&(i&&this.renderer.setState(Ve.id,{completeFraction:0}),p.push({...Ve,coordinates:[D,A]}))}if(g.length<2)return p;let I=this.floorsById.get(h)?.layers.get(ro)?.containerId,E=this.renderer.addPath({type:"FeatureCollection",features:g.map(O=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:vt(O)}}))},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 v=Yp(g,h,this.api);p.push(new so({fraction:0}).to({fraction:1},v?t?.drawDuration??1500:0).onUpdate(I=>{this.renderer.setState(g.id,{completeFraction:I.fraction})}))}),p.forEach((g,v)=>{v<p.length-1&&g.chain(p[v+1]),this.renderer.getInternalTweenGroup().add(g)}),p[0].start(),this.renderer.render(),this.animations.set(c[0].id.toString(),p[0]),{paths:c,animation:js(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)})}};#n={enabled:!1,floorGap:"auto",updateCameraElevationOnFloorChange:!0,footprintColor:io.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=zp(this.mvf["styles.json"]||{});if(this.styleMap=i,this.#n={...this.#n,...r?.multiFloorView},!t){this.id!=="outdoors-container"&&x.warn(`Map (${this.id}) created with no data.`);let l=new Rn({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 Nn(l.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this,this.#n,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 we("MVF does not contain any Floor Stacks.");for(let l of a){let c=new Rn(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 Nn(c.id,h,this,this.#n,r??{},this.mvf,i,t);this.floorsById.set(g.id,g),c.addFloor(g)}}if(c.floorObjects.length<1){x.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=hn(r.initialFloor);l&&this.floorsById.has(l)?s=l:x.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.#n)}};function du(o,e,t,r){return o.labelText3D(e.id,t??e.name,{...r,parentId:Oo(e.floor.id)})}f();var Vn=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:Dr(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 no(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){x.error("Cannot determine coordinate from target.");return}let n=this.currentMap;if(!n){x.error("Cannot determine the current map.");return}let i=this.#e.get(e.id);if(!i){x.error(`Cannot find the Marker with id "${e.id}".`);return}n.Markers.setPosition(i.entityId,vt(r),r.floorId??n.currentFloorId),i.marker.updateTarget(t)}animateTo(e,t,r){let n=t.anchorTarget;if(!n)return x.error("Cannot determine coordinate from target."),Promise.resolve();let i=this.currentMap;if(!i)return x.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,vt(n),n.floorId??i.currentFloorId,r)):(x.error(`Cannot find the Marker with id "${e.id}".`),Promise.resolve())}};f();var jn=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(vt(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 bt(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 Gn=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 x.error("Cannot determine coordinate from options."),l;let p=Or(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=oe();a.Models.add(p,l,{...r,url:t,floorId:c,verticalOffset:l[0].verticalOffset+(r?.verticalOffset??0)}).forEach(g=>{let v=new Qo(g.toString(),p,l[0]);this.#e.set(v.id,{model:v,entityId:g.toString(),groupId:p}),s.push(v)})}),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 z({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 Un=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 Pt(t?.id||oe(),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=Dn([e],t,r,i);if(!a)return;let s=n?.animationDuration??1500,l=()=>{},c=new Promise(h=>{l=h}),p=new so({fraction:0}).to({fraction:1},s).onUpdate(h=>{for(let g of a)this.currentMap?.api.updateState(g.segment,{highlightCompleteFraction:h.fraction})}).onStart(()=>{let h=this.currentMap?.api.core;if(h)for(let g of a)this.currentMap?.api.updateState(g.segment,Pn(h,g.segment.id,g,n))}).onComplete(()=>{l(),this.currentMap?.api.removeTween(p)});return this.currentMap?.api.tweenGroup().add(p),p.start(),{animation:c}}clearHighlightedPathSection(e){let t=this.currentMap?.api.core;if(t)for(let r of e.segments)this.currentMap?.api.updateState(r,On(t,r.id))}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 Hn=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 fo(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 Wn=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(Ce))continue;let n=r.layers.get(Ce);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===Po&&!(to in e)){let s=n.layers.get(to);s&&"color"in e[t]&&this.currentMap?.renderer.setState(s,{color:e[t].color})}if(!r.layers.has(Yo))continue;let i=r.layers.get(Yo),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 sl={opacity:1},Cy=["flyTo","jumpTo","easeTo","panTo","panBy","zoomTo","zoomIn","zoomOut","setZoom","setCenter","setCenterClampedToGround","setCenterElevation","setBearing","setPitch","setRoll","rotateTo","resetNorth","resetNorthPitch","snapToNorth","setPadding","fitBounds","fitScreenCoordinates"],Py=new Set(Cy),Vr=class{#e;#t=[];#o={opacity:"initial"};#r={opacity:new Map};#n=new Set;#i=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")??sl.opacity,e.getPaintProperty(r.id,"text-opacity")??sl.opacity]):this.#r.opacity.set(r.id,[e.getPaintProperty(r.id,`${r.type}-opacity`)??sl.opacity,void 0])))})}#c(){Object.values(this.#r).forEach(e=>e.clear())}setStyle(e){if(this.#e.map){this.#e.map?.setStyle(e),this.#n.size&&(this.#n.clear(),this.hide()),this.#c(),this.#s(this.#e.map),this.setOpacity(this.#o.opacity),this.#e.map?.moveLayer(Oc),this.#t.length>1&&x.error(`Outdoor.setStyle: ${this.#t.length} hiddenOutdoorGeometry entries; multi-map covering is not supported yet (only the last map's footprints will be reapplied).`);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.#i.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"&&(Py.has(s)?r[s]=(...c)=>(n.has(s)||(n.add(s),x.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.#i.set(e,r),r}get enabled(){return!!this.#e.map}get visible(){return this.#n.size===0}show(){let e=this.#e.map;if(!e)return;let t=e.getStyle().layers;t&&(t.forEach(r=>{this.#n.has(r.id)&&e.setLayoutProperty(r.id,"visibility","visible")}),this.#n.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.#n.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){x.warn("Error setting opacity:",s)}})})}};f();function Oy(){Ac(!1)}var zn=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 ho(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(xe.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 ho(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(!z.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 x.warn(`Text3DView with ID ${s} already exists. A new Text3DView will not be created. Returning existing. `),l.text3DView;let c=new ho(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 Ut from"zod";var uu="doors",ll=Ut.object({type:Ut.literal(uu).default(uu),color:Ut.string().default("#ffffff"),topColor:Ut.string().optional(),texture:Ut.object({url:Ut.string().optional()}).optional(),topTexture:Ut.object({url:Ut.string().optional()}).optional(),visible:Ut.boolean().default(!1),opacity:Ut.number().default(1)}),$i=ll.partial(),b5=Ut.strictObject(ll.shape);function fu(o,e){let{color:t,topColor:r,texture:n,topTexture:i,opacity:a}=o,s=e?.visible??!1;return He(ll,{visible:s,color:t,topColor:r,opacity:a,texture:n?{url:n}:void 0,topTexture:i?{url:i}:void 0})}function cl(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 hu(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 Xn}from"zod";var gu="facade",pl=Xn.object({type:Xn.literal(gu).default(gu),opacity:Xn.number().default(1),visible:Xn.boolean().default(!0)}),mu=pl.partial(),E5=Xn.strictObject(pl.shape);function yu(o){return He(pl,{opacity:o.opacity,visible:o.visible})}f();import{z as $}from"zod";var Ht="floor",bu=`${Ht}.footprint`,Tu=`${Ht}.geometry`,vu=`${Ht}.labels`,Iu=`${Ht}.markers`,Su=`${Ht}.images`,Eu=`${Ht}.occlusion`,Mu=`${Ht}.paths`,xu=`${Ht}.areas`,_u=`${Ht}.models`,er=$.object({type:$.literal(bu).default(bu),altitude:$.number().default(0),visible:$.boolean().default(!1),height:$.number().default(0),opacity:$.number().default(1),side:$.enum(["double","front","back"]).default("double"),color:$.string().default("#ffffff"),ceilingVisible:$.boolean().default(!0),basementMaskEnabled:$.boolean().default(!1),outline:$.boolean().default(!0),ceilingThickness:$.number().default(.2)}),D5=er.partial(),Yi=$.object({type:$.literal(Tu).default(Tu),opacity:$.number().default(1),visible:$.boolean().default(!0),maskId:$.number().nullable().default(null),maskEffect:$.enum(["hide","reveal"]).default("hide"),maskMode:$.enum(["mask","masked-object"]).default("mask"),maskEnabled:$.boolean().default(!1),effectStart:$.number().default(0),effectDistance:$.number().default(0),darkenAmount:$.number().default(0),darkenUseDepth:$.boolean().default(!0),desaturateAmount:$.number().default(0),desaturateUseDepth:$.boolean().default(!0),washOutAmount:$.number().default(0),washOutUseDepth:$.boolean().default(!1)}),Pu=Yi.partial(),Ji=$.object({type:$.literal(vu).default(vu),enabled:$.boolean().default(!0)}),Ou=Ji.partial(),Zi=$.object({type:$.literal(Iu).default(Iu),enabled:$.boolean().default(!0)}),Du=Zi.partial(),qi=$.object({type:$.literal(Su).default(Su),visible:$.boolean().default(!0),collisionsEnabled:$.boolean().default(!1)}),wu=qi.partial(),Qi=$.object({type:$.literal(Eu).default(Eu),enabled:$.boolean().default(!0)}),Au=Qi.partial(),Ki=$.object({type:$.literal(Mu).default(Mu),visible:$.boolean().default(!0)}),Fu=Ki.partial(),ea=$.object({type:$.literal(Ht).default(Ht),visible:$.boolean().default(!1),altitude:$.number().default(0)}),ta=$.object({type:$.literal(xu).default(xu),visible:$.boolean().default(!0)}),ku=ta.partial(),Dy=$.object({visible:$.boolean().default(!0)}),wy=$.object({visible:$.boolean().default(!0)}),oa=$.object({visible:$.boolean().default(!0),geometryText:Dy.default({visible:!0}),floorText:wy.default({visible:!0})}),Lu=oa.partial(),ra=$.object({type:$.literal(_u).default(_u),visible:$.boolean().default(!0)}),Nu=ra.partial(),Ay=$.object({...ea.shape,geometry:Yi,labels:Ji,markers:Zi,images:qi,footprint:er,occlusion:Qi,paths:Ki,areas:ta,text3d:oa,models:ra}),Ru=ea.partial(),w5=$.object({...ea.shape,geometry:Yi.partial(),labels:Ji.partial(),markers:Zi.partial(),images:qi.partial(),footprint:er.partial(),occlusion:Qi.partial(),paths:Ki.partial(),areas:ta.partial(),text3d:oa.partial(),models:ra.partial()}).partial(),A5=$.strictObject({...ea.shape,geometry:$.strictObject(Yi.shape),labels:$.strictObject(Ji.shape),markers:$.strictObject(Zi.shape),images:$.strictObject(qi.shape),footprint:$.strictObject(er.shape),occlusion:$.strictObject(Qi.shape),paths:$.strictObject(Ki.shape),areas:$.strictObject(ta.shape),text3d:$.strictObject(oa.shape),models:$.strictObject(ra.shape)});function Cu(o,e){let t=o?.getInternalState().geometry3DMap.get(e);if(t?.type!=="group-container")return!0;let r=t,n=o?.getSystems().text3DSystem;return n?.getBatchedText(r)?.visible??n?.getBatchVisible(r)??!0}function Bu(o,e,t){if(!e){x.error("Floor is not defined. Cannot get floor state.");return}let r=e.layers.get(Ce),n=r?t?.getState(r.containerId):void 0,i=e.layers.get(oo),a=e.layers.get(Vt),s=e.footprintObject?.getState(),l=e.layers.get(Xo),c=l?t?.getState(l.containerId):void 0,p=e.layers.get(xr),h=p?t?.getState(p.containerId):void 0,g=!1;if(r?.layers)for(let ge of r.layers.values()){let ie=t?.getState(ge);if(ie?.children?.[0]){g=t?.getState(ie.children[0])?.enableImageCollisions??!1;break}}let v=e.layers.get(ro),I=v?t?.getState(v.containerId):void 0,E=e.layers.get($o),O=E?t?.getState(E.containerId):void 0,D=e.layers.get(jt),A=D?t?.getState(D.containerId):void 0,W=!0,N=!0,B=!0,G=!0;for(let[,ge]of r.layers){let ie=t?.getState(ge);ie?.maskId||(W=!1),ie?.maskEffect||(N=!1),ie?.maskMode||(B=!1),ie?.maskEnabled||(G=!1)}let F=e.layers.get(Jo),j=F?t?.getState(F.containerId):void 0,te=Cu(t,Oo(e.id)),he=Cu(t,_r(e.id));return He(Ay,{geometry:{opacity:n?.opacity,visible:n?.visible,maskId:W,maskEffect:N,maskMode:B,maskEnabled:G},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:O?.visible},text3d:{visible:j?.visible,geometryText:{visible:te},floorText:{visible:he}},models:{visible:A?.visible},visible:o.visible,altitude:o.altitude})}f();import{z as Te}from"zod";var Vu="geometry",dl=Te.object({type:Te.literal(Vu).default(Vu),visible:Te.boolean().default(!0),color:Te.union([Te.string(),Te.literal("initial")]).default("#ffffff"),topColor:Te.union([Te.string(),Te.literal("initial")]).optional(),hoverColor:Te.union([Te.string(),Te.literal("initial")]).optional(),interactive:Te.union([Te.boolean(),Te.literal("pass-through")]).default(!1),opacity:Te.number().default(1),height:Te.number().default(0),altitude:Te.number().default(0),texture:Te.object({url:Te.string()}).optional(),topTexture:Te.object({url:Te.string()}).optional(),flipImageToFaceCamera:Te.boolean().default(!1),enableImageCollisions:Te.boolean().default(!1),borderVisible:Te.boolean().default(!1),borderColor:Te.string().optional(),borderWidth:Te.number().optional()}),ul=dl.partial(),R5=Te.strictObject(dl.shape);function ju(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:v,borderColor:I,borderWidth:E}=o;return He(dl,{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:v,borderColor:I,borderWidth:E})}function Gu(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 Ot from"zod";var fl="label",Fy=Ot.object({type:Ot.literal(fl).default(fl),text:Ot.string(),rank:Ot.custom(o=>bi.safeParse(o).success||o==="initial"),appearance:Ot.custom(o=>Fc.safeParse(o).success),interactive:Ot.boolean().default(!1),enabled:Ot.boolean().default(!0),textPlacement:Ot.union([Ot.enum(Ga),Ot.array(Ot.enum(Ga))]).default(Ua),occlude:Ot.boolean().default(!0)}),Uu=Fy.partial();function Hu(o){let{text:e,enabled:t,options:r}=o;return{type:fl,text:e??"",appearance:kc(r?.appearance??{}),rank:r?.rank??"medium",enabled:t??!0,interactive:r?.interactive??!1,textPlacement:r?.textPlacement??Ua,occlude:r?.occlude??!0}}function Wu(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 Pe from"zod";var hl="marker",ky=Pe.object({type:Pe.literal(hl).default(hl),rank:Pe.custom(o=>bi.safeParse(o).success||o==="initial"),placement:Pe.union([Pe.enum(Ha),Pe.array(Pe.enum(Ha))]).optional(),interactive:Pe.union([Pe.boolean(),Pe.literal("pointer-events-auto")]).default(!1),dynamicResize:Pe.boolean().default(!0),enabled:Pe.boolean().default(!0),zIndex:Pe.number().optional(),lowPriorityPin:Pe.object({enabled:Pe.boolean().optional(),size:Pe.number().positive().optional(),color:Pe.string().optional()}).optional(),element:Pe.custom(o=>o instanceof HTMLElement,{error:"Must be an HTMLElement instance"}),contentHTML:Pe.string(),occlude:Pe.boolean().default(!0),animated:Pe.boolean().default(!0)}),zu=ky.omit({element:!0}).partial();function Xu(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 z({latitude:c?.[1]??0,longitude:c?.[0]??0,floorId:h?.toString()})),{type:hl,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 $u(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 Re}from"zod";var Yu="shape",gl=Re.object({type:Re.literal(Yu).default(Yu),visible:Re.boolean().default(!0),altitude:Re.number().default(0),color:Re.string().default("#ffffff"),hoverColor:Re.string().optional(),height:Re.number().default(0),opacity:Re.number().default(1),interactive:Re.union([Re.boolean(),Re.literal("pass-through")]).default(!1),bevel:Re.object({enabled:Re.boolean().optional(),thickness:Re.number().optional(),size:Re.number().optional(),offset:Re.number().optional(),segments:Re.number().optional()}).optional(),position:Re.custom(o=>z.is(o))}),ml=gl.partial(),K5=Re.strictObject(gl.shape);function Ju(o){let{children:e,bevel:t,position:r}=o;if(e==null||e.length<1){x.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 He(gl,{altitude:p,visible:c,color:n,hoverColor:i,height:l,opacity:a,interactive:s,bevel:t,position:new z({latitude:r[1],longitude:r[0],verticalOffset:p??0})})}function Zu(o){let e=fe(ml,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 na from"zod";var qu="text3d",Qu=na.object({type:na.literal(qu).default(qu),position:na.custom(o=>o instanceof z,{error:"Must be a Coordinate instance"})}),Ku=Cc.extend({...Qu.shape}),ef=Pc.extend({...Qu.shape}).partial(),aC=na.strictObject(Ku.shape);function tf(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:v,strokeOpacity:I,strokeColor:E,fillOpacity:O,hoverColor:D,rotation:A,content:W}=o;return He(Ku,{position:new z({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:v,strokeOpacity:I,strokeColor:E,fillOpacity:O,hoverColor:D,rotation:A,content:W})}f();import ut from"zod";var of="walls",yl=ut.object({type:ut.literal(of).default(of),color:ut.string().default("#ffffff"),topColor:ut.string().optional(),texture:ut.object({url:ut.string()}).or(ut.undefined()),topTexture:ut.object({url:ut.string()}).or(ut.undefined()),visible:ut.boolean().default(!0),height:ut.number().default(0),opacity:ut.number().default(1)}),bl=yl.partial(),dC=ut.strictObject(yl.shape);function rf(o){let{color:e,topColor:t,texture:r,topTexture:n,visible:i,height:a,opacity:s}=o;return He(yl,{visible:i,color:e,topColor:t,texture:r?{url:r}:void 0,topTexture:n?{url:n}:void 0,height:a,opacity:s})}function Tl(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 Wt}from"zod";var vl="image3d",Ly=Wt.object({type:Wt.literal(vl).default(vl),visible:Wt.boolean().default(!0),opacity:Wt.number().min(0).max(1).default(1),position:Wt.custom(o=>o instanceof z,{error:"Must be a Coordinate instance"}),width:Wt.number().default(1),height:Wt.number().default(1),rotation:Wt.number().default(0),verticalOffset:Wt.number().default(0),flipImagesToFaceCamera:Wt.boolean().default(!1),interactive:Wt.boolean().default(!1)}),nf=Ly.partial();function af(o){let{position:e}=o;return{type:vl,visible:o.visible??!0,opacity:o.opacity??1,position:new z({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 ce}from"zod";var sf="model",Il=xc.extend({type:ce.literal(sf).default(sf),color:ce.string().optional(),position:ce.custom(o=>z.is(o),{error:"Expected a Coordinate"}),visible:ce.boolean().default(!0),rotation:ce.tuple([ce.number(),ce.number(),ce.number()]).default([0,0,0]),scale:ce.tuple([ce.number(),ce.number(),ce.number()]).default([1,1,1]),verticalOffset:ce.number().default(0),opacity:ce.number().default(1),material:ce.record(ce.string(),_c).optional(),interactive:ce.boolean().default(!1),clippingPlaneZOffset:ce.custom(o=>typeof o=="number"&&!Number.isNaN(o),{message:"Must be a valid number (including Infinity)"}).default(1/0),clippingPlaneTopColor:ce.string().default("#E67B5B"),clippingPlaneTopVisible:ce.boolean().default(!0)}),lf=Il.extend({scale:ce.union([ce.number(),ce.tuple([ce.number(),ce.number(),ce.number()])]),rotation:ce.union([ce.number(),ce.tuple([ce.number(),ce.number(),ce.number()])])}).partial(),EC=ce.strictObject(Il.shape);function cf(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:v}=o,I=typeof p=="object"?p?.id?.toString():p?.toString(),E=`${jt}-`,O=I?.startsWith(E)?I.slice(E.length):I;return He(Il,{color:e,position:new z({latitude:t?.[1]??0,longitude:t?.[0]??0,verticalOffset:t?.[2],floorId:O}),rotation:r,scale:n,visible:i,interactive:a,opacity:s,material:l,verticalOffset:c,clippingPlaneZOffset:h,clippingPlaneTopColor:g,clippingPlaneTopVisible:v})}f();f();f();var Ur=di(Kf());Ur.registerHelper({});Ur.registerPartial({});var eh=Ur.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
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
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
254
|
</div>
|
|
255
|
-
</div>`},useData:!0});var
|
|
256
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gb(o,e){return ub(o)||fb(o,e)||mb(o,e)||hb()}function mb(o,e){if(o){if(typeof o=="string")return ih(o,e);var t={}.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ih(o,e):void 0}}var vh=Object.entries,ah=Object.setPrototypeOf,yb=Object.isFrozen,bb=Object.getPrototypeOf,Tb=Object.getOwnPropertyDescriptor,Je=Object.freeze,qe=Object.seal,zr=Object.create,Ih=typeof Reflect<"u"&&Reflect,Wl=Ih.apply,zl=Ih.construct;Je||(Je=function(e){return e});qe||(qe=function(e){return e});Wl||(Wl=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)});zl||(zl=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 Hr=Fe(Array.prototype.forEach),vb=Fe(Array.prototype.lastIndexOf),sh=Fe(Array.prototype.pop),Wr=Fe(Array.prototype.push),Ib=Fe(Array.prototype.splice),Bo=Array.isArray,Kn=Fe(String.prototype.toLowerCase),Vl=Fe(String.prototype.toString),lh=Fe(String.prototype.match),qn=Fe(String.prototype.replace),ch=Fe(String.prototype.indexOf),Sb=Fe(String.prototype.trim),Eb=Fe(Number.prototype.toString),Mb=Fe(Boolean.prototype.toString),ph=typeof BigInt>"u"?null:Fe(BigInt.prototype.toString),dh=typeof Symbol>"u"?null:Fe(Symbol.prototype.toString),ze=Fe(Object.prototype.hasOwnProperty),Qn=Fe(Object.prototype.toString),We=Fe(RegExp.prototype.test),rr=xb(TypeError);function Fe(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 Wl(o,e,r)}}function xb(o){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return zl(o,t)}}function le(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kn;if(ah&&ah(o,null),!Bo(e))return o;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let i=t(n);i!==n&&(yb(e)||(e[r]=i),n=i)}o[n]=!0}return o}function _b(o){for(let e=0;e<o.length;e++)ze(o,e)||(o[e]=null);return o}function tt(o){let e=zr(null);for(let r of vh(o)){var t=gb(r,2);let n=t[0],i=t[1];ze(o,n)&&(Bo(i)?e[n]=_b(i):i&&typeof i=="object"&&i.constructor===Object?e[n]=tt(i):e[n]=i)}return e}function Cb(o){switch(typeof o){case"string":return o;case"number":return Eb(o);case"boolean":return Mb(o);case"bigint":return ph?ph(o):"0";case"symbol":return dh?dh(o):"Symbol()";case"undefined":return Qn(o);case"function":case"object":{if(o===null)return Qn(o);let e=o,t=Xt(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:Qn(r)}return Qn(o)}default:return Qn(o)}}function Xt(o,e){for(;o!==null;){let r=Tb(o,e);if(r){if(r.get)return Fe(r.get);if(typeof r.value=="function")return Fe(r.value)}o=bb(o)}function t(){return null}return t}function Pb(o){try{return We(o,""),!0}catch{return!1}}var uh=Je(["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"]),jl=Je(["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"]),Gl=Je(["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"]),Ob=Je(["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"]),Ul=Je(["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"]),wb=Je(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fh=Je(["#text"]),hh=Je(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Hl=Je(["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","dominant-baseline","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-orientation","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"]),gh=Je(["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"]),Ea=Je(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Db=qe(/{{[\w\W]*|^[\w\W]*}}/g),Fb=qe(/<%[\w\W]*|^[\w\W]*%>/g),Ab=qe(/\${[\w\W]*/g),kb=qe(/^data-[\-\w.\u00B7-\uFFFF]+$/),Lb=qe(/^aria-[\-\w]+$/),mh=qe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Nb=qe(/^(?:\w+script|data):/i),Rb=qe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bb=qe(/^html$/i),Vb=qe(/^[a-z][.\w]*(-[.\w]+)+$/i),yh=qe(/<[/\w!]/g),bh=qe(/<[/\w]/g),jb=qe(/<\/no(script|embed|frames)/i),Gb=qe(/\/>/i),St={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ub=function(){return typeof window>"u"?null:window},Hb=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}},Th=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ro=function(e,t,r,n){return ze(e,t)&&Bo(e[t])?le(n.base?tt(n.base):{},e[t],n.transform):r};function Sh(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ub(),e=H=>Sh(H);if(e.version="3.4.13",e.removed=[],!o||!o.document||o.document.nodeType!==St.document||!o.Element)return e.isSupported=!1,e;let t=o.document,r=t,n=r.currentScript;o.DocumentFragment;let i=o.HTMLTemplateElement,a=o.Node,s=o.Element,l=o.NodeFilter,c=o.NamedNodeMap;c===void 0&&(o.NamedNodeMap||o.MozNamedAttrMap),o.HTMLFormElement;let p=o.DOMParser,h=o.trustedTypes,g=s.prototype,v=Xt(g,"cloneNode"),I=Xt(g,"remove"),E=Xt(g,"nextSibling"),O=Xt(g,"childNodes"),w=Xt(g,"parentNode"),F=Xt(g,"shadowRoot"),W=Xt(g,"attributes"),N=a&&a.prototype?Xt(a.prototype,"nodeType"):null,B=a&&a.prototype?Xt(a.prototype,"nodeName"):null,G=a&&a.prototype?Xt(a.prototype,"ownerDocument"):null;if(typeof i=="function"){let H=t.createElement("template");H.content&&H.content.ownerDocument&&(t=H.content.ownerDocument)}let A,j="",te,he=!1,ge=0,ie=function(){if(ge>0)throw rr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Te=function(y){ie(),ge++;try{return A.createHTML(y)}finally{ge--}},Be=function(y){ie(),ge++;try{return A.createScriptURL(y)}finally{ge--}},Ve=function(){return he||(te=Hb(h,n),he=!0),te},pe=t,$e=pe.implementation,wt=pe.createNodeIterator,ot=pe.createDocumentFragment,ve=pe.getElementsByTagName,mo=r.importNode,se=Th();e.isSupported=typeof vh=="function"&&typeof w=="function"&&$e&&$e.createHTMLDocument!==void 0;let Et=Db,Dt=Fb,$t=Ab,Ft=kb,yo=Lb,bo=Nb,Vo=Rb,ir=Vb,ar=mh,re=null,jo=le({},[...uh,...jl,...Gl,...Ul,...fh]),ae=null,To=le({},[...hh,...Hl,...gh,...Ea]),Se=Object.seal(zr(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}})),vo=null,Go=null,At=Object.seal(zr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ri=!0,Yr=!0,Zr=!1,ni=!0,Yt=!1,Oe=!0,Io=!1,ii=!1,Jr=null,qr=null,Qr=!1,M=!1,d=!1,u=!1,m=!0,T=!1,b="user-content-",D=!0,C=!1,L={},k=null,X=le({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),P=null,R=le({},["audio","video","img","source","image","track"]),U=null,K=le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),J="http://www.w3.org/1998/Math/MathML",ne="http://www.w3.org/2000/svg",Q="http://www.w3.org/1999/xhtml",de=Q,we=!1,Ee=null,je=le({},[J,ne,Q],Vl),Ae=Je(["mi","mo","mn","ms","mtext"]),Qe=le({},Ae),ke=Je(["annotation-xml"]),rt=le({},ke),ft=le({},["title","style","font","a","script"]),Ye=null,ht=["application/xhtml+xml","text/html"],kt="text/html",me=null,So=null,_a=t.createElement("form"),ai=function(y){return y instanceof RegExp||y instanceof Function},Ca=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(So&&So===y)return;(!y||typeof y!="object")&&(y={}),y=tt(y),Ye=ht.indexOf(y.PARSER_MEDIA_TYPE)===-1?kt:y.PARSER_MEDIA_TYPE,me=Ye==="application/xhtml+xml"?Vl:Kn,re=Ro(y,"ALLOWED_TAGS",jo,{transform:me}),ae=Ro(y,"ALLOWED_ATTR",To,{transform:me}),Ee=Ro(y,"ALLOWED_NAMESPACES",je,{transform:Vl}),U=Ro(y,"ADD_URI_SAFE_ATTR",K,{transform:me,base:K}),P=Ro(y,"ADD_DATA_URI_TAGS",R,{transform:me,base:R}),k=Ro(y,"FORBID_CONTENTS",X,{transform:me}),vo=Ro(y,"FORBID_TAGS",tt({}),{transform:me}),Go=Ro(y,"FORBID_ATTR",tt({}),{transform:me}),L=ze(y,"USE_PROFILES")?y.USE_PROFILES&&typeof y.USE_PROFILES=="object"?tt(y.USE_PROFILES):y.USE_PROFILES:!1,ri=y.ALLOW_ARIA_ATTR!==!1,Yr=y.ALLOW_DATA_ATTR!==!1,Zr=y.ALLOW_UNKNOWN_PROTOCOLS||!1,ni=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Yt=y.SAFE_FOR_TEMPLATES||!1,Oe=y.SAFE_FOR_XML!==!1,Io=y.WHOLE_DOCUMENT||!1,M=y.RETURN_DOM||!1,d=y.RETURN_DOM_FRAGMENT||!1,u=y.RETURN_TRUSTED_TYPE||!1,Qr=y.FORCE_BODY||!1,m=y.SANITIZE_DOM!==!1,T=y.SANITIZE_NAMED_PROPS||!1,D=y.KEEP_CONTENT!==!1,C=y.IN_PLACE||!1,ar=Pb(y.ALLOWED_URI_REGEXP)?y.ALLOWED_URI_REGEXP:mh,de=typeof y.NAMESPACE=="string"?y.NAMESPACE:Q,Qe=ze(y,"MATHML_TEXT_INTEGRATION_POINTS")&&y.MATHML_TEXT_INTEGRATION_POINTS&&typeof y.MATHML_TEXT_INTEGRATION_POINTS=="object"?tt(y.MATHML_TEXT_INTEGRATION_POINTS):le({},Ae),rt=ze(y,"HTML_INTEGRATION_POINTS")&&y.HTML_INTEGRATION_POINTS&&typeof y.HTML_INTEGRATION_POINTS=="object"?tt(y.HTML_INTEGRATION_POINTS):le({},ke);let _=ze(y,"CUSTOM_ELEMENT_HANDLING")&&y.CUSTOM_ELEMENT_HANDLING&&typeof y.CUSTOM_ELEMENT_HANDLING=="object"?tt(y.CUSTOM_ELEMENT_HANDLING):zr(null);if(Se=zr(null),ze(_,"tagNameCheck")&&ai(_.tagNameCheck)&&(Se.tagNameCheck=_.tagNameCheck),ze(_,"attributeNameCheck")&&ai(_.attributeNameCheck)&&(Se.attributeNameCheck=_.attributeNameCheck),ze(_,"allowCustomizedBuiltInElements")&&typeof _.allowCustomizedBuiltInElements=="boolean"&&(Se.allowCustomizedBuiltInElements=_.allowCustomizedBuiltInElements),qe(Se),Yt&&(Yr=!1),d&&(M=!0),L&&(re=le({},fh),ae=zr(null),L.html===!0&&(le(re,uh),le(ae,hh)),L.svg===!0&&(le(re,jl),le(ae,Hl),le(ae,Ea)),L.svgFilters===!0&&(le(re,Gl),le(ae,Hl),le(ae,Ea)),L.mathMl===!0&&(le(re,Ul),le(ae,gh),le(ae,Ea))),At.tagCheck=null,At.attributeCheck=null,ze(y,"ADD_TAGS")&&(typeof y.ADD_TAGS=="function"?At.tagCheck=y.ADD_TAGS:Bo(y.ADD_TAGS)&&(re===jo&&(re=tt(re)),le(re,y.ADD_TAGS,me))),ze(y,"ADD_ATTR")&&(typeof y.ADD_ATTR=="function"?At.attributeCheck=y.ADD_ATTR:Bo(y.ADD_ATTR)&&(ae===To&&(ae=tt(ae)),le(ae,y.ADD_ATTR,me))),ze(y,"ADD_URI_SAFE_ATTR")&&Bo(y.ADD_URI_SAFE_ATTR)&&le(U,y.ADD_URI_SAFE_ATTR,me),ze(y,"FORBID_CONTENTS")&&Bo(y.FORBID_CONTENTS)&&(k===X&&(k=tt(k)),le(k,y.FORBID_CONTENTS,me)),ze(y,"ADD_FORBID_CONTENTS")&&Bo(y.ADD_FORBID_CONTENTS)&&(k===X&&(k=tt(k)),le(k,y.ADD_FORBID_CONTENTS,me)),D&&(re["#text"]=!0),Io&&le(re,["html","head","body"]),re.table&&(le(re,["tbody"]),delete vo.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw rr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let V=A;A=y.TRUSTED_TYPES_POLICY;try{j=Te("")}catch(Z){throw A=V,Z}}else y.TRUSTED_TYPES_POLICY===null?(A=void 0,j=""):(A===void 0&&(A=Ve()),A&&typeof j=="string"&&(j=Te("")));Je&&Je(y),So=y},tc=le({},[...jl,...Gl,...Ob]),oc=le({},[...Ul,...wb]),Yh=function(y,_,V){return _.namespaceURI===Q?y==="svg":_.namespaceURI===J?y==="svg"&&(V==="annotation-xml"||Qe[V]):!!tc[y]},Zh=function(y,_,V){return _.namespaceURI===Q?y==="math":_.namespaceURI===ne?y==="math"&&rt[V]:!!oc[y]},Jh=function(y,_,V){return _.namespaceURI===ne&&!rt[V]||_.namespaceURI===J&&!Qe[V]?!1:!oc[y]&&(ft[y]||!tc[y])},qh=function(y){let _=w(y);(!_||!_.tagName)&&(_={namespaceURI:de,tagName:"template"});let V=Kn(y.tagName),Z=Kn(_.tagName);return Ee[y.namespaceURI]?y.namespaceURI===ne?Yh(V,_,Z):y.namespaceURI===J?Zh(V,_,Z):y.namespaceURI===Q?Jh(V,_,Z):!!(Ye==="application/xhtml+xml"&&Ee[y.namespaceURI]):!1},Eo=function(y){Wr(e.removed,{element:y});try{w(y).removeChild(y)}catch{if(I(y),!w(y))throw rr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},si=function(y){Kr(y);let _=O(y);if(_){let Z=[];Hr(_,q=>{Wr(Z,q)}),Hr(Z,q=>{try{I(q)}catch{}})}let V=W(y);if(V)for(let Z=V.length-1;Z>=0;--Z){let q=V[Z],ee=q&&q.name;if(typeof ee=="string")try{y.removeAttribute(ee)}catch{}}},Uo=function(y,_){try{Wr(e.removed,{attribute:_.getAttributeNode(y),from:_})}catch{Wr(e.removed,{attribute:null,from:_})}if(_.removeAttribute(y),y==="is")if(M||d)try{Eo(_)}catch{}else try{_.setAttribute(y,"")}catch{}},Qh=function(y){let _=W(y);if(_)for(let V=_.length-1;V>=0;--V){let Z=_[V],q=Z&&Z.name;if(!(typeof q!="string"||ae[me(q)]))try{y.removeAttribute(q)}catch{}}},Kr=function(y){let _=[y];for(;_.length>0;){let V=_.pop();(N?N(V):V.nodeType)===St.element&&Qh(V);let q=O(V);if(q)for(let ee=q.length-1;ee>=0;--ee)_.push(q[ee])}},Kh=function(y){if(!Oe)return;let _=[y];for(;_.length>0;){let V=_.pop(),Z=N?N(V):V.nodeType;if(Z===St.processingInstruction||Z===St.comment&&We(bh,V.data)){try{I(V)}catch{}continue}if(Z===St.element){let ee=V,ye=me(B?B(V):V.nodeName);try{ee.hasAttribute&&ee.hasAttribute("patchsrc")&&ee.removeAttribute("patchsrc"),ee.hasAttribute&&ee.hasAttribute("for")&&ye!=="label"&&ye!=="output"&&ee.removeAttribute("for")}catch{}}let q=O(V);if(q)for(let ee=q.length-1;ee>=0;--ee)_.push(q[ee])}},rc=function(y){let _=null,V=null;if(Qr)y="<remove></remove>"+y;else{let ee=lh(y,/^[\r\n\t ]+/);V=ee&&ee[0]}Ye==="application/xhtml+xml"&&de===Q&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");let Z=A?Te(y):y;if(de===Q)try{_=new p().parseFromString(Z,Ye)}catch{}if(!_||!_.documentElement){_=$e.createDocument(de,"template",null);try{_.documentElement.innerHTML=we?j:Z}catch{}}let q=_.body||_.documentElement;return y&&V&&q.insertBefore(t.createTextNode(V),q.childNodes[0]||null),de===Q?ve.call(_,Io?"html":"body")[0]:Io?_.documentElement:q},nc=function(y){let _=G?G(y):y.ownerDocument;return wt.call(_||y,y,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},li=function(y){return y=qn(y,Et," "),y=qn(y,Dt," "),y=qn(y,$t," "),y},Pa=function(y){var _;y.normalize();let V=G?G(y):y.ownerDocument,Z=wt.call(V||y,y,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),q=Z.nextNode();for(;q;)q.data=li(q.data),q=Z.nextNode();let ee=(_=y.querySelectorAll)===null||_===void 0?void 0:_.call(y,"template");ee&&Hr(ee,ye=>{sr(ye.content)&&Pa(ye.content)})},ci=function(y){let _=B?B(y):null;return typeof _!="string"||me(_)!=="form"?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||y.attributes!==W(y)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function"||y.nodeType!==N(y)||y.childNodes!==O(y)},sr=function(y){if(!N||typeof y!="object"||y===null)return!1;try{return N(y)===St.documentFragment}catch{return!1}},en=function(y){if(!N||typeof y!="object"||y===null)return!1;try{return typeof N(y)=="number"}catch{return!1}};function Zt(H,y,_){H.length!==0&&Hr(H,V=>{V.call(e,y,_,So)})}let eg=function(y,_){return!!(Oe&&y.hasChildNodes()&&!en(y.firstElementChild)&&We(yh,y.textContent)&&We(yh,y.innerHTML)||Oe&&y.namespaceURI===Q&&_==="style"&&en(y.firstElementChild)||y.nodeType===St.processingInstruction||Oe&&y.nodeType===St.comment&&We(bh,y.data))},tg=function(y,_,V){if(!vo[_]&&lc(_)&&(Se.tagNameCheck instanceof RegExp&&We(Se.tagNameCheck,_)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(_)))return!1;if(D&&!k[_]){let Z=w(y),q=O(y);if(q&&Z){let ee=q.length;for(let ye=ee-1;ye>=0;--ye){let Me=y===V?v(q[ye],!0):q[ye];Z.insertBefore(Me,E(y))}}}return Eo(y),!0},ic=function(y,_,V,Z){return y.length===0?_:_===V||_===Z?tt(_):_},ac=function(y,_){if(Zt(se.beforeSanitizeElements,y,null),y!==_&&w(y)===null)return C&&Kr(y),!0;if(ci(y))return Eo(y),!0;let V=me(B?B(y):y.nodeName);if(re=ic(se.uponSanitizeElement,re,jo,Jr),Zt(se.uponSanitizeElement,y,{tagName:V,allowedTags:re}),y!==_&&w(y)===null)return C&&Kr(y),!0;if(eg(y,V))return Eo(y),!0;if(vo[V]||!(At.tagCheck instanceof Function&&At.tagCheck(V))&&!re[V]){let q=tg(y,V,_);return q===!1&&Zt(se.afterSanitizeElements,y,null),q}if((N?N(y):y.nodeType)===St.element&&!qh(y)||(V==="noscript"||V==="noembed"||V==="noframes")&&We(jb,y.innerHTML))return Eo(y),!0;if(Yt&&y.nodeType===St.text){let q=li(y.textContent);y.textContent!==q&&(Wr(e.removed,{element:y.cloneNode()}),y.textContent=q)}return Zt(se.afterSanitizeElements,y,null),!1},sc=function(y,_,V){if(Go[_]||Oe&&_==="patchsrc"||Oe&&_==="for"&&y!=="label"&&y!=="output"||m&&(_==="id"||_==="name")&&(V in t||V in _a))return!1;let Z=ae[_]||At.attributeCheck instanceof Function&&At.attributeCheck(_,y);if(!(Yr&&We(Ft,_))){if(!(ri&&We(yo,_))){if(Z){if(!U[_]){if(!We(ar,qn(V,Vo,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&y!=="script"&&ch(V,"data:")===0&&P[y])){if(!(Zr&&!We(bo,qn(V,Vo,"")))){if(V)return!1}}}}}else if(!(lc(y)&&(Se.tagNameCheck instanceof RegExp&&We(Se.tagNameCheck,y)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(y))&&(Se.attributeNameCheck instanceof RegExp&&We(Se.attributeNameCheck,_)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(_,y))||_==="is"&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&We(Se.tagNameCheck,V)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(V))))return!1}}return!0},og=le({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),lc=function(y){return!og[Kn(y)]&&We(ir,y)},rg=function(y,_,V,Z){if(A&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!V)switch(h.getAttributeType(y,_)){case"TrustedHTML":return Te(Z);case"TrustedScriptURL":return Be(Z)}return Z},ng=function(y,_,V,Z){try{V?y.setAttributeNS(V,_,Z):y.setAttribute(_,Z),ci(y)?Eo(y):sh(e.removed)}catch{Uo(_,y)}},cc=function(y){Zt(se.beforeSanitizeAttributes,y,null);let _=y.attributes;if(!_||ci(y))return;ae=ic(se.uponSanitizeAttribute,ae,To,qr);let V={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0},Z=_.length,q=me(y.nodeName);for(;Z--;){let ee=_[Z],ye=ee.name,Me=ee.namespaceURI,st=ee.value,lt=me(ye),wa=st,nt=ye==="value"?wa:Sb(wa);if(V.attrName=lt,V.attrValue=nt,V.keepAttr=!0,V.forceKeepAttr=void 0,Zt(se.uponSanitizeAttribute,y,V),nt=V.attrValue,T&&(lt==="id"||lt==="name")&&ch(nt,b)!==0&&(Uo(ye,y),nt=b+nt),Oe&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,nt)){Uo(ye,y);continue}if(lt==="attributename"&&lh(nt,"href")){Uo(ye,y);continue}if(!V.forceKeepAttr){if(!V.keepAttr){Uo(ye,y);continue}if(!ni&&We(Gb,nt)){Uo(ye,y);continue}if(Yt&&(nt=li(nt)),!sc(q,lt,nt)){Uo(ye,y);continue}nt=rg(q,lt,Me,nt),nt!==wa&&ng(y,ye,Me,nt)}}Zt(se.afterSanitizeAttributes,y,null)},pi=function(y){let _=null,V=nc(y);for(Zt(se.beforeSanitizeShadowDOM,y,null);_=V.nextNode();)if(Zt(se.uponSanitizeShadowNode,_,null),ac(_,y),cc(_),sr(_.content)&&pi(_.content),(N?N(_):_.nodeType)===St.element){let q=F(_);sr(q)&&(Oa(q),pi(q))}Zt(se.afterSanitizeShadowDOM,y,null)},Oa=function(y){let _=[{node:y,shadow:null}];for(;_.length>0;){let V=_.pop();if(V.shadow){pi(V.shadow);continue}let Z=V.node,ee=(N?N(Z):Z.nodeType)===St.element,ye=O(Z);if(ye)for(let Me=ye.length-1;Me>=0;--Me)_.push({node:ye[Me],shadow:null});if(ee){let Me=B?B(Z):null;if(typeof Me=="string"&&me(Me)==="template"){let st=Z.content;sr(st)&&_.push({node:st,shadow:null})}}if(ee){let Me=F(Z);sr(Me)&&_.push({node:null,shadow:Me},{node:Me,shadow:null})}}};return e.sanitize=function(H){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,V=null,Z=null,q=null;if(we=!H,we&&(H="<!-->"),typeof H!="string"&&!en(H)&&(H=Cb(H),typeof H!="string"))throw rr("dirty is not a string, aborting");if(!e.isSupported)return H;ii?(re=Jr,ae=qr):Ca(y),(se.uponSanitizeElement.length>0||se.uponSanitizeAttribute.length>0)&&(re=tt(re)),se.uponSanitizeAttribute.length>0&&(ae=tt(ae)),e.removed=[];let ee=C&&typeof H!="string"&&en(H);if(ee){Kh(H);let st=B?B(H):H.nodeName;if(typeof st=="string"){let lt=me(st);if(!re[lt]||vo[lt])throw si(H),rr("root node is forbidden and cannot be sanitized in-place")}if(ci(H))throw si(H),rr("root node is clobbered and cannot be sanitized in-place");try{Oa(H)}catch(lt){throw si(H),lt}}else if(en(H))_=rc("<!---->"),V=_.ownerDocument.importNode(H,!0),V.nodeType===St.element&&V.nodeName==="BODY"||V.nodeName==="HTML"?_=V:_.appendChild(V),Oa(V);else{if(!M&&!Yt&&!Io&&H.indexOf("<")===-1)return A&&u?Te(H):H;if(_=rc(H),!_)return M?null:u?j:""}_&&Qr&&Eo(_.firstChild);let ye=ee?H:_;try{let st=nc(ye);for(;Z=st.nextNode();)ac(Z,ye),cc(Z),sr(Z.content)&&pi(Z.content)}catch(st){throw ee&&(si(H),Hr(e.removed,lt=>{lt.element&&Kr(lt.element)})),st}if(ee)return Hr(e.removed,st=>{st.element&&Kr(st.element)}),Yt&&Pa(H),H;if(M){if(Yt&&Pa(_),d)for(q=ot.call(_.ownerDocument);_.firstChild;)q.appendChild(_.firstChild);else q=_;return(ae.shadowroot||ae.shadowrootmode)&&(q=mo.call(r,q,!0)),q}let Me=Io?_.outerHTML:_.innerHTML;return Io&&re["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&We(Bb,_.ownerDocument.doctype.name)&&(Me="<!DOCTYPE "+_.ownerDocument.doctype.name+`>
|
|
257
|
-
`+Me),
|
|
255
|
+
</div>`},useData:!0});var cb=30,th=new Set(["annotation"]);function pb(o){return eh({size:cb,icon:o.icon?.url??"",name:o.name})}function db(o={}){return{rank:"high",placement:["center"],interactive:!0,...o}}function ub(o,e){return e.Markers.add(o.coordinate,pb(o),db())}function oh(o,e){let t=[];for(let r of e)co(r)&&Gt.is(r)&&r.icon!=null&&typeof r.icon.url=="string"&&r.icon.url.length>0&&t.push(ub(r,o));return t}f();var rh=new Set(["space","object"]);function nh(o,e){e.forEach(t=>{Dp(t)&&o.updateState(t,{interactive:!0})})}f();f();function ih(o){return co(o)?"anchorTarget"in o&&o.anchorTarget!=null:!1}f();f();function ah(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,r=Array(e);t<e;t++)r[t]=o[t];return r}function fb(o){if(Array.isArray(o))return o}function hb(o,e){var t=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(t!=null){var r,n,i,a,s=[],l=!0,c=!1;try{if(i=(t=t.call(o)).next,e!==0)for(;!(l=(r=i.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(p){c=!0,n=p}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}function gb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
256
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mb(o,e){return fb(o)||hb(o,e)||yb(o,e)||gb()}function yb(o,e){if(o){if(typeof o=="string")return ah(o,e);var t={}.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ah(o,e):void 0}}var Ih=Object.entries,sh=Object.setPrototypeOf,bb=Object.isFrozen,Tb=Object.getPrototypeOf,vb=Object.getOwnPropertyDescriptor,Ze=Object.freeze,qe=Object.seal,zr=Object.create,Sh=typeof Reflect<"u"&&Reflect,zl=Sh.apply,Xl=Sh.construct;Ze||(Ze=function(e){return e});qe||(qe=function(e){return e});zl||(zl=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)});Xl||(Xl=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 Hr=Ae(Array.prototype.forEach),Ib=Ae(Array.prototype.lastIndexOf),lh=Ae(Array.prototype.pop),Wr=Ae(Array.prototype.push),Sb=Ae(Array.prototype.splice),Bo=Array.isArray,Kn=Ae(String.prototype.toLowerCase),jl=Ae(String.prototype.toString),ch=Ae(String.prototype.match),qn=Ae(String.prototype.replace),ph=Ae(String.prototype.indexOf),Eb=Ae(String.prototype.trim),Mb=Ae(Number.prototype.toString),xb=Ae(Boolean.prototype.toString),dh=typeof BigInt>"u"?null:Ae(BigInt.prototype.toString),uh=typeof Symbol>"u"?null:Ae(Symbol.prototype.toString),ze=Ae(Object.prototype.hasOwnProperty),Qn=Ae(Object.prototype.toString),We=Ae(RegExp.prototype.test),rr=_b(TypeError);function Ae(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 zl(o,e,r)}}function _b(o){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Xl(o,t)}}function le(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kn;if(sh&&sh(o,null),!Bo(e))return o;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let i=t(n);i!==n&&(bb(e)||(e[r]=i),n=i)}o[n]=!0}return o}function Cb(o){for(let e=0;e<o.length;e++)ze(o,e)||(o[e]=null);return o}function tt(o){let e=zr(null);for(let r of Ih(o)){var t=mb(r,2);let n=t[0],i=t[1];ze(o,n)&&(Bo(i)?e[n]=Cb(i):i&&typeof i=="object"&&i.constructor===Object?e[n]=tt(i):e[n]=i)}return e}function Pb(o){switch(typeof o){case"string":return o;case"number":return Mb(o);case"boolean":return xb(o);case"bigint":return dh?dh(o):"0";case"symbol":return uh?uh(o):"Symbol()";case"undefined":return Qn(o);case"function":case"object":{if(o===null)return Qn(o);let e=o,t=Xt(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:Qn(r)}return Qn(o)}default:return Qn(o)}}function Xt(o,e){for(;o!==null;){let r=vb(o,e);if(r){if(r.get)return Ae(r.get);if(typeof r.value=="function")return Ae(r.value)}o=Tb(o)}function t(){return null}return t}function Ob(o){try{return We(o,""),!0}catch{return!1}}var fh=Ze(["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"]),Gl=Ze(["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"]),Ul=Ze(["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"]),Db=Ze(["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"]),Hl=Ze(["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"]),wb=Ze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hh=Ze(["#text"]),gh=Ze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Wl=Ze(["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","dominant-baseline","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-orientation","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"]),mh=Ze(["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"]),Ea=Ze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ab=qe(/{{[\w\W]*|^[\w\W]*}}/g),Fb=qe(/<%[\w\W]*|^[\w\W]*%>/g),kb=qe(/\${[\w\W]*/g),Lb=qe(/^data-[\-\w.\u00B7-\uFFFF]+$/),Nb=qe(/^aria-[\-\w]+$/),yh=qe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Rb=qe(/^(?:\w+script|data):/i),Bb=qe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vb=qe(/^html$/i),jb=qe(/^[a-z][.\w]*(-[.\w]+)+$/i),bh=qe(/<[/\w!]/g),Th=qe(/<[/\w]/g),Gb=qe(/<\/no(script|embed|frames)/i),Ub=qe(/\/>/i),St={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Hb=function(){return typeof window>"u"?null:window},Wb=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}},vh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ro=function(e,t,r,n){return ze(e,t)&&Bo(e[t])?le(n.base?tt(n.base):{},e[t],n.transform):r};function Eh(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hb(),e=H=>Eh(H);if(e.version="3.4.13",e.removed=[],!o||!o.document||o.document.nodeType!==St.document||!o.Element)return e.isSupported=!1,e;let t=o.document,r=t,n=r.currentScript;o.DocumentFragment;let i=o.HTMLTemplateElement,a=o.Node,s=o.Element,l=o.NodeFilter,c=o.NamedNodeMap;c===void 0&&(o.NamedNodeMap||o.MozNamedAttrMap),o.HTMLFormElement;let p=o.DOMParser,h=o.trustedTypes,g=s.prototype,v=Xt(g,"cloneNode"),I=Xt(g,"remove"),E=Xt(g,"nextSibling"),O=Xt(g,"childNodes"),D=Xt(g,"parentNode"),A=Xt(g,"shadowRoot"),W=Xt(g,"attributes"),N=a&&a.prototype?Xt(a.prototype,"nodeType"):null,B=a&&a.prototype?Xt(a.prototype,"nodeName"):null,G=a&&a.prototype?Xt(a.prototype,"ownerDocument"):null;if(typeof i=="function"){let H=t.createElement("template");H.content&&H.content.ownerDocument&&(t=H.content.ownerDocument)}let F,j="",te,he=!1,ge=0,ie=function(){if(ge>0)throw rr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ve=function(y){ie(),ge++;try{return F.createHTML(y)}finally{ge--}},Be=function(y){ie(),ge++;try{return F.createScriptURL(y)}finally{ge--}},Ve=function(){return he||(te=Wb(h,n),he=!0),te},pe=t,Et=pe.implementation,Dt=pe.createNodeIterator,$e=pe.createDocumentFragment,ye=pe.getElementsByTagName,$t=r.importNode,se=vh();e.isSupported=typeof Ih=="function"&&typeof D=="function"&&Et&&Et.createHTMLDocument!==void 0;let Mt=Ab,wt=Fb,Yt=kb,At=Lb,yo=Nb,bo=Rb,Vo=Bb,ir=jb,ar=yh,re=null,jo=le({},[...fh,...Gl,...Ul,...Hl,...hh]),ae=null,To=le({},[...gh,...Wl,...mh,...Ea]),Se=Object.seal(zr(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}})),vo=null,Go=null,Ft=Object.seal(zr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ri=!0,Yr=!0,Jr=!1,ni=!0,Jt=!1,Oe=!0,Io=!1,ii=!1,Zr=null,qr=null,Qr=!1,M=!1,d=!1,u=!1,m=!0,T=!1,b="user-content-",w=!0,C=!1,L={},k=null,X=le({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),P=null,R=le({},["audio","video","img","source","image","track"]),U=null,K=le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Z="http://www.w3.org/1998/Math/MathML",ne="http://www.w3.org/2000/svg",Q="http://www.w3.org/1999/xhtml",de=Q,De=!1,Ee=null,je=le({},[Z,ne,Q],jl),Fe=Ze(["mi","mo","mn","ms","mtext"]),Qe=le({},Fe),ke=Ze(["annotation-xml"]),ot=le({},ke),ft=le({},["title","style","font","a","script"]),Ye=null,ht=["application/xhtml+xml","text/html"],kt="text/html",me=null,So=null,_a=t.createElement("form"),ai=function(y){return y instanceof RegExp||y instanceof Function},Ca=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(So&&So===y)return;(!y||typeof y!="object")&&(y={}),y=tt(y),Ye=ht.indexOf(y.PARSER_MEDIA_TYPE)===-1?kt:y.PARSER_MEDIA_TYPE,me=Ye==="application/xhtml+xml"?jl:Kn,re=Ro(y,"ALLOWED_TAGS",jo,{transform:me}),ae=Ro(y,"ALLOWED_ATTR",To,{transform:me}),Ee=Ro(y,"ALLOWED_NAMESPACES",je,{transform:jl}),U=Ro(y,"ADD_URI_SAFE_ATTR",K,{transform:me,base:K}),P=Ro(y,"ADD_DATA_URI_TAGS",R,{transform:me,base:R}),k=Ro(y,"FORBID_CONTENTS",X,{transform:me}),vo=Ro(y,"FORBID_TAGS",tt({}),{transform:me}),Go=Ro(y,"FORBID_ATTR",tt({}),{transform:me}),L=ze(y,"USE_PROFILES")?y.USE_PROFILES&&typeof y.USE_PROFILES=="object"?tt(y.USE_PROFILES):y.USE_PROFILES:!1,ri=y.ALLOW_ARIA_ATTR!==!1,Yr=y.ALLOW_DATA_ATTR!==!1,Jr=y.ALLOW_UNKNOWN_PROTOCOLS||!1,ni=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Jt=y.SAFE_FOR_TEMPLATES||!1,Oe=y.SAFE_FOR_XML!==!1,Io=y.WHOLE_DOCUMENT||!1,M=y.RETURN_DOM||!1,d=y.RETURN_DOM_FRAGMENT||!1,u=y.RETURN_TRUSTED_TYPE||!1,Qr=y.FORCE_BODY||!1,m=y.SANITIZE_DOM!==!1,T=y.SANITIZE_NAMED_PROPS||!1,w=y.KEEP_CONTENT!==!1,C=y.IN_PLACE||!1,ar=Ob(y.ALLOWED_URI_REGEXP)?y.ALLOWED_URI_REGEXP:yh,de=typeof y.NAMESPACE=="string"?y.NAMESPACE:Q,Qe=ze(y,"MATHML_TEXT_INTEGRATION_POINTS")&&y.MATHML_TEXT_INTEGRATION_POINTS&&typeof y.MATHML_TEXT_INTEGRATION_POINTS=="object"?tt(y.MATHML_TEXT_INTEGRATION_POINTS):le({},Fe),ot=ze(y,"HTML_INTEGRATION_POINTS")&&y.HTML_INTEGRATION_POINTS&&typeof y.HTML_INTEGRATION_POINTS=="object"?tt(y.HTML_INTEGRATION_POINTS):le({},ke);let _=ze(y,"CUSTOM_ELEMENT_HANDLING")&&y.CUSTOM_ELEMENT_HANDLING&&typeof y.CUSTOM_ELEMENT_HANDLING=="object"?tt(y.CUSTOM_ELEMENT_HANDLING):zr(null);if(Se=zr(null),ze(_,"tagNameCheck")&&ai(_.tagNameCheck)&&(Se.tagNameCheck=_.tagNameCheck),ze(_,"attributeNameCheck")&&ai(_.attributeNameCheck)&&(Se.attributeNameCheck=_.attributeNameCheck),ze(_,"allowCustomizedBuiltInElements")&&typeof _.allowCustomizedBuiltInElements=="boolean"&&(Se.allowCustomizedBuiltInElements=_.allowCustomizedBuiltInElements),qe(Se),Jt&&(Yr=!1),d&&(M=!0),L&&(re=le({},hh),ae=zr(null),L.html===!0&&(le(re,fh),le(ae,gh)),L.svg===!0&&(le(re,Gl),le(ae,Wl),le(ae,Ea)),L.svgFilters===!0&&(le(re,Ul),le(ae,Wl),le(ae,Ea)),L.mathMl===!0&&(le(re,Hl),le(ae,mh),le(ae,Ea))),Ft.tagCheck=null,Ft.attributeCheck=null,ze(y,"ADD_TAGS")&&(typeof y.ADD_TAGS=="function"?Ft.tagCheck=y.ADD_TAGS:Bo(y.ADD_TAGS)&&(re===jo&&(re=tt(re)),le(re,y.ADD_TAGS,me))),ze(y,"ADD_ATTR")&&(typeof y.ADD_ATTR=="function"?Ft.attributeCheck=y.ADD_ATTR:Bo(y.ADD_ATTR)&&(ae===To&&(ae=tt(ae)),le(ae,y.ADD_ATTR,me))),ze(y,"ADD_URI_SAFE_ATTR")&&Bo(y.ADD_URI_SAFE_ATTR)&&le(U,y.ADD_URI_SAFE_ATTR,me),ze(y,"FORBID_CONTENTS")&&Bo(y.FORBID_CONTENTS)&&(k===X&&(k=tt(k)),le(k,y.FORBID_CONTENTS,me)),ze(y,"ADD_FORBID_CONTENTS")&&Bo(y.ADD_FORBID_CONTENTS)&&(k===X&&(k=tt(k)),le(k,y.ADD_FORBID_CONTENTS,me)),w&&(re["#text"]=!0),Io&&le(re,["html","head","body"]),re.table&&(le(re,["tbody"]),delete vo.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw rr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let V=F;F=y.TRUSTED_TYPES_POLICY;try{j=ve("")}catch(J){throw F=V,J}}else y.TRUSTED_TYPES_POLICY===null?(F=void 0,j=""):(F===void 0&&(F=Ve()),F&&typeof j=="string"&&(j=ve("")));Ze&&Ze(y),So=y},oc=le({},[...Gl,...Ul,...Db]),rc=le({},[...Hl,...wb]),Jh=function(y,_,V){return _.namespaceURI===Q?y==="svg":_.namespaceURI===Z?y==="svg"&&(V==="annotation-xml"||Qe[V]):!!oc[y]},Zh=function(y,_,V){return _.namespaceURI===Q?y==="math":_.namespaceURI===ne?y==="math"&&ot[V]:!!rc[y]},qh=function(y,_,V){return _.namespaceURI===ne&&!ot[V]||_.namespaceURI===Z&&!Qe[V]?!1:!rc[y]&&(ft[y]||!oc[y])},Qh=function(y){let _=D(y);(!_||!_.tagName)&&(_={namespaceURI:de,tagName:"template"});let V=Kn(y.tagName),J=Kn(_.tagName);return Ee[y.namespaceURI]?y.namespaceURI===ne?Jh(V,_,J):y.namespaceURI===Z?Zh(V,_,J):y.namespaceURI===Q?qh(V,_,J):!!(Ye==="application/xhtml+xml"&&Ee[y.namespaceURI]):!1},Eo=function(y){Wr(e.removed,{element:y});try{D(y).removeChild(y)}catch{if(I(y),!D(y))throw rr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},si=function(y){Kr(y);let _=O(y);if(_){let J=[];Hr(_,q=>{Wr(J,q)}),Hr(J,q=>{try{I(q)}catch{}})}let V=W(y);if(V)for(let J=V.length-1;J>=0;--J){let q=V[J],ee=q&&q.name;if(typeof ee=="string")try{y.removeAttribute(ee)}catch{}}},Uo=function(y,_){try{Wr(e.removed,{attribute:_.getAttributeNode(y),from:_})}catch{Wr(e.removed,{attribute:null,from:_})}if(_.removeAttribute(y),y==="is")if(M||d)try{Eo(_)}catch{}else try{_.setAttribute(y,"")}catch{}},Kh=function(y){let _=W(y);if(_)for(let V=_.length-1;V>=0;--V){let J=_[V],q=J&&J.name;if(!(typeof q!="string"||ae[me(q)]))try{y.removeAttribute(q)}catch{}}},Kr=function(y){let _=[y];for(;_.length>0;){let V=_.pop();(N?N(V):V.nodeType)===St.element&&Kh(V);let q=O(V);if(q)for(let ee=q.length-1;ee>=0;--ee)_.push(q[ee])}},eg=function(y){if(!Oe)return;let _=[y];for(;_.length>0;){let V=_.pop(),J=N?N(V):V.nodeType;if(J===St.processingInstruction||J===St.comment&&We(Th,V.data)){try{I(V)}catch{}continue}if(J===St.element){let ee=V,be=me(B?B(V):V.nodeName);try{ee.hasAttribute&&ee.hasAttribute("patchsrc")&&ee.removeAttribute("patchsrc"),ee.hasAttribute&&ee.hasAttribute("for")&&be!=="label"&&be!=="output"&&ee.removeAttribute("for")}catch{}}let q=O(V);if(q)for(let ee=q.length-1;ee>=0;--ee)_.push(q[ee])}},nc=function(y){let _=null,V=null;if(Qr)y="<remove></remove>"+y;else{let ee=ch(y,/^[\r\n\t ]+/);V=ee&&ee[0]}Ye==="application/xhtml+xml"&&de===Q&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");let J=F?ve(y):y;if(de===Q)try{_=new p().parseFromString(J,Ye)}catch{}if(!_||!_.documentElement){_=Et.createDocument(de,"template",null);try{_.documentElement.innerHTML=De?j:J}catch{}}let q=_.body||_.documentElement;return y&&V&&q.insertBefore(t.createTextNode(V),q.childNodes[0]||null),de===Q?ye.call(_,Io?"html":"body")[0]:Io?_.documentElement:q},ic=function(y){let _=G?G(y):y.ownerDocument;return Dt.call(_||y,y,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},li=function(y){return y=qn(y,Mt," "),y=qn(y,wt," "),y=qn(y,Yt," "),y},Pa=function(y){var _;y.normalize();let V=G?G(y):y.ownerDocument,J=Dt.call(V||y,y,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),q=J.nextNode();for(;q;)q.data=li(q.data),q=J.nextNode();let ee=(_=y.querySelectorAll)===null||_===void 0?void 0:_.call(y,"template");ee&&Hr(ee,be=>{sr(be.content)&&Pa(be.content)})},ci=function(y){let _=B?B(y):null;return typeof _!="string"||me(_)!=="form"?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||y.attributes!==W(y)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function"||y.nodeType!==N(y)||y.childNodes!==O(y)},sr=function(y){if(!N||typeof y!="object"||y===null)return!1;try{return N(y)===St.documentFragment}catch{return!1}},en=function(y){if(!N||typeof y!="object"||y===null)return!1;try{return typeof N(y)=="number"}catch{return!1}};function Zt(H,y,_){H.length!==0&&Hr(H,V=>{V.call(e,y,_,So)})}let tg=function(y,_){return!!(Oe&&y.hasChildNodes()&&!en(y.firstElementChild)&&We(bh,y.textContent)&&We(bh,y.innerHTML)||Oe&&y.namespaceURI===Q&&_==="style"&&en(y.firstElementChild)||y.nodeType===St.processingInstruction||Oe&&y.nodeType===St.comment&&We(Th,y.data))},og=function(y,_,V){if(!vo[_]&&cc(_)&&(Se.tagNameCheck instanceof RegExp&&We(Se.tagNameCheck,_)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(_)))return!1;if(w&&!k[_]){let J=D(y),q=O(y);if(q&&J){let ee=q.length;for(let be=ee-1;be>=0;--be){let Me=y===V?v(q[be],!0):q[be];J.insertBefore(Me,E(y))}}}return Eo(y),!0},ac=function(y,_,V,J){return y.length===0?_:_===V||_===J?tt(_):_},sc=function(y,_){if(Zt(se.beforeSanitizeElements,y,null),y!==_&&D(y)===null)return C&&Kr(y),!0;if(ci(y))return Eo(y),!0;let V=me(B?B(y):y.nodeName);if(re=ac(se.uponSanitizeElement,re,jo,Zr),Zt(se.uponSanitizeElement,y,{tagName:V,allowedTags:re}),y!==_&&D(y)===null)return C&&Kr(y),!0;if(tg(y,V))return Eo(y),!0;if(vo[V]||!(Ft.tagCheck instanceof Function&&Ft.tagCheck(V))&&!re[V]){let q=og(y,V,_);return q===!1&&Zt(se.afterSanitizeElements,y,null),q}if((N?N(y):y.nodeType)===St.element&&!Qh(y)||(V==="noscript"||V==="noembed"||V==="noframes")&&We(Gb,y.innerHTML))return Eo(y),!0;if(Jt&&y.nodeType===St.text){let q=li(y.textContent);y.textContent!==q&&(Wr(e.removed,{element:y.cloneNode()}),y.textContent=q)}return Zt(se.afterSanitizeElements,y,null),!1},lc=function(y,_,V){if(Go[_]||Oe&&_==="patchsrc"||Oe&&_==="for"&&y!=="label"&&y!=="output"||m&&(_==="id"||_==="name")&&(V in t||V in _a))return!1;let J=ae[_]||Ft.attributeCheck instanceof Function&&Ft.attributeCheck(_,y);if(!(Yr&&We(At,_))){if(!(ri&&We(yo,_))){if(J){if(!U[_]){if(!We(ar,qn(V,Vo,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&y!=="script"&&ph(V,"data:")===0&&P[y])){if(!(Jr&&!We(bo,qn(V,Vo,"")))){if(V)return!1}}}}}else if(!(cc(y)&&(Se.tagNameCheck instanceof RegExp&&We(Se.tagNameCheck,y)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(y))&&(Se.attributeNameCheck instanceof RegExp&&We(Se.attributeNameCheck,_)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(_,y))||_==="is"&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&We(Se.tagNameCheck,V)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(V))))return!1}}return!0},rg=le({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),cc=function(y){return!rg[Kn(y)]&&We(ir,y)},ng=function(y,_,V,J){if(F&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!V)switch(h.getAttributeType(y,_)){case"TrustedHTML":return ve(J);case"TrustedScriptURL":return Be(J)}return J},ig=function(y,_,V,J){try{V?y.setAttributeNS(V,_,J):y.setAttribute(_,J),ci(y)?Eo(y):lh(e.removed)}catch{Uo(_,y)}},pc=function(y){Zt(se.beforeSanitizeAttributes,y,null);let _=y.attributes;if(!_||ci(y))return;ae=ac(se.uponSanitizeAttribute,ae,To,qr);let V={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0},J=_.length,q=me(y.nodeName);for(;J--;){let ee=_[J],be=ee.name,Me=ee.namespaceURI,st=ee.value,lt=me(be),Da=st,rt=be==="value"?Da:Eb(Da);if(V.attrName=lt,V.attrValue=rt,V.keepAttr=!0,V.forceKeepAttr=void 0,Zt(se.uponSanitizeAttribute,y,V),rt=V.attrValue,T&&(lt==="id"||lt==="name")&&ph(rt,b)!==0&&(Uo(be,y),rt=b+rt),Oe&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,rt)){Uo(be,y);continue}if(lt==="attributename"&&ch(rt,"href")){Uo(be,y);continue}if(!V.forceKeepAttr){if(!V.keepAttr){Uo(be,y);continue}if(!ni&&We(Ub,rt)){Uo(be,y);continue}if(Jt&&(rt=li(rt)),!lc(q,lt,rt)){Uo(be,y);continue}rt=ng(q,lt,Me,rt),rt!==Da&&ig(y,be,Me,rt)}}Zt(se.afterSanitizeAttributes,y,null)},pi=function(y){let _=null,V=ic(y);for(Zt(se.beforeSanitizeShadowDOM,y,null);_=V.nextNode();)if(Zt(se.uponSanitizeShadowNode,_,null),sc(_,y),pc(_),sr(_.content)&&pi(_.content),(N?N(_):_.nodeType)===St.element){let q=A(_);sr(q)&&(Oa(q),pi(q))}Zt(se.afterSanitizeShadowDOM,y,null)},Oa=function(y){let _=[{node:y,shadow:null}];for(;_.length>0;){let V=_.pop();if(V.shadow){pi(V.shadow);continue}let J=V.node,ee=(N?N(J):J.nodeType)===St.element,be=O(J);if(be)for(let Me=be.length-1;Me>=0;--Me)_.push({node:be[Me],shadow:null});if(ee){let Me=B?B(J):null;if(typeof Me=="string"&&me(Me)==="template"){let st=J.content;sr(st)&&_.push({node:st,shadow:null})}}if(ee){let Me=A(J);sr(Me)&&_.push({node:null,shadow:Me},{node:Me,shadow:null})}}};return e.sanitize=function(H){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,V=null,J=null,q=null;if(De=!H,De&&(H="<!-->"),typeof H!="string"&&!en(H)&&(H=Pb(H),typeof H!="string"))throw rr("dirty is not a string, aborting");if(!e.isSupported)return H;ii?(re=Zr,ae=qr):Ca(y),(se.uponSanitizeElement.length>0||se.uponSanitizeAttribute.length>0)&&(re=tt(re)),se.uponSanitizeAttribute.length>0&&(ae=tt(ae)),e.removed=[];let ee=C&&typeof H!="string"&&en(H);if(ee){eg(H);let st=B?B(H):H.nodeName;if(typeof st=="string"){let lt=me(st);if(!re[lt]||vo[lt])throw si(H),rr("root node is forbidden and cannot be sanitized in-place")}if(ci(H))throw si(H),rr("root node is clobbered and cannot be sanitized in-place");try{Oa(H)}catch(lt){throw si(H),lt}}else if(en(H))_=nc("<!---->"),V=_.ownerDocument.importNode(H,!0),V.nodeType===St.element&&V.nodeName==="BODY"||V.nodeName==="HTML"?_=V:_.appendChild(V),Oa(V);else{if(!M&&!Jt&&!Io&&H.indexOf("<")===-1)return F&&u?ve(H):H;if(_=nc(H),!_)return M?null:u?j:""}_&&Qr&&Eo(_.firstChild);let be=ee?H:_;try{let st=ic(be);for(;J=st.nextNode();)sc(J,be),pc(J),sr(J.content)&&pi(J.content)}catch(st){throw ee&&(si(H),Hr(e.removed,lt=>{lt.element&&Kr(lt.element)})),st}if(ee)return Hr(e.removed,st=>{st.element&&Kr(st.element)}),Jt&&Pa(H),H;if(M){if(Jt&&Pa(_),d)for(q=$e.call(_.ownerDocument);_.firstChild;)q.appendChild(_.firstChild);else q=_;return(ae.shadowroot||ae.shadowrootmode)&&(q=$t.call(r,q,!0)),q}let Me=Io?_.outerHTML:_.innerHTML;return Io&&re["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&We(Vb,_.ownerDocument.doctype.name)&&(Me="<!DOCTYPE "+_.ownerDocument.doctype.name+`>
|
|
257
|
+
`+Me),Jt&&(Me=li(Me)),F&&u?ve(Me):Me},e.setConfig=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ca(H),ii=!0,Zr=re,qr=ae},e.clearConfig=function(){So=null,ii=!1,Zr=null,qr=null,F=te,j=""},e.isValidAttribute=function(H,y,_){So||Ca({});let V=me(H),J=me(y);return lc(V,J,_)},e.addHook=function(H,y){typeof y=="function"&&ze(se,H)&&Wr(se[H],y)},e.removeHook=function(H,y){if(ze(se,H)){if(y!==void 0){let _=Ib(se[H],y);return _===-1?void 0:Sb(se[H],_,1)[0]}return lh(se[H])}},e.removeHooks=function(H){ze(se,H)&&(se[H]=[])},e.removeAllHooks=function(){se=vh()},e}var Mh=Eh();var zb={"connection-stairs-12x12":`<svg viewBox="0 0 12 12" stroke="none">
|
|
258
258
|
<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" />
|
|
259
259
|
<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" />
|
|
260
260
|
<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" />
|
|
@@ -294,7 +294,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
294
294
|
<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 "/>
|
|
295
295
|
<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 "/>
|
|
296
296
|
</g>
|
|
297
|
-
</svg>`},zb=/<svg([^>]*)>/g;function Mh(o,e,t){let r=Wb[o];return r?r.replace(zb,`<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:${e}; width:${t}px; height:${t}px">`):null}function Xb(o){return Eh.sanitize(o,{USE_PROFILES:{svg:!0}})}function $b(o,e){let n=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;return n==null||n.tagName==="parsererror"||n.tagName.toLowerCase()!=="svg"?(x.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 xh(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 mt()(o),n=r.headers.get("content-type");if(n?.includes("image/svg+xml")){let i=await r.text();return t=Xb(i),e?.color!=null&&(t=$b(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 x.error(`Failed to fetch icon from ${o}.`,r),null}}f();function _h(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Restroom")))}function Ch(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Parking")))}var Oh=new Set(["connection","point-of-interest","space","object","door","facade"]),nr={default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F",parking:"#418425",door:"#A0552C"},Xr={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 Yb(o){let e=null;if(Ze.is(o))switch(o.type){case"elevator":e=Xr.elevator;break;case"ladder":e=Xr.ladder;break;case"escalator":case"stairs":default:e=Xr.stairs}else Tt.is(o)?e=Xr.point:it.is(o)?e=Xr.door:Ge.is(o)&&(e=Xr.building);return e!=null?Mh(e,"#FFFFFF",12):null}function Ph(o){return Ze.is(o)?nr.connection:Ge.is(o)?nr.default:_h(o)?nr.washroom:Ch(o)?nr.parking:Tt.is(o)?nr.point:it.is(o)?nr.door:nr.default}async function Zb(o,e){let t=null,r="locationProfiles"in o?o.locationProfiles.find(n=>n.icon!=null)?.icon:null;if(r?.url!=null&&(t=await xh(r.url,{color:e.color,style:"fill"})),t==null){let n=Yb(o);n!=null&&(t={icon:n,type:"svg"})}return t}function Jb(o){return Ze.is(o)||it.is(o)?"low":Tt.is(o)||Ge.is(o)?"high":"medium"}async function qb(o){let e={appearance:{color:Ph(o),pinOutlineColor:Ph(o),iconPadding:8,iconSize:24,textSize:12.5,iconScale:{on:"zoom-level",input:[18,20],output:[.7,1]}},rank:Jb(o),interactive:!0},t=await Zb(o,{color:"#FFFFFF"});return t!=null&&(e.appearance.icon=t.icon,t.type==="svg"?Ge.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 wh(o,e){return(await Promise.all(e.map(async r=>{let n=[];if(!lo(r))return n;let i=await qb(r);return Ze.is(r)?n=r.coordinates.map(a=>o.Labels.add(a,r.name,i)):Ge.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)):nh(r)&&fs(r)&&n.push(o.Labels.add(r,r.name,i)),n}))).flat()}async function Dh(o,e){let t=o.getMapDataInternal();if(!t)throw new Error("Map data not found");let r=t.getAllOfTypes(Oh,e),n=t.getAllOfTypes(eh,e),i=t.getAllOfTypes(oh,e),[a,s]=await Promise.all([r.length>0?wh(o,r):[],n.length>0?th(o,n):[],i.length>0?rh(o,i):[]]);return{labels:a,markers:s}}f();f();var Xl=(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)};var Ma=.05,ei=class extends gt{core;mapObjects=[];id;mapDataExternal={};mapsByFloorId={};mapData;currentMap;hiddenOutdoorGeometries=[];lastFacadeIntersected;#e;#t=!1;mapView;externalPubSub;get __EXPERIMENTAL__floorHandler(){return this.#e}__EXPERIMENTAL__overrideSetFloorHandler(e){e&&this.#e&&this.#e!==yi&&x.warn("overwriting an existing setFloor override handler"),this.#o(e)}get manualFloorVisibility(){return this.#e!==void 0}set manualFloorVisibility(e){let t=this.#e;t&&t!==yi&&e&&x.warn("manualFloorVisibility true overwriting an existing setFloor handler to noop"),this.#o(e?yi:void 0)}#o(e){let t=this.manualFloorVisibility;this.#e=e,this.manualFloorVisibility!==t&&this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:this.manualFloorVisibility})}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 Fn(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new Bn("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 yc(c instanceof Error?c.message:"Unknown error")})},{signal:this.signal});let i=c=>{let p=c;c.startsWith(mn)&&c.endsWith("-merged")&&(p=c.slice(mn.length,-7));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 _n(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",Di(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=[],v=[],I=[],E=[];p.labels.forEach(A=>{let j=this.Labels.getById(A.toString());j&&h.push(j.label)}),p.markers.forEach(A=>{let j=this.Markers.getById(A.toString())||this.Navigation.getMarkerById(A.toString());j&&g.push(j.marker)}),p.models.forEach(A=>{let j=this.Models.getById(A.toString());j&&v.push(j.model)}),p.images.forEach(A=>{let j=this.Image3D.getById(A.toString());j&&I.push(j.image)}),p.paths.forEach(A=>{let j=this.Paths.getById(A.toString())||this.Navigation.getPathById(A.toString());j&&!E.includes(j)&&E.push(j)});let O=p.geometry,w;O.length>0&&(w=O.map(A=>this.getMapDataInternal()?.getById("space",A)).filter(Boolean)[0],w||(w=O.map(A=>this.getMapDataInternal()?.getById("object",A)).filter(Boolean)[0]),w||(w=O.map(A=>this.getMapDataInternal()?.getById("area",A)).filter(Boolean)[0]),w||(w=O.map(A=>this.Shapes.getById(A)).filter(Boolean)[0]));let F=p.containers.reduce((A,j)=>{let te=this.getMapDataInternal()?.getById("floor",j);return te&&pt.is(te)&&A.push(te),A},[]),W,N=0;if(F.length>0){W=F[0].id;let A=this.core.getState(W);N=p.coordinate[2]?p.coordinate[2]-A.altitude:N}let B;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(A=>{this.core.setState(A.id,{hovered:!1})}),w&&xe.is(w)&&(B=O.map(A=>this.getMapDataInternal()?.facadesBySpaceId[A]).filter(Boolean)[0],B&&B.spaces.forEach(A=>{this.core.setState(A.id,{hovered:!0})})),this.lastFacadeIntersected=B;let G={coordinate:new z({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:W,verticalOffset:N}),spaces:w&&xe.is(w)?[w]:[],objects:w&&dt.is(w)?[w]:[],areas:w&&_t.is(w)?[w]:[],shapes:w&&uo.is(w)?[w]:[],markers:g,labels:h,models:v,images:I,paths:E,floors:F,facades:B?[B]:[]};"pointerEvent"in p&&(G.pointerEvent=p.pointerEvent),r.publish(c,G)};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 Vn(l),this.Models=new Gn(l),this.Labels=new kn(l),this.Text3D=new zn(l),this.Exporter=new An(l),this.Paths=new Un(l),this.Navigation=new Dn(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 Vr(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 jn(l),this.Shapes=new Hn(l),this.Style=new Wn(l)}preloadFloors(e){e.forEach(t=>{t instanceof pt&&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(Ce);if(a){let s=a.layers.get(Po);s&&this.core.hasState(s)&&this.core.setState(s,bl(fe(yl,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="exterior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Ce);if(a){let s=a.layers.get(eo);s&&this.core.hasState(s)&&this.core.setState(s,bl(fe(yl,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="interior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Ce),s=i.layers.get(Er);if(!a)return;let l=a.layers.get(Ir);if(!l||!this.core.hasState(l))return;let c=ll(fe($i,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(Ce),s=i.layers.get(Mr);if(!a)return;let l=a.layers.get(Sr);if(!l||!this.core.hasState(l))return;let c=ll(fe($i,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!==Ct.__type&&!this.core.hasState(n.id)){x.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,Hu(fe(Gu,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(ro.is(n))return this.core.setState(n.id,Xu(fe(Wu,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(xe.is(n)||dt.is(n)){let i=this.core.getState(n.id);i!=null&&this.core.setState(n.id,ju(fe(dl,t,{warn:!0,disableValidation:r}),i))}if(_t.is(n)&&this.core.setState(n.id,fe(dl,t,{warn:!0,disableValidation:r})),bt.is(n)&&this.core.setState(n.id,fe(rf,t,{warn:!0,disableValidation:r})),it.is(n)&&this.core.setState(n.id,fu(fe($i,t,{warn:!0,disableValidation:r}),this.core.getState(n.id))),uo.is(n)){let i=Zu(fe(gl,t,{warn:!0,disableValidation:r}));i.mergedShapeState&&this.core.setState(n.id,i.mergedShapeState)}if(Qo.is(n)){let{position:i,scale:a,rotation:s,...l}=fe(sf,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(pt.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;let a=fe(Nu,t,{warn:!0,disableValidation:r});this.core.setState(n.id,a);let s=i.layers.get(Ce);if(s!=null&&"geometry"in t&&t.geometry){this.core.setState(s.containerId,fe(Cu,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(to);if(l!=null&&"labels"in t&&t.labels){let E=fe(Pu,t.labels,{warn:!0,disableValidation:r});"enabled"in E&&typeof E.enabled=="boolean"&&l.setVisible(E.enabled)}let c=i.layers.get(Vt);if(c!=null&&"markers"in t&&t.markers){let E=fe(Ou,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=fe(er,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 O=fe(er,t.footprint,{warn:!0,disableValidation:r});O.color!==void 0&&(E.color=O.color),O.opacity!==void 0&&(E.opacity=O.opacity),O.outline!==void 0&&(E.outline=O.outline)}i.gapFootprintObject.update(E)}let p=i.layers.get(Xo);if(p!=null&&"occlusion"in t&&t.occlusion){let E=fe(Du,t.occlusion,{warn:!0,disableValidation:r});"enabled"in E&&typeof E.enabled=="boolean"&&p.setVisible(E.enabled)}let h=i.layers.get(xr);if(h!=null&&"images"in t&&t.images){let E=fe(wu,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 O of s.layers.values()){let w=this.core.getState(O);if(w?.children)for(let F of w.children)this.core.setState(F,{enableImageCollisions:E.collisionsEnabled})}}let g=i.layers.get(oo);if(g!=null&&"paths"in t&&t.paths!=null){let E=fe(Fu,t.paths,{warn:!0,disableValidation:r});E.visible!=null&&typeof E.visible=="boolean"&&g.setVisible(E.visible)}let v=i.layers.get($o);if(v!=null&&"areas"in t&&t.areas!=null){let E=fe(Au,t.areas,{warn:!0,disableValidation:r});E.visible!=null&&typeof E.visible=="boolean"&&v.setVisible(E.visible)}let I=i.layers.get(jt);if(I!=null&&"models"in t&&t.models!=null){let E=fe(Lu,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=fe(ku,t.text3d,{warn:!0,disableValidation:r}),O=i.layers.get(Zo);O!=null&&E.visible!=null&&O.setVisible(E.visible),E.geometryText?.visible!=null&&i.setGeometryTextBatchVisible(E.geometryText.visible),E.floorText?.visible!=null&&i.setFloorTextBatchVisible(E.floorText.visible)}}if(Ge.is(n)){let i=this.core.getState(n.id);for(let a of i.children)a.type==="group-container"&&this.core.setState(a.id,fe(gu,t,{warn:!0,disableValidation:r}))}if(fo.is(n)&&this.core.setState(n.id,fe(Ku,t,{warn:!0,disableValidation:r})),Ct.is(n)){let i=fe(il,t,{warn:!0,disableValidation:r}),a=Br(i);for(let s of n.segments)this.core.setState(s.id,a)}if(Ao.is(n)){let i=fe(il,t,{warn:!0,disableValidation:r}),a=Br(i);this.core.setState(n.id,a)}}}getMapDataObject(e){return this.getMapDataInternal()?.getMapDataById(e)}update=()=>{this.core.render()};getMapDataInternal(){if(this.mapData)return cn(this.mapData)}getMapData(){return this.mapData}addMap(e,t){return new Promise(r=>{let n;try{n=cn(e)}catch(p){x.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 z(a[1],a[0])});let s=i["manifest.geojson"].features[0].properties.name,l=new Bn(`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=>{let h=Fh(this.getMapDataInternal(),p.floorId,p.previousFloorId);h&&this.externalPubSub.publish("floor-change-start",{reason:p.reason,...h})},{signal:this.signal}),l.on("floor-change",p=>{let h=Fh(this.getMapDataInternal(),p.floorId,p.previousFloorId);h&&this.externalPubSub.publish("floor-change",{reason:p.reason,...h}),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:Ma*this.core.canvasHeight,left:Ma*this.core.canvasWidth,right:Ma*this.core.canvasWidth,bottom:Ma*this.core.canvasHeight};this.Camera.focusOn(this.currentFloor,{duration:wp,screenOffsets:p}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),r(e)})}else r(e)})}setFloor(e,t){return this.currentMap.setFloor(hn(e),t)}setFloorStack(e,t){return this.currentMap.setFloorStack(hn(e),t)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){let e=this.currentMap.currentFloorStack.id;if(!e)throw new De("Missing currentFloorStack.");let t=this.mapData?.getById("floor-stack",e);if(!t)throw new De("FloorStack was not found in map data.");return t}get currentFloor(){let e=this.currentMap.currentFloor.id;if(!e)throw new De("Missing currentFloor object from GeoJsonApi");let t=this.mapData?.getById("floor",e);if(!t)throw new De("Missing currentFloor");return t}getState(e){typeof e=="object"&&Ct.is(e)&&x.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let t=Vs(e,this),r=this.core.getState(t);if(r){if(["interior-walls","exterior-walls"].includes(e)&&r.type==="feature-collection")return of(r);if(["interior-doors","exterior-doors"].includes(e)&&r.type==="feature-collection"){let n=e==="interior-doors"?Er:Mr,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 uu(r,i)}else{if(r.type==="geometry")return Vu(r);if(r.type==="label"&&r.options.appearance&&r.options.rank!==void 0&&r.options.interactive!==void 0)return Uu(r);if(r.type==="marker"&&r.options?.rank!==void 0&&r.options.interactive!==void 0)return zu(r,this.Markers.getById(r.id.toString())?.marker);if(r.type==="model")return lf(r);if(r.type==="image")return nf(r);if(r.type==="text3d")return ef(r);if(r.type==="feature-collection"&&e&&typeof e!="string"&&uo.is(e))return Yu(r);if(r.type==="path")return cu(r);if(r.type==="group-container"&&typeof e!="string"&&pt.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"&&Ge.is(e)){let n=this.core.getState(r.children[0].id);return mu(n)}}}}__EXPERIMENTAL__getRenderedState(e){let t=Vs(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 z(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 z(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 ro.__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 Dh(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,markers:this.Navigation.markers}}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){x.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(e.length<2){x.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){x.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}ja(n,"group-container"),ja(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 Qb(o){if(o===""){Ra(""),Va("");return}Va(`${o}/${wc}`),Ra(`${o}/${Oc}`)}function Fh(o,e,t){let r=o?.getById("floor",t),n=o?.getById("floor",e);return!r||!n?null:{floor:n,previousFloor:r}}f();var xa=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 z({longitude:e[0],latitude:e[1]}),zoomLevel:this.#e.camera.zoomLevel,bearing:t,pitch:this.#e.camera.pitch}}};f();import Xe from"zod";var Ah=Xe.strictObject({environment:Xe.union([Xe.literal("basic"),Xe.literal(!1)]).optional(),text3d:Xe.object({hoverColor:Xe.string().optional()}).optional(),geometry:Xe.object({hoverColor:Xe.string().optional()}).optional(),backgroundColor:Xe.string().optional(),backgroundAlpha:Xe.number().optional(),multiFloorView:Xe.object({spacesOpenToBelowVisualEffectEnabled:Xe.boolean().optional(),spacesOpenToBelowVisualEffectDarkenAmount:Xe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDarkenUseDepth:Xe.boolean().optional(),spacesOpenToBelowVisualEffectDesaturateAmount:Xe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDesaturateUseDepth:Xe.boolean().optional(),spacesOpenToBelowVisualEffectWashOutAmount:Xe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectWashOutUseDepth:Xe.boolean().optional()}).optional()});f();var ql=di(ig(),1);f();var ti=null;function kh(){if(ti)return ti;if(typeof OffscreenCanvas<"u")ti=new OffscreenCanvas(1,1).getContext("2d");else if(typeof document<"u"){let o=document.createElement("canvas");o.width=1,o.height=1,ti=o.getContext("2d")}return ti}function $l(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function Yl(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}function Zl(o){let e=kh();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[$l(t/255),$l(r/255),$l(n/255)]}function Lh(o){let e=Math.round(Math.min(1,Math.max(0,Yl(o[0])))*255),t=Math.round(Math.min(1,Math.max(0,Yl(o[1])))*255),r=Math.round(Math.min(1,Math.max(0,Yl(o[2])))*255);return"#"+(1<<24|e<<16|t<<8|r).toString(16).slice(1)}var Kb=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,eT=/^rgba?\(\s*\d+/,tT=/^hsla?\(\s*[\d.]+/;function Jl(o){if(o==null||typeof o!="string")return!1;if(Kb.test(o)||eT.test(o)||tT.test(o))return!0;let e=kh();return e?(e.fillStyle="#000",e.fillStyle=o,e.fillStyle!=="#000000"||o.toLowerCase()==="black"||o==="#000"||o==="#000000"):!1}var oT=(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},Nh=(o,e)=>{let t=oT(o,e),r=(0,ql.default)({},t,e),n=(0,ql.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(Jl(h)&&Jl(g)){let v=Zl(h),I=Zl(g);v&&I?c[p]=Lh([v[0]+(I[0]-v[0])*l,v[1]+(I[1]-v[1])*l,v[2]+(I[2]-v[2])*l]):x.warn(`Color "${p}" could not be animated!`)}}else typeof g=="object"&&g!==null&&typeof h=="object"&&h!==null?i(h,g,l,c[p]):x.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 rT(o){return o.getContext("webgl2")||o.getContext("webgl")}function Ql(o){let e=rT(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 Rh(o,e=1e3){let t=null,r=new Promise(a=>{t=()=>{let s=o.getCanvas();a(s?Ql(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 Kl(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 x.warn(n),null}}var oi=class{#e;#t;#o;Camera;Labels;Text3D;Markers;Image3D;Models;Paths;Exporter;Navigation;Style;Shapes;Outdoor;constructor(e){this.#e=new gt,this.#o=e;let t=new ei(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 xa(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 x.warn(`Cannot animate state of ${e}.`),new Promise(c=>c({result:"completed"}));let i=Nh(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 ur&&a.easing(ur[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{Ah.parse(e)}catch(t){x.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 kp(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 De("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 z(e):new z(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-LHEBDO45.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 Rh(n);h&&c.drawImage(h,0,0,l.width,l.height)}await this.#o.renderSync();let p=Ql(r);if(p&&c.drawImage(p,0,0,l.width,l.height),t.withLabels){let h=this.#o.labelsCanvas;if(h){let g=Kl(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 v=h.children[g],I=v.classList.contains("mappedin-2d-entities");if(!(v.tagName==="CANVAS"||v.offsetWidth===0||v.offsetHeight===0||!I))try{let E=await t.captureMarkers(v),O=Kl(E,"overlay");O&&O.width>0&&O.height>0&&c.drawImage(O,0,0,l.width,l.height)}catch(E){x.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 De(E)}let I=h instanceof Error?`Screenshot failed: ${h.message}`:"Screenshot failed due to an unknown error.";throw new De(I)}}finally{i&&this.Outdoor.show(),a&&this.Outdoor.hide(s)}}get manualFloorVisibility(){return this.#t.manualFloorVisibility}set manualFloorVisibility(e){this.#t.manualFloorVisibility=e}__EXPERIMENTAL__overrideSetFloorHandler(e){this.#t.__EXPERIMENTAL__overrideSetFloorHandler(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){x.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 nT=1e3*60*60*2,$r=class{#e=new gt;#t;#o;#r;#n;#i;#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.#i?.token;this.#i=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.#i=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.#i!=null&&this.#i.expires!=null&&this.#i.expires>Date.now()&&!e?this.#i:(this.#r=pn({...this.#o,key:this.#o.key,secret:this.#o.secret},this.#o.enterprise??!1,e).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.#n!=null?this.#n:this.#s!=null&&this.#s.expires>Date.now()&&!e?this.#s:(this.#n=new Promise((t,r)=>{this.#u().then(n=>{let i={},a=this.#t.map(s=>Xa({...this.#o,mapId:s},n.token).then(l=>{i[s]={token:l.token,expires:l.expires}}).catch(l=>{x.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.#n.catch(t=>{throw t}).finally(()=>{this.#n=void 0}),this.#n)}#p(e){if(!("key"in this.#o)||!("secret"in this.#o))return;let t=e.expires!=null?e.expires-Date.now():nT;isFinite(t)&&(this.#c=setTimeout(()=>{this.#u(!0).then(r=>{this.#p(r)})},t-ap))}#m(e){let t=e.expires-Date.now();isFinite(t)&&(this.#a=setTimeout(()=>{this.#f(!0).then(r=>{this.#m(r)})},t-pp))}#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)){x.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),on()&&globalThis.addEventListener?.("focus",this.#l)}async refreshing(){let e=[];return this.#r!=null&&e.push(this.#r),this.#n!=null&&e.push(this.#n),Promise.all(e)}getAccessTokenAsync(e=!1){return this.#u(e)}getSasTokensAsync(){return this.#f()}getAccessToken(){return this.#i==null?(x.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):this.#i}getSasToken(e){return this.isEnterpriseMode()?(x.error("SAS tokens are not available in the enterprise mode!"),{token:""}):this.#s==null?(x.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):e in this.#s.tokens?this.#s.tokens[e]:(x.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(),on()&&globalThis.removeEventListener("focus",this.#l)}};f();var iT=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=xo();a.updateByUserOption(r);let s={};if("type"in o&&typeof o.type=="string"){if(o.type==="binary"&&o.main instanceof Uint8Array){let F=await Si(o.main,r.mvfVersion);n=F.mvf2,i=F.mvf3,s.languagePacks=[];for(let W of o.languagePacks??[])W.localePack instanceof Uint8Array&&s.languagePacks.push({language:W.language,localePack:await br(W.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 w=i!=null?Ii(i):n.enterprise!=null;o.options?.enterprise!==void 0&&(w?x.warn('The "enterprise" option in hydrateMapData is deprecated and ignored. Enterprise mode is now automatically detected from the MVF data.'):x.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=w||(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&&sp(r.key)&&(s.enterprise=!1),a.setEnterprise(s.enterprise??!1);let p=vi(n),h=p.length>0?p:[r.mapId];r.baseAuthUri=a.getBaseAuthUri();let g=new $r(h,{...r,enterprise:s.enterprise}),v;if(c)v=r.accessToken;else if(l){let w;try{w=await g.getAccessTokenAsync()}catch(F){x.error("Failed getting token during hydrateMapData",F)}v=w?.token||""}if(s.outdoorViewToken=v,s.env=a,s.getMapDataOptions=r,s.tokenManager=g,r.prefetchTokens&&(l||c))try{await g.readySync()}catch(w){x.error("Failed to ready token manager!",w)}xn()&&(s.enterprise&&x.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),r.mvfVersion!=="3.0.0"&&x.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let I=new qo(n,s);v&&I.Analytics.init({accessToken:v,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 ln(I),O=I.findPreferredLanguage({languageCode:r.language,fallbackToNavigatorLanguage:!1});if(O)try{await E.changeLanguage(O.code)}catch{}return typeof e?.onMVFParsed=="function"&&e.onMVFParsed(n),E};var Bh=`:root {
|
|
297
|
+
</svg>`},Xb=/<svg([^>]*)>/g;function xh(o,e,t){let r=zb[o];return r?r.replace(Xb,`<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:${e}; width:${t}px; height:${t}px">`):null}function $b(o){return Mh.sanitize(o,{USE_PROFILES:{svg:!0}})}function Yb(o,e){let n=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;return n==null||n.tagName==="parsererror"||n.tagName.toLowerCase()!=="svg"?(x.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 _h(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 mt()(o),n=r.headers.get("content-type");if(n?.includes("image/svg+xml")){let i=await r.text();return t=$b(i),e?.color!=null&&(t=Yb(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 x.error(`Failed to fetch icon from ${o}.`,r),null}}f();function Ch(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Restroom")))}function Ph(o){return o.locationProfiles.some(e=>e.categories.some(t=>t.name.includes("Parking")))}var Dh=new Set(["connection","point-of-interest","space","object","door","facade"]),nr={default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F",parking:"#418425",door:"#A0552C"},Xr={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 Jb(o){let e=null;if(Je.is(o))switch(o.type){case"elevator":e=Xr.elevator;break;case"ladder":e=Xr.ladder;break;case"escalator":case"stairs":default:e=Xr.stairs}else Tt.is(o)?e=Xr.point:nt.is(o)?e=Xr.door:Ge.is(o)&&(e=Xr.building);return e!=null?xh(e,"#FFFFFF",12):null}function Oh(o){return Je.is(o)?nr.connection:Ge.is(o)?nr.default:Ch(o)?nr.washroom:Ph(o)?nr.parking:Tt.is(o)?nr.point:nt.is(o)?nr.door:nr.default}async function Zb(o,e){let t=null,r="locationProfiles"in o?o.locationProfiles.find(n=>n.icon!=null)?.icon:null;if(r?.url!=null&&(t=await _h(r.url,{color:e.color,style:"fill"})),t==null){let n=Jb(o);n!=null&&(t={icon:n,type:"svg"})}return t}function qb(o){return Je.is(o)||nt.is(o)?"low":Tt.is(o)||Ge.is(o)?"high":"medium"}async function Qb(o){let e={appearance:{color:Oh(o),pinOutlineColor:Oh(o),iconPadding:8,iconSize:24,textSize:12.5,iconScale:{on:"zoom-level",input:[18,20],output:[.7,1]}},rank:qb(o),interactive:!0},t=await Zb(o,{color:"#FFFFFF"});return t!=null&&(e.appearance.icon=t.icon,t.type==="svg"?Ge.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 wh(o,e){return(await Promise.all(e.map(async r=>{let n=[];if(!co(r))return n;let i=await Qb(r);return Je.is(r)?n=r.coordinates.map(a=>o.Labels.add(a,r.name,i)):Ge.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)):ih(r)&&fs(r)&&n.push(o.Labels.add(r,r.name,i)),n}))).flat()}async function Ah(o,e){let t=o.getMapDataInternal();if(!t)throw new Error("Map data not found");let r=t.getAllOfTypes(Dh,e),n=t.getAllOfTypes(th,e),i=t.getAllOfTypes(rh,e),[a,s]=await Promise.all([r.length>0?wh(o,r):[],n.length>0?oh(o,n):[],i.length>0?nh(o,i):[]]);return{labels:a,markers:s}}f();f();var $l=(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)};var Ma=.05,ei=class extends gt{core;mapObjects=[];id;mapDataExternal={};mapsByFloorId={};mapData;currentMap;hiddenOutdoorGeometries=[];lastFacadeIntersected;#e;#t=!1;mapView;externalPubSub;get __EXPERIMENTAL__floorHandler(){return this.#e}__EXPERIMENTAL__overrideSetFloorHandler(e){e&&this.#e&&this.#e!==yi&&x.warn("overwriting an existing setFloor override handler"),this.#o(e)}get manualFloorVisibility(){return this.#e!==void 0}set manualFloorVisibility(e){let t=this.#e;t&&t!==yi&&e&&x.warn("manualFloorVisibility true overwriting an existing setFloor handler to noop"),this.#o(e?yi:void 0)}#o(e){let t=this.manualFloorVisibility;this.#e=e,this.manualFloorVisibility!==t&&this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:this.manualFloorVisibility})}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 An(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new Bn("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 bc(c instanceof Error?c.message:"Unknown error")})},{signal:this.signal});let i=c=>{let p=c;c.startsWith(mn)&&c.endsWith("-merged")&&(p=c.slice(mn.length,-7));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 _n(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",wi(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=[],v=[],I=[],E=[];p.labels.forEach(F=>{let j=this.Labels.getById(F.toString());j&&h.push(j.label)}),p.markers.forEach(F=>{let j=this.Markers.getById(F.toString())||this.Navigation.getMarkerById(F.toString());j&&g.push(j.marker)}),p.models.forEach(F=>{let j=this.Models.getById(F.toString());j&&v.push(j.model)}),p.images.forEach(F=>{let j=this.Image3D.getById(F.toString());j&&I.push(j.image)}),p.paths.forEach(F=>{let j=this.Paths.getById(F.toString())||this.Navigation.getPathById(F.toString());j&&!E.includes(j)&&E.push(j)});let O=p.geometry,D;O.length>0&&(D=O.map(F=>this.getMapDataInternal()?.getById("space",F)).filter(Boolean)[0],D||(D=O.map(F=>this.getMapDataInternal()?.getById("object",F)).filter(Boolean)[0]),D||(D=O.map(F=>this.getMapDataInternal()?.getById("area",F)).filter(Boolean)[0]),D||(D=O.map(F=>this.Shapes.getById(F)).filter(Boolean)[0]));let A=p.containers.reduce((F,j)=>{let te=this.getMapDataInternal()?.getById("floor",j);return te&&pt.is(te)&&F.push(te),F},[]),W,N=0;if(A.length>0){W=A[0].id;let F=this.core.getState(W);N=p.coordinate[2]?p.coordinate[2]-F.altitude:N}let B;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!1})}),D&&xe.is(D)&&(B=O.map(F=>this.getMapDataInternal()?.facadesBySpaceId[F]).filter(Boolean)[0],B&&B.spaces.forEach(F=>{this.core.setState(F.id,{hovered:!0})})),this.lastFacadeIntersected=B;let G={coordinate:new z({latitude:p.coordinate[1],longitude:p.coordinate[0],floorId:W,verticalOffset:N}),spaces:D&&xe.is(D)?[D]:[],objects:D&&dt.is(D)?[D]:[],areas:D&&Ct.is(D)?[D]:[],shapes:D&&fo.is(D)?[D]:[],markers:g,labels:h,models:v,images:I,paths:E,floors:A,facades:B?[B]:[]};"pointerEvent"in p&&(G.pointerEvent=p.pointerEvent),r.publish(c,G)};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 Vn(l),this.Models=new Gn(l),this.Labels=new kn(l),this.Text3D=new zn(l),this.Exporter=new Fn(l),this.Paths=new Un(l),this.Navigation=new wn(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 Vr(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 jn(l),this.Shapes=new Hn(l),this.Style=new Wn(l)}preloadFloors(e){e.forEach(t=>{t instanceof pt&&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(Ce);if(a){let s=a.layers.get(Po);s&&this.core.hasState(s)&&this.core.setState(s,Tl(fe(bl,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="exterior-walls"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Ce);if(a){let s=a.layers.get(to);s&&this.core.hasState(s)&&this.core.setState(s,Tl(fe(bl,t,{warn:!0,disableValidation:r}),this.core.getState(s)))}});return}if(e==="interior-doors"){this.currentMap.floors.forEach(i=>{let a=i.layers.get(Ce),s=i.layers.get(Er);if(!a)return;let l=a.layers.get(Ir);if(!l||!this.core.hasState(l))return;let c=cl(fe($i,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(Ce),s=i.layers.get(Mr);if(!a)return;let l=a.layers.get(Sr);if(!l||!this.core.hasState(l))return;let c=cl(fe($i,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!==Pt.__type&&!this.core.hasState(n.id)){x.warn(`Failed to update state for "${n.id}". No ${n.__type} found with that ID.`);return}if(uo.is(n))return this.core.setState(n.id,Wu(fe(Uu,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(no.is(n))return this.core.setState(n.id,$u(fe(zu,t,{warn:!0,disableValidation:r}),this.core.getState(n.id)));if(xe.is(n)||dt.is(n)){let i=this.core.getState(n.id);i!=null&&this.core.setState(n.id,Gu(fe(ul,t,{warn:!0,disableValidation:r}),i))}if(Ct.is(n)&&this.core.setState(n.id,fe(ul,t,{warn:!0,disableValidation:r})),bt.is(n)&&this.core.setState(n.id,fe(nf,t,{warn:!0,disableValidation:r})),nt.is(n)&&this.core.setState(n.id,hu(fe($i,t,{warn:!0,disableValidation:r}),this.core.getState(n.id))),fo.is(n)){let i=Zu(fe(ml,t,{warn:!0,disableValidation:r}));i.mergedShapeState&&this.core.setState(n.id,i.mergedShapeState)}if(Qo.is(n)){let{position:i,scale:a,rotation:s,...l}=fe(lf,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(pt.is(n)){let i=this.currentMap.floorsById.get(n.id);if(i==null)return;let a=fe(Ru,t,{warn:!0,disableValidation:r});this.core.setState(n.id,a);let s=i.layers.get(Ce);if(s!=null&&"geometry"in t&&t.geometry){this.core.setState(s.containerId,fe(Pu,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(oo);if(l!=null&&"labels"in t&&t.labels){let E=fe(Ou,t.labels,{warn:!0,disableValidation:r});"enabled"in E&&typeof E.enabled=="boolean"&&l.setVisible(E.enabled)}let c=i.layers.get(Vt);if(c!=null&&"markers"in t&&t.markers){let E=fe(Du,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=fe(er,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 O=fe(er,t.footprint,{warn:!0,disableValidation:r});O.color!==void 0&&(E.color=O.color),O.opacity!==void 0&&(E.opacity=O.opacity),O.outline!==void 0&&(E.outline=O.outline)}i.gapFootprintObject.update(E)}let p=i.layers.get(Xo);if(p!=null&&"occlusion"in t&&t.occlusion){let E=fe(Au,t.occlusion,{warn:!0,disableValidation:r});"enabled"in E&&typeof E.enabled=="boolean"&&p.setVisible(E.enabled)}let h=i.layers.get(xr);if(h!=null&&"images"in t&&t.images){let E=fe(wu,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 O of s.layers.values()){let D=this.core.getState(O);if(D?.children)for(let A of D.children)this.core.setState(A,{enableImageCollisions:E.collisionsEnabled})}}let g=i.layers.get(ro);if(g!=null&&"paths"in t&&t.paths!=null){let E=fe(Fu,t.paths,{warn:!0,disableValidation:r});E.visible!=null&&typeof E.visible=="boolean"&&g.setVisible(E.visible)}let v=i.layers.get($o);if(v!=null&&"areas"in t&&t.areas!=null){let E=fe(ku,t.areas,{warn:!0,disableValidation:r});E.visible!=null&&typeof E.visible=="boolean"&&v.setVisible(E.visible)}let I=i.layers.get(jt);if(I!=null&&"models"in t&&t.models!=null){let E=fe(Nu,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=fe(Lu,t.text3d,{warn:!0,disableValidation:r}),O=i.layers.get(Jo);O!=null&&E.visible!=null&&O.setVisible(E.visible),E.geometryText?.visible!=null&&i.setGeometryTextBatchVisible(E.geometryText.visible),E.floorText?.visible!=null&&i.setFloorTextBatchVisible(E.floorText.visible)}}if(Ge.is(n)){let i=this.core.getState(n.id);for(let a of i.children)a.type==="group-container"&&this.core.setState(a.id,fe(mu,t,{warn:!0,disableValidation:r}))}if(ho.is(n)&&this.core.setState(n.id,fe(ef,t,{warn:!0,disableValidation:r})),Pt.is(n)){let i=fe(al,t,{warn:!0,disableValidation:r}),a=Br(i);for(let s of n.segments)this.core.setState(s.id,a)}if(Fo.is(n)){let i=fe(al,t,{warn:!0,disableValidation:r}),a=Br(i);this.core.setState(n.id,a)}}}getMapDataObject(e){return this.getMapDataInternal()?.getMapDataById(e)}update=()=>{this.core.render()};getMapDataInternal(){if(this.mapData)return cn(this.mapData)}getMapData(){return this.mapData}addMap(e,t){return new Promise(r=>{let n;try{n=cn(e)}catch(p){x.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 z(a[1],a[0])});let s=i["manifest.geojson"].features[0].properties.name,l=new Bn(`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=>{let h=Fh(this.getMapDataInternal(),p.floorId,p.previousFloorId);h&&this.externalPubSub.publish("floor-change-start",{reason:p.reason,...h})},{signal:this.signal}),l.on("floor-change",p=>{let h=Fh(this.getMapDataInternal(),p.floorId,p.previousFloorId);h&&this.externalPubSub.publish("floor-change",{reason:p.reason,...h}),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:Ma*this.core.canvasHeight,left:Ma*this.core.canvasWidth,right:Ma*this.core.canvasWidth,bottom:Ma*this.core.canvasHeight};this.Camera.focusOn(this.currentFloor,{duration:wp,screenOffsets:p}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),r(e)})}else r(e)})}setFloor(e,t){return this.currentMap.setFloor(hn(e),t)}setFloorStack(e,t){return this.currentMap.setFloorStack(hn(e),t)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){let e=this.currentMap.currentFloorStack.id;if(!e)throw new we("Missing currentFloorStack.");let t=this.mapData?.getById("floor-stack",e);if(!t)throw new we("FloorStack was not found in map data.");return t}get currentFloor(){let e=this.currentMap.currentFloor.id;if(!e)throw new we("Missing currentFloor object from GeoJsonApi");let t=this.mapData?.getById("floor",e);if(!t)throw new we("Missing currentFloor");return t}getState(e){typeof e=="object"&&Pt.is(e)&&x.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let t=Vs(e,this),r=this.core.getState(t);if(r){if(["interior-walls","exterior-walls"].includes(e)&&r.type==="feature-collection")return rf(r);if(["interior-doors","exterior-doors"].includes(e)&&r.type==="feature-collection"){let n=e==="interior-doors"?Er:Mr,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 fu(r,i)}else{if(r.type==="geometry")return ju(r);if(r.type==="label"&&r.options.appearance&&r.options.rank!==void 0&&r.options.interactive!==void 0)return Hu(r);if(r.type==="marker"&&r.options?.rank!==void 0&&r.options.interactive!==void 0)return Xu(r,this.Markers.getById(r.id.toString())?.marker);if(r.type==="model")return cf(r);if(r.type==="image")return af(r);if(r.type==="text3d")return tf(r);if(r.type==="feature-collection"&&e&&typeof e!="string"&&fo.is(e))return Ju(r);if(r.type==="path")return pu(r);if(r.type==="group-container"&&typeof e!="string"&&pt.is(e))return Bu(r,this.currentMap.floorsById.get(e.id),this.core);if(r.type==="group-container"&&r.children.length>0&&typeof e!="string"&&Ge.is(e)){let n=this.core.getState(r.children[0].id);return yu(n)}}}}__EXPERIMENTAL__getRenderedState(e){let t=Vs(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 z(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 z(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 uo.__type:n=r.map(i=>this.Labels.getById(i)).filter(i=>i!=null).map(i=>i.label);break;case no.__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 Ah(this,e)}tween(e){let t=new so(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,markers:this.Navigation.markers}}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){x.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(e.length<2){x.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){x.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}ja(n,"group-container"),ja(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 Kb(o){if(o===""){Ra(""),Va("");return}Va(`${o}/${wc}`),Ra(`${o}/${Dc}`)}function Fh(o,e,t){let r=o?.getById("floor",t),n=o?.getById("floor",e);return!r||!n?null:{floor:n,previousFloor:r}}f();var xa=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 z({longitude:e[0],latitude:e[1]}),zoomLevel:this.#e.camera.zoomLevel,bearing:t,pitch:this.#e.camera.pitch}}};f();import Xe from"zod";var kh=Xe.strictObject({environment:Xe.union([Xe.literal("basic"),Xe.literal(!1)]).optional(),text3d:Xe.object({hoverColor:Xe.string().optional()}).optional(),geometry:Xe.object({hoverColor:Xe.string().optional()}).optional(),backgroundColor:Xe.string().optional(),backgroundAlpha:Xe.number().optional(),multiFloorView:Xe.object({spacesOpenToBelowVisualEffectEnabled:Xe.boolean().optional(),spacesOpenToBelowVisualEffectDarkenAmount:Xe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDarkenUseDepth:Xe.boolean().optional(),spacesOpenToBelowVisualEffectDesaturateAmount:Xe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectDesaturateUseDepth:Xe.boolean().optional(),spacesOpenToBelowVisualEffectWashOutAmount:Xe.number().min(0).max(1).optional(),spacesOpenToBelowVisualEffectWashOutUseDepth:Xe.boolean().optional()}).optional()});f();var Ql=di(ag(),1);f();var ti=null;function Lh(){if(ti)return ti;if(typeof OffscreenCanvas<"u")ti=new OffscreenCanvas(1,1).getContext("2d");else if(typeof document<"u"){let o=document.createElement("canvas");o.width=1,o.height=1,ti=o.getContext("2d")}return ti}function Yl(o){return o<.04045?o*.0773993808:Math.pow(o*.9478672986+.0521327014,2.4)}function Jl(o){return o<.0031308?o*12.92:1.055*Math.pow(o,.41666)-.055}function Zl(o){let e=Lh();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[Yl(t/255),Yl(r/255),Yl(n/255)]}function Nh(o){let e=Math.round(Math.min(1,Math.max(0,Jl(o[0])))*255),t=Math.round(Math.min(1,Math.max(0,Jl(o[1])))*255),r=Math.round(Math.min(1,Math.max(0,Jl(o[2])))*255);return"#"+(1<<24|e<<16|t<<8|r).toString(16).slice(1)}var eT=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,tT=/^rgba?\(\s*\d+/,oT=/^hsla?\(\s*[\d.]+/;function ql(o){if(o==null||typeof o!="string")return!1;if(eT.test(o)||tT.test(o)||oT.test(o))return!0;let e=Lh();return e?(e.fillStyle="#000",e.fillStyle=o,e.fillStyle!=="#000000"||o.toLowerCase()==="black"||o==="#000"||o==="#000000"):!1}var rT=(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},Rh=(o,e)=>{let t=rT(o,e),r=(0,Ql.default)({},t,e),n=(0,Ql.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(ql(h)&&ql(g)){let v=Zl(h),I=Zl(g);v&&I?c[p]=Nh([v[0]+(I[0]-v[0])*l,v[1]+(I[1]-v[1])*l,v[2]+(I[2]-v[2])*l]):x.warn(`Color "${p}" could not be animated!`)}}else typeof g=="object"&&g!==null&&typeof h=="object"&&h!==null?i(h,g,l,c[p]):x.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 nT(o){return o.getContext("webgl2")||o.getContext("webgl")}function Kl(o){let e=nT(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 Bh(o,e=1e3){let t=null,r=new Promise(a=>{t=()=>{let s=o.getCanvas();a(s?Kl(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 ec(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 x.warn(n),null}}var oi=class{#e;#t;#o;Camera;Labels;Text3D;Markers;Image3D;Models;Paths;Exporter;Navigation;Style;Shapes;Outdoor;constructor(e){this.#e=new gt,this.#o=e;let t=new ei(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 xa(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 x.warn(`Cannot animate state of ${e}.`),new Promise(c=>c({result:"completed"}));let i=Rh(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 ur&&a.easing(ur[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{kh.parse(e)}catch(t){x.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 Lp(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 we("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 z(e):new z(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-RHOYG5KR.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 Bh(n);h&&c.drawImage(h,0,0,l.width,l.height)}await this.#o.renderSync();let p=Kl(r);if(p&&c.drawImage(p,0,0,l.width,l.height),t.withLabels){let h=this.#o.labelsCanvas;if(h){let g=ec(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 v=h.children[g],I=v.classList.contains("mappedin-2d-entities");if(!(v.tagName==="CANVAS"||v.offsetWidth===0||v.offsetHeight===0||!I))try{let E=await t.captureMarkers(v),O=ec(E,"overlay");O&&O.width>0&&O.height>0&&c.drawImage(O,0,0,l.width,l.height)}catch(E){x.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 we(E)}let I=h instanceof Error?`Screenshot failed: ${h.message}`:"Screenshot failed due to an unknown error.";throw new we(I)}}finally{i&&this.Outdoor.show(),a&&this.Outdoor.hide(s)}}get manualFloorVisibility(){return this.#t.manualFloorVisibility}set manualFloorVisibility(e){this.#t.manualFloorVisibility=e}__EXPERIMENTAL__overrideSetFloorHandler(e){this.#t.__EXPERIMENTAL__overrideSetFloorHandler(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){x.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 iT=1e3*60*60*2,$r=class{#e=new gt;#t;#o;#r;#n;#i;#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.#i?.token;this.#i=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.#i=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.#i!=null&&this.#i.expires!=null&&this.#i.expires>Date.now()&&!e?this.#i:(this.#r=pn({...this.#o,key:this.#o.key,secret:this.#o.secret},this.#o.enterprise??!1,e).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.#n!=null?this.#n:this.#s!=null&&this.#s.expires>Date.now()&&!e?this.#s:(this.#n=new Promise((t,r)=>{this.#u().then(n=>{let i={},a=this.#t.map(s=>Xa({...this.#o,mapId:s},n.token).then(l=>{i[s]={token:l.token,expires:l.expires}}).catch(l=>{x.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.#n.catch(t=>{throw t}).finally(()=>{this.#n=void 0}),this.#n)}#p(e){if(!("key"in this.#o)||!("secret"in this.#o))return;let t=e.expires!=null?e.expires-Date.now():iT;isFinite(t)&&(this.#c=setTimeout(()=>{this.#u(!0).then(r=>{this.#p(r)})},t-sp))}#m(e){let t=e.expires-Date.now();isFinite(t)&&(this.#a=setTimeout(()=>{this.#f(!0).then(r=>{this.#m(r)})},t-dp))}#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)){x.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),on()&&globalThis.addEventListener?.("focus",this.#l)}async refreshing(){let e=[];return this.#r!=null&&e.push(this.#r),this.#n!=null&&e.push(this.#n),Promise.all(e)}getAccessTokenAsync(e=!1){return this.#u(e)}getSasTokensAsync(){return this.#f()}getAccessToken(){return this.#i==null?(x.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):this.#i}getSasToken(e){return this.isEnterpriseMode()?(x.error("SAS tokens are not available in the enterprise mode!"),{token:""}):this.#s==null?(x.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):e in this.#s.tokens?this.#s.tokens[e]:(x.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(),on()&&globalThis.removeEventListener("focus",this.#l)}};f();var aT=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=xo();a.updateByUserOption(r);let s={};if("type"in o&&typeof o.type=="string"){if(o.type==="binary"&&o.main instanceof Uint8Array){let A=await Si(o.main,r.mvfVersion);n=A.mvf2,i=A.mvf3,s.languagePacks=[];for(let W of o.languagePacks??[])W.localePack instanceof Uint8Array&&s.languagePacks.push({language:W.language,localePack:await br(W.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 D=i!=null?Ii(i):n.enterprise!=null;o.options?.enterprise!==void 0&&(D?x.warn('The "enterprise" option in hydrateMapData is deprecated and ignored. Enterprise mode is now automatically detected from the MVF data.'):x.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=D||(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&&lp(r.key)&&(s.enterprise=!1),a.setEnterprise(s.enterprise??!1);let p=vi(n),h=p.length>0?p:[r.mapId];r.baseAuthUri=a.getBaseAuthUri();let g=new $r(h,{...r,enterprise:s.enterprise}),v;if(c)v=r.accessToken;else if(l){let D;try{D=await g.getAccessTokenAsync()}catch(A){x.error("Failed getting token during hydrateMapData",A)}v=D?.token||""}if(s.outdoorViewToken=v,s.env=a,s.getMapDataOptions=r,s.tokenManager=g,r.prefetchTokens&&(l||c))try{await g.readySync()}catch(D){x.error("Failed to ready token manager!",D)}xn()&&(s.enterprise&&x.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),r.mvfVersion!=="3.0.0"&&x.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let I=new qo(n,s);v&&I.Analytics.init({accessToken:v,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 ln(I),O=I.findPreferredLanguage({languageCode:r.language,fallbackToNavigatorLanguage:!1});if(O)try{await E.changeLanguage(O.code)}catch{}return typeof e?.onMVFParsed=="function"&&e.onMVFParsed(n),E};var Vh=`:root {
|
|
298
298
|
--pin-shadow-hover-scale: 0.9;
|
|
299
299
|
--pin-shadow-width: 12px;
|
|
300
300
|
--pin-shadow-height: 5px;
|
|
@@ -406,7 +406,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
406
406
|
background: #595959;
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
`;var
|
|
409
|
+
`;var jh=`.mappedin-marker {
|
|
410
410
|
font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;
|
|
411
411
|
font-weight: normal;
|
|
412
412
|
top: 0;
|
|
@@ -453,7 +453,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
453
453
|
.mappedin-marker[data-placement='hidden']::before {
|
|
454
454
|
display: block;
|
|
455
455
|
}
|
|
456
|
-
`;var
|
|
456
|
+
`;var Gh=`.mappedin__smart-collision-engine__container {
|
|
457
457
|
position: absolute;
|
|
458
458
|
left: 0px;
|
|
459
459
|
top: 0px;
|
|
@@ -480,7 +480,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
480
480
|
opacity: 0.2;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
`;var
|
|
483
|
+
`;var Uh=`.mappedin-map {
|
|
484
484
|
.mappedin-interactive {
|
|
485
485
|
cursor: grab;
|
|
486
486
|
|
|
@@ -493,7 +493,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
`;var
|
|
496
|
+
`;var Hh=`.mappedin-map {
|
|
497
497
|
.mappedin-control-container {
|
|
498
498
|
position: absolute;
|
|
499
499
|
left: 0px;
|
|
@@ -633,7 +633,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
`;var
|
|
636
|
+
`;var Wh='.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 zh=`.mappedin-annotation-marker {
|
|
637
637
|
--mappedin-annotation-border-radius: 5px;
|
|
638
638
|
--mappedin-annotation-border-width: 2px;
|
|
639
639
|
--mappedin-annotation-background-color: #ffffff;
|
|
@@ -656,6 +656,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
656
656
|
border-radius: calc(var(--mappedin-annotation-border-radius) - var(--mappedin-annotation-border-width));
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
`;f();function
|
|
659
|
+
`;f();function hT(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 gT(o){if(!(!o.languages||!on()||!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 qs(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=gT(o);a&&(i=a)}catch(a){x.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",a)}return i??o.defaultLanguage}var mT=[Vh,jh,Gh,Uh,Hh,Wh,zh],Xh;function YO(o){Xh=o}var JO=async(o,e)=>{let t,r=xo();e&&r.updateByUserOption(e);try{e&&(t=(await pn({...e,baseAuthUri:r.getBaseAuthUri()})).accessToken)}catch(a){x.warn("Getting access token failed. Outdoor map disabled.",a)}let n=new qo(o,{outdoorViewToken:t,languagePacks:e?.languagePacks,env:r});return new ln(n)},$h=!1;function ZO(o){$h=o}var Yh=!1;function qO(o){Yh=o}function xn(){return Yh}var yT=async o=>{let e=$h,t,r=xo();r.updateByUserOption(o);let n={prefetchTokens:!0,...o,fallbackToNavigatorLanguage:o.fallbackToNavigatorLanguage??!0},i=n.bundleUri!=null,a="accessToken"in n&&typeof n.accessToken=="string"?n.accessToken:void 0,s="key"in n&&typeof n.key=="string"?n.key:void 0,l="secret"in n&&typeof n.secret=="string"?n.secret:void 0,c=a!=null,p=s!=null&&l!=null;i&&(n.viewId!=null||n.mvfVersion!=null)&&x.warn("bundleUri already names a specific export; viewId and mvfVersion are ignored.");let h=new $r([n.mapId],n);if(c){t=a;let{aud:F,sub:j}=gi(t);(Fp.some(te=>F.includes(te))||j&&j.startsWith("client"))&&(e=!0,r.setEnterprise(e),h.setEnterprise(e))}else if(p){if(s.startsWith("mipk_"))throw new Error(`Partner API keys detected!
|
|
660
660
|
|
|
661
|
-
Partner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.`);s.startsWith("mik_")||(e=!0,r.setEnterprise(e),h.setEnterprise(e)),n.baseAuthUri=r.getBaseAuthUri();let
|
|
661
|
+
Partner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.`);s.startsWith("mik_")||(e=!0,r.setEnterprise(e),h.setEnterprise(e)),n.baseAuthUri=r.getBaseAuthUri();let F;try{F=await h.getAccessTokenAsync(),t=F?.token}catch(j){if(x.warn("Get access token failed",j.message),!i)throw new Error("Get access token failed: "+j.message)}}else if(!i)throw new Error("Missing key or secret.");i&&e&&x.warn("bundleUri takes precedence over the enterprise bundle resolver. The supplied URL is downloaded as-is, so layoutId and API gateway locale packs are not applied."),n.layoutId!=null&&(e?n.layoutId!=="draft"&&x.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):x.warn("layoutId is currently unsupported!")),n.baseUri=r.getBaseUri();let g=performance.now(),v,I;if(i||!e)v=await rs(n,t);else{let F={...n,venue:n.mapId,clientId:n.key,clientSecret:n.secret,version:"1.0.0",perspective:n.viewId,useDraftData:n.layoutId==="draft"},j=await os(F);v=j.compressed,I=j.localePacks}let E=performance.now(),{mvf2:O,mvf3:D}=await Si(v,i?void 0:n.mvfVersion),A=performance.now();typeof o.onMVFParsed=="function"&&o.onMVFParsed(O),i&&!p&&!c&&(D!=null?Ii(D):O.enterprise!=null)&&(e=!0,r.setEnterprise(e),h.setEnterprise(e));let W=vi(O);if(W.length>0?h.setMapIds(W):h.setMapIds([n.mapId]),n.prefetchTokens&&(p||c))try{await h.readySync()}catch(F){x.error("Failed to ready token manager!",F)}xn()&&(e&&x.warn("forceEnterpriseLocations is enabled, but the map is already an enterprise map!"),n.mvfVersion!=="3.0.0"&&x.warn("mvfVersion must be '3.0.0' when forceEnterpriseLocations is enabled!"));let N=new qo(O,{env:r,outdoorViewToken:t,tokenManager:h,enterprise:e,localePacksUrls:I,binaryBundle:v,getMapDataOptions:n,mvf3:D}),B=new ln(N,{search:o.search});t&&(N.Analytics.init({accessToken:t,mapId:n.mapId,key:s,secret:l,enterprise:e,...n.analytics,baseUri:r.getAnalyticsBaseUri(),context:n.analytics?.context}),N.Analytics.sendGetMapDataEvent({parseDuration:A-E,downloadDuration:E-g,viewId:n.viewId}));let G=N.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:n.fallbackToNavigatorLanguage});if(G)try{await B.changeLanguage(G.code)}catch{}return B},QO=yT,bT=async()=>{if(Na===""||Ba==="")return!1;let o=[fetch(Na,{mode:"same-origin"}),fetch(Ba,{mode:"same-origin"})],[e,t]=[{ok:!1},{ok:!1}];try{[e,t]=await Promise.all(o)}catch{}return{collision:e.ok,maplibre:t.ok}},tc=new WeakSet,TT=async(o,e,t)=>{let r=performance.now();tc.has(o)&&x.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=ms(t,e);n&&gs(n),(n.injectStyles??!0)&&$l(mT,{id:"mappedin__styles"});let i=kp(e.outdoorViewToken??""),a=cn(e);n.outdoorView?.style&&a.envControl.updateTileServerBaseUrl(n.outdoorView?.style);let s=a.tokenManager,l=s?async()=>{try{return(await s.getAccessTokenAsync(!0))?.token}catch(I){x.warn("Failed to refresh outdoor tiles token:",I);return}}:void 0,c=!1,p=!1,h=await bT();h&&(h.collision||(c=!0),h.maplibre||(p=!0));let g=await Bc(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:!p&&n.outdoorView?.token?{headers:{"x-mappedin-tiles-key":n.outdoorView?.token},style:e.getEnv().tileServerUri,enabled:!!n.outdoorView?.enabled,lowDpi:n.outdoorView?.lowDpi,refreshToken:l}:void 0,watermark:{...n.watermark,visible:n.watermark?.visible??(!a.enterpriseMode&&!i.remove_watermark),onClick:Xh||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:!c,disableUpdateStateValidation:n.disableUpdateStateValidation??!1,__EXPERIMENTAL_shadows:n.__EXPERIMENTAL_shadows,__TEST_synchronousIdleWork:n.__TEST_synchronousIdleWork??(Rc()?{enabled:!0,maxDelay:100}:void 0),outlines:typeof n.style?.outlines=="object"?n.style.outlines:void 0}),v=new oi(g);return await v.addMap(e,n),a.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-r,dimension:v.getDimensions(),collisionWorkerDisabled:c,outdoorsWorkerDisabled:p}),tc.add(o),v.on("destroy",()=>tc.delete(o)),v},KO=()=>S.env.npm_package_version,e6=TT;export{z as a,_t as b,zo as c,eo as d,Ne as e,um as f,Ct as g,nt as h,xe as i,pt as j,Je as k,dt as l,Tt as m,Gt as n,Cr as o,Ge as p,ct as q,Ci as r,Fs as s,Mp as t,ns as u,Si as v,Vp as w,ks as x,jp as y,Oi as z,Di as A,Do as B,po as C,Pi as D,rl as E,Oy as F,fl as G,hl as H,Kb as I,oi as J,aT as K,hT as L,qs as M,YO as N,JO as O,ZO as P,qO as Q,xn as R,yT as S,QO as T,bT as U,TT as V,KO as W,e6 as X};
|