@mappedin/react-sdk 6.0.1-beta.52 → 6.0.1-beta.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{a as Ms}from"./chunk-YGXQDTMT.js";import{$ as gp,A as Ha,Aa as yP,B as tP,Ba as h_,C as Xa,Ca as vP,D as kr,Da as bP,E as zr,Ea as yp,F as Dn,Fa as xP,G as we,Ga as _P,H as zf,Ha as ev,I as o_,Ia as f_,J as ia,Ja as dg,K as q0,Ka as Yf,L as W0,La as rv,M as mp,Ma as qf,N as Si,Na as Wf,O as Ui,P as eP,Q as nn,R as oi,S as rP,T as Kn,U as nP,V as Ya,W as Z0,X as Bn,Y as s_,Z as io,_ as iP,a as Mw,aa as oa,b as Tw,ba as Sr,c as tt,ca as Er,d as Ci,da as $0,e as ww,ea as a_,f as Q2,fa as J0,g as z0,ga as l_,h as Zw,ha as u_,i as Uf,ia as c_,j as H0,ja as lP,k as $w,ka as Hf,l as X0,la as uP,m as Is,ma as Xf,n as za,na as fg,o as Y0,oa as cP,p as pg,pa as is,q as n_,qa as pP,r as Hl,ra as hP,s as Mr,sa as p_,t as le,ta as K0,u as Xl,ua as Q0,v as hg,va as fP,w as i_,wa as dP,x as Jw,xa as mP,y as Kw,ya as tv,z as Qw,za as gP}from"./chunk-2LTL6ZVN.js";import{a as iA,ca as aP,k as oP,v as sP}from"./chunk-L6SCRGG4.js";import{a as nA}from"./chunk-WVB6PZOJ.js";import{$ as ue,A as Ow,Aa as V0,B as R0,Ba as r_,C as F0,Ca as Va,D as Dw,Da as ja,E as Lw,Ea as ra,Fa as j0,G as Aw,Ga as Uw,H as Ie,Ha as zw,I as ne,Ja as na,M as Nw,N as kw,O as Rw,P as dp,Q as zt,R as In,S as Fw,T as ns,Ta as jf,U as Ul,V as zl,W as rn,Xa as U0,Y as On,Ya as Hw,Z as Ro,_ as B0,aa as Fo,ab as Xw,b as L0,c as A0,ca as nc,cb as Ua,d as Pw,da as Bw,db as Yw,e as jl,ea as t_,eb as qw,f as Ew,g as Ga,ga as ic,gb as Ww,la as Gw,oa as oc,p as N0,pa as Vw,qa as G0,r as k0,ra as e_,ta as Vf,ya as jw,z as fp,za as sc}from"./chunk-6X6EHSZ7.js";import{a as y,b as P}from"./chunk-5SHMBNLX.js";import{a as U,b as rt,c as l,e as ea,g as Lt,h as K2,i as $r,j as b,k as p,l as R,m as V,n as yt}from"./chunk-PEDEW3M6.js";var nv=Lt((t$,SP)=>{"use strict";y();var CP=Object.getOwnPropertySymbols,sA=Object.prototype.hasOwnProperty,aA=Object.prototype.propertyIsEnumerable;function lA(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}l(lA,"toObject");function uA(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var n=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(a){return!1}}l(uA,"shouldUseNative");SP.exports=uA()?Object.assign:function(r,t){for(var e,n=lA(r),i,a=1;a<arguments.length;a++){e=Object(arguments[a]);for(var u in e)sA.call(e,u)&&(n[u]=e[u]);if(CP){i=CP(e);for(var h=0;h<i.length;h++)aA.call(e,i[h])&&(n[i[h]]=e[i[h]])}}return n}});var b_=Lt((y_,v_)=>{y();(function(r,t){typeof y_=="object"&&typeof v_<"u"?v_.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(y_,function(){"use strict";function r(T,D,A,L,B){l(function j(W,$,F,J,ot){for(;J>F;){if(J-F>600){var K=J-F+1,H=$-F+1,_t=Math.log(K),ct=.5*Math.exp(2*_t/3),ft=.5*Math.sqrt(_t*ct*(K-ct)/K)*(H-K/2<0?-1:1),mt=Math.max(F,Math.floor($-H*ct/K+ft)),St=Math.min(J,Math.floor($+(K-H)*ct/K+ft));j(W,$,mt,St,ot)}var dt=W[$],xt=F,q=J;for(t(W,F,$),ot(W[J],dt)>0&&t(W,F,J);xt<q;){for(t(W,xt,q),xt++,q--;ot(W[xt],dt)<0;)xt++;for(;ot(W[q],dt)>0;)q--}ot(W[F],dt)===0?t(W,F,q):t(W,++q,J),q<=$&&(F=q+1),$<=q&&(J=q-1)}},"t")(T,D,A||0,L||T.length-1,B||e)}l(r,"t");function t(T,D,A){var L=T[D];T[D]=T[A],T[A]=L}l(t,"i");function e(T,D){return T<D?-1:T>D?1:0}l(e,"n");var n=l(function(T){T===void 0&&(T=9),this._maxEntries=Math.max(4,T),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function i(T,D,A){if(!A)return D.indexOf(T);for(var L=0;L<D.length;L++)if(A(T,D[L]))return L;return-1}l(i,"e");function a(T,D){u(T,0,T.children.length,D,T)}l(a,"a");function u(T,D,A,L,B){B||(B=w(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var j=D;j<A;j++){var W=T.children[j];h(B,T.leaf?L(W):W)}return B}l(u,"h");function h(T,D){return T.minX=Math.min(T.minX,D.minX),T.minY=Math.min(T.minY,D.minY),T.maxX=Math.max(T.maxX,D.maxX),T.maxY=Math.max(T.maxY,D.maxY),T}l(h,"o");function d(T,D){return T.minX-D.minX}l(d,"s");function m(T,D){return T.minY-D.minY}l(m,"l");function v(T){return(T.maxX-T.minX)*(T.maxY-T.minY)}l(v,"f");function x(T){return T.maxX-T.minX+(T.maxY-T.minY)}l(x,"u");function S(T,D){return T.minX<=D.minX&&T.minY<=D.minY&&D.maxX<=T.maxX&&D.maxY<=T.maxY}l(S,"m");function I(T,D){return D.minX<=T.maxX&&D.minY<=T.maxY&&D.maxX>=T.minX&&D.maxY>=T.minY}l(I,"c");function w(T){return{children:T,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}l(w,"p");function E(T,D,A,L,B){for(var j=[D,A];j.length;)if(!((A=j.pop())-(D=j.pop())<=L)){var W=D+Math.ceil((A-D)/L/2)*L;r(T,W,D,A,B),j.push(D,W,W,A)}}return l(E,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(T){var D=this.data,A=[];if(!I(T,D))return A;for(var L=this.toBBox,B=[];D;){for(var j=0;j<D.children.length;j++){var W=D.children[j],$=D.leaf?L(W):W;I(T,$)&&(D.leaf?A.push(W):S(T,$)?this._all(W,A):B.push(W))}D=B.pop()}return A},n.prototype.collides=function(T){var D=this.data;if(!I(T,D))return!1;for(var A=[];D;){for(var L=0;L<D.children.length;L++){var B=D.children[L],j=D.leaf?this.toBBox(B):B;if(I(T,j)){if(D.leaf||S(T,j))return!0;A.push(B)}}D=A.pop()}return!1},n.prototype.load=function(T){if(!T||!T.length)return this;if(T.length<this._minEntries){for(var D=0;D<T.length;D++)this.insert(T[D]);return this}var A=this._build(T.slice(),0,T.length-1,0);if(this.data.children.length)if(this.data.height===A.height)this._splitRoot(this.data,A);else{if(this.data.height<A.height){var L=this.data;this.data=A,A=L}this._insert(A,this.data.height-A.height-1,!0)}else this.data=A;return this},n.prototype.insert=function(T){return T&&this._insert(T,this.data.height-1),this},n.prototype.clear=function(){return this.data=w([]),this},n.prototype.remove=function(T,D){if(!T)return this;for(var A,L,B,j=this.data,W=this.toBBox(T),$=[],F=[];j||$.length;){if(j||(j=$.pop(),L=$[$.length-1],A=F.pop(),B=!0),j.leaf){var J=i(T,j.children,D);if(J!==-1)return j.children.splice(J,1),$.push(j),this._condense($),this}B||j.leaf||!S(j,W)?L?(A++,j=L.children[A],B=!1):j=null:($.push(j),F.push(A),A=0,L=j,j=j.children[0])}return this},n.prototype.toBBox=function(T){return T},n.prototype.compareMinX=function(T,D){return T.minX-D.minX},n.prototype.compareMinY=function(T,D){return T.minY-D.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(T){return this.data=T,this},n.prototype._all=function(T,D){for(var A=[];T;)T.leaf?D.push.apply(D,T.children):A.push.apply(A,T.children),T=A.pop();return D},n.prototype._build=function(T,D,A,L){var B,j=A-D+1,W=this._maxEntries;if(j<=W)return a(B=w(T.slice(D,A+1)),this.toBBox),B;L||(L=Math.ceil(Math.log(j)/Math.log(W)),W=Math.ceil(j/Math.pow(W,L-1))),(B=w([])).leaf=!1,B.height=L;var $=Math.ceil(j/W),F=$*Math.ceil(Math.sqrt(W));E(T,D,A,F,this.compareMinX);for(var J=D;J<=A;J+=F){var ot=Math.min(J+F-1,A);E(T,J,ot,$,this.compareMinY);for(var K=J;K<=ot;K+=$){var H=Math.min(K+$-1,ot);B.children.push(this._build(T,K,H,L-1))}}return a(B,this.toBBox),B},n.prototype._chooseSubtree=function(T,D,A,L){for(;L.push(D),!D.leaf&&L.length-1!==A;){for(var B=1/0,j=1/0,W=void 0,$=0;$<D.children.length;$++){var F=D.children[$],J=v(F),ot=(K=T,H=F,(Math.max(H.maxX,K.maxX)-Math.min(H.minX,K.minX))*(Math.max(H.maxY,K.maxY)-Math.min(H.minY,K.minY))-J);ot<j?(j=ot,B=J<B?J:B,W=F):ot===j&&J<B&&(B=J,W=F)}D=W||D.children[0]}var K,H;return D},n.prototype._insert=function(T,D,A){var L=A?T:this.toBBox(T),B=[],j=this._chooseSubtree(L,this.data,D,B);for(j.children.push(T),h(j,L);D>=0&&B[D].children.length>this._maxEntries;)this._split(B,D),D--;this._adjustParentBBoxes(L,B,D)},n.prototype._split=function(T,D){var A=T[D],L=A.children.length,B=this._minEntries;this._chooseSplitAxis(A,B,L);var j=this._chooseSplitIndex(A,B,L),W=w(A.children.splice(j,A.children.length-j));W.height=A.height,W.leaf=A.leaf,a(A,this.toBBox),a(W,this.toBBox),D?T[D-1].children.push(W):this._splitRoot(A,W)},n.prototype._splitRoot=function(T,D){this.data=w([T,D]),this.data.height=T.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(T,D,A){for(var L,B,j,W,$,F,J,ot=1/0,K=1/0,H=D;H<=A-D;H++){var _t=u(T,0,H,this.toBBox),ct=u(T,H,A,this.toBBox),ft=(B=_t,j=ct,W=void 0,$=void 0,F=void 0,J=void 0,W=Math.max(B.minX,j.minX),$=Math.max(B.minY,j.minY),F=Math.min(B.maxX,j.maxX),J=Math.min(B.maxY,j.maxY),Math.max(0,F-W)*Math.max(0,J-$)),mt=v(_t)+v(ct);ft<ot?(ot=ft,L=H,K=mt<K?mt:K):ft===ot&&mt<K&&(K=mt,L=H)}return L||A-D},n.prototype._chooseSplitAxis=function(T,D,A){var L=T.leaf?this.compareMinX:d,B=T.leaf?this.compareMinY:m;this._allDistMargin(T,D,A,L)<this._allDistMargin(T,D,A,B)&&T.children.sort(L)},n.prototype._allDistMargin=function(T,D,A,L){T.children.sort(L);for(var B=this.toBBox,j=u(T,0,D,B),W=u(T,A-D,A,B),$=x(j)+x(W),F=D;F<A-D;F++){var J=T.children[F];h(j,T.leaf?B(J):J),$+=x(j)}for(var ot=A-D-1;ot>=D;ot--){var K=T.children[ot];h(W,T.leaf?B(K):K),$+=x(W)}return $},n.prototype._adjustParentBBoxes=function(T,D,A){for(var L=A;L>=0;L--)h(D[L],T)},n.prototype._condense=function(T){for(var D=T.length-1,A=void 0;D>=0;D--)T[D].children.length===0?D>0?(A=T[D-1].children).splice(A.indexOf(T[D]),1):this.clear():a(T[D],this.toBBox)},n})});var MP=Lt((h$,IP)=>{y();IP.exports=l(function(t,e,n,i){var a=t[0],u=t[1],h=!1;n===void 0&&(n=0),i===void 0&&(i=e.length);for(var d=(i-n)/2,m=0,v=d-1;m<d;v=m++){var x=e[n+m*2+0],S=e[n+m*2+1],I=e[n+v*2+0],w=e[n+v*2+1],E=S>u!=w>u&&a<(I-x)*(u-S)/(w-S)+x;E&&(h=!h)}return h},"pointInPolygonFlat")});var wP=Lt((m$,TP)=>{y();TP.exports=l(function(t,e,n,i){var a=t[0],u=t[1],h=!1;n===void 0&&(n=0),i===void 0&&(i=e.length);for(var d=i-n,m=0,v=d-1;m<d;v=m++){var x=e[m+n][0],S=e[m+n][1],I=e[v+n][0],w=e[v+n][1],E=S>u!=w>u&&a<(I-x)*(u-S)/(w-S)+x;E&&(h=!h)}return h},"pointInPolygonNested")});var OP=Lt((v$,ov)=>{y();var PP=MP(),EP=wP();ov.exports=l(function(t,e,n,i){return e.length>0&&Array.isArray(e[0])?EP(t,e,n,i):PP(t,e,n,i)},"pointInPolygon");ov.exports.nested=EP;ov.exports.flat=PP});var LP=Lt((sv,DP)=>{y();(function(r,t){typeof sv=="object"&&typeof DP<"u"?t(sv):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(sv,function(r){"use strict";let e=33306690738754706e-32;function n(I,w,E,T,D){let A,L,B,j,W=w[0],$=T[0],F=0,J=0;$>W==$>-W?(A=W,W=w[++F]):(A=$,$=T[++J]);let ot=0;if(F<I&&J<E)for($>W==$>-W?(B=A-((L=W+A)-W),W=w[++F]):(B=A-((L=$+A)-$),$=T[++J]),A=L,B!==0&&(D[ot++]=B);F<I&&J<E;)$>W==$>-W?(B=A-((L=A+W)-(j=L-A))+(W-j),W=w[++F]):(B=A-((L=A+$)-(j=L-A))+($-j),$=T[++J]),A=L,B!==0&&(D[ot++]=B);for(;F<I;)B=A-((L=A+W)-(j=L-A))+(W-j),W=w[++F],A=L,B!==0&&(D[ot++]=B);for(;J<E;)B=A-((L=A+$)-(j=L-A))+($-j),$=T[++J],A=L,B!==0&&(D[ot++]=B);return A===0&&ot!==0||(D[ot++]=A),ot}l(n,"r");function i(I){return new Float64Array(I)}l(i,"o");let a=33306690738754716e-32,u=22204460492503146e-32,h=11093356479670487e-47,d=i(4),m=i(8),v=i(12),x=i(16),S=i(4);r.orient2d=function(I,w,E,T,D,A){let L=(w-A)*(E-D),B=(I-D)*(T-A),j=L-B;if(L===0||B===0||L>0!=B>0)return j;let W=Math.abs(L+B);return Math.abs(j)>=a*W?j:-function($,F,J,ot,K,H,_t){let ct,ft,mt,St,dt,xt,q,ee,Gt,Kt,It,ie,vr,Qe,Nt,At,Ct,_e,de=$-K,qr=J-K,me=F-H,Se=ot-H;dt=(Nt=(ee=de-(q=(xt=134217729*de)-(xt-de)))*(Kt=Se-(Gt=(xt=134217729*Se)-(xt-Se)))-((Qe=de*Se)-q*Gt-ee*Gt-q*Kt))-(It=Nt-(Ct=(ee=me-(q=(xt=134217729*me)-(xt-me)))*(Kt=qr-(Gt=(xt=134217729*qr)-(xt-qr)))-((At=me*qr)-q*Gt-ee*Gt-q*Kt))),d[0]=Nt-(It+dt)+(dt-Ct),dt=(vr=Qe-((ie=Qe+It)-(dt=ie-Qe))+(It-dt))-(It=vr-At),d[1]=vr-(It+dt)+(dt-At),dt=(_e=ie+It)-ie,d[2]=ie-(_e-dt)+(It-dt),d[3]=_e;let br=function(co,Ji){let po=Ji[0];for(let En=1;En<co;En++)po+=Ji[En];return po}(4,d),Wr=u*_t;if(br>=Wr||-br>=Wr||(ct=$-(de+(dt=$-de))+(dt-K),mt=J-(qr+(dt=J-qr))+(dt-K),ft=F-(me+(dt=F-me))+(dt-H),St=ot-(Se+(dt=ot-Se))+(dt-H),ct===0&&ft===0&&mt===0&&St===0)||(Wr=h*_t+e*Math.abs(br),(br+=de*St+Se*ct-(me*mt+qr*ft))>=Wr||-br>=Wr))return br;dt=(Nt=(ee=ct-(q=(xt=134217729*ct)-(xt-ct)))*(Kt=Se-(Gt=(xt=134217729*Se)-(xt-Se)))-((Qe=ct*Se)-q*Gt-ee*Gt-q*Kt))-(It=Nt-(Ct=(ee=ft-(q=(xt=134217729*ft)-(xt-ft)))*(Kt=qr-(Gt=(xt=134217729*qr)-(xt-qr)))-((At=ft*qr)-q*Gt-ee*Gt-q*Kt))),S[0]=Nt-(It+dt)+(dt-Ct),dt=(vr=Qe-((ie=Qe+It)-(dt=ie-Qe))+(It-dt))-(It=vr-At),S[1]=vr-(It+dt)+(dt-At),dt=(_e=ie+It)-ie,S[2]=ie-(_e-dt)+(It-dt),S[3]=_e;let $i=n(4,d,4,S,m);dt=(Nt=(ee=de-(q=(xt=134217729*de)-(xt-de)))*(Kt=St-(Gt=(xt=134217729*St)-(xt-St)))-((Qe=de*St)-q*Gt-ee*Gt-q*Kt))-(It=Nt-(Ct=(ee=me-(q=(xt=134217729*me)-(xt-me)))*(Kt=mt-(Gt=(xt=134217729*mt)-(xt-mt)))-((At=me*mt)-q*Gt-ee*Gt-q*Kt))),S[0]=Nt-(It+dt)+(dt-Ct),dt=(vr=Qe-((ie=Qe+It)-(dt=ie-Qe))+(It-dt))-(It=vr-At),S[1]=vr-(It+dt)+(dt-At),dt=(_e=ie+It)-ie,S[2]=ie-(_e-dt)+(It-dt),S[3]=_e;let Yt=n($i,m,4,S,v);dt=(Nt=(ee=ct-(q=(xt=134217729*ct)-(xt-ct)))*(Kt=St-(Gt=(xt=134217729*St)-(xt-St)))-((Qe=ct*St)-q*Gt-ee*Gt-q*Kt))-(It=Nt-(Ct=(ee=ft-(q=(xt=134217729*ft)-(xt-ft)))*(Kt=mt-(Gt=(xt=134217729*mt)-(xt-mt)))-((At=ft*mt)-q*Gt-ee*Gt-q*Kt))),S[0]=Nt-(It+dt)+(dt-Ct),dt=(vr=Qe-((ie=Qe+It)-(dt=ie-Qe))+(It-dt))-(It=vr-At),S[1]=vr-(It+dt)+(dt-At),dt=(_e=ie+It)-ie,S[2]=ie-(_e-dt)+(It-dt),S[3]=_e;let mr=n(Yt,v,4,S,x);return x[mr-1]}(I,w,E,T,D,A,W)},r.orient2dfast=function(I,w,E,T,D,A){return(w-A)*(E-D)-(I-D)*(T-A)},Object.defineProperty(r,"__esModule",{value:!0})})});var BP=Lt((S$,S_)=>{"use strict";y();var AP=b_(),lv=nA(),pA=OP(),hA=LP().orient2d;lv.default&&(lv=lv.default);S_.exports=FP;S_.exports.default=FP;function FP(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var n=yA(r),i=new AP(16);i.toBBox=function(A){return{minX:A[0],minY:A[1],maxX:A[0],maxY:A[1]}},i.compareMinX=function(A,L){return A[0]-L[0]},i.compareMinY=function(A,L){return A[1]-L[1]},i.load(r);for(var a=[],u=0,h;u<n.length;u++){var d=n[u];i.remove(d),h=RP(d,h),a.push(h)}var m=new AP(16);for(u=0;u<a.length;u++)m.insert(x_(a[u]));for(var v=t*t,x=e*e;a.length;){var S=a.shift(),I=S.p,w=S.next.p,E=__(I,w);if(!(E<x)){var T=E/v;d=fA(i,S.prev.p,I,w,S.next.next.p,T,m),d&&Math.min(__(d,I),__(d,w))<=T&&(a.push(S),a.push(RP(d,S)),i.remove(d),m.remove(S),m.insert(x_(S)),m.insert(x_(S.next)))}}S=h;var D=[];do D.push(S.p),S=S.next;while(S!==h);return D.push(S.p),D}l(FP,"concaveman");function fA(r,t,e,n,i,a,u){for(var h=new lv([],dA),d=r.data;d;){for(var m=0;m<d.children.length;m++){var v=d.children[m],x=d.leaf?C_(v,e,n):mA(e,n,v);x>a||h.push({node:v,dist:x})}for(;h.length&&!h.peek().node.children;){var S=h.pop(),I=S.node,w=C_(I,t,e),E=C_(I,n,i);if(S.dist<w&&S.dist<E&&kP(e,I,u)&&kP(n,I,u))return I}d=h.pop(),d&&(d=d.node)}return null}l(fA,"findCandidate");function dA(r,t){return r.dist-t.dist}l(dA,"compareDist");function mA(r,t,e){if(NP(r,e)||NP(t,e))return 0;var n=av(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(n===0)return 0;var i=av(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(i===0)return 0;var a=av(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(a===0)return 0;var u=av(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return u===0?0:Math.min(n,i,a,u)}l(mA,"sqSegBoxDist");function NP(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}l(NP,"inside");function kP(r,t,e){for(var n=Math.min(r[0],t[0]),i=Math.min(r[1],t[1]),a=Math.max(r[0],t[0]),u=Math.max(r[1],t[1]),h=e.search({minX:n,minY:i,maxX:a,maxY:u}),d=0;d<h.length;d++)if(gA(h[d].p,h[d].next.p,r,t))return!1;return!0}l(kP,"noIntersections");function Zf(r,t,e){return hA(r[0],r[1],t[0],t[1],e[0],e[1])}l(Zf,"cross");function gA(r,t,e,n){return r!==n&&t!==e&&Zf(r,t,e)>0!=Zf(r,t,n)>0&&Zf(e,n,r)>0!=Zf(e,n,t)>0}l(gA,"intersects");function x_(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}l(x_,"updateBBox");function yA(r){for(var t=r[0],e=r[0],n=r[0],i=r[0],a=0;a<r.length;a++){var u=r[a];u[0]<t[0]&&(t=u),u[0]>n[0]&&(n=u),u[1]<e[1]&&(e=u),u[1]>i[1]&&(i=u)}var h=[t,e,n,i],d=h.slice();for(a=0;a<r.length;a++)pA(r[a],h)||d.push(r[a]);return bA(d)}l(yA,"fastConvexHull");function RP(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}l(RP,"insertNode");function __(r,t){var e=r[0]-t[0],n=r[1]-t[1];return e*e+n*n}l(__,"getSqDist");function C_(r,t,e){var n=t[0],i=t[1],a=e[0]-n,u=e[1]-i;if(a!==0||u!==0){var h=((r[0]-n)*a+(r[1]-i)*u)/(a*a+u*u);h>1?(n=e[0],i=e[1]):h>0&&(n+=a*h,i+=u*h)}return a=r[0]-n,u=r[1]-i,a*a+u*u}l(C_,"sqSegDist");function av(r,t,e,n,i,a,u,h){var d=e-r,m=n-t,v=u-i,x=h-a,S=r-i,I=t-a,w=d*d+m*m,E=d*v+m*x,T=v*v+x*x,D=d*S+m*I,A=v*S+x*I,L=w*T-E*E,B,j,W,$,F=L,J=L;L===0?(j=0,F=1,$=A,J=T):(j=E*A-T*D,$=w*A-E*D,j<0?(j=0,$=A,J=T):j>F&&(j=F,$=A+E,J=T)),$<0?($=0,-D<0?j=0:-D>w?j=F:(j=-D,F=w)):$>J&&($=J,-D+E<0?j=0:-D+E>w?j=F:(j=-D+E,F=w)),B=j===0?0:j/F,W=$===0?0:$/J;var ot=(1-B)*r+B*e,K=(1-B)*t+B*n,H=(1-W)*i+W*u,_t=(1-W)*a+W*h,ct=H-ot,ft=_t-K;return ct*ct+ft*ft}l(av,"sqSegSegDist");function vA(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}l(vA,"compareByX");function bA(r){r.sort(vA);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Zf(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var n=[],i=r.length-1;i>=0;i--){for(;n.length>=2&&Zf(n[n.length-2],n[n.length-1],r[i])<=0;)n.pop();n.push(r[i])}return n.pop(),t.pop(),t.concat(n)}l(bA,"convexHull")});var zP=Lt((M_,T_)=>{y();(function(r,t){typeof M_=="object"&&typeof T_<"u"?T_.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(M_,function(){"use strict";function r(i,a,u,h,d){t(i,a,u||0,h||i.length-1,d||n)}l(r,"quickselect");function t(i,a,u,h,d){for(;h>u;){if(h-u>600){var m=h-u+1,v=a-u+1,x=Math.log(m),S=.5*Math.exp(2*x/3),I=.5*Math.sqrt(x*S*(m-S)/m)*(v-m/2<0?-1:1),w=Math.max(u,Math.floor(a-v*S/m+I)),E=Math.min(h,Math.floor(a+(m-v)*S/m+I));t(i,a,w,E,d)}var T=i[a],D=u,A=h;for(e(i,u,a),d(i[h],T)>0&&e(i,u,h);D<A;){for(e(i,D,A),D++,A--;d(i[D],T)<0;)D++;for(;d(i[A],T)>0;)A--}d(i[u],T)===0?e(i,u,A):(A++,e(i,A,h)),A<=a&&(u=A+1),a<=A&&(h=A-1)}}l(t,"quickselectStep");function e(i,a,u){var h=i[a];i[a]=i[u],i[u]=h}l(e,"swap");function n(i,a){return i<a?-1:i>a?1:0}return l(n,"defaultCompare"),r})});var O_=Lt((btt,E_)=>{"use strict";y();E_.exports=yg;E_.exports.default=yg;var AA=zP();function yg(r,t){if(!(this instanceof yg))return new yg(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}l(yg,"rbush");yg.prototype={all:l(function(){return this._all(this.data,[])},"all"),search:l(function(r){var t=this.data,e=[],n=this.toBBox;if(!cv(r,t))return e;for(var i=[],a,u,h,d;t;){for(a=0,u=t.children.length;a<u;a++)h=t.children[a],d=t.leaf?n(h):h,cv(r,d)&&(t.leaf?e.push(h):P_(r,d)?this._all(h,e):i.push(h));t=i.pop()}return e},"search"),collides:l(function(r){var t=this.data,e=this.toBBox;if(!cv(r,t))return!1;for(var n=[],i,a,u,h;t;){for(i=0,a=t.children.length;i<a;i++)if(u=t.children[i],h=t.leaf?e(u):u,cv(r,h)){if(t.leaf||P_(r,h))return!0;n.push(u)}t=n.pop()}return!1},"collides"),load:l(function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var n=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this},"load"),insert:l(function(r){return r&&this._insert(r,this.data.height-1),this},"insert"),clear:l(function(){return this.data=Kf([]),this},"clear"),remove:l(function(r,t){if(!r)return this;for(var e=this.data,n=this.toBBox(r),i=[],a=[],u,h,d,m;e||i.length;){if(e||(e=i.pop(),h=i[i.length-1],u=a.pop(),m=!0),e.leaf&&(d=NA(r,e.children,t),d!==-1))return e.children.splice(d,1),i.push(e),this._condense(i),this;!m&&!e.leaf&&P_(e,n)?(i.push(e),a.push(u),u=0,h=e,e=e.children[0]):h?(u++,e=h.children[u],m=!1):e=null}return this},"remove"),toBBox:l(function(r){return r},"toBBox"),compareMinX:HP,compareMinY:XP,toJSON:l(function(){return this.data},"toJSON"),fromJSON:l(function(r){return this.data=r,this},"fromJSON"),_all:l(function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},"_all"),_build:l(function(r,t,e,n){var i=e-t+1,a=this._maxEntries,u;if(i<=a)return u=Kf(r.slice(t,e+1)),Jf(u,this.toBBox),u;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),u=Kf([]),u.leaf=!1,u.height=n;var h=Math.ceil(i/a),d=h*Math.ceil(Math.sqrt(a)),m,v,x,S;for(YP(r,t,e,d,this.compareMinX),m=t;m<=e;m+=d)for(x=Math.min(m+d-1,e),YP(r,m,x,h,this.compareMinY),v=m;v<=x;v+=h)S=Math.min(v+h-1,x),u.children.push(this._build(r,v,S,n-1));return Jf(u,this.toBBox),u},"_build"),_chooseSubtree:l(function(r,t,e,n){for(var i,a,u,h,d,m,v,x;n.push(t),!(t.leaf||n.length-1===e);){for(v=x=1/0,i=0,a=t.children.length;i<a;i++)u=t.children[i],d=w_(u),m=kA(r,u)-d,m<x?(x=m,v=d<v?d:v,h=u):m===x&&d<v&&(v=d,h=u);t=h||t.children[0]}return t},"_chooseSubtree"),_insert:l(function(r,t,e){var n=this.toBBox,i=e?r:n(r),a=[],u=this._chooseSubtree(i,this.data,t,a);for(u.children.push(r),gg(u,i);t>=0&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(i,a,t)},"_insert"),_split:l(function(r,t){var e=r[t],n=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,n);var a=this._chooseSplitIndex(e,i,n),u=Kf(e.children.splice(a,e.children.length-a));u.height=e.height,u.leaf=e.leaf,Jf(e,this.toBBox),Jf(u,this.toBBox),t?r[t-1].children.push(u):this._splitRoot(e,u)},"_split"),_splitRoot:l(function(r,t){this.data=Kf([r,t]),this.data.height=r.height+1,this.data.leaf=!1,Jf(this.data,this.toBBox)},"_splitRoot"),_chooseSplitIndex:l(function(r,t,e){var n,i,a,u,h,d,m,v;for(d=m=1/0,n=t;n<=e-t;n++)i=mg(r,0,n,this.toBBox),a=mg(r,n,e,this.toBBox),u=RA(i,a),h=w_(i)+w_(a),u<d?(d=u,v=n,m=h<m?h:m):u===d&&h<m&&(m=h,v=n);return v},"_chooseSplitIndex"),_chooseSplitAxis:l(function(r,t,e){var n=r.leaf?this.compareMinX:HP,i=r.leaf?this.compareMinY:XP,a=this._allDistMargin(r,t,e,n),u=this._allDistMargin(r,t,e,i);a<u&&r.children.sort(n)},"_chooseSplitAxis"),_allDistMargin:l(function(r,t,e,n){r.children.sort(n);var i=this.toBBox,a=mg(r,0,t,i),u=mg(r,e-t,e,i),h=uv(a)+uv(u),d,m;for(d=t;d<e-t;d++)m=r.children[d],gg(a,r.leaf?i(m):m),h+=uv(a);for(d=e-t-1;d>=t;d--)m=r.children[d],gg(u,r.leaf?i(m):m),h+=uv(u);return h},"_allDistMargin"),_adjustParentBBoxes:l(function(r,t,e){for(var n=e;n>=0;n--)gg(t[n],r)},"_adjustParentBBoxes"),_condense:l(function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():Jf(r[t],this.toBBox)},"_condense"),_initFormat:l(function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")},"_initFormat")};function NA(r,t,e){if(!e)return t.indexOf(r);for(var n=0;n<t.length;n++)if(e(r,t[n]))return n;return-1}l(NA,"findItem");function Jf(r,t){mg(r,0,r.children.length,t,r)}l(Jf,"calcBBox");function mg(r,t,e,n,i){i||(i=Kf(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=t,u;a<e;a++)u=r.children[a],gg(i,r.leaf?n(u):u);return i}l(mg,"distBBox");function gg(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}l(gg,"extend");function HP(r,t){return r.minX-t.minX}l(HP,"compareNodeMinX");function XP(r,t){return r.minY-t.minY}l(XP,"compareNodeMinY");function w_(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}l(w_,"bboxArea");function uv(r){return r.maxX-r.minX+(r.maxY-r.minY)}l(uv,"bboxMargin");function kA(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}l(kA,"enlargedArea");function RA(r,t){var e=Math.max(r.minX,t.minX),n=Math.max(r.minY,t.minY),i=Math.min(r.maxX,t.maxX),a=Math.min(r.maxY,t.maxY);return Math.max(0,i-e)*Math.max(0,a-n)}l(RA,"intersectionArea");function P_(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}l(P_,"contains");function cv(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}l(cv,"intersects");function Kf(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}l(Kf,"createNode");function YP(r,t,e,n,i){for(var a=[t,e],u;a.length;)e=a.pop(),t=a.pop(),!(e-t<=n)&&(u=t+Math.ceil((e-t)/n/2)*n,AA(r,u,t,e,i),a.push(t,u,u,e))}l(YP,"multiSelect")});var R_=Lt(se=>{"use strict";y();Object.defineProperty(se,"__esModule",{value:!0});se.earthRadius=63710088e-1;se.factors={centimeters:se.earthRadius*100,centimetres:se.earthRadius*100,degrees:se.earthRadius/111325,feet:se.earthRadius*3.28084,inches:se.earthRadius*39.37,kilometers:se.earthRadius/1e3,kilometres:se.earthRadius/1e3,meters:se.earthRadius,metres:se.earthRadius,miles:se.earthRadius/1609.344,millimeters:se.earthRadius*1e3,millimetres:se.earthRadius*1e3,nauticalmiles:se.earthRadius/1852,radians:1,yards:se.earthRadius*1.0936};se.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/se.earthRadius,yards:1.0936133};se.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function ac(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}l(ac,"feature");se.feature=ac;function ZA(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return L_(t).geometry;case"LineString":return N_(t).geometry;case"Polygon":return A_(t).geometry;case"MultiPoint":return WP(t).geometry;case"MultiLineString":return qP(t).geometry;case"MultiPolygon":return ZP(t).geometry;default:throw new Error(r+" is invalid")}}l(ZA,"geometry");se.geometry=ZA;function L_(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hv(r[0])||!hv(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return ac(n,t,e)}l(L_,"point");se.point=L_;function $A(r,t,e){return e===void 0&&(e={}),fv(r.map(function(n){return L_(n,t)}),e)}l($A,"points");se.points=$A;function A_(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var a=i[n];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var u=0;u<a[a.length-1].length;u++)if(a[a.length-1][u]!==a[0][u])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return ac(h,t,e)}l(A_,"polygon");se.polygon=A_;function JA(r,t,e){return e===void 0&&(e={}),fv(r.map(function(n){return A_(n,t)}),e)}l(JA,"polygons");se.polygons=JA;function N_(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return ac(n,t,e)}l(N_,"lineString");se.lineString=N_;function KA(r,t,e){return e===void 0&&(e={}),fv(r.map(function(n){return N_(n,t)}),e)}l(KA,"lineStrings");se.lineStrings=KA;function fv(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}l(fv,"featureCollection");se.featureCollection=fv;function qP(r,t,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:r};return ac(n,t,e)}l(qP,"multiLineString");se.multiLineString=qP;function WP(r,t,e){e===void 0&&(e={});var n={type:"MultiPoint",coordinates:r};return ac(n,t,e)}l(WP,"multiPoint");se.multiPoint=WP;function ZP(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return ac(n,t,e)}l(ZP,"multiPolygon");se.multiPolygon=ZP;function QA(r,t,e){e===void 0&&(e={});var n={type:"GeometryCollection",geometries:r};return ac(n,t,e)}l(QA,"geometryCollection");se.geometryCollection=QA;function tN(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}l(tN,"round");se.round=tN;function $P(r,t){t===void 0&&(t="kilometers");var e=se.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}l($P,"radiansToLength");se.radiansToLength=$P;function k_(r,t){t===void 0&&(t="kilometers");var e=se.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}l(k_,"lengthToRadians");se.lengthToRadians=k_;function eN(r,t){return JP(k_(r,t))}l(eN,"lengthToDegrees");se.lengthToDegrees=eN;function rN(r){var t=r%360;return t<0&&(t+=360),t}l(rN,"bearingToAzimuth");se.bearingToAzimuth=rN;function JP(r){var t=r%(2*Math.PI);return t*180/Math.PI}l(JP,"radiansToDegrees");se.radiansToDegrees=JP;function nN(r){var t=r%360;return t*Math.PI/180}l(nN,"degreesToRadians");se.degreesToRadians=nN;function iN(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return $P(k_(r,t),e)}l(iN,"convertLength");se.convertLength=iN;function oN(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var n=se.areaFactors[t];if(!n)throw new Error("invalid original units");var i=se.areaFactors[e];if(!i)throw new Error("invalid final units");return r/n*i}l(oN,"convertArea");se.convertArea=oN;function hv(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}l(hv,"isNumber");se.isNumber=hv;function sN(r){return!!r&&r.constructor===Object}l(sN,"isObject");se.isObject=sN;function aN(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!hv(t))throw new Error("bbox must only contain numbers")})}l(aN,"validateBBox");se.validateBBox=aN;function lN(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}l(lN,"validateId");se.validateId=lN});var B_=Lt(ai=>{"use strict";y();Object.defineProperty(ai,"__esModule",{value:!0});var so=R_();function bg(r,t,e){if(r!==null)for(var n,i,a,u,h,d,m,v=0,x=0,S,I=r.type,w=I==="FeatureCollection",E=I==="Feature",T=w?r.features.length:1,D=0;D<T;D++){m=w?r.features[D].geometry:E?r.geometry:r,S=m?m.type==="GeometryCollection":!1,h=S?m.geometries.length:1;for(var A=0;A<h;A++){var L=0,B=0;if(u=S?m.geometries[A]:m,u!==null){d=u.coordinates;var j=u.type;switch(v=e&&(j==="Polygon"||j==="MultiPolygon")?1:0,j){case null:break;case"Point":if(t(d,x,D,L,B)===!1)return!1;x++,L++;break;case"LineString":case"MultiPoint":for(n=0;n<d.length;n++){if(t(d[n],x,D,L,B)===!1)return!1;x++,j==="MultiPoint"&&L++}j==="LineString"&&L++;break;case"Polygon":case"MultiLineString":for(n=0;n<d.length;n++){for(i=0;i<d[n].length-v;i++){if(t(d[n][i],x,D,L,B)===!1)return!1;x++}j==="MultiLineString"&&L++,j==="Polygon"&&B++}j==="Polygon"&&L++;break;case"MultiPolygon":for(n=0;n<d.length;n++){for(B=0,i=0;i<d[n].length;i++){for(a=0;a<d[n][i].length-v;a++){if(t(d[n][i][a],x,D,L,B)===!1)return!1;x++}B++}L++}break;case"GeometryCollection":for(n=0;n<u.geometries.length;n++)if(bg(u.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}l(bg,"coordEach");function uN(r,t,e,n){var i=e;return bg(r,function(a,u,h,d,m){u===0&&e===void 0?i=a:i=t(i,a,u,h,d,m)},n),i}l(uN,"coordReduce");function KP(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}l(KP,"propEach");function cN(r,t,e){var n=e;return KP(r,function(i,a){a===0&&e===void 0?n=i:n=t(n,i,a)}),n}l(cN,"propReduce");function QP(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}l(QP,"featureEach");function pN(r,t,e){var n=e;return QP(r,function(i,a){a===0&&e===void 0?n=i:n=t(n,i,a)}),n}l(pN,"featureReduce");function hN(r){var t=[];return bg(r,function(e){t.push(e)}),t}l(hN,"coordAll");function F_(r,t){var e,n,i,a,u,h,d,m,v,x,S=0,I=r.type==="FeatureCollection",w=r.type==="Feature",E=I?r.features.length:1;for(e=0;e<E;e++){for(h=I?r.features[e].geometry:w?r.geometry:r,m=I?r.features[e].properties:w?r.properties:{},v=I?r.features[e].bbox:w?r.bbox:void 0,x=I?r.features[e].id:w?r.id:void 0,d=h?h.type==="GeometryCollection":!1,u=d?h.geometries.length:1,i=0;i<u;i++){if(a=d?h.geometries[i]:h,a===null){if(t(null,S,m,v,x)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(a,S,m,v,x)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<a.geometries.length;n++)if(t(a.geometries[n],S,m,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}S++}}l(F_,"geomEach");function fN(r,t,e){var n=e;return F_(r,function(i,a,u,h,d){a===0&&e===void 0?n=i:n=t(n,i,a,u,h,d)}),n}l(fN,"geomReduce");function dv(r,t){F_(r,function(e,n,i,a,u){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(so.feature(e,i,{bbox:a,id:u}),n,0)===!1?!1:void 0}var d;switch(h){case"MultiPoint":d="Point";break;case"MultiLineString":d="LineString";break;case"MultiPolygon":d="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var v=e.coordinates[m],x={type:d,coordinates:v};if(t(so.feature(x,i),n,m)===!1)return!1}})}l(dv,"flattenEach");function dN(r,t,e){var n=e;return dv(r,function(i,a,u){a===0&&u===0&&e===void 0?n=i:n=t(n,i,a,u)}),n}l(dN,"flattenReduce");function tE(r,t){dv(r,function(e,n,i){var a=0;if(e.geometry){var u=e.geometry.type;if(!(u==="Point"||u==="MultiPoint")){var h,d=0,m=0,v=0;if(bg(e,function(x,S,I,w,E){if(h===void 0||n>d||w>m||E>v){h=x,d=n,m=w,v=E,a=0;return}var T=so.lineString([h,x],e.properties);if(t(T,n,i,E,a)===!1)return!1;a++,h=x})===!1)return!1}}})}l(tE,"segmentEach");function mN(r,t,e){var n=e,i=!1;return tE(r,function(a,u,h,d,m){i===!1&&e===void 0?n=a:n=t(n,a,u,h,d,m),i=!0}),n}l(mN,"segmentReduce");function eE(r,t){if(!r)throw new Error("geojson is required");dv(r,function(e,n,i){if(e.geometry!==null){var a=e.geometry.type,u=e.geometry.coordinates;switch(a){case"LineString":if(t(e,n,i,0,0)===!1)return!1;break;case"Polygon":for(var h=0;h<u.length;h++)if(t(so.lineString(u[h],e.properties),n,i,h)===!1)return!1;break}}})}l(eE,"lineEach");function gN(r,t,e){var n=e;return eE(r,function(i,a,u,h){a===0&&e===void 0?n=i:n=t(n,i,a,u,h)}),n}l(gN,"lineReduce");function yN(r,t){if(t=t||{},!so.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,a=t.segmentIndex||0,u=t.properties,h;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),u=u||r.features[e].properties,h=r.features[e].geometry;break;case"Feature":u=u||r.properties,h=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=r;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var d=h.coordinates;switch(h.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=d.length+a-1),so.lineString([d[a],d[a+1]],u,t);case"Polygon":return i<0&&(i=d.length+i),a<0&&(a=d[i].length+a-1),so.lineString([d[i][a],d[i][a+1]],u,t);case"MultiLineString":return n<0&&(n=d.length+n),a<0&&(a=d[n].length+a-1),so.lineString([d[n][a],d[n][a+1]],u,t);case"MultiPolygon":return n<0&&(n=d.length+n),i<0&&(i=d[n].length+i),a<0&&(a=d[n][i].length-a-1),so.lineString([d[n][i][a],d[n][i][a+1]],u,t)}throw new Error("geojson is invalid")}l(yN,"findSegment");function vN(r,t){if(t=t||{},!so.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,a=t.coordIndex||0,u=t.properties,h;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),u=u||r.features[e].properties,h=r.features[e].geometry;break;case"Feature":u=u||r.properties,h=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":h=r;break;default:throw new Error("geojson is invalid")}if(h===null)return null;var d=h.coordinates;switch(h.type){case"Point":return so.point(d,u,t);case"MultiPoint":return n<0&&(n=d.length+n),so.point(d[n],u,t);case"LineString":return a<0&&(a=d.length+a),so.point(d[a],u,t);case"Polygon":return i<0&&(i=d.length+i),a<0&&(a=d[i].length+a),so.point(d[i][a],u,t);case"MultiLineString":return n<0&&(n=d.length+n),a<0&&(a=d[n].length+a),so.point(d[n][a],u,t);case"MultiPolygon":return n<0&&(n=d.length+n),i<0&&(i=d[n].length+i),a<0&&(a=d[n][i].length-a),so.point(d[n][i][a],u,t)}throw new Error("geojson is invalid")}l(vN,"findPoint");ai.coordAll=hN;ai.coordEach=bg;ai.coordReduce=uN;ai.featureEach=QP;ai.featureReduce=pN;ai.findPoint=vN;ai.findSegment=yN;ai.flattenEach=dv;ai.flattenReduce=dN;ai.geomEach=F_;ai.geomReduce=fN;ai.lineEach=eE;ai.lineReduce=gN;ai.propEach=KP;ai.propReduce=cN;ai.segmentEach=tE;ai.segmentReduce=mN});var rE=Lt(V_=>{"use strict";y();Object.defineProperty(V_,"__esModule",{value:!0});var bN=B_();function G_(r){var t=[1/0,1/0,-1/0,-1/0];return bN.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}l(G_,"bbox");G_.default=G_;V_.default=G_});var mv=Lt((Zrt,j_)=>{y();var Wa=b_(),iE=R_(),oE=B_(),td=rE().default,xN=oE.featureEach,qrt=oE.coordEach,Wrt=iE.polygon,nE=iE.featureCollection;function sE(r){var t=new Wa(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:td(e),Wa.prototype.insert.call(this,e)},t.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:td(i),n.push(i)}):xN(e,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:td(i),n.push(i)}),Wa.prototype.load.call(this,n)},t.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:td(e),Wa.prototype.remove.call(this,e,n)},t.clear=function(){return Wa.prototype.clear.call(this)},t.search=function(e){var n=Wa.prototype.search.call(this,this.toBBox(e));return nE(n)},t.collides=function(e){return Wa.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Wa.prototype.all.call(this);return nE(e)},t.toJSON=function(){return Wa.prototype.toJSON.call(this)},t.fromJSON=function(e){return Wa.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=td(e);else if(e.type==="FeatureCollection")n=td(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}l(sE,"geojsonRbush");j_.exports=sE;j_.exports.default=sE});var Y_=Lt((ost,xE)=>{"use strict";y();var bE=Object.prototype.toString;xE.exports=l(function(t){var e=bE.call(t),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&bE.call(t.callee)==="[object Function]"),n},"isArguments")});var EE=Lt((lst,PE)=>{"use strict";y();var wE;Object.keys||(_g=Object.prototype.hasOwnProperty,q_=Object.prototype.toString,_E=Y_(),W_=Object.prototype.propertyIsEnumerable,CE=!W_.call({toString:null},"toString"),SE=W_.call(function(){},"prototype"),Cg=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],vv=l(function(r){var t=r.constructor;return t&&t.prototype===r},"equalsConstructorPrototype"),IE={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},ME=function(){if(typeof window>"u")return!1;for(var r in window)try{if(!IE["$"+r]&&_g.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{vv(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),TE=l(function(r){if(typeof window>"u"||!ME)return vv(r);try{return vv(r)}catch(t){return!1}},"equalsConstructorPrototypeIfNotBuggy"),wE=l(function(t){var e=t!==null&&typeof t=="object",n=q_.call(t)==="[object Function]",i=_E(t),a=e&&q_.call(t)==="[object String]",u=[];if(!e&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var h=SE&&n;if(a&&t.length>0&&!_g.call(t,0))for(var d=0;d<t.length;++d)u.push(String(d));if(i&&t.length>0)for(var m=0;m<t.length;++m)u.push(String(m));else for(var v in t)!(h&&v==="prototype")&&_g.call(t,v)&&u.push(String(v));if(CE)for(var x=TE(t),S=0;S<Cg.length;++S)!(x&&Cg[S]==="constructor")&&_g.call(t,Cg[S])&&u.push(Cg[S]);return u},"keys"));var _g,q_,_E,W_,CE,SE,Cg,vv,IE,ME,TE;PE.exports=wE});var Z_=Lt((pst,LE)=>{"use strict";y();var kN=Array.prototype.slice,RN=Y_(),OE=Object.keys,bv=OE?l(function(t){return OE(t)},"keys"):EE(),DE=Object.keys;bv.shim=l(function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=l(function(n){return RN(n)?DE(kN.call(n)):DE(n)},"keys"))}else Object.keys=bv;return Object.keys||bv},"shimObjectKeys");LE.exports=bv});var $_=Lt((dst,AE)=>{"use strict";y();AE.exports=l(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(t,e);if(h.value!==i||h.enumerable!==!0)return!1}return!0},"hasSymbols")});var xv=Lt((yst,NE)=>{"use strict";y();var FN=$_();NE.exports=l(function(){return FN()&&!!Symbol.toStringTag},"hasToStringTagShams")});var J_=Lt((xst,kE)=>{"use strict";y();kE.exports=Object});var K_=Lt((Cst,RE)=>{"use strict";y();RE.exports=Error});var BE=Lt((Ist,FE)=>{"use strict";y();FE.exports=EvalError});var VE=Lt((Tst,GE)=>{"use strict";y();GE.exports=RangeError});var UE=Lt((Pst,jE)=>{"use strict";y();jE.exports=ReferenceError});var Q_=Lt((Ost,zE)=>{"use strict";y();zE.exports=SyntaxError});var Sp=Lt((Lst,HE)=>{"use strict";y();HE.exports=TypeError});var YE=Lt((Nst,XE)=>{"use strict";y();XE.exports=URIError});var WE=Lt((Rst,qE)=>{"use strict";y();qE.exports=Math.abs});var $E=Lt((Bst,ZE)=>{"use strict";y();ZE.exports=Math.floor});var KE=Lt((Vst,JE)=>{"use strict";y();JE.exports=Math.max});var t4=Lt((Ust,QE)=>{"use strict";y();QE.exports=Math.min});var r4=Lt((Hst,e4)=>{"use strict";y();e4.exports=Math.pow});var i4=Lt((Yst,n4)=>{"use strict";y();n4.exports=Math.round});var s4=Lt((Wst,o4)=>{"use strict";y();o4.exports=Number.isNaN||l(function(t){return t!==t},"isNaN")});var l4=Lt((Jst,a4)=>{"use strict";y();var BN=s4();a4.exports=l(function(t){return BN(t)||t===0?t:t<0?-1:1},"sign")});var c4=Lt((tat,u4)=>{"use strict";y();u4.exports=Object.getOwnPropertyDescriptor});var Ip=Lt((rat,p4)=>{"use strict";y();var _v=c4();if(_v)try{_v([],"length")}catch(r){_v=null}p4.exports=_v});var Sg=Lt((iat,h4)=>{"use strict";y();var Cv=Object.defineProperty||!1;if(Cv)try{Cv({},"a",{value:1})}catch(r){Cv=!1}h4.exports=Cv});var m4=Lt((sat,d4)=>{"use strict";y();var f4=typeof Symbol<"u"&&Symbol,GN=$_();d4.exports=l(function(){return typeof f4!="function"||typeof Symbol!="function"||typeof f4("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:GN()},"hasNativeSymbols")});var tC=Lt((uat,g4)=>{"use strict";y();g4.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var eC=Lt((pat,y4)=>{"use strict";y();var VN=J_();y4.exports=VN.getPrototypeOf||null});var x4=Lt((fat,b4)=>{"use strict";y();var jN="Function.prototype.bind called on incompatible ",UN=Object.prototype.toString,zN=Math.max,HN="[object Function]",v4=l(function(t,e){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var a=0;a<e.length;a+=1)n[a+t.length]=e[a];return n},"concatty"),XN=l(function(t,e){for(var n=[],i=e||0,a=0;i<t.length;i+=1,a+=1)n[a]=t[i];return n},"slicy"),YN=l(function(r,t){for(var e="",n=0;n<r.length;n+=1)e+=r[n],n+1<r.length&&(e+=t);return e},"joiny");b4.exports=l(function(t){var e=this;if(typeof e!="function"||UN.apply(e)!==HN)throw new TypeError(jN+e);for(var n=XN(arguments,1),i,a=l(function(){if(this instanceof i){var v=e.apply(this,v4(n,arguments));return Object(v)===v?v:this}return e.apply(t,v4(n,arguments))},"binder"),u=zN(0,e.length-n.length),h=[],d=0;d<u;d++)h[d]="$"+d;if(i=Function("binder","return function ("+YN(h,",")+"){ return binder.apply(this,arguments); }")(a),e.prototype){var m=l(function(){},"Empty");m.prototype=e.prototype,i.prototype=new m,m.prototype=null}return i},"bind")});var rd=Lt((gat,_4)=>{"use strict";y();var qN=x4();_4.exports=Function.prototype.bind||qN});var Sv=Lt((vat,C4)=>{"use strict";y();C4.exports=Function.prototype.call});var Iv=Lt((xat,S4)=>{"use strict";y();S4.exports=Function.prototype.apply});var M4=Lt((Cat,I4)=>{"use strict";y();I4.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var rC=Lt((Iat,T4)=>{"use strict";y();var WN=rd(),ZN=Iv(),$N=Sv(),JN=M4();T4.exports=JN||WN.call($N,ZN)});var Mv=Lt((Tat,w4)=>{"use strict";y();var KN=rd(),QN=Sp(),tk=Sv(),ek=rC();w4.exports=l(function(t){if(t.length<1||typeof t[0]!="function")throw new QN("a function is required");return ek(KN,tk,t)},"callBindBasic")});var A4=Lt((Eat,L4)=>{"use strict";y();var rk=Mv(),P4=Ip(),O4;try{O4=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var nC=!!O4&&P4&&P4(Object.prototype,"__proto__"),D4=Object,E4=D4.getPrototypeOf;L4.exports=nC&&typeof nC.get=="function"?rk([nC.get]):typeof E4=="function"?l(function(t){return E4(t==null?t:D4(t))},"getDunder"):!1});var iC=Lt((Lat,F4)=>{"use strict";y();var N4=tC(),k4=eC(),R4=A4();F4.exports=N4?l(function(t){return N4(t)},"getProto"):k4?l(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return k4(t)},"getProto"):R4?l(function(t){return R4(t)},"getProto"):null});var oC=Lt((kat,B4)=>{"use strict";y();var nk=Function.prototype.call,ik=Object.prototype.hasOwnProperty,ok=rd();B4.exports=ok.call(nk,ik)});var lC=Lt((Fat,H4)=>{"use strict";y();var nr,sk=J_(),ak=K_(),lk=BE(),uk=VE(),ck=UE(),sd=Q_(),od=Sp(),pk=YE(),hk=WE(),fk=$E(),dk=KE(),mk=t4(),gk=r4(),yk=i4(),vk=l4(),U4=Function,sC=l(function(r){try{return U4('"use strict"; return ('+r+").constructor;")()}catch(t){}},"getEvalledConstructor"),Ig=Ip(),bk=Sg(),aC=l(function(){throw new od},"throwTypeError"),xk=Ig?function(){try{return arguments.callee,aC}catch(r){try{return Ig(arguments,"callee").get}catch(t){return aC}}}():aC,nd=m4()(),Ii=iC(),_k=eC(),Ck=tC(),z4=Iv(),Mg=Sv(),id={},Sk=typeof Uint8Array>"u"||!Ii?nr:Ii(Uint8Array),Mp={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?nr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?nr:ArrayBuffer,"%ArrayIteratorPrototype%":nd&&Ii?Ii([][Symbol.iterator]()):nr,"%AsyncFromSyncIteratorPrototype%":nr,"%AsyncFunction%":id,"%AsyncGenerator%":id,"%AsyncGeneratorFunction%":id,"%AsyncIteratorPrototype%":id,"%Atomics%":typeof Atomics>"u"?nr:Atomics,"%BigInt%":typeof BigInt>"u"?nr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?nr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?nr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?nr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ak,"%eval%":eval,"%EvalError%":lk,"%Float16Array%":typeof Float16Array>"u"?nr:Float16Array,"%Float32Array%":typeof Float32Array>"u"?nr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?nr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?nr:FinalizationRegistry,"%Function%":U4,"%GeneratorFunction%":id,"%Int8Array%":typeof Int8Array>"u"?nr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?nr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?nr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nd&&Ii?Ii(Ii([][Symbol.iterator]())):nr,"%JSON%":typeof JSON=="object"?JSON:nr,"%Map%":typeof Map>"u"?nr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nd||!Ii?nr:Ii(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":sk,"%Object.getOwnPropertyDescriptor%":Ig,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?nr:Promise,"%Proxy%":typeof Proxy>"u"?nr:Proxy,"%RangeError%":uk,"%ReferenceError%":ck,"%Reflect%":typeof Reflect>"u"?nr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?nr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nd||!Ii?nr:Ii(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?nr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nd&&Ii?Ii(""[Symbol.iterator]()):nr,"%Symbol%":nd?Symbol:nr,"%SyntaxError%":sd,"%ThrowTypeError%":xk,"%TypedArray%":Sk,"%TypeError%":od,"%Uint8Array%":typeof Uint8Array>"u"?nr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?nr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?nr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?nr:Uint32Array,"%URIError%":pk,"%WeakMap%":typeof WeakMap>"u"?nr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?nr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?nr:WeakSet,"%Function.prototype.call%":Mg,"%Function.prototype.apply%":z4,"%Object.defineProperty%":bk,"%Object.getPrototypeOf%":_k,"%Math.abs%":hk,"%Math.floor%":fk,"%Math.max%":dk,"%Math.min%":mk,"%Math.pow%":gk,"%Math.round%":yk,"%Math.sign%":vk,"%Reflect.getPrototypeOf%":Ck};if(Ii)try{null.error}catch(r){G4=Ii(Ii(r)),Mp["%Error.prototype%"]=G4}var G4,Ik=l(function r(t){var e;if(t==="%AsyncFunction%")e=sC("async function () {}");else if(t==="%GeneratorFunction%")e=sC("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=sC("async function* () {}");else if(t==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&Ii&&(e=Ii(i.prototype))}return Mp[t]=e,e},"doEval"),V4={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Tg=rd(),Tv=oC(),Mk=Tg.call(Mg,Array.prototype.concat),Tk=Tg.call(z4,Array.prototype.splice),j4=Tg.call(Mg,String.prototype.replace),wv=Tg.call(Mg,String.prototype.slice),wk=Tg.call(Mg,RegExp.prototype.exec),Pk=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ek=/\\(\\)?/g,Ok=l(function(t){var e=wv(t,0,1),n=wv(t,-1);if(e==="%"&&n!=="%")throw new sd("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new sd("invalid intrinsic syntax, expected opening `%`");var i=[];return j4(t,Pk,function(a,u,h,d){i[i.length]=h?j4(d,Ek,"$1"):u||a}),i},"stringToPath"),Dk=l(function(t,e){var n=t,i;if(Tv(V4,n)&&(i=V4[n],n="%"+i[0]+"%"),Tv(Mp,n)){var a=Mp[n];if(a===id&&(a=Ik(n)),typeof a>"u"&&!e)throw new od("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new sd("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");H4.exports=l(function(t,e){if(typeof t!="string"||t.length===0)throw new od("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new od('"allowMissing" argument must be a boolean');if(wk(/^%?[^%]*%?$/,t)===null)throw new sd("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ok(t),i=n.length>0?n[0]:"",a=Dk("%"+i+"%",e),u=a.name,h=a.value,d=!1,m=a.alias;m&&(i=m[0],Tk(n,Mk([0,1],m)));for(var v=1,x=!0;v<n.length;v+=1){var S=n[v],I=wv(S,0,1),w=wv(S,-1);if((I==='"'||I==="'"||I==="`"||w==='"'||w==="'"||w==="`")&&I!==w)throw new sd("property names with quotes must have matching quotes");if((S==="constructor"||!x)&&(d=!0),i+="."+S,u="%"+i+"%",Tv(Mp,u))h=Mp[u];else if(h!=null){if(!(S in h)){if(!e)throw new od("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ig&&v+1>=n.length){var E=Ig(h,S);x=!!E,x&&"get"in E&&!("originalValue"in E.get)?h=E.get:h=h[S]}else x=Tv(h,S),h=h[S];x&&!d&&(Mp[u]=h)}}return h},"GetIntrinsic")});var Pv=Lt((Vat,q4)=>{"use strict";y();var X4=lC(),Y4=Mv(),Lk=Y4([X4("%String.prototype.indexOf%")]);q4.exports=l(function(t,e){var n=X4(t,!!e);return typeof n=="function"&&Lk(t,".prototype.")>-1?Y4([n]):n},"callBoundIntrinsic")});var $4=Lt((zat,Z4)=>{"use strict";y();var Ak=xv()(),Nk=Pv(),uC=Nk("Object.prototype.toString"),Ev=l(function(t){return Ak&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:uC(t)==="[object Arguments]"},"isArguments"),W4=l(function(t){return Ev(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&uC(t)!=="[object Array]"&&"callee"in t&&uC(t.callee)==="[object Function]"},"isArguments"),kk=function(){return Ev(arguments)}();Ev.isLegacyArguments=W4;Z4.exports=kk?Ev:W4});var Ov=Lt((Yat,Q4)=>{"use strict";y();var J4=Sg(),Rk=Q_(),ad=Sp(),K4=Ip();Q4.exports=l(function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new ad("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new ad("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ad("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ad("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ad("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ad("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,d=!!K4&&K4(t,e);if(J4)J4(t,e,{configurable:u===null&&d?d.configurable:!u,enumerable:i===null&&d?d.enumerable:!i,value:n,writable:a===null&&d?d.writable:!a});else if(h||!i&&!a&&!u)t[e]=n;else throw new Rk("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var Dv=Lt((Zat,e5)=>{"use strict";y();var cC=Sg(),t5=l(function(){return!!cC},"hasPropertyDescriptors");t5.hasArrayLengthDefineBug=l(function(){if(!cC)return null;try{return cC([],"length",{value:1}).length!==1}catch(t){return!0}},"hasArrayLengthDefineBug");e5.exports=t5});var ld=Lt((Kat,o5)=>{"use strict";y();var Fk=Z_(),Bk=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Gk=Object.prototype.toString,Vk=Array.prototype.concat,r5=Ov(),jk=l(function(r){return typeof r=="function"&&Gk.call(r)==="[object Function]"},"isFunction"),n5=Dv()(),Uk=l(function(r,t,e,n){if(t in r){if(n===!0){if(r[t]===e)return}else if(!jk(n)||!n())return}n5?r5(r,t,e,!0):r5(r,t,e)},"defineProperty"),i5=l(function(r,t){var e=arguments.length>2?arguments[2]:{},n=Fk(t);Bk&&(n=Vk.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)Uk(r,n[i],t[n[i]],e[n[i]])},"defineProperties");i5.supportsDescriptors=!!n5;o5.exports=i5});var c5=Lt((elt,u5)=>{"use strict";y();var zk=lC(),s5=Ov(),Hk=Dv()(),a5=Ip(),l5=Sp(),Xk=zk("%Math.floor%");u5.exports=l(function(t,e){if(typeof t!="function")throw new l5("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||Xk(e)!==e)throw new l5("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in t&&a5){var u=a5(t,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(a=!1)}return(i||a||!n)&&(Hk?s5(t,"length",e,!0,!0):s5(t,"length",e)),t},"setFunctionLength")});var h5=Lt((ilt,p5)=>{"use strict";y();var Yk=rd(),qk=Iv(),Wk=rC();p5.exports=l(function(){return Wk(Yk,qk,arguments)},"applyBind")});var pC=Lt((alt,Lv)=>{"use strict";y();var Zk=c5(),f5=Sg(),$k=Mv(),d5=h5();Lv.exports=l(function(t){var e=$k(arguments),n=t.length-(arguments.length-1);return Zk(e,1+(n>0?n:0),!0)},"callBind");f5?f5(Lv.exports,"apply",{value:d5}):Lv.exports.apply=d5});var hC=Lt((clt,g5)=>{"use strict";y();var m5=l(function(r){return r!==r},"numberIsNaN");g5.exports=l(function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||m5(t)&&m5(e))},"is")});var fC=Lt((flt,y5)=>{"use strict";y();var Jk=hC();y5.exports=l(function(){return typeof Object.is=="function"?Object.is:Jk},"getPolyfill")});var b5=Lt((glt,v5)=>{"use strict";y();var Kk=fC(),Qk=ld();v5.exports=l(function(){var t=Kk();return Qk(Object,{is:t},{is:l(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var S5=Lt((blt,C5)=>{"use strict";y();var tR=ld(),eR=pC(),rR=hC(),x5=fC(),nR=b5(),_5=eR(x5(),Object);tR(_5,{getPolyfill:x5,implementation:rR,shim:nR});C5.exports=_5});var E5=Lt((_lt,P5)=>{"use strict";y();var I5=Pv(),iR=xv()(),oR=oC(),sR=Ip(),gC;iR?(M5=I5("RegExp.prototype.exec"),dC={},Av=l(function(){throw dC},"throwRegexMarker"),mC={toString:Av,valueOf:Av},typeof Symbol.toPrimitive=="symbol"&&(mC[Symbol.toPrimitive]=Av),gC=l(function(t){if(!t||typeof t!="object")return!1;var e=sR(t,"lastIndex"),n=e&&oR(e,"value");if(!n)return!1;try{M5(t,mC)}catch(i){return i===dC}},"isRegex")):(T5=I5("Object.prototype.toString"),w5="[object RegExp]",gC=l(function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:T5(t)===w5},"isRegex"));var M5,dC,Av,mC,T5,w5;P5.exports=gC});var D5=Lt((Ilt,O5)=>{"use strict";y();var Pg=l(function(){return typeof l(function(){},"f").name=="string"},"functionsHaveNames"),wg=Object.getOwnPropertyDescriptor;if(wg)try{wg([],"length")}catch(r){wg=null}Pg.functionsHaveConfigurableNames=l(function(){if(!Pg()||!wg)return!1;var t=wg(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var aR=Function.prototype.bind;Pg.boundFunctionsHaveNames=l(function(){return Pg()&&typeof aR=="function"&&l(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");O5.exports=Pg});var N5=Lt((wlt,A5)=>{"use strict";y();var L5=Ov(),lR=Dv()(),uR=D5().functionsHaveConfigurableNames(),cR=Sp();A5.exports=l(function(t,e){if(typeof t!="function")throw new cR("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||uR)&&(lR?L5(t,"name",e,!0,!0):L5(t,"name",e)),t},"setFunctionName")});var yC=Lt((Olt,k5)=>{"use strict";y();var pR=N5(),hR=Sp(),fR=Object;k5.exports=pR(l(function(){if(this==null||this!==fR(this))throw new hR("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var vC=Lt((Alt,R5)=>{"use strict";y();var dR=yC(),mR=ld().supportsDescriptors,gR=Object.getOwnPropertyDescriptor;R5.exports=l(function(){if(mR&&/a/mig.flags==="gim"){var t=gR(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:l(function(){e+="d"},"get")}),Object.defineProperty(n,"sticky",{get:l(function(){e+="y"},"get")}),t.get.call(n),e==="dy")return t.get}}return dR},"getPolyfill")});var G5=Lt((Rlt,B5)=>{"use strict";y();var yR=ld().supportsDescriptors,vR=vC(),bR=Ip(),xR=Object.defineProperty,_R=K_(),F5=iC(),CR=/a/;B5.exports=l(function(){if(!yR||!F5)throw new _R("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=vR(),e=F5(CR),n=bR(e,"flags");return(!n||n.get!==t)&&xR(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var z5=Lt((Glt,U5)=>{"use strict";y();var SR=ld(),IR=pC(),MR=yC(),V5=vC(),TR=G5(),j5=IR(V5());SR(j5,{getPolyfill:V5,implementation:MR,shim:TR});U5.exports=j5});var Y5=Lt((jlt,X5)=>{"use strict";y();var H5=Pv(),wR=H5("Date.prototype.getDay"),PR=l(function(t){try{return wR(t),!0}catch(e){return!1}},"tryDateGetDayCall"),ER=H5("Object.prototype.toString"),OR="[object Date]",DR=xv()();X5.exports=l(function(t){return typeof t!="object"||t===null?!1:DR?PR(t):ER(t)===OR},"isDateObject")});var bC=Lt((Hlt,n6)=>{y();var q5=Z_(),W5=$4(),Z5=S5(),$5=E5(),J5=z5(),K5=Y5(),Q5=Date.prototype.getTime;function r6(r,t,e){var n=e||{};return(n.strict?Z5(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?n.strict?Z5(r,t):r==t:LR(r,t,n)}l(r6,"deepEqual");function t6(r){return r==null}l(t6,"isUndefinedOrNull");function e6(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}l(e6,"isBuffer");function LR(r,t,e){var n,i;if(typeof r!=typeof t||t6(r)||t6(t)||r.prototype!==t.prototype||W5(r)!==W5(t))return!1;var a=$5(r),u=$5(t);if(a!==u)return!1;if(a||u)return r.source===t.source&&J5(r)===J5(t);if(K5(r)&&K5(t))return Q5.call(r)===Q5.call(t);var h=e6(r),d=e6(t);if(h!==d)return!1;if(h||d){if(r.length!==t.length)return!1;for(n=0;n<r.length;n++)if(r[n]!==t[n])return!1;return!0}if(typeof r!=typeof t)return!1;try{var m=q5(r),v=q5(t)}catch(x){return!1}if(m.length!==v.length)return!1;for(m.sort(),v.sort(),n=m.length-1;n>=0;n--)if(m[n]!=v[n])return!1;for(n=m.length-1;n>=0;n--)if(i=m[n],!r6(r[i],t[i],e))return!1;return!0}l(LR,"objEquiv");n6.exports=r6});var LC=Lt((Gpt,p6)=>{y();var PF=bC(),$a=l(function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:EF},"Equality");$a.prototype.compare=function(r,t){if(r.type!==t.type||!c6(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,n=u6(r),i=u6(t);return n.every(function(a){return this.some(function(u){return e.compare(a,u)})},i)}}return!1};function u6(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}l(u6,"explode");function c6(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}l(c6,"sameLength");$a.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};$a.prototype.compareLine=function(r,t,e,n){if(!c6(r,t))return!1;var i=this.pseudoNode?r:this.removePseudo(r),a=this.pseudoNode?t:this.removePseudo(t);if(!(n&&!this.compareCoord(i[0],a[0])&&(a=this.fixStartIndex(a,i),!a))){var u=this.compareCoord(i[e],a[e]);return this.direction||u?this.comparePath(i,a):this.compareCoord(i[e],a[a.length-(1+e)])?this.comparePath(i.slice().reverse(),a):!1}};$a.prototype.fixStartIndex=function(r,t){for(var e,n=-1,i=0;i<r.length;i++)if(this.compareCoord(r[i],t[0])){n=i;break}return n>=0&&(e=[].concat(r.slice(n,r.length),r.slice(1,n+1))),e};$a.prototype.comparePath=function(r,t){var e=this;return r.every(function(n,i){return e.compareCoord(n,this[i])},t)};$a.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),n=t.coordinates.slice(1,t.coordinates.length),i=this;return e.every(function(a){return this.some(function(u){return i.compareLine(a,u,1,!0)})},n)}else return!1};$a.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};$a.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};$a.prototype.removePseudo=function(r){return r};function EF(r,t){return PF(r,t,{strict:!0})}l(EF,"objectComparator");p6.exports=$a});var h6=Lt((oht,Rv)=>{y();function lc(r,t,e,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,n)}l(lc,"DBSCAN");lc.prototype.run=function(r,t,e,n){this._init(r,t,e,n);for(var i=0;i<this._datasetLength;i++)if(this._visited[i]!==1){this._visited[i]=1;var a=this._regionQuery(i);if(a.length<this.minPts)this.noise.push(i);else{var u=this.clusters.length;this.clusters.push([]),this._addToCluster(i,u),this._expandCluster(u,a)}}return this.clusters};lc.prototype._init=function(r,t,e,n){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),n&&(this.distance=n)};lc.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var n=t[e];if(this._visited[n]!==1){this._visited[n]=1;var i=this._regionQuery(n);i.length>=this.minPts&&(t=this._mergeArrays(t,i))}this._assigned[n]!==1&&this._addToCluster(n,r)}};lc.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};lc.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var n=this.distance(this.dataset[r],this.dataset[e]);n<this.epsilon&&t.push(e)}return t};lc.prototype._mergeArrays=function(r,t){for(var e=t.length,n=0;n<e;n++){var i=t[n];r.indexOf(i)<0&&r.push(i)}return r};lc.prototype._euclideanDistance=function(r,t){for(var e=0,n=Math.min(r.length,t.length);n--;)e+=(r[n]-t[n])*(r[n]-t[n]);return Math.sqrt(e)};typeof Rv<"u"&&Rv.exports&&(Rv.exports=lc)});var f6=Lt((lht,Fv)=>{y();function uc(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}l(uc,"KMEANS");uc.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r<"u"&&(this.dataset=r),typeof t<"u"&&(this.k=t),typeof e<"u"&&(this.distance=e)};uc.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var a=0;a<this.k;a++){for(var u=new Array(v),h=0,d=0;d<v;d++)u[d]=0;for(var m=0;m<e;m++){var v=this.dataset[m].length;if(a===this.assignments[m]){for(var d=0;d<v;d++)u[d]+=this.dataset[m][d];h++}}if(h>0){for(var d=0;d<v;d++)u[d]/=h;this.centroids[a]=u}else this.centroids[a]=this.randomCentroid(),i=!0}}return this.getClusters()};uc.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};uc.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,n=0;n<t;n++)e=this.argmin(this.dataset[n],this.centroids,this.distance),e!=this.assignments[n]&&(this.assignments[n]=e,r=!0);return r};uc.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]>"u"&&(r[t]=[]),r[t].push(e);return r};uc.prototype.argmin=function(r,t,e){for(var n=Number.MAX_VALUE,i=0,a=t.length,u,h=0;h<a;h++)u=e(r,t[h]),u<n&&(n=u,i=h);return i};uc.prototype.distance=function(r,t){for(var e=0,n=Math.min(r.length,t.length);n--;){var i=r[n]-t[n];e+=i*i}return Math.sqrt(e)};typeof Fv<"u"&&Fv.exports&&(Fv.exports=uc)});var AC=Lt((pht,Bv)=>{y();function Ja(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}l(Ja,"PriorityQueue");Ja.prototype.insert=function(r,t){for(var e=this._queue.length,n=e;n--;){var i=this._priorities[n];this._sorting==="desc"?t>i&&(e=n):t<i&&(e=n)}this._insertAt(r,t,e)};Ja.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Ja.prototype.forEach=function(r){this._queue.forEach(r)};Ja.prototype.getElements=function(){return this._queue};Ja.prototype.getElementPriority=function(r){return this._priorities[r]};Ja.prototype.getPriorities=function(){return this._priorities};Ja.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};Ja.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var n=0;n<r.length;n++)this.insert(r[n],t[n])}e&&(this._sorting=e)};Ja.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Bv<"u"&&Bv.exports&&(Bv.exports=Ja)});var m6=Lt((dht,cd)=>{y();typeof cd<"u"&&cd.exports&&(d6=AC());var d6;function Wl(r,t,e,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,n)}l(Wl,"OPTICS");Wl.prototype.run=function(r,t,e,n){this._init(r,t,e,n);for(var i=0,a=this.dataset.length;i<a;i++)if(this._processed[i]!==1){this._processed[i]=1,this.clusters.push([i]);var u=this.clusters.length-1;this._orderedList.push(i);var h=new d6(null,null,"asc"),d=this._regionQuery(i);this._distanceToCore(i)!==void 0&&(this._updateQueue(i,d,h),this._expandCluster(u,h))}return this.clusters};Wl.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var n=this._orderedList[t],i=this._reachability[n];r.push([n,i])}return r};Wl.prototype._init=function(r,t,e,n){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),n&&(this.distance=n)};Wl.prototype._updateQueue=function(r,t,e){var n=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(i){if(n._processed[i]===void 0){var a=n.distance(n.dataset[r],n.dataset[i]),u=Math.max(n._coreDistance,a);n._reachability[i]===void 0?(n._reachability[i]=u,e.insert(i,u)):u<n._reachability[i]&&(n._reachability[i]=u,e.remove(i),e.insert(i,u))}})};Wl.prototype._expandCluster=function(r,t){for(var e=t.getElements(),n=0,i=e.length;n<i;n++){var a=e[n];if(this._processed[a]===void 0){var u=this._regionQuery(a);this._processed[a]=1,this.clusters[r].push(a),this._orderedList.push(a),this._distanceToCore(a)!==void 0&&(this._updateQueue(a,u,t),this._expandCluster(r,t))}}};Wl.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var n=this._regionQuery(r,e);if(n.length>=this.minPts)return e}};Wl.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],n=0,i=this.dataset.length;n<i;n++)this.distance(this.dataset[r],this.dataset[n])<t&&e.push(n);return e};Wl.prototype._euclideanDistance=function(r,t){for(var e=0,n=Math.min(r.length,t.length);n--;)e+=(r[n]-t[n])*(r[n]-t[n]);return Math.sqrt(e)};typeof cd<"u"&&cd.exports&&(cd.exports=Wl)});var g6=Lt((yht,Gv)=>{y();typeof Gv<"u"&&Gv.exports&&(Gv.exports={DBSCAN:h6(),KMEANS:f6(),OPTICS:m6(),PriorityQueue:AC()})});var NC=Lt((Tht,v6)=>{"use strict";y();v6.exports={eudist:l(function(t,e,n){for(var i=t.length,a=0,u=0;u<i;u++){var h=(t[u]||0)-(e[u]||0);a+=h*h}return n?Math.sqrt(a):a},"eudist"),mandist:l(function(t,e,n){for(var i=t.length,a=0,u=0;u<i;u++)a+=Math.abs((t[u]||0)-(e[u]||0));return n?Math.sqrt(a):a},"mandist"),dist:l(function(t,e,n){var i=Math.abs(t-e);return n?i:i*i},"dist")}});var _6=Lt((Eht,x6)=>{"use strict";y();var b6=NC(),NF=b6.eudist,kF=b6.dist;x6.exports={kmrand:l(function(t,e){for(var n={},i=[],a=e<<2,u=t.length,h=t[0].length>0;i.length<e&&a-- >0;){var d=t[Math.floor(Math.random()*u)],m=h?d.join("_"):""+d;n[m]||(n[m]=!0,i.push(d))}if(i.length<e)throw new Error("Error initializating clusters");return i},"kmrand"),kmpp:l(function(t,e){var n=t[0].length?NF:kF,i=[],a=t.length,u=t[0].length>0,h={},d=t[Math.floor(Math.random()*a)],m=u?d.join("_"):""+d;for(i.push(d),h[m]=!0;i.length<e;){for(var v=[],x=i.length,S=0,I=[],w=0;w<a;w++){for(var E=1/0,T=0;T<x;T++){var D=n(t[w],i[T]);D<=E&&(E=D)}v[w]=E}for(var A=0;A<a;A++)S+=v[A];for(var L=0;L<a;L++)I[L]={i:L,v:t[L],pr:v[L]/S,cs:0};I.sort(function($,F){return $.pr-F.pr}),I[0].cs=I[0].pr;for(var B=1;B<a;B++)I[B].cs=I[B-1].cs+I[B].pr;for(var j=Math.random(),W=0;W<a-1&&I[W++].cs<j;);i.push(I[W-1].v)}return i},"kmpp")}});var T6=Lt((Nht,M6)=>{"use strict";y();var kC=NC(),I6=_6(),RF=kC.eudist,Lht=kC.mandist,Aht=kC.dist,FF=I6.kmrand,BF=I6.kmpp,C6=1e4;function S6(r,t,e){e=e||[];for(var n=0;n<r;n++)e[n]=t;return e}l(S6,"init");function GF(r,t,e,n){var i=[],a=[],u=[],h=[],d=!1,m=n||C6,v=r.length,x=r[0].length,S=x>0,I=[];if(e)e=="kmrand"?i=FF(r,t):e=="kmpp"?i=BF(r,t):i=e;else for(var w={};i.length<t;){var E=Math.floor(Math.random()*v);w[E]||(w[E]=!0,i.push(r[E]))}do{S6(t,0,I);for(var T=0;T<v;T++){for(var D=1/0,A=0,L=0;L<t;L++){var h=S?RF(r[T],i[L]):Math.abs(r[T]-i[L]);h<=D&&(D=h,A=L)}u[T]=A,I[A]++}for(var B=[],a=[],j=0,W=0;W<t;W++)B[W]=S?S6(x,0,B[W]):0,a[W]=i[W];if(S){for(var $=0;$<t;$++)i[$]=[];for(var F=0;F<v;F++)for(var J=u[F],ot=B[J],K=r[F],H=0;H<x;H++)ot[H]+=K[H];d=!0;for(var _t=0;_t<t;_t++){for(var ct=i[_t],ft=B[_t],mt=a[_t],St=I[_t],dt=0;dt<x;dt++)ct[dt]=ft[dt]/St||0;if(d){for(var xt=0;xt<x;xt++)if(mt[xt]!=ct[xt]){d=!1;break}}}}else{for(var q=0;q<v;q++){var ee=u[q];B[ee]+=r[q]}for(var Gt=0;Gt<t;Gt++)i[Gt]=B[Gt]/I[Gt]||0;d=!0;for(var Kt=0;Kt<t;Kt++)if(a[Kt]!=i[Kt]){d=!1;break}}d=d||--m<=0}while(!d);return{it:C6-m,k:t,idxs:u,centroids:i}}l(GF,"skmeans");M6.exports=GF});var md=Lt((jC,UC)=>{y();(function(r,t){typeof jC=="object"&&typeof UC<"u"?UC.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis<"u"?globalThis:r||self,r.polygonClipping=t())})(jC,function(){"use strict";function r(et,O){var k={label:0,sent:l(function(){if(X[0]&1)throw X[1];return X[1]},"sent"),trys:[],ops:[]},z,Y,X,pt;return pt={next:lt(0),throw:lt(1),return:lt(2)},typeof Symbol=="function"&&(pt[Symbol.iterator]=function(){return this}),pt;function lt(ht){return function(Rt){return vt([ht,Rt])}}function vt(ht){if(z)throw new TypeError("Generator is already executing.");for(;k;)try{if(z=1,Y&&(X=ht[0]&2?Y.return:ht[0]?Y.throw||((X=Y.return)&&X.call(Y),0):Y.next)&&!(X=X.call(Y,ht[1])).done)return X;switch(Y=0,X&&(ht=[ht[0]&2,X.value]),ht[0]){case 0:case 1:X=ht;break;case 4:return k.label++,{value:ht[1],done:!1};case 5:k.label++,Y=ht[1],ht=[0];continue;case 7:ht=k.ops.pop(),k.trys.pop();continue;default:if(X=k.trys,!(X=X.length>0&&X[X.length-1])&&(ht[0]===6||ht[0]===2)){k=0;continue}if(ht[0]===3&&(!X||ht[1]>X[0]&&ht[1]<X[3])){k.label=ht[1];break}if(ht[0]===6&&k.label<X[1]){k.label=X[1],X=ht;break}if(X&&k.label<X[2]){k.label=X[2],k.ops.push(ht);break}X[2]&&k.ops.pop(),k.trys.pop();continue}ht=O.call(et,k)}catch(Rt){ht=[6,Rt],Y=0}finally{z=X=0}if(ht[0]&5)throw ht[1];return{value:ht[0]?ht[1]:void 0,done:!0}}}l(r,"__generator");var t=function(){function et(O,k){this.next=null,this.key=O,this.data=k,this.left=null,this.right=null}return l(et,"Node"),et}();function e(et,O){return et>O?1:et<O?-1:0}l(e,"DEFAULT_COMPARE");function n(et,O,k){for(var z=new t(null,null),Y=z,X=z;;){var pt=k(et,O.key);if(pt<0){if(O.left===null)break;if(k(et,O.left.key)<0){var lt=O.left;if(O.left=lt.right,lt.right=O,O=lt,O.left===null)break}X.left=O,X=O,O=O.left}else if(pt>0){if(O.right===null)break;if(k(et,O.right.key)>0){var lt=O.right;if(O.right=lt.left,lt.left=O,O=lt,O.right===null)break}Y.right=O,Y=O,O=O.right}else break}return Y.right=O.left,X.left=O.right,O.left=z.right,O.right=z.left,O}l(n,"splay");function i(et,O,k,z){var Y=new t(et,O);if(k===null)return Y.left=Y.right=null,Y;k=n(et,k,z);var X=z(et,k.key);return X<0?(Y.left=k.left,Y.right=k,k.left=null):X>=0&&(Y.right=k.right,Y.left=k,k.right=null),Y}l(i,"insert");function a(et,O,k){var z=null,Y=null;if(O){O=n(et,O,k);var X=k(O.key,et);X===0?(z=O.left,Y=O.right):X<0?(Y=O.right,O.right=null,z=O):(z=O.left,O.left=null,Y=O)}return{left:z,right:Y}}l(a,"split");function u(et,O,k){return O===null?et:(et===null||(O=n(et.key,O,k),O.left=et),O)}l(u,"merge");function h(et,O,k,z,Y){if(et){z(""+O+(k?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+Y(et)+"\n");var X=O+(k?" ":"\u2502 ");et.left&&h(et.left,X,!1,z,Y),et.right&&h(et.right,X,!0,z,Y)}}l(h,"printRow");var d=function(){function et(O){O===void 0&&(O=e),this._root=null,this._size=0,this._comparator=O}return l(et,"Tree"),et.prototype.insert=function(O,k){return this._size++,this._root=i(O,k,this._root,this._comparator)},et.prototype.add=function(O,k){var z=new t(O,k);this._root===null&&(z.left=z.right=null,this._size++,this._root=z);var Y=this._comparator,X=n(O,this._root,Y),pt=Y(O,X.key);return pt===0?this._root=X:(pt<0?(z.left=X.left,z.right=X,X.left=null):pt>0&&(z.right=X.right,z.left=X,X.right=null),this._size++,this._root=z),this._root},et.prototype.remove=function(O){this._root=this._remove(O,this._root,this._comparator)},et.prototype._remove=function(O,k,z){var Y;if(k===null)return null;k=n(O,k,z);var X=z(O,k.key);return X===0?(k.left===null?Y=k.right:(Y=n(O,k.left,z),Y.right=k.right),this._size--,Y):k},et.prototype.pop=function(){var O=this._root;if(O){for(;O.left;)O=O.left;return this._root=n(O.key,this._root,this._comparator),this._root=this._remove(O.key,this._root,this._comparator),{key:O.key,data:O.data}}return null},et.prototype.findStatic=function(O){for(var k=this._root,z=this._comparator;k;){var Y=z(O,k.key);if(Y===0)return k;Y<0?k=k.left:k=k.right}return null},et.prototype.find=function(O){return this._root&&(this._root=n(O,this._root,this._comparator),this._comparator(O,this._root.key)!==0)?null:this._root},et.prototype.contains=function(O){for(var k=this._root,z=this._comparator;k;){var Y=z(O,k.key);if(Y===0)return!0;Y<0?k=k.left:k=k.right}return!1},et.prototype.forEach=function(O,k){for(var z=this._root,Y=[],X=!1;!X;)z!==null?(Y.push(z),z=z.left):Y.length!==0?(z=Y.pop(),O.call(k,z),z=z.right):X=!0;return this},et.prototype.range=function(O,k,z,Y){for(var X=[],pt=this._comparator,lt=this._root,vt;X.length!==0||lt;)if(lt)X.push(lt),lt=lt.left;else{if(lt=X.pop(),vt=pt(lt.key,k),vt>0)break;if(pt(lt.key,O)>=0&&z.call(Y,lt))return this;lt=lt.right}return this},et.prototype.keys=function(){var O=[];return this.forEach(function(k){var z=k.key;return O.push(z)}),O},et.prototype.values=function(){var O=[];return this.forEach(function(k){var z=k.data;return O.push(z)}),O},et.prototype.min=function(){return this._root?this.minNode(this._root).key:null},et.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},et.prototype.minNode=function(O){if(O===void 0&&(O=this._root),O)for(;O.left;)O=O.left;return O},et.prototype.maxNode=function(O){if(O===void 0&&(O=this._root),O)for(;O.right;)O=O.right;return O},et.prototype.at=function(O){for(var k=this._root,z=!1,Y=0,X=[];!z;)if(k)X.push(k),k=k.left;else if(X.length>0){if(k=X.pop(),Y===O)return k;Y++,k=k.right}else z=!0;return null},et.prototype.next=function(O){var k=this._root,z=null;if(O.right){for(z=O.right;z.left;)z=z.left;return z}for(var Y=this._comparator;k;){var X=Y(O.key,k.key);if(X===0)break;X<0?(z=k,k=k.left):k=k.right}return z},et.prototype.prev=function(O){var k=this._root,z=null;if(O.left!==null){for(z=O.left;z.right;)z=z.right;return z}for(var Y=this._comparator;k;){var X=Y(O.key,k.key);if(X===0)break;X<0?k=k.left:(z=k,k=k.right)}return z},et.prototype.clear=function(){return this._root=null,this._size=0,this},et.prototype.toList=function(){return x(this._root)},et.prototype.load=function(O,k,z){k===void 0&&(k=[]),z===void 0&&(z=!1);var Y=O.length,X=this._comparator;if(z&&w(O,k,0,Y-1,X),this._root===null)this._root=m(O,k,0,Y),this._size=Y;else{var pt=I(this.toList(),v(O,k),X);Y=this._size+Y,this._root=S({head:pt},0,Y)}return this},et.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(et.prototype,"size",{get:l(function(){return this._size},"get"),enumerable:!0,configurable:!0}),Object.defineProperty(et.prototype,"root",{get:l(function(){return this._root},"get"),enumerable:!0,configurable:!0}),et.prototype.toString=function(O){O===void 0&&(O=l(function(z){return String(z.key)},"printNode"));var k=[];return h(this._root,"",!0,function(z){return k.push(z)},O),k.join("")},et.prototype.update=function(O,k,z){var Y=this._comparator,X=a(O,this._root,Y),pt=X.left,lt=X.right;Y(O,k)<0?lt=i(k,z,lt,Y):pt=i(k,z,pt,Y),this._root=u(pt,lt,Y)},et.prototype.split=function(O){return a(O,this._root,this._comparator)},et.prototype[Symbol.iterator]=function(){var O,k,z;return r(this,function(Y){switch(Y.label){case 0:O=this._root,k=[],z=!1,Y.label=1;case 1:return z?[3,6]:O===null?[3,2]:(k.push(O),O=O.left,[3,5]);case 2:return k.length===0?[3,4]:(O=k.pop(),[4,O]);case 3:return Y.sent(),O=O.right,[3,5];case 4:z=!0,Y.label=5;case 5:return[3,1];case 6:return[2]}})},et}();function m(et,O,k,z){var Y=z-k;if(Y>0){var X=k+Math.floor(Y/2),pt=et[X],lt=O[X],vt=new t(pt,lt);return vt.left=m(et,O,k,X),vt.right=m(et,O,X+1,z),vt}return null}l(m,"loadRecursive");function v(et,O){for(var k=new t(null,null),z=k,Y=0;Y<et.length;Y++)z=z.next=new t(et[Y],O[Y]);return z.next=null,k.next}l(v,"createList");function x(et){for(var O=et,k=[],z=!1,Y=new t(null,null),X=Y;!z;)O?(k.push(O),O=O.left):k.length>0?(O=X=X.next=k.pop(),O=O.right):z=!0;return X.next=null,Y.next}l(x,"toList");function S(et,O,k){var z=k-O;if(z>0){var Y=O+Math.floor(z/2),X=S(et,O,Y),pt=et.head;return pt.left=X,et.head=et.head.next,pt.right=S(et,Y+1,k),pt}return null}l(S,"sortedListToBST");function I(et,O,k){for(var z=new t(null,null),Y=z,X=et,pt=O;X!==null&&pt!==null;)k(X.key,pt.key)<0?(Y.next=X,X=X.next):(Y.next=pt,pt=pt.next),Y=Y.next;return X!==null?Y.next=X:pt!==null&&(Y.next=pt),z.next}l(I,"mergeLists");function w(et,O,k,z,Y){if(!(k>=z)){for(var X=et[k+z>>1],pt=k-1,lt=z+1;;){do pt++;while(Y(et[pt],X)<0);do lt--;while(Y(et[lt],X)>0);if(pt>=lt)break;var vt=et[pt];et[pt]=et[lt],et[lt]=vt,vt=O[pt],O[pt]=O[lt],O[lt]=vt}w(et,O,k,lt,Y),w(et,O,lt+1,z,Y)}}l(w,"sort");let E=l((et,O)=>et.ll.x<=O.x&&O.x<=et.ur.x&&et.ll.y<=O.y&&O.y<=et.ur.y,"isInBbox"),T=l((et,O)=>{if(O.ur.x<et.ll.x||et.ur.x<O.ll.x||O.ur.y<et.ll.y||et.ur.y<O.ll.y)return null;let k=et.ll.x<O.ll.x?O.ll.x:et.ll.x,z=et.ur.x<O.ur.x?et.ur.x:O.ur.x,Y=et.ll.y<O.ll.y?O.ll.y:et.ll.y,X=et.ur.y<O.ur.y?et.ur.y:O.ur.y;return{ll:{x:k,y:Y},ur:{x:z,y:X}}},"getBboxOverlap"),D=Number.EPSILON;D===void 0&&(D=Math.pow(2,-52));let A=D*D,L=l((et,O)=>{if(-D<et&&et<D&&-D<O&&O<D)return 0;let k=et-O;return k*k<A*et*O?0:et<O?-1:1},"cmp"),Ai=class Ai{constructor(){this.reset()}reset(){this.xRounder=new j,this.yRounder=new j}round(O,k){return{x:this.xRounder.round(O),y:this.yRounder.round(k)}}};l(Ai,"PtRounder");let B=Ai,Hn=class Hn{constructor(){this.tree=new d,this.round(0)}round(O){let k=this.tree.add(O),z=this.tree.prev(k);if(z!==null&&L(k.key,z.key)===0)return this.tree.remove(O),z.key;let Y=this.tree.next(k);return Y!==null&&L(k.key,Y.key)===0?(this.tree.remove(O),Y.key):O}};l(Hn,"CoordRounder");let j=Hn,W=new B,$=11102230246251565e-32,F=134217729,J=(3+8*$)*$;function ot(et,O,k,z,Y){let X,pt,lt,vt,ht=O[0],Rt=z[0],at=0,bt=0;Rt>ht==Rt>-ht?(X=ht,ht=O[++at]):(X=Rt,Rt=z[++bt]);let gt=0;if(at<et&&bt<k)for(Rt>ht==Rt>-ht?(pt=ht+X,lt=X-(pt-ht),ht=O[++at]):(pt=Rt+X,lt=X-(pt-Rt),Rt=z[++bt]),X=pt,lt!==0&&(Y[gt++]=lt);at<et&&bt<k;)Rt>ht==Rt>-ht?(pt=X+ht,vt=pt-X,lt=X-(pt-vt)+(ht-vt),ht=O[++at]):(pt=X+Rt,vt=pt-X,lt=X-(pt-vt)+(Rt-vt),Rt=z[++bt]),X=pt,lt!==0&&(Y[gt++]=lt);for(;at<et;)pt=X+ht,vt=pt-X,lt=X-(pt-vt)+(ht-vt),ht=O[++at],X=pt,lt!==0&&(Y[gt++]=lt);for(;bt<k;)pt=X+Rt,vt=pt-X,lt=X-(pt-vt)+(Rt-vt),Rt=z[++bt],X=pt,lt!==0&&(Y[gt++]=lt);return(X!==0||gt===0)&&(Y[gt++]=X),gt}l(ot,"sum");function K(et,O){let k=O[0];for(let z=1;z<et;z++)k+=O[z];return k}l(K,"estimate");function H(et){return new Float64Array(et)}l(H,"vec");let _t=(3+16*$)*$,ct=(2+12*$)*$,ft=(9+64*$)*$*$,mt=H(4),St=H(8),dt=H(12),xt=H(16),q=H(4);function ee(et,O,k,z,Y,X,pt){let lt,vt,ht,Rt,at,bt,gt,Qt,qt,fe,te,Tr,Dr,sn,Lr,Xn,Te,ye,Ri=et-Y,Ur=k-Y,Nn=O-X,xr=z-X;sn=Ri*xr,bt=F*Ri,gt=bt-(bt-Ri),Qt=Ri-gt,bt=F*xr,qt=bt-(bt-xr),fe=xr-qt,Lr=Qt*fe-(sn-gt*qt-Qt*qt-gt*fe),Xn=Nn*Ur,bt=F*Nn,gt=bt-(bt-Nn),Qt=Nn-gt,bt=F*Ur,qt=bt-(bt-Ur),fe=Ur-qt,Te=Qt*fe-(Xn-gt*qt-Qt*qt-gt*fe),te=Lr-Te,at=Lr-te,mt[0]=Lr-(te+at)+(at-Te),Tr=sn+te,at=Tr-sn,Dr=sn-(Tr-at)+(te-at),te=Dr-Xn,at=Dr-te,mt[1]=Dr-(te+at)+(at-Xn),ye=Tr+te,at=ye-Tr,mt[2]=Tr-(ye-at)+(te-at),mt[3]=ye;let Ki=K(4,mt),Fi=ct*pt;if(Ki>=Fi||-Ki>=Fi||(at=et-Ri,lt=et-(Ri+at)+(at-Y),at=k-Ur,ht=k-(Ur+at)+(at-Y),at=O-Nn,vt=O-(Nn+at)+(at-X),at=z-xr,Rt=z-(xr+at)+(at-X),lt===0&&vt===0&&ht===0&&Rt===0)||(Fi=ft*pt+J*Math.abs(Ki),Ki+=Ri*Rt+xr*lt-(Nn*ht+Ur*vt),Ki>=Fi||-Ki>=Fi))return Ki;sn=lt*xr,bt=F*lt,gt=bt-(bt-lt),Qt=lt-gt,bt=F*xr,qt=bt-(bt-xr),fe=xr-qt,Lr=Qt*fe-(sn-gt*qt-Qt*qt-gt*fe),Xn=vt*Ur,bt=F*vt,gt=bt-(bt-vt),Qt=vt-gt,bt=F*Ur,qt=bt-(bt-Ur),fe=Ur-qt,Te=Qt*fe-(Xn-gt*qt-Qt*qt-gt*fe),te=Lr-Te,at=Lr-te,q[0]=Lr-(te+at)+(at-Te),Tr=sn+te,at=Tr-sn,Dr=sn-(Tr-at)+(te-at),te=Dr-Xn,at=Dr-te,q[1]=Dr-(te+at)+(at-Xn),ye=Tr+te,at=ye-Tr,q[2]=Tr-(ye-at)+(te-at),q[3]=ye;let Jo=ot(4,mt,4,q,St);sn=Ri*Rt,bt=F*Ri,gt=bt-(bt-Ri),Qt=Ri-gt,bt=F*Rt,qt=bt-(bt-Rt),fe=Rt-qt,Lr=Qt*fe-(sn-gt*qt-Qt*qt-gt*fe),Xn=Nn*ht,bt=F*Nn,gt=bt-(bt-Nn),Qt=Nn-gt,bt=F*ht,qt=bt-(bt-ht),fe=ht-qt,Te=Qt*fe-(Xn-gt*qt-Qt*qt-gt*fe),te=Lr-Te,at=Lr-te,q[0]=Lr-(te+at)+(at-Te),Tr=sn+te,at=Tr-sn,Dr=sn-(Tr-at)+(te-at),te=Dr-Xn,at=Dr-te,q[1]=Dr-(te+at)+(at-Xn),ye=Tr+te,at=ye-Tr,q[2]=Tr-(ye-at)+(te-at),q[3]=ye;let Qi=ot(Jo,St,4,q,dt);sn=lt*Rt,bt=F*lt,gt=bt-(bt-lt),Qt=lt-gt,bt=F*Rt,qt=bt-(bt-Rt),fe=Rt-qt,Lr=Qt*fe-(sn-gt*qt-Qt*qt-gt*fe),Xn=vt*ht,bt=F*vt,gt=bt-(bt-vt),Qt=vt-gt,bt=F*ht,qt=bt-(bt-ht),fe=ht-qt,Te=Qt*fe-(Xn-gt*qt-Qt*qt-gt*fe),te=Lr-Te,at=Lr-te,q[0]=Lr-(te+at)+(at-Te),Tr=sn+te,at=Tr-sn,Dr=sn-(Tr-at)+(te-at),te=Dr-Xn,at=Dr-te,q[1]=Dr-(te+at)+(at-Xn),ye=Tr+te,at=ye-Tr,q[2]=Tr-(ye-at)+(te-at),q[3]=ye;let Pf=ot(Qi,dt,4,q,xt);return xt[Pf-1]}l(ee,"orient2dadapt");function Gt(et,O,k,z,Y,X){let pt=(O-X)*(k-Y),lt=(et-Y)*(z-X),vt=pt-lt,ht=Math.abs(pt+lt);return Math.abs(vt)>=_t*ht?vt:-ee(et,O,k,z,Y,X,ht)}l(Gt,"orient2d");let Kt=l((et,O)=>et.x*O.y-et.y*O.x,"crossProduct"),It=l((et,O)=>et.x*O.x+et.y*O.y,"dotProduct"),ie=l((et,O,k)=>{let z=Gt(et.x,et.y,O.x,O.y,k.x,k.y);return z>0?-1:z<0?1:0},"compareVectorAngles"),vr=l(et=>Math.sqrt(It(et,et)),"length"),Qe=l((et,O,k)=>{let z={x:O.x-et.x,y:O.y-et.y},Y={x:k.x-et.x,y:k.y-et.y};return Kt(Y,z)/vr(Y)/vr(z)},"sineOfAngle"),Nt=l((et,O,k)=>{let z={x:O.x-et.x,y:O.y-et.y},Y={x:k.x-et.x,y:k.y-et.y};return It(Y,z)/vr(Y)/vr(z)},"cosineOfAngle"),At=l((et,O,k)=>O.y===0?null:{x:et.x+O.x/O.y*(k-et.y),y:k},"horizontalIntersection"),Ct=l((et,O,k)=>O.x===0?null:{x:k,y:et.y+O.y/O.x*(k-et.x)},"verticalIntersection"),_e=l((et,O,k,z)=>{if(O.x===0)return Ct(k,z,et.x);if(z.x===0)return Ct(et,O,k.x);if(O.y===0)return At(k,z,et.y);if(z.y===0)return At(et,O,k.y);let Y=Kt(O,z);if(Y==0)return null;let X={x:k.x-et.x,y:k.y-et.y},pt=Kt(X,O)/Y,lt=Kt(X,z)/Y,vt=et.x+lt*O.x,ht=k.x+pt*z.x,Rt=et.y+lt*O.y,at=k.y+pt*z.y,bt=(vt+ht)/2,gt=(Rt+at)/2;return{x:bt,y:gt}},"intersection$1"),Ni=class Ni{static compare(O,k){let z=Ni.comparePoints(O.point,k.point);return z!==0?z:(O.point!==k.point&&O.link(k),O.isLeft!==k.isLeft?O.isLeft?1:-1:me.compare(O.segment,k.segment))}static comparePoints(O,k){return O.x<k.x?-1:O.x>k.x?1:O.y<k.y?-1:O.y>k.y?1:0}constructor(O,k){O.events===void 0?O.events=[this]:O.events.push(this),this.point=O,this.isLeft=k}link(O){if(O.point===this.point)throw new Error("Tried to link already linked events");let k=O.point.events;for(let z=0,Y=k.length;z<Y;z++){let X=k[z];this.point.events.push(X),X.point=this.point}this.checkForConsuming()}checkForConsuming(){let O=this.point.events.length;for(let k=0;k<O;k++){let z=this.point.events[k];if(z.segment.consumedBy===void 0)for(let Y=k+1;Y<O;Y++){let X=this.point.events[Y];X.consumedBy===void 0&&z.otherSE.point.events===X.otherSE.point.events&&z.segment.consume(X.segment)}}}getAvailableLinkedEvents(){let O=[];for(let k=0,z=this.point.events.length;k<z;k++){let Y=this.point.events[k];Y!==this&&!Y.segment.ringOut&&Y.segment.isInResult()&&O.push(Y)}return O}getLeftmostComparator(O){let k=new Map,z=l(Y=>{let X=Y.otherSE;k.set(Y,{sine:Qe(this.point,O.point,X.point),cosine:Nt(this.point,O.point,X.point)})},"fillCache");return(Y,X)=>{k.has(Y)||z(Y),k.has(X)||z(X);let{sine:pt,cosine:lt}=k.get(Y),{sine:vt,cosine:ht}=k.get(X);return pt>=0&&vt>=0?lt<ht?1:lt>ht?-1:0:pt<0&&vt<0?lt<ht?-1:lt>ht?1:0:vt<pt?-1:vt>pt?1:0}}};l(Ni,"SweepEvent");let de=Ni,qr=0,$o=class $o{static compare(O,k){let z=O.leftSE.point.x,Y=k.leftSE.point.x,X=O.rightSE.point.x,pt=k.rightSE.point.x;if(pt<z)return 1;if(X<Y)return-1;let lt=O.leftSE.point.y,vt=k.leftSE.point.y,ht=O.rightSE.point.y,Rt=k.rightSE.point.y;if(z<Y){if(vt<lt&&vt<ht)return 1;if(vt>lt&&vt>ht)return-1;let at=O.comparePoint(k.leftSE.point);if(at<0)return 1;if(at>0)return-1;let bt=k.comparePoint(O.rightSE.point);return bt!==0?bt:-1}if(z>Y){if(lt<vt&&lt<Rt)return-1;if(lt>vt&&lt>Rt)return 1;let at=k.comparePoint(O.leftSE.point);if(at!==0)return at;let bt=O.comparePoint(k.rightSE.point);return bt<0?1:bt>0?-1:1}if(lt<vt)return-1;if(lt>vt)return 1;if(X<pt){let at=k.comparePoint(O.rightSE.point);if(at!==0)return at}if(X>pt){let at=O.comparePoint(k.rightSE.point);if(at<0)return 1;if(at>0)return-1}if(X!==pt){let at=ht-lt,bt=X-z,gt=Rt-vt,Qt=pt-Y;if(at>bt&&gt<Qt)return 1;if(at<bt&&gt>Qt)return-1}return X>pt?1:X<pt||ht<Rt?-1:ht>Rt?1:O.id<k.id?-1:O.id>k.id?1:0}constructor(O,k,z,Y){this.id=++qr,this.leftSE=O,O.segment=this,O.otherSE=k,this.rightSE=k,k.segment=this,k.otherSE=O,this.rings=z,this.windings=Y}static fromRing(O,k,z){let Y,X,pt,lt=de.comparePoints(O,k);if(lt<0)Y=O,X=k,pt=1;else if(lt>0)Y=k,X=O,pt=-1;else throw new Error("Tried to create degenerate segment at [".concat(O.x,", ").concat(O.y,"]"));let vt=new de(Y,!0),ht=new de(X,!1);return new $o(vt,ht,[z],[pt])}replaceRightSE(O){this.rightSE=O,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let O=this.leftSE.point.y,k=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:O<k?O:k},ur:{x:this.rightSE.point.x,y:O>k?O:k}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(O){return O.x===this.leftSE.point.x&&O.y===this.leftSE.point.y||O.x===this.rightSE.point.x&&O.y===this.rightSE.point.y}comparePoint(O){if(this.isAnEndpoint(O))return 0;let k=this.leftSE.point,z=this.rightSE.point,Y=this.vector();if(k.x===z.x)return O.x===k.x?0:O.x<k.x?1:-1;let X=(O.y-k.y)/Y.y,pt=k.x+X*Y.x;if(O.x===pt)return 0;let lt=(O.x-k.x)/Y.x,vt=k.y+lt*Y.y;return O.y===vt?0:O.y<vt?-1:1}getIntersection(O){let k=this.bbox(),z=O.bbox(),Y=T(k,z);if(Y===null)return null;let X=this.leftSE.point,pt=this.rightSE.point,lt=O.leftSE.point,vt=O.rightSE.point,ht=E(k,lt)&&this.comparePoint(lt)===0,Rt=E(z,X)&&O.comparePoint(X)===0,at=E(k,vt)&&this.comparePoint(vt)===0,bt=E(z,pt)&&O.comparePoint(pt)===0;if(Rt&&ht)return bt&&!at?pt:!bt&&at?vt:null;if(Rt)return at&&X.x===vt.x&&X.y===vt.y?null:X;if(ht)return bt&&pt.x===lt.x&&pt.y===lt.y?null:lt;if(bt&&at)return null;if(bt)return pt;if(at)return vt;let gt=_e(X,this.vector(),lt,O.vector());return gt===null||!E(Y,gt)?null:W.round(gt.x,gt.y)}split(O){let k=[],z=O.events!==void 0,Y=new de(O,!0),X=new de(O,!1),pt=this.rightSE;this.replaceRightSE(X),k.push(X),k.push(Y);let lt=new $o(Y,pt,this.rings.slice(),this.windings.slice());return de.comparePoints(lt.leftSE.point,lt.rightSE.point)>0&&lt.swapEvents(),de.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),z&&(Y.checkForConsuming(),X.checkForConsuming()),k}swapEvents(){let O=this.rightSE;this.rightSE=this.leftSE,this.leftSE=O,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let k=0,z=this.windings.length;k<z;k++)this.windings[k]*=-1}consume(O){let k=this,z=O;for(;k.consumedBy;)k=k.consumedBy;for(;z.consumedBy;)z=z.consumedBy;let Y=$o.compare(k,z);if(Y!==0){if(Y>0){let X=k;k=z,z=X}if(k.prev===z){let X=k;k=z,z=X}for(let X=0,pt=z.rings.length;X<pt;X++){let lt=z.rings[X],vt=z.windings[X],ht=k.rings.indexOf(lt);ht===-1?(k.rings.push(lt),k.windings.push(vt)):k.windings[ht]+=vt}z.rings=null,z.windings=null,z.consumedBy=k,z.leftSE.consumedBy=k.leftSE,z.rightSE.consumedBy=k.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 O=this.prev.consumedBy||this.prev;this._beforeState=O.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let O=this.beforeState();this._afterState={rings:O.rings.slice(0),windings:O.windings.slice(0),multiPolys:[]};let k=this._afterState.rings,z=this._afterState.windings,Y=this._afterState.multiPolys;for(let lt=0,vt=this.rings.length;lt<vt;lt++){let ht=this.rings[lt],Rt=this.windings[lt],at=k.indexOf(ht);at===-1?(k.push(ht),z.push(Rt)):z[at]+=Rt}let X=[],pt=[];for(let lt=0,vt=k.length;lt<vt;lt++){if(z[lt]===0)continue;let ht=k[lt],Rt=ht.poly;if(pt.indexOf(Rt)===-1)if(ht.isExterior)X.push(Rt);else{pt.indexOf(Rt)===-1&&pt.push(Rt);let at=X.indexOf(ht.poly);at!==-1&&X.splice(at,1)}}for(let lt=0,vt=X.length;lt<vt;lt++){let ht=X[lt].multiPoly;Y.indexOf(ht)===-1&&Y.push(ht)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let O=this.beforeState().multiPolys,k=this.afterState().multiPolys;switch(wt.type){case"union":{let z=O.length===0,Y=k.length===0;this._isInResult=z!==Y;break}case"intersection":{let z,Y;O.length<k.length?(z=O.length,Y=k.length):(z=k.length,Y=O.length),this._isInResult=Y===wt.numMultiPolys&&z<Y;break}case"xor":{let z=Math.abs(O.length-k.length);this._isInResult=z%2===1;break}case"difference":{let z=l(Y=>Y.length===1&&Y[0].isSubject,"isJustSubject");this._isInResult=z(O)!==z(k);break}default:throw new Error("Unrecognized operation type found ".concat(wt.type))}return this._isInResult}};l($o,"Segment");let me=$o,Ea=class Ea{constructor(O,k,z){if(!Array.isArray(O)||O.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=k,this.isExterior=z,this.segments=[],typeof O[0][0]!="number"||typeof O[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let Y=W.round(O[0][0],O[0][1]);this.bbox={ll:{x:Y.x,y:Y.y},ur:{x:Y.x,y:Y.y}};let X=Y;for(let pt=1,lt=O.length;pt<lt;pt++){if(typeof O[pt][0]!="number"||typeof O[pt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let vt=W.round(O[pt][0],O[pt][1]);vt.x===X.x&&vt.y===X.y||(this.segments.push(me.fromRing(X,vt,this)),vt.x<this.bbox.ll.x&&(this.bbox.ll.x=vt.x),vt.y<this.bbox.ll.y&&(this.bbox.ll.y=vt.y),vt.x>this.bbox.ur.x&&(this.bbox.ur.x=vt.x),vt.y>this.bbox.ur.y&&(this.bbox.ur.y=vt.y),X=vt)}(Y.x!==X.x||Y.y!==X.y)&&this.segments.push(me.fromRing(X,Y,this))}getSweepEvents(){let O=[];for(let k=0,z=this.segments.length;k<z;k++){let Y=this.segments[k];O.push(Y.leftSE),O.push(Y.rightSE)}return O}};l(Ea,"RingIn");let Se=Ea,Oa=class Oa{constructor(O,k){if(!Array.isArray(O))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Se(O[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 z=1,Y=O.length;z<Y;z++){let X=new Se(O[z],this,!1);X.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=X.bbox.ll.x),X.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=X.bbox.ll.y),X.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=X.bbox.ur.x),X.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=X.bbox.ur.y),this.interiorRings.push(X)}this.multiPoly=k}getSweepEvents(){let O=this.exteriorRing.getSweepEvents();for(let k=0,z=this.interiorRings.length;k<z;k++){let Y=this.interiorRings[k].getSweepEvents();for(let X=0,pt=Y.length;X<pt;X++)O.push(Y[X])}return O}};l(Oa,"PolyIn");let br=Oa,Da=class Da{constructor(O,k){if(!Array.isArray(O))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof O[0][0][0]=="number"&&(O=[O])}catch(z){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let z=0,Y=O.length;z<Y;z++){let X=new br(O[z],this);X.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=X.bbox.ll.x),X.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=X.bbox.ll.y),X.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=X.bbox.ur.x),X.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=X.bbox.ur.y),this.polys.push(X)}this.isSubject=k}getSweepEvents(){let O=[];for(let k=0,z=this.polys.length;k<z;k++){let Y=this.polys[k].getSweepEvents();for(let X=0,pt=Y.length;X<pt;X++)O.push(Y[X])}return O}};l(Da,"MultiPolyIn");let Wr=Da,Rr=class Rr{static factory(O){let k=[];for(let z=0,Y=O.length;z<Y;z++){let X=O[z];if(!X.isInResult()||X.ringOut)continue;let pt=null,lt=X.leftSE,vt=X.rightSE,ht=[lt],Rt=lt.point,at=[];for(;pt=lt,lt=vt,ht.push(lt),lt.point!==Rt;)for(;;){let bt=lt.getAvailableLinkedEvents();if(bt.length===0){let qt=ht[0].point,fe=ht[ht.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(qt.x,",")+" ".concat(qt.y,"]. Last matching segment found ends at")+" [".concat(fe.x,", ").concat(fe.y,"]."))}if(bt.length===1){vt=bt[0].otherSE;break}let gt=null;for(let qt=0,fe=at.length;qt<fe;qt++)if(at[qt].point===lt.point){gt=qt;break}if(gt!==null){let qt=at.splice(gt)[0],fe=ht.splice(qt.index);fe.unshift(fe[0].otherSE),k.push(new Rr(fe.reverse()));continue}at.push({index:ht.length,point:lt.point});let Qt=lt.getLeftmostComparator(pt);vt=bt.sort(Qt)[0].otherSE;break}k.push(new Rr(ht))}return k}constructor(O){this.events=O;for(let k=0,z=O.length;k<z;k++)O[k].segment.ringOut=this;this.poly=null}getGeom(){let O=this.events[0].point,k=[O];for(let ht=1,Rt=this.events.length-1;ht<Rt;ht++){let at=this.events[ht].point,bt=this.events[ht+1].point;ie(at,O,bt)!==0&&(k.push(at),O=at)}if(k.length===1)return null;let z=k[0],Y=k[1];ie(z,O,Y)===0&&k.shift(),k.push(k[0]);let X=this.isExteriorRing()?1:-1,pt=this.isExteriorRing()?0:k.length-1,lt=this.isExteriorRing()?k.length:-1,vt=[];for(let ht=pt;ht!=lt;ht+=X)vt.push([k[ht].x,k[ht].y]);return vt}isExteriorRing(){if(this._isExteriorRing===void 0){let O=this.enclosingRing();this._isExteriorRing=O?!O.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let O=this.events[0];for(let Y=1,X=this.events.length;Y<X;Y++){let pt=this.events[Y];de.compare(O,pt)>0&&(O=pt)}let k=O.segment.prevInResult(),z=k?k.prevInResult():null;for(;;){if(!k)return null;if(!z)return k.ringOut;if(z.ringOut!==k.ringOut)return z.ringOut.enclosingRing()!==k.ringOut?k.ringOut:k.ringOut.enclosingRing();k=z.prevInResult(),z=k?k.prevInResult():null}}};l(Rr,"RingOut");let $i=Rr,La=class La{constructor(O){this.exteriorRing=O,O.poly=this,this.interiorRings=[]}addInterior(O){this.interiorRings.push(O),O.poly=this}getGeom(){let O=[this.exteriorRing.getGeom()];if(O[0]===null)return null;for(let k=0,z=this.interiorRings.length;k<z;k++){let Y=this.interiorRings[k].getGeom();Y!==null&&O.push(Y)}return O}};l(La,"PolyOut");let Yt=La,ki=class ki{constructor(O){this.rings=O,this.polys=this._composePolys(O)}getGeom(){let O=[];for(let k=0,z=this.polys.length;k<z;k++){let Y=this.polys[k].getGeom();Y!==null&&O.push(Y)}return O}_composePolys(O){let k=[];for(let z=0,Y=O.length;z<Y;z++){let X=O[z];if(!X.poly)if(X.isExteriorRing())k.push(new Yt(X));else{let pt=X.enclosingRing();pt.poly||k.push(new Yt(pt)),pt.poly.addInterior(X)}}return k}};l(ki,"MultiPolyOut");let mr=ki,Et=class Et{constructor(O){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:me.compare;this.queue=O,this.tree=new d(k),this.segments=[]}process(O){let k=O.segment,z=[];if(O.consumedBy)return O.isLeft?this.queue.remove(O.otherSE):this.tree.remove(k),z;let Y=O.isLeft?this.tree.add(k):this.tree.find(k);if(!Y)throw new Error("Unable to find segment #".concat(k.id," ")+"[".concat(k.leftSE.point.x,", ").concat(k.leftSE.point.y,"] -> ")+"[".concat(k.rightSE.point.x,", ").concat(k.rightSE.point.y,"] ")+"in SweepLine tree.");let X=Y,pt=Y,lt,vt;for(;lt===void 0;)X=this.tree.prev(X),X===null?lt=null:X.key.consumedBy===void 0&&(lt=X.key);for(;vt===void 0;)pt=this.tree.next(pt),pt===null?vt=null:pt.key.consumedBy===void 0&&(vt=pt.key);if(O.isLeft){let ht=null;if(lt){let at=lt.getIntersection(k);if(at!==null&&(k.isAnEndpoint(at)||(ht=at),!lt.isAnEndpoint(at))){let bt=this._splitSafely(lt,at);for(let gt=0,Qt=bt.length;gt<Qt;gt++)z.push(bt[gt])}}let Rt=null;if(vt){let at=vt.getIntersection(k);if(at!==null&&(k.isAnEndpoint(at)||(Rt=at),!vt.isAnEndpoint(at))){let bt=this._splitSafely(vt,at);for(let gt=0,Qt=bt.length;gt<Qt;gt++)z.push(bt[gt])}}if(ht!==null||Rt!==null){let at=null;ht===null?at=Rt:Rt===null?at=ht:at=de.comparePoints(ht,Rt)<=0?ht:Rt,this.queue.remove(k.rightSE),z.push(k.rightSE);let bt=k.split(at);for(let gt=0,Qt=bt.length;gt<Qt;gt++)z.push(bt[gt])}z.length>0?(this.tree.remove(k),z.push(O)):(this.segments.push(k),k.prev=lt)}else{if(lt&&vt){let ht=lt.getIntersection(vt);if(ht!==null){if(!lt.isAnEndpoint(ht)){let Rt=this._splitSafely(lt,ht);for(let at=0,bt=Rt.length;at<bt;at++)z.push(Rt[at])}if(!vt.isAnEndpoint(ht)){let Rt=this._splitSafely(vt,ht);for(let at=0,bt=Rt.length;at<bt;at++)z.push(Rt[at])}}}this.tree.remove(k)}return z}_splitSafely(O,k){this.tree.remove(O);let z=O.rightSE;this.queue.remove(z);let Y=O.split(k);return Y.push(z),O.consumedBy===void 0&&this.tree.add(O),Y}};l(Et,"SweepLine");let co=Et,Ji=typeof P<"u"&&P.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,po=typeof P<"u"&&P.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,$m=class $m{run(O,k,z){wt.type=O,W.reset();let Y=[new Wr(k,!0)];for(let at=0,bt=z.length;at<bt;at++)Y.push(new Wr(z[at],!1));if(wt.numMultiPolys=Y.length,wt.type==="difference"){let at=Y[0],bt=1;for(;bt<Y.length;)T(Y[bt].bbox,at.bbox)!==null?bt++:Y.splice(bt,1)}if(wt.type==="intersection")for(let at=0,bt=Y.length;at<bt;at++){let gt=Y[at];for(let Qt=at+1,qt=Y.length;Qt<qt;Qt++)if(T(gt.bbox,Y[Qt].bbox)===null)return[]}let X=new d(de.compare);for(let at=0,bt=Y.length;at<bt;at++){let gt=Y[at].getSweepEvents();for(let Qt=0,qt=gt.length;Qt<qt;Qt++)if(X.insert(gt[Qt]),X.size>Ji)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let pt=new co(X),lt=X.size,vt=X.pop();for(;vt;){let at=vt.key;if(X.size===lt){let gt=at.segment;throw new Error("Unable to pop() ".concat(at.isLeft?"left":"right"," SweepEvent ")+"[".concat(at.point.x,", ").concat(at.point.y,"] from segment #").concat(gt.id," ")+"[".concat(gt.leftSE.point.x,", ").concat(gt.leftSE.point.y,"] -> ")+"[".concat(gt.rightSE.point.x,", ").concat(gt.rightSE.point.y,"] from queue."))}if(X.size>Ji)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(pt.segments.length>po)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let bt=pt.process(at);for(let gt=0,Qt=bt.length;gt<Qt;gt++){let qt=bt[gt];qt.consumedBy===void 0&&X.insert(qt)}lt=X.size,vt=X.pop()}W.reset();let ht=$i.factory(pt.segments);return new mr(ht).getGeom()}};l($m,"Operation");let En=$m,wt=new En;var Pa={union:l(function(et){for(var O=arguments.length,k=new Array(O>1?O-1:0),z=1;z<O;z++)k[z-1]=arguments[z];return wt.run("union",et,k)},"union"),intersection:l(function(et){for(var O=arguments.length,k=new Array(O>1?O-1:0),z=1;z<O;z++)k[z-1]=arguments[z];return wt.run("intersection",et,k)},"intersection"),xor:l(function(et){for(var O=arguments.length,k=new Array(O>1?O-1:0),z=1;z<O;z++)k[z-1]=arguments[z];return wt.run("xor",et,k)},"xor"),difference:l(function(et){for(var O=arguments.length,k=new Array(O>1?O-1:0),z=1;z<O;z++)k[z-1]=arguments[z];return wt.run("difference",et,k)},"difference")};return Pa})});var X6=Lt((zv,H6)=>{y();(function(r,t){typeof zv=="object"&&typeof H6<"u"?t(zv):typeof define=="function"&&define.amd?define(["exports"],t):t(r.jsts={})})(zv,function(r){"use strict";function t(){}l(t,"e");function e(o){this.message=o||""}l(e,"n");function n(o){this.message=o||""}l(n,"i");function i(o){this.message=o||""}l(i,"r");function a(){}l(a,"o");function u(o){return o===null?ht:o.color}l(u,"s");function h(o){return o===null?null:o.parent}l(h,"a");function d(o,s){o!==null&&(o.color=s)}l(d,"u");function m(o){return o===null?null:o.left}l(m,"l");function v(o){return o===null?null:o.right}l(v,"c");function x(){this.root_=null,this.size_=0}l(x,"p");function S(){}l(S,"h");function I(){this.array_=[],arguments[0]instanceof Rr&&this.addAll(arguments[0])}l(I,"f");function w(){}l(w,"g");function E(o){this.message=o||""}l(E,"d");function T(){this.array_=[]}l(T,"y"),"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:l(function(o){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var s=Object(this),c=Math.max(Math.min(s.length,9007199254740991),0)||0,f=1 in arguments&&parseInt(Number(arguments[1]),10)||0;f=f<0?Math.max(c+f,0):Math.min(f,c);var g=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:c;for(g=g<0?Math.max(c+arguments[2],0):Math.min(g,c);f<g;)s[f]=o,++f;return s},"value"),writable:!0}),Number.isFinite=Number.isFinite||function(o){return typeof o=="number"&&isFinite(o)},Number.isInteger=Number.isInteger||function(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(o){return o!=o},Math.trunc=Math.trunc||function(o){return o<0?Math.ceil(o):Math.floor(o)};var D=l(function(){},"_");D.prototype.interfaces_=function(){return[]},D.prototype.getClass=function(){return D},D.prototype.equalsWithTolerance=function(o,s,c){return Math.abs(o-s)<=c};var A=function(o){function s(c){o.call(this,c),this.name="IllegalArgumentException",this.message=c,this.stack=new o().stack}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(Error),L=l(function(){},"v"),B={MAX_VALUE:{configurable:!0}};L.isNaN=function(o){return Number.isNaN(o)},L.doubleToLongBits=function(o){return o},L.longBitsToDouble=function(o){return o},L.isInfinite=function(o){return!Number.isFinite(o)},B.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(L,B);var j=l(function(){},"E"),W=l(function(){},"x"),$=l(function(){},"N"),F=l(function o(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=o.NULL_ORDINATE;else if(arguments.length===1){var s=arguments[0];this.x=s.x,this.y=s.y,this.z=s.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=o.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},"t"),J={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};F.prototype.setOrdinate=function(o,s){switch(o){case F.X:this.x=s;break;case F.Y:this.y=s;break;case F.Z:this.z=s;break;default:throw new A("Invalid ordinate index: "+o)}},F.prototype.equals2D=function(){if(arguments.length===1){var o=arguments[0];return this.x===o.x&&this.y===o.y}if(arguments.length===2){var s=arguments[0],c=arguments[1];return!!D.equalsWithTolerance(this.x,s.x,c)&&!!D.equalsWithTolerance(this.y,s.y,c)}},F.prototype.getOrdinate=function(o){switch(o){case F.X:return this.x;case F.Y:return this.y;case F.Z:return this.z}throw new A("Invalid ordinate index: "+o)},F.prototype.equals3D=function(o){return this.x===o.x&&this.y===o.y&&(this.z===o.z||L.isNaN(this.z))&&L.isNaN(o.z)},F.prototype.equals=function(o){return o instanceof F&&this.equals2D(o)},F.prototype.equalInZ=function(o,s){return D.equalsWithTolerance(this.z,o.z,s)},F.prototype.compareTo=function(o){var s=o;return this.x<s.x?-1:this.x>s.x?1:this.y<s.y?-1:this.y>s.y?1:0},F.prototype.clone=function(){},F.prototype.copy=function(){return new F(this)},F.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},F.prototype.distance3D=function(o){var s=this.x-o.x,c=this.y-o.y,f=this.z-o.z;return Math.sqrt(s*s+c*c+f*f)},F.prototype.distance=function(o){var s=this.x-o.x,c=this.y-o.y;return Math.sqrt(s*s+c*c)},F.prototype.hashCode=function(){var o=17;return o=37*o+F.hashCode(this.x),o=37*o+F.hashCode(this.y)},F.prototype.setCoordinate=function(o){this.x=o.x,this.y=o.y,this.z=o.z},F.prototype.interfaces_=function(){return[j,W,t]},F.prototype.getClass=function(){return F},F.hashCode=function(){if(arguments.length===1){var o=arguments[0],s=L.doubleToLongBits(o);return Math.trunc((s^s)>>>32)}},J.DimensionalComparator.get=function(){return ot},J.serialVersionUID.get=function(){return 6683108902428367e3},J.NULL_ORDINATE.get=function(){return L.NaN},J.X.get=function(){return 0},J.Y.get=function(){return 1},J.Z.get=function(){return 2},Object.defineProperties(F,J);var ot=l(function(o){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var s=arguments[0];if(s!==2&&s!==3)throw new A("only 2 or 3 dimensions may be specified");this._dimensionsToTest=s}}},"L");ot.prototype.compare=function(o,s){var c=o,f=s,g=ot.compare(c.x,f.x);if(g!==0)return g;var _=ot.compare(c.y,f.y);return _!==0?_:this._dimensionsToTest<=2?0:ot.compare(c.z,f.z)},ot.prototype.interfaces_=function(){return[$]},ot.prototype.getClass=function(){return ot},ot.compare=function(o,s){return o<s?-1:o>s?1:L.isNaN(o)?L.isNaN(s)?0:-1:L.isNaN(s)?1:0};var K=l(function(){},"b");K.prototype.create=function(){},K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K};var H=l(function(){},"w"),_t={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.toLocationSymbol=function(o){switch(o){case H.EXTERIOR:return"e";case H.BOUNDARY:return"b";case H.INTERIOR:return"i";case H.NONE:return"-"}throw new A("Unknown location value: "+o)},_t.INTERIOR.get=function(){return 0},_t.BOUNDARY.get=function(){return 1},_t.EXTERIOR.get=function(){return 2},_t.NONE.get=function(){return-1},Object.defineProperties(H,_t);var ct=l(function(o,s){return o.interfaces_&&o.interfaces_().indexOf(s)>-1},"T"),ft=l(function(){},"R"),mt={LOG_10:{configurable:!0}};ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},ft.log10=function(o){var s=Math.log(o);return L.isInfinite(s)||L.isNaN(s)?s:s/ft.LOG_10},ft.min=function(o,s,c,f){var g=o;return s<g&&(g=s),c<g&&(g=c),f<g&&(g=f),g},ft.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],c=arguments[2];return o<s?s:o>c?c:o}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var f=arguments[0],g=arguments[1],_=arguments[2];return f<g?g:f>_?_:f}},ft.wrap=function(o,s){return o<0?s- -o%s:o%s},ft.max=function(){if(arguments.length===3){var o=arguments[0],s=arguments[1],c=arguments[2],f=o;return s>f&&(f=s),c>f&&(f=c),f}if(arguments.length===4){var g=arguments[0],_=arguments[1],M=arguments[2],N=arguments[3],G=g;return _>G&&(G=_),M>G&&(G=M),N>G&&(G=N),G}},ft.average=function(o,s){return(o+s)/2},mt.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(ft,mt);var St=l(function(o){this.str=o},"D");St.prototype.append=function(o){this.str+=o},St.prototype.setCharAt=function(o,s){this.str=this.str.substr(0,o)+s+this.str.substr(o+1)},St.prototype.toString=function(o){return this.str};var dt=l(function(o){this.value=o},"M");dt.prototype.intValue=function(){return this.value},dt.prototype.compareTo=function(o){return this.value<o?-1:this.value>o?1:0},dt.isNaN=function(o){return Number.isNaN(o)};var xt=l(function(){},"A");xt.isWhitespace=function(o){return o<=32&&o>=0||o===127},xt.toUpperCase=function(o){return o.toUpperCase()};var q=l(function o(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var s=arguments[0];this.init(s)}else if(arguments[0]instanceof o){var c=arguments[0];this.init(c)}else if(typeof arguments[0]=="string"){var f=arguments[0];o.call(this,o.parse(f))}}else if(arguments.length===2){var g=arguments[0],_=arguments[1];this.init(g,_)}},"t"),ee={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};q.prototype.le=function(o){return(this._hi<o._hi||this._hi===o._hi)&&this._lo<=o._lo},q.prototype.extractSignificantDigits=function(o,s){var c=this.abs(),f=q.magnitude(c._hi),g=q.TEN.pow(f);(c=c.divide(g)).gt(q.TEN)?(c=c.divide(q.TEN),f+=1):c.lt(q.ONE)&&(c=c.multiply(q.TEN),f-=1);for(var _=f+1,M=new St,N=q.MAX_PRINT_DIGITS-1,G=0;G<=N;G++){o&&G===_&&M.append(".");var Z=Math.trunc(c._hi);if(Z<0)break;var st=!1,ut=0;Z>9?(st=!0,ut="9"):ut="0"+Z,M.append(ut),c=c.subtract(q.valueOf(Z)).multiply(q.TEN),st&&c.selfAdd(q.TEN);var Ot=!0,Dt=q.magnitude(c._hi);if(Dt<0&&Math.abs(Dt)>=N-G&&(Ot=!1),!Ot)break}return s[0]=f,M.toString()},q.prototype.sqr=function(){return this.multiply(this)},q.prototype.doubleValue=function(){return this._hi+this._lo},q.prototype.subtract=function(){if(arguments[0]instanceof q){var o=arguments[0];return this.add(o.negate())}if(typeof arguments[0]=="number"){var s=arguments[0];return this.add(-s)}},q.prototype.equals=function(){if(arguments.length===1){var o=arguments[0];return this._hi===o._hi&&this._lo===o._lo}},q.prototype.isZero=function(){return this._hi===0&&this._lo===0},q.prototype.selfSubtract=function(){if(arguments[0]instanceof q){var o=arguments[0];return this.isNaN()?this:this.selfAdd(-o._hi,-o._lo)}if(typeof arguments[0]=="number"){var s=arguments[0];return this.isNaN()?this:this.selfAdd(-s,0)}},q.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},q.prototype.min=function(o){return this.le(o)?this:o},q.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof q){var o=arguments[0];return this.selfDivide(o._hi,o._lo)}if(typeof arguments[0]=="number"){var s=arguments[0];return this.selfDivide(s,0)}}else if(arguments.length===2){var c=arguments[0],f=arguments[1],g=null,_=null,M=null,N=null,G=null,Z=null,st=null,ut=null;return G=this._hi/c,Z=q.SPLIT*G,g=Z-G,ut=q.SPLIT*c,g=Z-g,_=G-g,M=ut-c,st=G*c,M=ut-M,N=c-M,ut=g*M-st+g*N+_*M+_*N,Z=(this._hi-st-ut+this._lo-G*f)/c,ut=G+Z,this._hi=ut,this._lo=G-ut+Z,this}},q.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},q.prototype.divide=function(){if(arguments[0]instanceof q){var o=arguments[0],s=null,c=null,f=null,g=null,_=null,M=null,N=null,G=null;return c=(_=this._hi/o._hi)-(s=(M=q.SPLIT*_)-(s=M-_)),G=s*(f=(G=q.SPLIT*o._hi)-(f=G-o._hi))-(N=_*o._hi)+s*(g=o._hi-f)+c*f+c*g,M=(this._hi-N-G+this._lo-_*o._lo)/o._hi,new q(G=_+M,_-G+M)}if(typeof arguments[0]=="number"){var Z=arguments[0];return L.isNaN(Z)?q.createNaN():q.copy(this).selfDivide(Z,0)}},q.prototype.ge=function(o){return(this._hi>o._hi||this._hi===o._hi)&&this._lo>=o._lo},q.prototype.pow=function(o){if(o===0)return q.valueOf(1);var s=new q(this),c=q.valueOf(1),f=Math.abs(o);if(f>1)for(;f>0;)f%2==1&&c.selfMultiply(s),(f/=2)>0&&(s=s.sqr());else c=s;return o<0?c.reciprocal():c},q.prototype.ceil=function(){if(this.isNaN())return q.NaN;var o=Math.ceil(this._hi),s=0;return o===this._hi&&(s=Math.ceil(this._lo)),new q(o,s)},q.prototype.compareTo=function(o){var s=o;return this._hi<s._hi?-1:this._hi>s._hi?1:this._lo<s._lo?-1:this._lo>s._lo?1:0},q.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},q.prototype.setValue=function(){if(arguments[0]instanceof q){var o=arguments[0];return this.init(o),this}if(typeof arguments[0]=="number"){var s=arguments[0];return this.init(s),this}},q.prototype.max=function(o){return this.ge(o)?this:o},q.prototype.sqrt=function(){if(this.isZero())return q.valueOf(0);if(this.isNegative())return q.NaN;var o=1/Math.sqrt(this._hi),s=this._hi*o,c=q.valueOf(s),f=this.subtract(c.sqr())._hi*(.5*o);return c.add(f)},q.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof q){var o=arguments[0];return this.selfAdd(o._hi,o._lo)}if(typeof arguments[0]=="number"){var s=arguments[0],c=null,f=null,g=null,_=null,M=null,N=null;return g=this._hi+s,M=g-this._hi,_=g-M,_=s-M+(this._hi-_),N=_+this._lo,c=g+N,f=N+(g-c),this._hi=c+f,this._lo=f+(c-this._hi),this}}else if(arguments.length===2){var G=arguments[0],Z=arguments[1],st=null,ut=null,Ot=null,Dt=null,Bt=null,Wt=null,Cr=null;Dt=this._hi+G,ut=this._lo+Z,Bt=Dt-(Wt=Dt-this._hi),Ot=ut-(Cr=ut-this._lo);var vn=(st=Dt+(Wt=(Bt=G-Wt+(this._hi-Bt))+ut))+(Wt=(Ot=Z-Cr+(this._lo-Ot))+(Wt+(Dt-st))),_i=Wt+(st-vn);return this._hi=vn,this._lo=_i,this}},q.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof q){var o=arguments[0];return this.selfMultiply(o._hi,o._lo)}if(typeof arguments[0]=="number"){var s=arguments[0];return this.selfMultiply(s,0)}}else if(arguments.length===2){var c=arguments[0],f=arguments[1],g=null,_=null,M=null,N=null,G=null,Z=null;g=(G=q.SPLIT*this._hi)-this._hi,Z=q.SPLIT*c,g=G-g,_=this._hi-g,M=Z-c;var st=(G=this._hi*c)+(Z=g*(M=Z-M)-G+g*(N=c-M)+_*M+_*N+(this._hi*f+this._lo*c)),ut=Z+(g=G-st);return this._hi=st,this._lo=ut,this}},q.prototype.selfSqr=function(){return this.selfMultiply(this)},q.prototype.floor=function(){if(this.isNaN())return q.NaN;var o=Math.floor(this._hi),s=0;return o===this._hi&&(s=Math.floor(this._lo)),new q(o,s)},q.prototype.negate=function(){return this.isNaN()?this:new q(-this._hi,-this._lo)},q.prototype.clone=function(){},q.prototype.multiply=function(){if(arguments[0]instanceof q){var o=arguments[0];return o.isNaN()?q.createNaN():q.copy(this).selfMultiply(o)}if(typeof arguments[0]=="number"){var s=arguments[0];return L.isNaN(s)?q.createNaN():q.copy(this).selfMultiply(s,0)}},q.prototype.isNaN=function(){return L.isNaN(this._hi)},q.prototype.intValue=function(){return Math.trunc(this._hi)},q.prototype.toString=function(){var o=q.magnitude(this._hi);return o>=-3&&o<=20?this.toStandardNotation():this.toSciNotation()},q.prototype.toStandardNotation=function(){var o=this.getSpecialNumberString();if(o!==null)return o;var s=new Array(1).fill(null),c=this.extractSignificantDigits(!0,s),f=s[0]+1,g=c;if(c.charAt(0)===".")g="0"+c;else if(f<0)g="0."+q.stringOfChar("0",-f)+c;else if(c.indexOf(".")===-1){var _=f-c.length;g=c+q.stringOfChar("0",_)+".0"}return this.isNegative()?"-"+g:g},q.prototype.reciprocal=function(){var o=null,s=null,c=null,f=null,g=null,_=null,M=null,N=null;s=(g=1/this._hi)-(o=(_=q.SPLIT*g)-(o=_-g)),c=(N=q.SPLIT*this._hi)-this._hi;var G=g+(_=(1-(M=g*this._hi)-(N=o*(c=N-c)-M+o*(f=this._hi-c)+s*c+s*f)-g*this._lo)/this._hi);return new q(G,g-G+_)},q.prototype.toSciNotation=function(){if(this.isZero())return q.SCI_NOT_ZERO;var o=this.getSpecialNumberString();if(o!==null)return o;var s=new Array(1).fill(null),c=this.extractSignificantDigits(!1,s),f=q.SCI_NOT_EXPONENT_CHAR+s[0];if(c.charAt(0)==="0")throw new Error("Found leading zero: "+c);var g="";c.length>1&&(g=c.substring(1));var _=c.charAt(0)+"."+g;return this.isNegative()?"-"+_+f:_+f},q.prototype.abs=function(){return this.isNaN()?q.NaN:this.isNegative()?this.negate():new q(this)},q.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},q.prototype.lt=function(o){return(this._hi<o._hi||this._hi===o._hi)&&this._lo<o._lo},q.prototype.add=function(){if(arguments[0]instanceof q){var o=arguments[0];return q.copy(this).selfAdd(o)}if(typeof arguments[0]=="number"){var s=arguments[0];return q.copy(this).selfAdd(s)}},q.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var o=arguments[0];this._hi=o,this._lo=0}else if(arguments[0]instanceof q){var s=arguments[0];this._hi=s._hi,this._lo=s._lo}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];this._hi=c,this._lo=f}},q.prototype.gt=function(o){return(this._hi>o._hi||this._hi===o._hi)&&this._lo>o._lo},q.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},q.prototype.trunc=function(){return this.isNaN()?q.NaN:this.isPositive()?this.floor():this.ceil()},q.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},q.prototype.interfaces_=function(){return[t,j,W]},q.prototype.getClass=function(){return q},q.sqr=function(o){return q.valueOf(o).selfMultiply(o)},q.valueOf=function(){if(typeof arguments[0]=="string"){var o=arguments[0];return q.parse(o)}if(typeof arguments[0]=="number"){var s=arguments[0];return new q(s)}},q.sqrt=function(o){return q.valueOf(o).sqrt()},q.parse=function(o){for(var s=0,c=o.length;xt.isWhitespace(o.charAt(s));)s++;var f=!1;if(s<c){var g=o.charAt(s);g!=="-"&&g!=="+"||(s++,g==="-"&&(f=!0))}for(var _=new q,M=0,N=0,G=0;!(s>=c);){var Z=o.charAt(s);if(s++,xt.isDigit(Z)){var st=Z-"0";_.selfMultiply(q.TEN),_.selfAdd(st),M++}else{if(Z!=="."){if(Z==="e"||Z==="E"){var ut=o.substring(s);try{G=dt.parseInt(ut)}catch(Cr){throw Cr instanceof Error?new Error("Invalid exponent "+ut+" in string "+o):Cr}break}throw new Error("Unexpected character '"+Z+"' at position "+s+" in string "+o)}N=M}}var Ot=_,Dt=M-N-G;if(Dt===0)Ot=_;else if(Dt>0){var Bt=q.TEN.pow(Dt);Ot=_.divide(Bt)}else if(Dt<0){var Wt=q.TEN.pow(-Dt);Ot=_.multiply(Wt)}return f?Ot.negate():Ot},q.createNaN=function(){return new q(L.NaN,L.NaN)},q.copy=function(o){return new q(o)},q.magnitude=function(o){var s=Math.abs(o),c=Math.log(s)/Math.log(10),f=Math.trunc(Math.floor(c));return 10*Math.pow(10,f)<=s&&(f+=1),f},q.stringOfChar=function(o,s){for(var c=new St,f=0;f<s;f++)c.append(o);return c.toString()},ee.PI.get=function(){return new q(3.141592653589793,12246467991473532e-32)},ee.TWO_PI.get=function(){return new q(6.283185307179586,24492935982947064e-32)},ee.PI_2.get=function(){return new q(1.5707963267948966,6123233995736766e-32)},ee.E.get=function(){return new q(2.718281828459045,14456468917292502e-32)},ee.NaN.get=function(){return new q(L.NaN,L.NaN)},ee.EPS.get=function(){return 123259516440783e-46},ee.SPLIT.get=function(){return 134217729},ee.MAX_PRINT_DIGITS.get=function(){return 32},ee.TEN.get=function(){return q.valueOf(10)},ee.ONE.get=function(){return q.valueOf(1)},ee.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},ee.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(q,ee);var Gt=l(function(){},"q"),Kt={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(o,s,c){var f=Gt.orientationIndexFilter(o,s,c);if(f<=1)return f;var g=q.valueOf(s.x).selfAdd(-o.x),_=q.valueOf(s.y).selfAdd(-o.y),M=q.valueOf(c.x).selfAdd(-s.x),N=q.valueOf(c.y).selfAdd(-s.y);return g.selfMultiply(N).selfSubtract(_.selfMultiply(M)).signum()},Gt.signOfDet2x2=function(o,s,c,f){return o.multiply(f).selfSubtract(s.multiply(c)).signum()},Gt.intersection=function(o,s,c,f){var g=q.valueOf(f.y).selfSubtract(c.y).selfMultiply(q.valueOf(s.x).selfSubtract(o.x)),_=q.valueOf(f.x).selfSubtract(c.x).selfMultiply(q.valueOf(s.y).selfSubtract(o.y)),M=g.subtract(_),N=q.valueOf(f.x).selfSubtract(c.x).selfMultiply(q.valueOf(o.y).selfSubtract(c.y)),G=q.valueOf(f.y).selfSubtract(c.y).selfMultiply(q.valueOf(o.x).selfSubtract(c.x)),Z=N.subtract(G).selfDivide(M).doubleValue(),st=q.valueOf(o.x).selfAdd(q.valueOf(s.x).selfSubtract(o.x).selfMultiply(Z)).doubleValue(),ut=q.valueOf(s.x).selfSubtract(o.x).selfMultiply(q.valueOf(o.y).selfSubtract(c.y)),Ot=q.valueOf(s.y).selfSubtract(o.y).selfMultiply(q.valueOf(o.x).selfSubtract(c.x)),Dt=ut.subtract(Ot).selfDivide(M).doubleValue(),Bt=q.valueOf(c.y).selfAdd(q.valueOf(f.y).selfSubtract(c.y).selfMultiply(Dt)).doubleValue();return new F(st,Bt)},Gt.orientationIndexFilter=function(o,s,c){var f=null,g=(o.x-c.x)*(s.y-c.y),_=(o.y-c.y)*(s.x-c.x),M=g-_;if(g>0){if(_<=0)return Gt.signum(M);f=g+_}else{if(!(g<0)||_>=0)return Gt.signum(M);f=-g-_}var N=Gt.DP_SAFE_EPSILON*f;return M>=N||-M>=N?Gt.signum(M):2},Gt.signum=function(o){return o>0?1:o<0?-1:0},Kt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,Kt);var It=l(function(){},"V"),ie={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ie.X.get=function(){return 0},ie.Y.get=function(){return 1},ie.Z.get=function(){return 2},ie.M.get=function(){return 3},It.prototype.setOrdinate=function(o,s,c){},It.prototype.size=function(){},It.prototype.getOrdinate=function(o,s){},It.prototype.getCoordinate=function(){},It.prototype.getCoordinateCopy=function(o){},It.prototype.getDimension=function(){},It.prototype.getX=function(o){},It.prototype.clone=function(){},It.prototype.expandEnvelope=function(o){},It.prototype.copy=function(){},It.prototype.getY=function(o){},It.prototype.toCoordinateArray=function(){},It.prototype.interfaces_=function(){return[W]},It.prototype.getClass=function(){return It},Object.defineProperties(It,ie);var vr=l(function(){},"z"),Qe=function(o){function s(){o.call(this,"Projective point not representable on the Cartesian plane.")}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(vr),Nt=l(function(){},"Y");Nt.arraycopy=function(o,s,c,f,g){for(var _=0,M=s;M<s+g;M++)c[f+_]=o[M],_++},Nt.getProperty=function(o){return{"line.separator":"\n"}[o]};var At=l(function o(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var s=arguments[0];this.x=s.x,this.y=s.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1];this.x=c,this.y=f,this.w=1}else if(arguments[0]instanceof o&&arguments[1]instanceof o){var g=arguments[0],_=arguments[1];this.x=g.y*_.w-_.y*g.w,this.y=_.x*g.w-g.x*_.w,this.w=g.x*_.y-_.x*g.y}else if(arguments[0]instanceof F&&arguments[1]instanceof F){var M=arguments[0],N=arguments[1];this.x=M.y-N.y,this.y=N.x-M.x,this.w=M.x*N.y-N.x*M.y}}else if(arguments.length===3){var G=arguments[0],Z=arguments[1],st=arguments[2];this.x=G,this.y=Z,this.w=st}else if(arguments.length===4){var ut=arguments[0],Ot=arguments[1],Dt=arguments[2],Bt=arguments[3],Wt=ut.y-Ot.y,Cr=Ot.x-ut.x,vn=ut.x*Ot.y-Ot.x*ut.y,_i=Dt.y-Bt.y,ta=Bt.x-Dt.x,Vl=Dt.x*Bt.y-Bt.x*Dt.y;this.x=Cr*Vl-ta*vn,this.y=_i*vn-Wt*Vl,this.w=Wt*ta-_i*Cr}},"t");At.prototype.getY=function(){var o=this.y/this.w;if(L.isNaN(o)||L.isInfinite(o))throw new Qe;return o},At.prototype.getX=function(){var o=this.x/this.w;if(L.isNaN(o)||L.isInfinite(o))throw new Qe;return o},At.prototype.getCoordinate=function(){var o=new F;return o.x=this.getX(),o.y=this.getY(),o},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.intersection=function(o,s,c,f){var g=o.y-s.y,_=s.x-o.x,M=o.x*s.y-s.x*o.y,N=c.y-f.y,G=f.x-c.x,Z=c.x*f.y-f.x*c.y,st=g*G-N*_,ut=(_*Z-G*M)/st,Ot=(N*M-g*Z)/st;if(L.isNaN(ut)||L.isInfinite(ut)||L.isNaN(Ot)||L.isInfinite(Ot))throw new Qe;return new F(ut,Ot)};var Ct=l(function o(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof F){var s=arguments[0];this.init(s.x,s.x,s.y,s.y)}else if(arguments[0]instanceof o){var c=arguments[0];this.init(c)}}else if(arguments.length===2){var f=arguments[0],g=arguments[1];this.init(f.x,g.x,f.y,g.y)}else if(arguments.length===4){var _=arguments[0],M=arguments[1],N=arguments[2],G=arguments[3];this.init(_,M,N,G)}},"t"),_e={serialVersionUID:{configurable:!0}};Ct.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Ct.prototype.equals=function(o){if(!(o instanceof Ct))return!1;var s=o;return this.isNull()?s.isNull():this._maxx===s.getMaxX()&&this._maxy===s.getMaxY()&&this._minx===s.getMinX()&&this._miny===s.getMinY()},Ct.prototype.intersection=function(o){if(this.isNull()||o.isNull()||!this.intersects(o))return new Ct;var s=this._minx>o._minx?this._minx:o._minx,c=this._miny>o._miny?this._miny:o._miny,f=this._maxx<o._maxx?this._maxx:o._maxx,g=this._maxy<o._maxy?this._maxy:o._maxy;return new Ct(s,f,c,g)},Ct.prototype.isNull=function(){return this._maxx<this._minx},Ct.prototype.getMaxX=function(){return this._maxx},Ct.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof F){var o=arguments[0];return this.covers(o.x,o.y)}if(arguments[0]instanceof Ct){var s=arguments[0];return!this.isNull()&&!s.isNull()&&s.getMinX()>=this._minx&&s.getMaxX()<=this._maxx&&s.getMinY()>=this._miny&&s.getMaxY()<=this._maxy}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];return!this.isNull()&&c>=this._minx&&c<=this._maxx&&f>=this._miny&&f<=this._maxy}},Ct.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Ct){var o=arguments[0];return!this.isNull()&&!o.isNull()&&!(o._minx>this._maxx||o._maxx<this._minx||o._miny>this._maxy||o._maxy<this._miny)}if(arguments[0]instanceof F){var s=arguments[0];return this.intersects(s.x,s.y)}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];return!this.isNull()&&!(c>this._maxx||c<this._minx||f>this._maxy||f<this._miny)}},Ct.prototype.getMinY=function(){return this._miny},Ct.prototype.getMinX=function(){return this._minx},Ct.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof F){var o=arguments[0];this.expandToInclude(o.x,o.y)}else if(arguments[0]instanceof Ct){var s=arguments[0];if(s.isNull())return null;this.isNull()?(this._minx=s.getMinX(),this._maxx=s.getMaxX(),this._miny=s.getMinY(),this._maxy=s.getMaxY()):(s._minx<this._minx&&(this._minx=s._minx),s._maxx>this._maxx&&(this._maxx=s._maxx),s._miny<this._miny&&(this._miny=s._miny),s._maxy>this._maxy&&(this._maxy=s._maxy))}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];this.isNull()?(this._minx=c,this._maxx=c,this._miny=f,this._maxy=f):(c<this._minx&&(this._minx=c),c>this._maxx&&(this._maxx=c),f<this._miny&&(this._miny=f),f>this._maxy&&(this._maxy=f))}},Ct.prototype.minExtent=function(){if(this.isNull())return 0;var o=this.getWidth(),s=this.getHeight();return o<s?o:s},Ct.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Ct.prototype.compareTo=function(o){var s=o;return this.isNull()?s.isNull()?0:-1:s.isNull()?1:this._minx<s._minx?-1:this._minx>s._minx?1:this._miny<s._miny?-1:this._miny>s._miny?1:this._maxx<s._maxx?-1:this._maxx>s._maxx?1:this._maxy<s._maxy?-1:this._maxy>s._maxy?1:0},Ct.prototype.translate=function(o,s){if(this.isNull())return null;this.init(this.getMinX()+o,this.getMaxX()+o,this.getMinY()+s,this.getMaxY()+s)},Ct.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Ct.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Ct.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Ct.prototype.maxExtent=function(){if(this.isNull())return 0;var o=this.getWidth(),s=this.getHeight();return o>s?o:s},Ct.prototype.expandBy=function(){if(arguments.length===1){var o=arguments[0];this.expandBy(o,o)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];if(this.isNull())return null;this._minx-=s,this._maxx+=s,this._miny-=c,this._maxy+=c,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Ct.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Ct){var o=arguments[0];return this.covers(o)}if(arguments[0]instanceof F){var s=arguments[0];return this.covers(s)}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];return this.covers(c,f)}},Ct.prototype.centre=function(){return this.isNull()?null:new F((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Ct.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof F){var o=arguments[0];this.init(o.x,o.x,o.y,o.y)}else if(arguments[0]instanceof Ct){var s=arguments[0];this._minx=s._minx,this._maxx=s._maxx,this._miny=s._miny,this._maxy=s._maxy}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];this.init(c.x,f.x,c.y,f.y)}else if(arguments.length===4){var g=arguments[0],_=arguments[1],M=arguments[2],N=arguments[3];g<_?(this._minx=g,this._maxx=_):(this._minx=_,this._maxx=g),M<N?(this._miny=M,this._maxy=N):(this._miny=N,this._maxy=M)}},Ct.prototype.getMaxY=function(){return this._maxy},Ct.prototype.distance=function(o){if(this.intersects(o))return 0;var s=0;this._maxx<o._minx?s=o._minx-this._maxx:this._minx>o._maxx&&(s=this._minx-o._maxx);var c=0;return this._maxy<o._miny?c=o._miny-this._maxy:this._miny>o._maxy&&(c=this._miny-o._maxy),s===0?c:c===0?s:Math.sqrt(s*s+c*c)},Ct.prototype.hashCode=function(){var o=17;return o=37*o+F.hashCode(this._minx),o=37*o+F.hashCode(this._maxx),o=37*o+F.hashCode(this._miny),o=37*o+F.hashCode(this._maxy)},Ct.prototype.interfaces_=function(){return[j,t]},Ct.prototype.getClass=function(){return Ct},Ct.intersects=function(){if(arguments.length===3){var o=arguments[0],s=arguments[1],c=arguments[2];return c.x>=(o.x<s.x?o.x:s.x)&&c.x<=(o.x>s.x?o.x:s.x)&&c.y>=(o.y<s.y?o.y:s.y)&&c.y<=(o.y>s.y?o.y:s.y)}if(arguments.length===4){var f=arguments[0],g=arguments[1],_=arguments[2],M=arguments[3],N=Math.min(_.x,M.x),G=Math.max(_.x,M.x),Z=Math.min(f.x,g.x),st=Math.max(f.x,g.x);return!(Z>G)&&!(st<N)&&(N=Math.min(_.y,M.y),G=Math.max(_.y,M.y),Z=Math.min(f.y,g.y),st=Math.max(f.y,g.y),!(Z>G)&&!(st<N))}},_e.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Ct,_e);var de={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},qr=l(function(o){this.geometryFactory=o||new ge},"K");qr.prototype.read=function(o){var s,c,f;o=o.replace(/[\n\r]/g," ");var g=de.typeStr.exec(o);if(o.search("EMPTY")!==-1&&((g=de.emptyTypeStr.exec(o))[2]=void 0),g&&(c=g[1].toLowerCase(),f=g[2],Se[c]&&(s=Se[c].apply(this,[f]))),s===void 0)throw new Error("Could not parse WKT "+o);return s},qr.prototype.write=function(o){return this.extractGeometry(o)},qr.prototype.extractGeometry=function(o){var s=o.getGeometryType().toLowerCase();if(!me[s])return null;var c=s.toUpperCase();return o.isEmpty()?c+" EMPTY":c+"("+me[s].apply(this,[o])+")"};var me={coordinate:l(function(o){return o.x+" "+o.y},"coordinate"),point:l(function(o){return me.coordinate.call(this,o._coordinates._coordinates[0])},"point"),multipoint:l(function(o){for(var s=[],c=0,f=o._geometries.length;c<f;++c)s.push("("+me.point.apply(this,[o._geometries[c]])+")");return s.join(",")},"multipoint"),linestring:l(function(o){for(var s=[],c=0,f=o._points._coordinates.length;c<f;++c)s.push(me.coordinate.apply(this,[o._points._coordinates[c]]));return s.join(",")},"linestring"),linearring:l(function(o){for(var s=[],c=0,f=o._points._coordinates.length;c<f;++c)s.push(me.coordinate.apply(this,[o._points._coordinates[c]]));return s.join(",")},"linearring"),multilinestring:l(function(o){for(var s=[],c=0,f=o._geometries.length;c<f;++c)s.push("("+me.linestring.apply(this,[o._geometries[c]])+")");return s.join(",")},"multilinestring"),polygon:l(function(o){var s=[];s.push("("+me.linestring.apply(this,[o._shell])+")");for(var c=0,f=o._holes.length;c<f;++c)s.push("("+me.linestring.apply(this,[o._holes[c]])+")");return s.join(",")},"polygon"),multipolygon:l(function(o){for(var s=[],c=0,f=o._geometries.length;c<f;++c)s.push("("+me.polygon.apply(this,[o._geometries[c]])+")");return s.join(",")},"multipolygon"),geometrycollection:l(function(o){for(var s=[],c=0,f=o._geometries.length;c<f;++c)s.push(this.extractGeometry(o._geometries[c]));return s.join(",")},"geometrycollection")},Se={point:l(function(o){if(o===void 0)return this.geometryFactory.createPoint();var s=o.trim().split(de.spaces);return this.geometryFactory.createPoint(new F(Number.parseFloat(s[0]),Number.parseFloat(s[1])))},"point"),multipoint:l(function(o){if(o===void 0)return this.geometryFactory.createMultiPoint();for(var s,c=o.trim().split(","),f=[],g=0,_=c.length;g<_;++g)s=c[g].replace(de.trimParens,"$1"),f.push(Se.point.apply(this,[s]));return this.geometryFactory.createMultiPoint(f)},"multipoint"),linestring:l(function(o){if(o===void 0)return this.geometryFactory.createLineString();for(var s,c=o.trim().split(","),f=[],g=0,_=c.length;g<_;++g)s=c[g].trim().split(de.spaces),f.push(new F(Number.parseFloat(s[0]),Number.parseFloat(s[1])));return this.geometryFactory.createLineString(f)},"linestring"),linearring:l(function(o){if(o===void 0)return this.geometryFactory.createLinearRing();for(var s,c=o.trim().split(","),f=[],g=0,_=c.length;g<_;++g)s=c[g].trim().split(de.spaces),f.push(new F(Number.parseFloat(s[0]),Number.parseFloat(s[1])));return this.geometryFactory.createLinearRing(f)},"linearring"),multilinestring:l(function(o){if(o===void 0)return this.geometryFactory.createMultiLineString();for(var s,c=o.trim().split(de.parenComma),f=[],g=0,_=c.length;g<_;++g)s=c[g].replace(de.trimParens,"$1"),f.push(Se.linestring.apply(this,[s]));return this.geometryFactory.createMultiLineString(f)},"multilinestring"),polygon:l(function(o){if(o===void 0)return this.geometryFactory.createPolygon();for(var s,c,f,g,_=o.trim().split(de.parenComma),M=[],N=0,G=_.length;N<G;++N)s=_[N].replace(de.trimParens,"$1"),c=Se.linestring.apply(this,[s]),f=this.geometryFactory.createLinearRing(c._points),N===0?g=f:M.push(f);return this.geometryFactory.createPolygon(g,M)},"polygon"),multipolygon:l(function(o){if(o===void 0)return this.geometryFactory.createMultiPolygon();for(var s,c=o.trim().split(de.doubleParenComma),f=[],g=0,_=c.length;g<_;++g)s=c[g].replace(de.trimParens,"$1"),f.push(Se.polygon.apply(this,[s]));return this.geometryFactory.createMultiPolygon(f)},"multipolygon"),geometrycollection:l(function(o){if(o===void 0)return this.geometryFactory.createGeometryCollection();for(var s=(o=o.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),c=[],f=0,g=s.length;f<g;++f)c.push(this.read(s[f]));return this.geometryFactory.createGeometryCollection(c)},"geometrycollection")},br=l(function(o){this.parser=new qr(o)},"Z");br.prototype.write=function(o){return this.parser.write(o)},br.toLineString=function(o,s){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+o.x+" "+o.y+", "+s.x+" "+s.y+" )"};var Wr=function(o){function s(c){o.call(this,c),this.name="RuntimeException",this.message=c,this.stack=new o().stack}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(Error),$i=function(o){function s(){if(o.call(this),arguments.length===0)o.call(this);else if(arguments.length===1){var c=arguments[0];o.call(this,c)}}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(Wr),Yt=l(function(){},"et");Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.shouldNeverReachHere=function(){if(arguments.length===0)Yt.shouldNeverReachHere(null);else if(arguments.length===1){var o=arguments[0];throw new $i("Should never reach here"+(o!==null?": "+o:""))}},Yt.isTrue=function(){var o,s;if(arguments.length===1)o=arguments[0],Yt.isTrue(o,null);else if(arguments.length===2&&(o=arguments[0],s=arguments[1],!o))throw s===null?new $i:new $i(s)},Yt.equals=function(){var o,s,c;if(arguments.length===2)o=arguments[0],s=arguments[1],Yt.equals(o,s,null);else if(arguments.length===3&&(o=arguments[0],s=arguments[1],c=arguments[2],!s.equals(o)))throw new $i("Expected "+o+" but encountered "+s+(c!==null?": "+c:""))};var mr=l(function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new F,this._intPt[1]=new F,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},"nt"),co={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};mr.prototype.getIndexAlongSegment=function(o,s){return this.computeIntLineIndex(),this._intLineIndex[o][s]},mr.prototype.getTopologySummary=function(){var o=new St;return this.isEndPoint()&&o.append(" endpoint"),this._isProper&&o.append(" proper"),this.isCollinear()&&o.append(" collinear"),o.toString()},mr.prototype.computeIntersection=function(o,s,c,f){this._inputLines[0][0]=o,this._inputLines[0][1]=s,this._inputLines[1][0]=c,this._inputLines[1][1]=f,this._result=this.computeIntersect(o,s,c,f)},mr.prototype.getIntersectionNum=function(){return this._result},mr.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var o=arguments[0];this.getEdgeDistance(o,0)>this.getEdgeDistance(o,1)?(this._intLineIndex[o][0]=0,this._intLineIndex[o][1]=1):(this._intLineIndex[o][0]=1,this._intLineIndex[o][1]=0)}},mr.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},mr.prototype.setPrecisionModel=function(o){this._precisionModel=o},mr.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var o=arguments[0],s=0;s<this._result;s++)if(!this._intPt[s].equals2D(this._inputLines[o][0])&&!this._intPt[s].equals2D(this._inputLines[o][1]))return!0;return!1}},mr.prototype.getIntersection=function(o){return this._intPt[o]},mr.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},mr.prototype.hasIntersection=function(){return this._result!==mr.NO_INTERSECTION},mr.prototype.getEdgeDistance=function(o,s){return mr.computeEdgeDistance(this._intPt[s],this._inputLines[o][0],this._inputLines[o][1])},mr.prototype.isCollinear=function(){return this._result===mr.COLLINEAR_INTERSECTION},mr.prototype.toString=function(){return br.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+br.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},mr.prototype.getEndpoint=function(o,s){return this._inputLines[o][s]},mr.prototype.isIntersection=function(o){for(var s=0;s<this._result;s++)if(this._intPt[s].equals2D(o))return!0;return!1},mr.prototype.getIntersectionAlongSegment=function(o,s){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[o][s]]},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.computeEdgeDistance=function(o,s,c){var f=Math.abs(c.x-s.x),g=Math.abs(c.y-s.y),_=-1;if(o.equals(s))_=0;else if(o.equals(c))_=f>g?f:g;else{var M=Math.abs(o.x-s.x),N=Math.abs(o.y-s.y);(_=f>g?M:N)!==0||o.equals(s)||(_=Math.max(M,N))}return Yt.isTrue(!(_===0&&!o.equals(s)),"Bad distance calculation"),_},mr.nonRobustComputeEdgeDistance=function(o,s,c){var f=o.x-s.x,g=o.y-s.y,_=Math.sqrt(f*f+g*g);return Yt.isTrue(!(_===0&&!o.equals(s)),"Invalid distance calculation"),_},co.DONT_INTERSECT.get=function(){return 0},co.DO_INTERSECT.get=function(){return 1},co.COLLINEAR.get=function(){return 2},co.NO_INTERSECTION.get=function(){return 0},co.POINT_INTERSECTION.get=function(){return 1},co.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(mr,co);var Ji=function(o){function s(){o.apply(this,arguments)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.isInSegmentEnvelopes=function(c){var f=new Ct(this._inputLines[0][0],this._inputLines[0][1]),g=new Ct(this._inputLines[1][0],this._inputLines[1][1]);return f.contains(c)&&g.contains(c)},s.prototype.computeIntersection=function(){if(arguments.length!==3)return o.prototype.computeIntersection.apply(this,arguments);var c=arguments[0],f=arguments[1],g=arguments[2];if(this._isProper=!1,Ct.intersects(f,g,c)&&wt.orientationIndex(f,g,c)===0&&wt.orientationIndex(g,f,c)===0)return this._isProper=!0,(c.equals(f)||c.equals(g))&&(this._isProper=!1),this._result=o.POINT_INTERSECTION,null;this._result=o.NO_INTERSECTION},s.prototype.normalizeToMinimum=function(c,f,g,_,M){M.x=this.smallestInAbsValue(c.x,f.x,g.x,_.x),M.y=this.smallestInAbsValue(c.y,f.y,g.y,_.y),c.x-=M.x,c.y-=M.y,f.x-=M.x,f.y-=M.y,g.x-=M.x,g.y-=M.y,_.x-=M.x,_.y-=M.y},s.prototype.safeHCoordinateIntersection=function(c,f,g,_){var M=null;try{M=At.intersection(c,f,g,_)}catch(N){if(!(N instanceof Qe))throw N;M=s.nearestEndpoint(c,f,g,_)}return M},s.prototype.intersection=function(c,f,g,_){var M=this.intersectionWithNormalization(c,f,g,_);return this.isInSegmentEnvelopes(M)||(M=new F(s.nearestEndpoint(c,f,g,_))),this._precisionModel!==null&&this._precisionModel.makePrecise(M),M},s.prototype.smallestInAbsValue=function(c,f,g,_){var M=c,N=Math.abs(M);return Math.abs(f)<N&&(M=f,N=Math.abs(f)),Math.abs(g)<N&&(M=g,N=Math.abs(g)),Math.abs(_)<N&&(M=_),M},s.prototype.checkDD=function(c,f,g,_,M){var N=Gt.intersection(c,f,g,_),G=this.isInSegmentEnvelopes(N);Nt.out.println("DD in env = "+G+" --------------------- "+N),M.distance(N)>1e-4&&Nt.out.println("Distance = "+M.distance(N))},s.prototype.intersectionWithNormalization=function(c,f,g,_){var M=new F(c),N=new F(f),G=new F(g),Z=new F(_),st=new F;this.normalizeToEnvCentre(M,N,G,Z,st);var ut=this.safeHCoordinateIntersection(M,N,G,Z);return ut.x+=st.x,ut.y+=st.y,ut},s.prototype.computeCollinearIntersection=function(c,f,g,_){var M=Ct.intersects(c,f,g),N=Ct.intersects(c,f,_),G=Ct.intersects(g,_,c),Z=Ct.intersects(g,_,f);return M&&N?(this._intPt[0]=g,this._intPt[1]=_,o.COLLINEAR_INTERSECTION):G&&Z?(this._intPt[0]=c,this._intPt[1]=f,o.COLLINEAR_INTERSECTION):M&&G?(this._intPt[0]=g,this._intPt[1]=c,!g.equals(c)||N||Z?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):M&&Z?(this._intPt[0]=g,this._intPt[1]=f,!g.equals(f)||N||G?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):N&&G?(this._intPt[0]=_,this._intPt[1]=c,!_.equals(c)||M||Z?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):N&&Z?(this._intPt[0]=_,this._intPt[1]=f,!_.equals(f)||M||G?o.COLLINEAR_INTERSECTION:o.POINT_INTERSECTION):o.NO_INTERSECTION},s.prototype.normalizeToEnvCentre=function(c,f,g,_,M){var N=c.x<f.x?c.x:f.x,G=c.y<f.y?c.y:f.y,Z=c.x>f.x?c.x:f.x,st=c.y>f.y?c.y:f.y,ut=g.x<_.x?g.x:_.x,Ot=g.y<_.y?g.y:_.y,Dt=g.x>_.x?g.x:_.x,Bt=g.y>_.y?g.y:_.y,Wt=((N>ut?N:ut)+(Z<Dt?Z:Dt))/2,Cr=((G>Ot?G:Ot)+(st<Bt?st:Bt))/2;M.x=Wt,M.y=Cr,c.x-=M.x,c.y-=M.y,f.x-=M.x,f.y-=M.y,g.x-=M.x,g.y-=M.y,_.x-=M.x,_.y-=M.y},s.prototype.computeIntersect=function(c,f,g,_){if(this._isProper=!1,!Ct.intersects(c,f,g,_))return o.NO_INTERSECTION;var M=wt.orientationIndex(c,f,g),N=wt.orientationIndex(c,f,_);if(M>0&&N>0||M<0&&N<0)return o.NO_INTERSECTION;var G=wt.orientationIndex(g,_,c),Z=wt.orientationIndex(g,_,f);return G>0&&Z>0||G<0&&Z<0?o.NO_INTERSECTION:M===0&&N===0&&G===0&&Z===0?this.computeCollinearIntersection(c,f,g,_):(M===0||N===0||G===0||Z===0?(this._isProper=!1,c.equals2D(g)||c.equals2D(_)?this._intPt[0]=c:f.equals2D(g)||f.equals2D(_)?this._intPt[0]=f:M===0?this._intPt[0]=new F(g):N===0?this._intPt[0]=new F(_):G===0?this._intPt[0]=new F(c):Z===0&&(this._intPt[0]=new F(f))):(this._isProper=!0,this._intPt[0]=this.intersection(c,f,g,_)),o.POINT_INTERSECTION)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s.nearestEndpoint=function(c,f,g,_){var M=c,N=wt.distancePointLine(c,g,_),G=wt.distancePointLine(f,g,_);return G<N&&(N=G,M=f),(G=wt.distancePointLine(g,c,f))<N&&(N=G,M=g),(G=wt.distancePointLine(_,c,f))<N&&(N=G,M=_),M},s}(mr),po=l(function(){},"ot");po.prototype.interfaces_=function(){return[]},po.prototype.getClass=function(){return po},po.orientationIndex=function(o,s,c){var f=s.x-o.x,g=s.y-o.y,_=c.x-s.x,M=c.y-s.y;return po.signOfDet2x2(f,g,_,M)},po.signOfDet2x2=function(o,s,c,f){var g=null,_=null,M=null;if(g=1,o===0||f===0)return s===0||c===0?0:s>0?c>0?-g:g:c>0?g:-g;if(s===0||c===0)return f>0?o>0?g:-g:o>0?-g:g;if(s>0?f>0?s<=f||(g=-g,_=o,o=c,c=_,_=s,s=f,f=_):s<=-f?(g=-g,c=-c,f=-f):(_=o,o=-c,c=_,_=s,s=-f,f=_):f>0?-s<=f?(g=-g,o=-o,s=-s):(_=-o,o=c,c=_,_=-s,s=f,f=_):s>=f?(o=-o,s=-s,c=-c,f=-f):(g=-g,_=-o,o=-c,c=_,_=-s,s=-f,f=_),o>0){if(!(c>0)||!(o<=c))return g}else{if(c>0||!(o>=c))return-g;g=-g,o=-o,c=-c}for(;;){if(M=Math.floor(c/o),c-=M*o,(f-=M*s)<0)return-g;if(f>s)return g;if(o>c+c){if(s<f+f)return g}else{if(s>f+f)return-g;c=o-c,f=s-f,g=-g}if(f===0)return c===0?0:-g;if(c===0||(M=Math.floor(o/c),o-=M*c,(s-=M*f)<0))return g;if(s>f)return-g;if(c>o+o){if(f<s+s)return-g}else{if(f>s+s)return g;o=c-o,s=f-s,g=-g}if(s===0)return o===0?0:g;if(o===0)return-g}};var En=l(function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var o=arguments[0];this._p=o},"st");En.prototype.countSegment=function(o,s){if(o.x<this._p.x&&s.x<this._p.x)return null;if(this._p.x===s.x&&this._p.y===s.y)return this._isPointOnSegment=!0,null;if(o.y===this._p.y&&s.y===this._p.y){var c=o.x,f=s.x;return c>f&&(c=s.x,f=o.x),this._p.x>=c&&this._p.x<=f&&(this._isPointOnSegment=!0),null}if(o.y>this._p.y&&s.y<=this._p.y||s.y>this._p.y&&o.y<=this._p.y){var g=o.x-this._p.x,_=o.y-this._p.y,M=s.x-this._p.x,N=s.y-this._p.y,G=po.signOfDet2x2(g,_,M,N);if(G===0)return this._isPointOnSegment=!0,null;N<_&&(G=-G),G>0&&this._crossingCount++}},En.prototype.isPointInPolygon=function(){return this.getLocation()!==H.EXTERIOR},En.prototype.getLocation=function(){return this._isPointOnSegment?H.BOUNDARY:this._crossingCount%2==1?H.INTERIOR:H.EXTERIOR},En.prototype.isOnSegment=function(){return this._isPointOnSegment},En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En},En.locatePointInRing=function(){if(arguments[0]instanceof F&&ct(arguments[1],It)){for(var o=arguments[0],s=arguments[1],c=new En(o),f=new F,g=new F,_=1;_<s.size();_++)if(s.getCoordinate(_,f),s.getCoordinate(_-1,g),c.countSegment(f,g),c.isOnSegment())return c.getLocation();return c.getLocation()}if(arguments[0]instanceof F&&arguments[1]instanceof Array){for(var M=arguments[0],N=arguments[1],G=new En(M),Z=1;Z<N.length;Z++){var st=N[Z],ut=N[Z-1];if(G.countSegment(st,ut),G.isOnSegment())return G.getLocation()}return G.getLocation()}};var wt=l(function(){},"at"),Hs={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt},wt.orientationIndex=function(o,s,c){return Gt.orientationIndex(o,s,c)},wt.signedArea=function(){if(arguments[0]instanceof Array){var o=arguments[0];if(o.length<3)return 0;for(var s=0,c=o[0].x,f=1;f<o.length-1;f++){var g=o[f].x-c,_=o[f+1].y;s+=g*(o[f-1].y-_)}return s/2}if(ct(arguments[0],It)){var M=arguments[0],N=M.size();if(N<3)return 0;var G=new F,Z=new F,st=new F;M.getCoordinate(0,Z),M.getCoordinate(1,st);var ut=Z.x;st.x-=ut;for(var Ot=0,Dt=1;Dt<N-1;Dt++)G.y=Z.y,Z.x=st.x,Z.y=st.y,M.getCoordinate(Dt+1,st),st.x-=ut,Ot+=Z.x*(G.y-st.y);return Ot/2}},wt.distanceLineLine=function(o,s,c,f){if(o.equals(s))return wt.distancePointLine(o,c,f);if(c.equals(f))return wt.distancePointLine(f,o,s);var g=!1;if(Ct.intersects(o,s,c,f)){var _=(s.x-o.x)*(f.y-c.y)-(s.y-o.y)*(f.x-c.x);if(_===0)g=!0;else{var M=(o.y-c.y)*(f.x-c.x)-(o.x-c.x)*(f.y-c.y),N=((o.y-c.y)*(s.x-o.x)-(o.x-c.x)*(s.y-o.y))/_,G=M/_;(G<0||G>1||N<0||N>1)&&(g=!0)}}else g=!0;return g?ft.min(wt.distancePointLine(o,c,f),wt.distancePointLine(s,c,f),wt.distancePointLine(c,o,s),wt.distancePointLine(f,o,s)):0},wt.isPointInRing=function(o,s){return wt.locatePointInRing(o,s)!==H.EXTERIOR},wt.computeLength=function(o){var s=o.size();if(s<=1)return 0;var c=0,f=new F;o.getCoordinate(0,f);for(var g=f.x,_=f.y,M=1;M<s;M++){o.getCoordinate(M,f);var N=f.x,G=f.y,Z=N-g,st=G-_;c+=Math.sqrt(Z*Z+st*st),g=N,_=G}return c},wt.isCCW=function(o){var s=o.length-1;if(s<3)throw new A("Ring has fewer than 4 points, so orientation cannot be determined");for(var c=o[0],f=0,g=1;g<=s;g++){var _=o[g];_.y>c.y&&(c=_,f=g)}var M=f;do(M-=1)<0&&(M=s);while(o[M].equals2D(c)&&M!==f);var N=f;do N=(N+1)%s;while(o[N].equals2D(c)&&N!==f);var G=o[M],Z=o[N];if(G.equals2D(c)||Z.equals2D(c)||G.equals2D(Z))return!1;var st=wt.computeOrientation(G,c,Z),ut=!1;return ut=st===0?G.x>Z.x:st>0,ut},wt.locatePointInRing=function(o,s){return En.locatePointInRing(o,s)},wt.distancePointLinePerpendicular=function(o,s,c){var f=(c.x-s.x)*(c.x-s.x)+(c.y-s.y)*(c.y-s.y),g=((s.y-o.y)*(c.x-s.x)-(s.x-o.x)*(c.y-s.y))/f;return Math.abs(g)*Math.sqrt(f)},wt.computeOrientation=function(o,s,c){return wt.orientationIndex(o,s,c)},wt.distancePointLine=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];if(s.length===0)throw new A("Line array must contain at least one vertex");for(var c=o.distance(s[0]),f=0;f<s.length-1;f++){var g=wt.distancePointLine(o,s[f],s[f+1]);g<c&&(c=g)}return c}if(arguments.length===3){var _=arguments[0],M=arguments[1],N=arguments[2];if(M.x===N.x&&M.y===N.y)return _.distance(M);var G=(N.x-M.x)*(N.x-M.x)+(N.y-M.y)*(N.y-M.y),Z=((_.x-M.x)*(N.x-M.x)+(_.y-M.y)*(N.y-M.y))/G;if(Z<=0)return _.distance(M);if(Z>=1)return _.distance(N);var st=((M.y-_.y)*(N.x-M.x)-(M.x-_.x)*(N.y-M.y))/G;return Math.abs(st)*Math.sqrt(G)}},wt.isOnLine=function(o,s){for(var c=new Ji,f=1;f<s.length;f++){var g=s[f-1],_=s[f];if(c.computeIntersection(o,g,_),c.hasIntersection())return!0}return!1},Hs.CLOCKWISE.get=function(){return-1},Hs.RIGHT.get=function(){return wt.CLOCKWISE},Hs.COUNTERCLOCKWISE.get=function(){return 1},Hs.LEFT.get=function(){return wt.COUNTERCLOCKWISE},Hs.COLLINEAR.get=function(){return 0},Hs.STRAIGHT.get=function(){return wt.COLLINEAR},Object.defineProperties(wt,Hs);var Zo=l(function(){},"lt");Zo.prototype.filter=function(o){},Zo.prototype.interfaces_=function(){return[]},Zo.prototype.getClass=function(){return Zo};var Jt=l(function(){var o=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=o,this._SRID=o.getSRID()},"ct"),ho={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};Jt.prototype.isGeometryCollection=function(){return this.getSortIndex()===Jt.SORTINDEX_GEOMETRYCOLLECTION},Jt.prototype.getFactory=function(){return this._factory},Jt.prototype.getGeometryN=function(o){return this},Jt.prototype.getArea=function(){return 0},Jt.prototype.isRectangle=function(){return!1},Jt.prototype.equals=function(){if(arguments[0]instanceof Jt){var o=arguments[0];return o!==null&&this.equalsTopo(o)}if(arguments[0]instanceof Object){var s=arguments[0];if(!(s instanceof Jt))return!1;var c=s;return this.equalsExact(c)}},Jt.prototype.equalsExact=function(o){return this===o||this.equalsExact(o,0)},Jt.prototype.geometryChanged=function(){this.apply(Jt.geometryChangedFilter)},Jt.prototype.geometryChangedAction=function(){this._envelope=null},Jt.prototype.equalsNorm=function(o){return o!==null&&this.norm().equalsExact(o.norm())},Jt.prototype.getLength=function(){return 0},Jt.prototype.getNumGeometries=function(){return 1},Jt.prototype.compareTo=function(){if(arguments.length===1){var o=arguments[0],s=o;return this.getSortIndex()!==s.getSortIndex()?this.getSortIndex()-s.getSortIndex():this.isEmpty()&&s.isEmpty()?0:this.isEmpty()?-1:s.isEmpty()?1:this.compareToSameClass(o)}if(arguments.length===2){var c=arguments[0],f=arguments[1];return this.getSortIndex()!==c.getSortIndex()?this.getSortIndex()-c.getSortIndex():this.isEmpty()&&c.isEmpty()?0:this.isEmpty()?-1:c.isEmpty()?1:this.compareToSameClass(c,f)}},Jt.prototype.getUserData=function(){return this._userData},Jt.prototype.getSRID=function(){return this._SRID},Jt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Jt.prototype.checkNotGeometryCollection=function(o){if(o.getSortIndex()===Jt.SORTINDEX_GEOMETRYCOLLECTION)throw new A("This method does not support GeometryCollection arguments")},Jt.prototype.equal=function(o,s,c){return c===0?o.equals(s):o.distance(s)<=c},Jt.prototype.norm=function(){var o=this.copy();return o.normalize(),o},Jt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Jt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Ct(this._envelope)},Jt.prototype.setSRID=function(o){this._SRID=o},Jt.prototype.setUserData=function(o){this._userData=o},Jt.prototype.compare=function(o,s){for(var c=o.iterator(),f=s.iterator();c.hasNext()&&f.hasNext();){var g=c.next(),_=f.next(),M=g.compareTo(_);if(M!==0)return M}return c.hasNext()?1:f.hasNext()?-1:0},Jt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Jt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Jt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Jt.SORTINDEX_MULTIPOINT||this.getSortIndex()===Jt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Jt.SORTINDEX_MULTIPOLYGON},Jt.prototype.interfaces_=function(){return[W,j,t]},Jt.prototype.getClass=function(){return Jt},Jt.hasNonEmptyElements=function(o){for(var s=0;s<o.length;s++)if(!o[s].isEmpty())return!0;return!1},Jt.hasNullElements=function(o){for(var s=0;s<o.length;s++)if(o[s]===null)return!0;return!1},ho.serialVersionUID.get=function(){return 8763622679187377e3},ho.SORTINDEX_POINT.get=function(){return 0},ho.SORTINDEX_MULTIPOINT.get=function(){return 1},ho.SORTINDEX_LINESTRING.get=function(){return 2},ho.SORTINDEX_LINEARRING.get=function(){return 3},ho.SORTINDEX_MULTILINESTRING.get=function(){return 4},ho.SORTINDEX_POLYGON.get=function(){return 5},ho.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ho.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ho.geometryChangedFilter.get=function(){return Pa},Object.defineProperties(Jt,ho);var Pa=l(function(){},"ht");Pa.interfaces_=function(){return[Zo]},Pa.filter=function(o){o.geometryChangedAction()};var Ai=l(function(){},"ft");Ai.prototype.filter=function(o){},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var Hn=l(function(){},"gt"),Ni={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Hn.prototype.isInBoundary=function(o){},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn},Ni.Mod2BoundaryNodeRule.get=function(){return $o},Ni.EndPointBoundaryNodeRule.get=function(){return Ea},Ni.MultiValentEndPointBoundaryNodeRule.get=function(){return Oa},Ni.MonoValentEndPointBoundaryNodeRule.get=function(){return Da},Ni.MOD2_BOUNDARY_RULE.get=function(){return new $o},Ni.ENDPOINT_BOUNDARY_RULE.get=function(){return new Ea},Ni.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Oa},Ni.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Da},Ni.OGC_SFS_BOUNDARY_RULE.get=function(){return Hn.MOD2_BOUNDARY_RULE},Object.defineProperties(Hn,Ni);var $o=l(function(){},"yt");$o.prototype.isInBoundary=function(o){return o%2==1},$o.prototype.interfaces_=function(){return[Hn]},$o.prototype.getClass=function(){return $o};var Ea=l(function(){},"_t");Ea.prototype.isInBoundary=function(o){return o>0},Ea.prototype.interfaces_=function(){return[Hn]},Ea.prototype.getClass=function(){return Ea};var Oa=l(function(){},"mt");Oa.prototype.isInBoundary=function(o){return o>1},Oa.prototype.interfaces_=function(){return[Hn]},Oa.prototype.getClass=function(){return Oa};var Da=l(function(){},"vt");Da.prototype.isInBoundary=function(o){return o===1},Da.prototype.interfaces_=function(){return[Hn]},Da.prototype.getClass=function(){return Da};var Rr=l(function(){},"It");Rr.prototype.add=function(){},Rr.prototype.addAll=function(){},Rr.prototype.isEmpty=function(){},Rr.prototype.iterator=function(){},Rr.prototype.size=function(){},Rr.prototype.toArray=function(){},Rr.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var La=l(function(){},"Et");La.prototype.hasNext=function(){},La.prototype.next=function(){},La.prototype.remove=function(){};var ki=function(o){function s(){o.apply(this,arguments)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.get=function(){},s.prototype.set=function(){},s.prototype.isEmpty=function(){},s}(Rr);(n.prototype=new Error).name="NoSuchElementException";var Et=function(o){function s(){o.call(this),this.array_=[],arguments[0]instanceof Rr&&this.addAll(arguments[0])}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.ensureCapacity=function(){},s.prototype.interfaces_=function(){return[o,Rr]},s.prototype.add=function(c){return arguments.length===1?this.array_.push(c):this.array_.splice(arguments[0],arguments[1]),!0},s.prototype.clear=function(){this.array_=[]},s.prototype.addAll=function(c){for(var f=c.iterator();f.hasNext();)this.add(f.next());return!0},s.prototype.set=function(c,f){var g=this.array_[c];return this.array_[c]=f,g},s.prototype.iterator=function(){return new $m(this)},s.prototype.get=function(c){if(c<0||c>=this.size())throw new e;return this.array_[c]},s.prototype.isEmpty=function(){return this.array_.length===0},s.prototype.size=function(){return this.array_.length},s.prototype.toArray=function(){for(var c=[],f=0,g=this.array_.length;f<g;f++)c.push(this.array_[f]);return c},s.prototype.remove=function(c){for(var f=!1,g=0,_=this.array_.length;g<_;g++)if(this.array_[g]===c){this.array_.splice(g,1),f=!0;break}return f},s}(ki),$m=function(o){function s(c){o.call(this),this.arrayList_=c,this.position_=0}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new n;return this.arrayList_.get(this.position_++)},s.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},s.prototype.set=function(c){return this.arrayList_.set(this.position_-1,c)},s.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},s}(La),et=function(o){function s(){if(o.call(this),arguments.length!==0){if(arguments.length===1){var f=arguments[0];this.ensureCapacity(f.length),this.add(f,!0)}else if(arguments.length===2){var g=arguments[0],_=arguments[1];this.ensureCapacity(g.length),this.add(g,_)}}}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={coordArrayType:{configurable:!0}};return c.coordArrayType.get=function(){return new Array(0).fill(null)},s.prototype.getCoordinate=function(f){return this.get(f)},s.prototype.addAll=function(){if(arguments.length===2){for(var f=arguments[0],g=arguments[1],_=!1,M=f.iterator();M.hasNext();)this.add(M.next(),g),_=!0;return _}return o.prototype.addAll.apply(this,arguments)},s.prototype.clone=function(){for(var f=o.prototype.clone.call(this),g=0;g<this.size();g++)f.add(g,this.get(g).copy());return f},s.prototype.toCoordinateArray=function(){return this.toArray(s.coordArrayType)},s.prototype.add=function(){if(arguments.length===1){var f=arguments[0];o.prototype.add.call(this,f)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],_=arguments[1];return this.add(g,_,!0),!0}if(arguments[0]instanceof F&&typeof arguments[1]=="boolean"){var M=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(M))return null;o.prototype.add.call(this,M)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var N=arguments[0],G=arguments[1];return this.add(N,G),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var Z=arguments[0],st=arguments[1];if(arguments[2])for(var ut=0;ut<Z.length;ut++)this.add(Z[ut],st);else for(var Ot=Z.length-1;Ot>=0;Ot--)this.add(Z[Ot],st);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof F){var Dt=arguments[0],Bt=arguments[1];if(!arguments[2]){var Wt=this.size();if(Wt>0&&(Dt>0&&this.get(Dt-1).equals2D(Bt)||Dt<Wt&&this.get(Dt).equals2D(Bt)))return null}o.prototype.add.call(this,Dt,Bt)}}else if(arguments.length===4){var Cr=arguments[0],vn=arguments[1],_i=arguments[2],ta=arguments[3],Vl=1;_i>ta&&(Vl=-1);for(var J2=_i;J2!==ta;J2+=Vl)this.add(Cr[J2],vn);return!0}},s.prototype.closeRing=function(){this.size()>0&&this.add(new F(this.get(0)),!1)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},Object.defineProperties(s,c),s}(Et),O=l(function(){},"Lt"),k={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};k.ForwardComparator.get=function(){return z},k.BidirectionalComparator.get=function(){return Y},k.coordArrayType.get=function(){return new Array(0).fill(null)},O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.isRing=function(o){return!(o.length<4)&&!!o[0].equals2D(o[o.length-1])},O.ptNotInList=function(o,s){for(var c=0;c<o.length;c++){var f=o[c];if(O.indexOf(f,s)<0)return f}return null},O.scroll=function(o,s){var c=O.indexOf(s,o);if(c<0)return null;var f=new Array(o.length).fill(null);Nt.arraycopy(o,c,f,0,o.length-c),Nt.arraycopy(o,0,f,o.length-c,c),Nt.arraycopy(f,0,o,0,o.length)},O.equals=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];if(o===s)return!0;if(o===null||s===null||o.length!==s.length)return!1;for(var c=0;c<o.length;c++)if(!o[c].equals(s[c]))return!1;return!0}if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2];if(f===g)return!0;if(f===null||g===null||f.length!==g.length)return!1;for(var M=0;M<f.length;M++)if(_.compare(f[M],g[M])!==0)return!1;return!0}},O.intersection=function(o,s){for(var c=new et,f=0;f<o.length;f++)s.intersects(o[f])&&c.add(o[f],!0);return c.toCoordinateArray()},O.hasRepeatedPoints=function(o){for(var s=1;s<o.length;s++)if(o[s-1].equals(o[s]))return!0;return!1},O.removeRepeatedPoints=function(o){return O.hasRepeatedPoints(o)?new et(o,!1).toCoordinateArray():o},O.reverse=function(o){for(var s=o.length-1,c=Math.trunc(s/2),f=0;f<=c;f++){var g=o[f];o[f]=o[s-f],o[s-f]=g}},O.removeNull=function(o){for(var s=0,c=0;c<o.length;c++)o[c]!==null&&s++;var f=new Array(s).fill(null);if(s===0)return f;for(var g=0,_=0;_<o.length;_++)o[_]!==null&&(f[g++]=o[_]);return f},O.copyDeep=function(){if(arguments.length===1){for(var o=arguments[0],s=new Array(o.length).fill(null),c=0;c<o.length;c++)s[c]=new F(o[c]);return s}if(arguments.length===5)for(var f=arguments[0],g=arguments[1],_=arguments[2],M=arguments[3],N=arguments[4],G=0;G<N;G++)_[M+G]=new F(f[g+G])},O.isEqualReversed=function(o,s){for(var c=0;c<o.length;c++){var f=o[c],g=s[o.length-c-1];if(f.compareTo(g)!==0)return!1}return!0},O.envelope=function(o){for(var s=new Ct,c=0;c<o.length;c++)s.expandToInclude(o[c]);return s},O.toCoordinateArray=function(o){return o.toArray(O.coordArrayType)},O.atLeastNCoordinatesOrNothing=function(o,s){return s.length>=o?s:[]},O.indexOf=function(o,s){for(var c=0;c<s.length;c++)if(o.equals(s[c]))return c;return-1},O.increasingDirection=function(o){for(var s=0;s<Math.trunc(o.length/2);s++){var c=o.length-1-s,f=o[s].compareTo(o[c]);if(f!==0)return f}return 1},O.compare=function(o,s){for(var c=0;c<o.length&&c<s.length;){var f=o[c].compareTo(s[c]);if(f!==0)return f;c++}return c<s.length?-1:c<o.length?1:0},O.minCoordinate=function(o){for(var s=null,c=0;c<o.length;c++)(s===null||s.compareTo(o[c])>0)&&(s=o[c]);return s},O.extract=function(o,s,c){s=ft.clamp(s,0,o.length);var f=(c=ft.clamp(c,-1,o.length))-s+1;c<0&&(f=0),s>=o.length&&(f=0),c<s&&(f=0);var g=new Array(f).fill(null);if(f===0)return g;for(var _=0,M=s;M<=c;M++)g[_++]=o[M];return g},Object.defineProperties(O,k);var z=l(function(){},"wt");z.prototype.compare=function(o,s){return O.compare(o,s)},z.prototype.interfaces_=function(){return[$]},z.prototype.getClass=function(){return z};var Y=l(function(){},"Ot");Y.prototype.compare=function(o,s){var c=o,f=s;if(c.length<f.length)return-1;if(c.length>f.length)return 1;if(c.length===0)return 0;var g=O.compare(c,f);return O.isEqualReversed(c,f)?0:g},Y.prototype.OLDcompare=function(o,s){var c=o,f=s;if(c.length<f.length)return-1;if(c.length>f.length)return 1;if(c.length===0)return 0;for(var g=O.increasingDirection(c),_=O.increasingDirection(f),M=g>0?0:c.length-1,N=_>0?0:c.length-1,G=0;G<c.length;G++){var Z=c[M].compareTo(f[N]);if(Z!==0)return Z;M+=g,N+=_}return 0},Y.prototype.interfaces_=function(){return[$]},Y.prototype.getClass=function(){return Y};var X=l(function(){},"Tt");X.prototype.get=function(){},X.prototype.put=function(){},X.prototype.size=function(){},X.prototype.values=function(){},X.prototype.entrySet=function(){};var pt=function(o){function s(){o.apply(this,arguments)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s}(X);(i.prototype=new Error).name="OperationNotSupported",(a.prototype=new Rr).contains=function(){};var lt=function(o){function s(){o.call(this),this.array_=[],arguments[0]instanceof Rr&&this.addAll(arguments[0])}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.contains=function(c){for(var f=0,g=this.array_.length;f<g;f++)if(this.array_[f]===c)return!0;return!1},s.prototype.add=function(c){return!this.contains(c)&&(this.array_.push(c),!0)},s.prototype.addAll=function(c){for(var f=c.iterator();f.hasNext();)this.add(f.next());return!0},s.prototype.remove=function(c){throw new Error},s.prototype.size=function(){return this.array_.length},s.prototype.isEmpty=function(){return this.array_.length===0},s.prototype.toArray=function(){for(var c=[],f=0,g=this.array_.length;f<g;f++)c.push(this.array_[f]);return c},s.prototype.iterator=function(){return new vt(this)},s}(a),vt=function(o){function s(c){o.call(this),this.hashSet_=c,this.position_=0}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new n;return this.hashSet_.array_[this.position_++]},s.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},s.prototype.remove=function(){throw new i},s}(La),ht=0;(x.prototype=new pt).get=function(o){for(var s=this.root_;s!==null;){var c=o.compareTo(s.key);if(c<0)s=s.left;else{if(!(c>0))return s.value;s=s.right}}return null},x.prototype.put=function(o,s){if(this.root_===null)return this.root_={key:o,value:s,left:null,right:null,parent:null,color:ht,getValue:l(function(){return this.value},"getValue"),getKey:l(function(){return this.key},"getKey")},this.size_=1,null;var c,f,g=this.root_;do if(c=g,(f=o.compareTo(g.key))<0)g=g.left;else{if(!(f>0)){var _=g.value;return g.value=s,_}g=g.right}while(g!==null);var M={key:o,left:null,right:null,value:s,parent:c,color:ht,getValue:l(function(){return this.value},"getValue"),getKey:l(function(){return this.key},"getKey")};return f<0?c.left=M:c.right=M,this.fixAfterInsertion(M),this.size_++,null},x.prototype.fixAfterInsertion=function(o){for(o.color=1;o!=null&&o!==this.root_&&o.parent.color===1;)if(h(o)===m(h(h(o)))){var s=v(h(h(o)));u(s)===1?(d(h(o),ht),d(s,ht),d(h(h(o)),1),o=h(h(o))):(o===v(h(o))&&(o=h(o),this.rotateLeft(o)),d(h(o),ht),d(h(h(o)),1),this.rotateRight(h(h(o))))}else{var c=m(h(h(o)));u(c)===1?(d(h(o),ht),d(c,ht),d(h(h(o)),1),o=h(h(o))):(o===m(h(o))&&(o=h(o),this.rotateRight(o)),d(h(o),ht),d(h(h(o)),1),this.rotateLeft(h(h(o))))}this.root_.color=ht},x.prototype.values=function(){var o=new Et,s=this.getFirstEntry();if(s!==null)for(o.add(s.value);(s=x.successor(s))!==null;)o.add(s.value);return o},x.prototype.entrySet=function(){var o=new lt,s=this.getFirstEntry();if(s!==null)for(o.add(s);(s=x.successor(s))!==null;)o.add(s);return o},x.prototype.rotateLeft=function(o){if(o!=null){var s=o.right;o.right=s.left,s.left!=null&&(s.left.parent=o),s.parent=o.parent,o.parent===null?this.root_=s:o.parent.left===o?o.parent.left=s:o.parent.right=s,s.left=o,o.parent=s}},x.prototype.rotateRight=function(o){if(o!=null){var s=o.left;o.left=s.right,s.right!=null&&(s.right.parent=o),s.parent=o.parent,o.parent===null?this.root_=s:o.parent.right===o?o.parent.right=s:o.parent.left=s,s.right=o,o.parent=s}},x.prototype.getFirstEntry=function(){var o=this.root_;if(o!=null)for(;o.left!=null;)o=o.left;return o},x.successor=function(o){if(o===null)return null;if(o.right!==null){for(var s=o.right;s.left!==null;)s=s.left;return s}for(var c=o.parent,f=o;c!==null&&f===c.right;)f=c,c=c.parent;return c},x.prototype.size=function(){return this.size_};var Rt=l(function(){},"At");Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt},S.prototype=new a,(I.prototype=new S).contains=function(o){for(var s=0,c=this.array_.length;s<c;s++)if(this.array_[s].compareTo(o)===0)return!0;return!1},I.prototype.add=function(o){if(this.contains(o))return!1;for(var s=0,c=this.array_.length;s<c;s++)if(this.array_[s].compareTo(o)===1)return this.array_.splice(s,0,o),!0;return this.array_.push(o),!0},I.prototype.addAll=function(o){for(var s=o.iterator();s.hasNext();)this.add(s.next());return!0},I.prototype.remove=function(o){throw new i},I.prototype.size=function(){return this.array_.length},I.prototype.isEmpty=function(){return this.array_.length===0},I.prototype.toArray=function(){for(var o=[],s=0,c=this.array_.length;s<c;s++)o.push(this.array_[s]);return o},I.prototype.iterator=function(){return new at(this)};var at=l(function(o){this.treeSet_=o,this.position_=0},"Ft");at.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new n;return this.treeSet_.array_[this.position_++]},at.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},at.prototype.remove=function(){throw new i};var bt=l(function(){},"Gt");bt.sort=function(){var o,s,c,f,g=arguments[0];if(arguments.length===1)f=l(function(M,N){return M.compareTo(N)},"i"),g.sort(f);else if(arguments.length===2)c=arguments[1],f=l(function(M,N){return c.compare(M,N)},"i"),g.sort(f);else if(arguments.length===3){(s=g.slice(arguments[1],arguments[2])).sort();var _=g.slice(0,arguments[1]).concat(s,g.slice(arguments[2],g.length));for(g.splice(0,g.length),o=0;o<_.length;o++)g.push(_[o])}else if(arguments.length===4)for(s=g.slice(arguments[1],arguments[2]),c=arguments[3],f=l(function(M,N){return c.compare(M,N)},"i"),s.sort(f),_=g.slice(0,arguments[1]).concat(s,g.slice(arguments[2],g.length)),g.splice(0,g.length),o=0;o<_.length;o++)g.push(_[o])},bt.asList=function(o){for(var s=new Et,c=0,f=o.length;c<f;c++)s.add(o[c]);return s};var gt=l(function(){},"qt"),Qt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Qt.P.get=function(){return 0},Qt.L.get=function(){return 1},Qt.A.get=function(){return 2},Qt.FALSE.get=function(){return-1},Qt.TRUE.get=function(){return-2},Qt.DONTCARE.get=function(){return-3},Qt.SYM_FALSE.get=function(){return"F"},Qt.SYM_TRUE.get=function(){return"T"},Qt.SYM_DONTCARE.get=function(){return"*"},Qt.SYM_P.get=function(){return"0"},Qt.SYM_L.get=function(){return"1"},Qt.SYM_A.get=function(){return"2"},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.toDimensionSymbol=function(o){switch(o){case gt.FALSE:return gt.SYM_FALSE;case gt.TRUE:return gt.SYM_TRUE;case gt.DONTCARE:return gt.SYM_DONTCARE;case gt.P:return gt.SYM_P;case gt.L:return gt.SYM_L;case gt.A:return gt.SYM_A}throw new A("Unknown dimension value: "+o)},gt.toDimensionValue=function(o){switch(xt.toUpperCase(o)){case gt.SYM_FALSE:return gt.FALSE;case gt.SYM_TRUE:return gt.TRUE;case gt.SYM_DONTCARE:return gt.DONTCARE;case gt.SYM_P:return gt.P;case gt.SYM_L:return gt.L;case gt.SYM_A:return gt.A}throw new A("Unknown dimension symbol: "+o)},Object.defineProperties(gt,Qt);var qt=l(function(){},"Vt");qt.prototype.filter=function(o){},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt};var fe=l(function(){},"Ut");fe.prototype.filter=function(o,s){},fe.prototype.isDone=function(){},fe.prototype.isGeometryChanged=function(){},fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe};var te=function(o){function s(f,g){if(o.call(this,g),this._geometries=f||[],o.hasNullElements(this._geometries))throw new A("geometries must not contain null elements")}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={serialVersionUID:{configurable:!0}};return s.prototype.computeEnvelopeInternal=function(){for(var f=new Ct,g=0;g<this._geometries.length;g++)f.expandToInclude(this._geometries[g].getEnvelopeInternal());return f},s.prototype.getGeometryN=function(f){return this._geometries[f]},s.prototype.getSortIndex=function(){return o.SORTINDEX_GEOMETRYCOLLECTION},s.prototype.getCoordinates=function(){for(var f=new Array(this.getNumPoints()).fill(null),g=-1,_=0;_<this._geometries.length;_++)for(var M=this._geometries[_].getCoordinates(),N=0;N<M.length;N++)f[++g]=M[N];return f},s.prototype.getArea=function(){for(var f=0,g=0;g<this._geometries.length;g++)f+=this._geometries[g].getArea();return f},s.prototype.equalsExact=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];if(!this.isEquivalentClass(f))return!1;var _=f;if(this._geometries.length!==_._geometries.length)return!1;for(var M=0;M<this._geometries.length;M++)if(!this._geometries[M].equalsExact(_._geometries[M],g))return!1;return!0}return o.prototype.equalsExact.apply(this,arguments)},s.prototype.normalize=function(){for(var f=0;f<this._geometries.length;f++)this._geometries[f].normalize();bt.sort(this._geometries)},s.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},s.prototype.getBoundaryDimension=function(){for(var f=gt.FALSE,g=0;g<this._geometries.length;g++)f=Math.max(f,this._geometries[g].getBoundaryDimension());return f},s.prototype.getDimension=function(){for(var f=gt.FALSE,g=0;g<this._geometries.length;g++)f=Math.max(f,this._geometries[g].getDimension());return f},s.prototype.getLength=function(){for(var f=0,g=0;g<this._geometries.length;g++)f+=this._geometries[g].getLength();return f},s.prototype.getNumPoints=function(){for(var f=0,g=0;g<this._geometries.length;g++)f+=this._geometries[g].getNumPoints();return f},s.prototype.getNumGeometries=function(){return this._geometries.length},s.prototype.reverse=function(){for(var f=this._geometries.length,g=new Array(f).fill(null),_=0;_<this._geometries.length;_++)g[_]=this._geometries[_].reverse();return this.getFactory().createGeometryCollection(g)},s.prototype.compareToSameClass=function(){if(arguments.length===1){var f=arguments[0],g=new I(bt.asList(this._geometries)),_=new I(bt.asList(f._geometries));return this.compare(g,_)}if(arguments.length===2){for(var M=arguments[0],N=arguments[1],G=M,Z=this.getNumGeometries(),st=G.getNumGeometries(),ut=0;ut<Z&&ut<st;){var Ot=this.getGeometryN(ut),Dt=G.getGeometryN(ut),Bt=Ot.compareToSameClass(Dt,N);if(Bt!==0)return Bt;ut++}return ut<Z?1:ut<st?-1:0}},s.prototype.apply=function(){if(ct(arguments[0],Ai))for(var f=arguments[0],g=0;g<this._geometries.length;g++)this._geometries[g].apply(f);else if(ct(arguments[0],fe)){var _=arguments[0];if(this._geometries.length===0)return null;for(var M=0;M<this._geometries.length&&(this._geometries[M].apply(_),!_.isDone());M++);_.isGeometryChanged()&&this.geometryChanged()}else if(ct(arguments[0],qt)){var N=arguments[0];N.filter(this);for(var G=0;G<this._geometries.length;G++)this._geometries[G].apply(N)}else if(ct(arguments[0],Zo)){var Z=arguments[0];Z.filter(this);for(var st=0;st<this._geometries.length;st++)this._geometries[st].apply(Z)}},s.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Yt.shouldNeverReachHere(),null},s.prototype.clone=function(){var f=o.prototype.clone.call(this);f._geometries=new Array(this._geometries.length).fill(null);for(var g=0;g<this._geometries.length;g++)f._geometries[g]=this._geometries[g].clone();return f},s.prototype.getGeometryType=function(){return"GeometryCollection"},s.prototype.copy=function(){for(var f=new Array(this._geometries.length).fill(null),g=0;g<f.length;g++)f[g]=this._geometries[g].copy();return new s(f,this._factory)},s.prototype.isEmpty=function(){for(var f=0;f<this._geometries.length;f++)if(!this._geometries[f].isEmpty())return!1;return!0},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(s,c),s}(Jt),Tr=function(o){function s(){o.apply(this,arguments)}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={serialVersionUID:{configurable:!0}};return s.prototype.getSortIndex=function(){return Jt.SORTINDEX_MULTILINESTRING},s.prototype.equalsExact=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];return!!this.isEquivalentClass(f)&&o.prototype.equalsExact.call(this,f,g)}return o.prototype.equalsExact.apply(this,arguments)},s.prototype.getBoundaryDimension=function(){return this.isClosed()?gt.FALSE:0},s.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var f=0;f<this._geometries.length;f++)if(!this._geometries[f].isClosed())return!1;return!0},s.prototype.getDimension=function(){return 1},s.prototype.reverse=function(){for(var f=this._geometries.length,g=new Array(f).fill(null),_=0;_<this._geometries.length;_++)g[f-1-_]=this._geometries[_].reverse();return this.getFactory().createMultiLineString(g)},s.prototype.getBoundary=function(){return new Dr(this).getBoundary()},s.prototype.getGeometryType=function(){return"MultiLineString"},s.prototype.copy=function(){for(var f=new Array(this._geometries.length).fill(null),g=0;g<f.length;g++)f[g]=this._geometries[g].copy();return new s(f,this._factory)},s.prototype.interfaces_=function(){return[Rt]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(s,c),s}(te),Dr=l(function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var o=arguments[0],s=Hn.MOD2_BOUNDARY_RULE;this._geom=o,this._geomFact=o.getFactory(),this._bnRule=s}else if(arguments.length===2){var c=arguments[0],f=arguments[1];this._geom=c,this._geomFact=c.getFactory(),this._bnRule=f}},"Yt");Dr.prototype.boundaryMultiLineString=function(o){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var s=this.computeBoundaryCoordinates(o);return s.length===1?this._geomFact.createPoint(s[0]):this._geomFact.createMultiPointFromCoords(s)},Dr.prototype.getBoundary=function(){return this._geom instanceof ye?this.boundaryLineString(this._geom):this._geom instanceof Tr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Dr.prototype.boundaryLineString=function(o){return this._geom.isEmpty()?this.getEmptyMultiPoint():o.isClosed()?this._bnRule.isInBoundary(2)?o.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([o.getStartPoint(),o.getEndPoint()])},Dr.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Dr.prototype.computeBoundaryCoordinates=function(o){var s=new Et;this._endpointMap=new x;for(var c=0;c<o.getNumGeometries();c++){var f=o.getGeometryN(c);f.getNumPoints()!==0&&(this.addEndpoint(f.getCoordinateN(0)),this.addEndpoint(f.getCoordinateN(f.getNumPoints()-1)))}for(var g=this._endpointMap.entrySet().iterator();g.hasNext();){var _=g.next(),M=_.getValue().count;this._bnRule.isInBoundary(M)&&s.add(_.getKey())}return O.toCoordinateArray(s)},Dr.prototype.addEndpoint=function(o){var s=this._endpointMap.get(o);s===null&&(s=new sn,this._endpointMap.put(o,s)),s.count++},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.getBoundary=function(){if(arguments.length===1){var o=arguments[0];return new Dr(o).getBoundary()}if(arguments.length===2){var s=arguments[0],c=arguments[1];return new Dr(s,c).getBoundary()}};var sn=l(function(){this.count=null},"kt");sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn};var Lr=l(function(){},"jt"),Xn={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.chars=function(o,s){for(var c=new Array(s).fill(null),f=0;f<s;f++)c[f]=o;return String(c)},Lr.getStackTrace=function(){if(arguments.length===1){var o=arguments[0],s=new function(){},c=new function(){}(s);return o.printStackTrace(c),s.toString()}if(arguments.length===2){for(var f=arguments[0],g=arguments[1],_="",M=new function(){}(new function(){}(Lr.getStackTrace(f))),N=0;N<g;N++)try{_+=M.readLine()+Lr.NEWLINE}catch(G){if(!(G instanceof w))throw G;Yt.shouldNeverReachHere()}return _}},Lr.split=function(o,s){for(var c=s.length,f=new Et,g=""+o,_=g.indexOf(s);_>=0;){var M=g.substring(0,_);f.add(M),_=(g=g.substring(_+c)).indexOf(s)}g.length>0&&f.add(g);for(var N=new Array(f.size()).fill(null),G=0;G<N.length;G++)N[G]=f.get(G);return N},Lr.toString=function(){if(arguments.length===1){var o=arguments[0];return Lr.SIMPLE_ORDINATE_FORMAT.format(o)}},Lr.spaces=function(o){return Lr.chars(" ",o)},Xn.NEWLINE.get=function(){return Nt.getProperty("line.separator")},Xn.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Lr,Xn);var Te=l(function(){},"Wt");Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.copyCoord=function(o,s,c,f){for(var g=Math.min(o.getDimension(),c.getDimension()),_=0;_<g;_++)c.setOrdinate(f,_,o.getOrdinate(s,_))},Te.isRing=function(o){var s=o.size();return s===0||!(s<=3)&&o.getOrdinate(0,It.X)===o.getOrdinate(s-1,It.X)&&o.getOrdinate(0,It.Y)===o.getOrdinate(s-1,It.Y)},Te.isEqual=function(o,s){var c=o.size();if(c!==s.size())return!1;for(var f=Math.min(o.getDimension(),s.getDimension()),g=0;g<c;g++)for(var _=0;_<f;_++){var M=o.getOrdinate(g,_),N=s.getOrdinate(g,_);if(o.getOrdinate(g,_)!==s.getOrdinate(g,_)&&(!L.isNaN(M)||!L.isNaN(N)))return!1}return!0},Te.extend=function(o,s,c){var f=o.create(c,s.getDimension()),g=s.size();if(Te.copy(s,0,f,0,g),g>0)for(var _=g;_<c;_++)Te.copy(s,g-1,f,_,1);return f},Te.reverse=function(o){for(var s=o.size()-1,c=Math.trunc(s/2),f=0;f<=c;f++)Te.swap(o,f,s-f)},Te.swap=function(o,s,c){if(s===c)return null;for(var f=0;f<o.getDimension();f++){var g=o.getOrdinate(s,f);o.setOrdinate(s,f,o.getOrdinate(c,f)),o.setOrdinate(c,f,g)}},Te.copy=function(o,s,c,f,g){for(var _=0;_<g;_++)Te.copyCoord(o,s+_,c,f+_)},Te.toString=function(){if(arguments.length===1){var o=arguments[0],s=o.size();if(s===0)return"()";var c=o.getDimension(),f=new St;f.append("(");for(var g=0;g<s;g++){g>0&&f.append(" ");for(var _=0;_<c;_++)_>0&&f.append(","),f.append(Lr.toString(o.getOrdinate(g,_)))}return f.append(")"),f.toString()}},Te.ensureValidRing=function(o,s){var c=s.size();return c===0?s:c<=3?Te.createClosedRing(o,s,4):s.getOrdinate(0,It.X)===s.getOrdinate(c-1,It.X)&&s.getOrdinate(0,It.Y)===s.getOrdinate(c-1,It.Y)?s:Te.createClosedRing(o,s,c+1)},Te.createClosedRing=function(o,s,c){var f=o.create(c,s.getDimension()),g=s.size();Te.copy(s,0,f,0,g);for(var _=g;_<c;_++)Te.copy(s,0,f,_,1);return f};var ye=function(o){function s(f,g){o.call(this,g),this._points=null,this.init(f)}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={serialVersionUID:{configurable:!0}};return s.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Ct:this._points.expandEnvelope(new Ct)},s.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},s.prototype.getSortIndex=function(){return o.SORTINDEX_LINESTRING},s.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},s.prototype.equalsExact=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];if(!this.isEquivalentClass(f))return!1;var _=f;if(this._points.size()!==_._points.size())return!1;for(var M=0;M<this._points.size();M++)if(!this.equal(this._points.getCoordinate(M),_._points.getCoordinate(M),g))return!1;return!0}return o.prototype.equalsExact.apply(this,arguments)},s.prototype.normalize=function(){for(var f=0;f<Math.trunc(this._points.size()/2);f++){var g=this._points.size()-1-f;if(!this._points.getCoordinate(f).equals(this._points.getCoordinate(g)))return this._points.getCoordinate(f).compareTo(this._points.getCoordinate(g))>0&&Te.reverse(this._points),null}},s.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},s.prototype.getBoundaryDimension=function(){return this.isClosed()?gt.FALSE:0},s.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},s.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},s.prototype.getDimension=function(){return 1},s.prototype.getLength=function(){return wt.computeLength(this._points)},s.prototype.getNumPoints=function(){return this._points.size()},s.prototype.reverse=function(){var f=this._points.copy();return Te.reverse(f),this.getFactory().createLineString(f)},s.prototype.compareToSameClass=function(){if(arguments.length===1){for(var f=arguments[0],g=0,_=0;g<this._points.size()&&_<f._points.size();){var M=this._points.getCoordinate(g).compareTo(f._points.getCoordinate(_));if(M!==0)return M;g++,_++}return g<this._points.size()?1:_<f._points.size()?-1:0}if(arguments.length===2){var N=arguments[0];return arguments[1].compare(this._points,N._points)}},s.prototype.apply=function(){if(ct(arguments[0],Ai))for(var f=arguments[0],g=0;g<this._points.size();g++)f.filter(this._points.getCoordinate(g));else if(ct(arguments[0],fe)){var _=arguments[0];if(this._points.size()===0)return null;for(var M=0;M<this._points.size()&&(_.filter(this._points,M),!_.isDone());M++);_.isGeometryChanged()&&this.geometryChanged()}else ct(arguments[0],qt)?arguments[0].filter(this):ct(arguments[0],Zo)&&arguments[0].filter(this)},s.prototype.getBoundary=function(){return new Dr(this).getBoundary()},s.prototype.isEquivalentClass=function(f){return f instanceof s},s.prototype.clone=function(){var f=o.prototype.clone.call(this);return f._points=this._points.clone(),f},s.prototype.getCoordinateN=function(f){return this._points.getCoordinate(f)},s.prototype.getGeometryType=function(){return"LineString"},s.prototype.copy=function(){return new s(this._points.copy(),this._factory)},s.prototype.getCoordinateSequence=function(){return this._points},s.prototype.isEmpty=function(){return this._points.size()===0},s.prototype.init=function(f){if(f===null&&(f=this.getFactory().getCoordinateSequenceFactory().create([])),f.size()===1)throw new A("Invalid number of points in LineString (found "+f.size()+" - must be 0 or >= 2)");this._points=f},s.prototype.isCoordinate=function(f){for(var g=0;g<this._points.size();g++)if(this._points.getCoordinate(g).equals(f))return!0;return!1},s.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},s.prototype.getPointN=function(f){return this.getFactory().createPoint(this._points.getCoordinate(f))},s.prototype.interfaces_=function(){return[Rt]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(s,c),s}(Jt),Ri=l(function(){},"Jt");Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var Ur=function(o){function s(f,g){o.call(this,g),this._coordinates=f||null,this.init(this._coordinates)}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={serialVersionUID:{configurable:!0}};return s.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Ct;var f=new Ct;return f.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),f},s.prototype.getSortIndex=function(){return o.SORTINDEX_POINT},s.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},s.prototype.equalsExact=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];return!!this.isEquivalentClass(f)&&(!(!this.isEmpty()||!f.isEmpty())||this.isEmpty()===f.isEmpty()&&this.equal(f.getCoordinate(),this.getCoordinate(),g))}return o.prototype.equalsExact.apply(this,arguments)},s.prototype.normalize=function(){},s.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},s.prototype.getBoundaryDimension=function(){return gt.FALSE},s.prototype.getDimension=function(){return 0},s.prototype.getNumPoints=function(){return this.isEmpty()?0:1},s.prototype.reverse=function(){return this.copy()},s.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},s.prototype.compareToSameClass=function(){if(arguments.length===1){var f=arguments[0];return this.getCoordinate().compareTo(f.getCoordinate())}if(arguments.length===2){var g=arguments[0];return arguments[1].compare(this._coordinates,g._coordinates)}},s.prototype.apply=function(){if(ct(arguments[0],Ai)){var f=arguments[0];if(this.isEmpty())return null;f.filter(this.getCoordinate())}else if(ct(arguments[0],fe)){var g=arguments[0];if(this.isEmpty())return null;g.filter(this._coordinates,0),g.isGeometryChanged()&&this.geometryChanged()}else ct(arguments[0],qt)?arguments[0].filter(this):ct(arguments[0],Zo)&&arguments[0].filter(this)},s.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},s.prototype.clone=function(){var f=o.prototype.clone.call(this);return f._coordinates=this._coordinates.clone(),f},s.prototype.getGeometryType=function(){return"Point"},s.prototype.copy=function(){return new s(this._coordinates.copy(),this._factory)},s.prototype.getCoordinateSequence=function(){return this._coordinates},s.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},s.prototype.isEmpty=function(){return this._coordinates.size()===0},s.prototype.init=function(f){f===null&&(f=this.getFactory().getCoordinateSequenceFactory().create([])),Yt.isTrue(f.size()<=1),this._coordinates=f},s.prototype.isSimple=function(){return!0},s.prototype.interfaces_=function(){return[Ri]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(s,c),s}(Jt),Nn=l(function(){},"Zt");Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn};var xr=function(o){function s(f,g,_){if(o.call(this,_),this._shell=null,this._holes=null,f===null&&(f=this.getFactory().createLinearRing()),g===null&&(g=[]),o.hasNullElements(g))throw new A("holes must not contain null elements");if(f.isEmpty()&&o.hasNonEmptyElements(g))throw new A("shell is empty but holes are not");this._shell=f,this._holes=g}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={serialVersionUID:{configurable:!0}};return s.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},s.prototype.getSortIndex=function(){return o.SORTINDEX_POLYGON},s.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var f=new Array(this.getNumPoints()).fill(null),g=-1,_=this._shell.getCoordinates(),M=0;M<_.length;M++)f[++g]=_[M];for(var N=0;N<this._holes.length;N++)for(var G=this._holes[N].getCoordinates(),Z=0;Z<G.length;Z++)f[++g]=G[Z];return f},s.prototype.getArea=function(){var f=0;f+=Math.abs(wt.signedArea(this._shell.getCoordinateSequence()));for(var g=0;g<this._holes.length;g++)f-=Math.abs(wt.signedArea(this._holes[g].getCoordinateSequence()));return f},s.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var f=this._shell.getCoordinateSequence(),g=this.getEnvelopeInternal(),_=0;_<5;_++){var M=f.getX(_);if(M!==g.getMinX()&&M!==g.getMaxX())return!1;var N=f.getY(_);if(N!==g.getMinY()&&N!==g.getMaxY())return!1}for(var G=f.getX(0),Z=f.getY(0),st=1;st<=4;st++){var ut=f.getX(st),Ot=f.getY(st);if(ut!==G==(Ot!==Z))return!1;G=ut,Z=Ot}return!0},s.prototype.equalsExact=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];if(!this.isEquivalentClass(f))return!1;var _=f,M=this._shell,N=_._shell;if(!M.equalsExact(N,g)||this._holes.length!==_._holes.length)return!1;for(var G=0;G<this._holes.length;G++)if(!this._holes[G].equalsExact(_._holes[G],g))return!1;return!0}return o.prototype.equalsExact.apply(this,arguments)},s.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var f=0;f<this._holes.length;f++)this.normalize(this._holes[f],!1);bt.sort(this._holes)}else if(arguments.length===2){var g=arguments[0],_=arguments[1];if(g.isEmpty())return null;var M=new Array(g.getCoordinates().length-1).fill(null);Nt.arraycopy(g.getCoordinates(),0,M,0,M.length);var N=O.minCoordinate(g.getCoordinates());O.scroll(M,N),Nt.arraycopy(M,0,g.getCoordinates(),0,M.length),g.getCoordinates()[M.length]=M[0],wt.isCCW(g.getCoordinates())===_&&O.reverse(g.getCoordinates())}},s.prototype.getCoordinate=function(){return this._shell.getCoordinate()},s.prototype.getNumInteriorRing=function(){return this._holes.length},s.prototype.getBoundaryDimension=function(){return 1},s.prototype.getDimension=function(){return 2},s.prototype.getLength=function(){var f=0;f+=this._shell.getLength();for(var g=0;g<this._holes.length;g++)f+=this._holes[g].getLength();return f},s.prototype.getNumPoints=function(){for(var f=this._shell.getNumPoints(),g=0;g<this._holes.length;g++)f+=this._holes[g].getNumPoints();return f},s.prototype.reverse=function(){var f=this.copy();f._shell=this._shell.copy().reverse(),f._holes=new Array(this._holes.length).fill(null);for(var g=0;g<this._holes.length;g++)f._holes[g]=this._holes[g].copy().reverse();return f},s.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},s.prototype.compareToSameClass=function(){if(arguments.length===1){var f=arguments[0],g=this._shell,_=f._shell;return g.compareToSameClass(_)}if(arguments.length===2){var M=arguments[0],N=arguments[1],G=M,Z=this._shell,st=G._shell,ut=Z.compareToSameClass(st,N);if(ut!==0)return ut;for(var Ot=this.getNumInteriorRing(),Dt=G.getNumInteriorRing(),Bt=0;Bt<Ot&&Bt<Dt;){var Wt=this.getInteriorRingN(Bt),Cr=G.getInteriorRingN(Bt),vn=Wt.compareToSameClass(Cr,N);if(vn!==0)return vn;Bt++}return Bt<Ot?1:Bt<Dt?-1:0}},s.prototype.apply=function(f){if(ct(f,Ai)){this._shell.apply(f);for(var g=0;g<this._holes.length;g++)this._holes[g].apply(f)}else if(ct(f,fe)){if(this._shell.apply(f),!f.isDone())for(var _=0;_<this._holes.length&&(this._holes[_].apply(f),!f.isDone());_++);f.isGeometryChanged()&&this.geometryChanged()}else if(ct(f,qt))f.filter(this);else if(ct(f,Zo)){f.filter(this),this._shell.apply(f);for(var M=0;M<this._holes.length;M++)this._holes[M].apply(f)}},s.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var f=new Array(this._holes.length+1).fill(null);f[0]=this._shell;for(var g=0;g<this._holes.length;g++)f[g+1]=this._holes[g];return f.length<=1?this.getFactory().createLinearRing(f[0].getCoordinateSequence()):this.getFactory().createMultiLineString(f)},s.prototype.clone=function(){var f=o.prototype.clone.call(this);f._shell=this._shell.clone(),f._holes=new Array(this._holes.length).fill(null);for(var g=0;g<this._holes.length;g++)f._holes[g]=this._holes[g].clone();return f},s.prototype.getGeometryType=function(){return"Polygon"},s.prototype.copy=function(){for(var f=this._shell.copy(),g=new Array(this._holes.length).fill(null),_=0;_<g.length;_++)g[_]=this._holes[_].copy();return new s(f,g,this._factory)},s.prototype.getExteriorRing=function(){return this._shell},s.prototype.isEmpty=function(){return this._shell.isEmpty()},s.prototype.getInteriorRingN=function(f){return this._holes[f]},s.prototype.interfaces_=function(){return[Nn]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(s,c),s}(Jt),Ki=function(o){function s(){o.apply(this,arguments)}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={serialVersionUID:{configurable:!0}};return s.prototype.getSortIndex=function(){return Jt.SORTINDEX_MULTIPOINT},s.prototype.isValid=function(){return!0},s.prototype.equalsExact=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];return!!this.isEquivalentClass(f)&&o.prototype.equalsExact.call(this,f,g)}return o.prototype.equalsExact.apply(this,arguments)},s.prototype.getCoordinate=function(){if(arguments.length===1){var f=arguments[0];return this._geometries[f].getCoordinate()}return o.prototype.getCoordinate.apply(this,arguments)},s.prototype.getBoundaryDimension=function(){return gt.FALSE},s.prototype.getDimension=function(){return 0},s.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},s.prototype.getGeometryType=function(){return"MultiPoint"},s.prototype.copy=function(){for(var f=new Array(this._geometries.length).fill(null),g=0;g<f.length;g++)f[g]=this._geometries[g].copy();return new s(f,this._factory)},s.prototype.interfaces_=function(){return[Ri]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(s,c),s}(te),Fi=function(o){function s(f,g){f instanceof F&&g instanceof ge&&(f=g.getCoordinateSequenceFactory().create(f)),o.call(this,f,g),this.validateConstruction()}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return s.prototype.getSortIndex=function(){return Jt.SORTINDEX_LINEARRING},s.prototype.getBoundaryDimension=function(){return gt.FALSE},s.prototype.isClosed=function(){return!!this.isEmpty()||o.prototype.isClosed.call(this)},s.prototype.reverse=function(){var f=this._points.copy();return Te.reverse(f),this.getFactory().createLinearRing(f)},s.prototype.validateConstruction=function(){if(!this.isEmpty()&&!o.prototype.isClosed.call(this))throw new A("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<s.MINIMUM_VALID_SIZE)throw new A("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},s.prototype.getGeometryType=function(){return"LinearRing"},s.prototype.copy=function(){return new s(this._points.copy(),this._factory)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},c.MINIMUM_VALID_SIZE.get=function(){return 4},c.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(s,c),s}(ye),Jo=function(o){function s(){o.apply(this,arguments)}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={serialVersionUID:{configurable:!0}};return s.prototype.getSortIndex=function(){return Jt.SORTINDEX_MULTIPOLYGON},s.prototype.equalsExact=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];return!!this.isEquivalentClass(f)&&o.prototype.equalsExact.call(this,f,g)}return o.prototype.equalsExact.apply(this,arguments)},s.prototype.getBoundaryDimension=function(){return 1},s.prototype.getDimension=function(){return 2},s.prototype.reverse=function(){for(var f=this._geometries.length,g=new Array(f).fill(null),_=0;_<this._geometries.length;_++)g[_]=this._geometries[_].reverse();return this.getFactory().createMultiPolygon(g)},s.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var f=new Et,g=0;g<this._geometries.length;g++)for(var _=this._geometries[g].getBoundary(),M=0;M<_.getNumGeometries();M++)f.add(_.getGeometryN(M));var N=new Array(f.size()).fill(null);return this.getFactory().createMultiLineString(f.toArray(N))},s.prototype.getGeometryType=function(){return"MultiPolygon"},s.prototype.copy=function(){for(var f=new Array(this._geometries.length).fill(null),g=0;g<f.length;g++)f[g]=this._geometries[g].copy();return new s(f,this._factory)},s.prototype.interfaces_=function(){return[Nn]},s.prototype.getClass=function(){return s},c.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(s,c),s}(te),Qi=l(function(o){this._factory=o||null,this._isUserDataCopied=!1},"ie"),Pf={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Qi.prototype.setCopyUserData=function(o){this._isUserDataCopied=o},Qi.prototype.edit=function(o,s){if(o===null)return null;var c=this.editInternal(o,s);return this._isUserDataCopied&&c.setUserData(o.getUserData()),c},Qi.prototype.editInternal=function(o,s){return this._factory===null&&(this._factory=o.getFactory()),o instanceof te?this.editGeometryCollection(o,s):o instanceof xr?this.editPolygon(o,s):o instanceof Ur?s.edit(o,this._factory):o instanceof ye?s.edit(o,this._factory):(Yt.shouldNeverReachHere("Unsupported Geometry class: "+o.getClass().getName()),null)},Qi.prototype.editGeometryCollection=function(o,s){for(var c=s.edit(o,this._factory),f=new Et,g=0;g<c.getNumGeometries();g++){var _=this.edit(c.getGeometryN(g),s);_===null||_.isEmpty()||f.add(_)}return c.getClass()===Ki?this._factory.createMultiPoint(f.toArray([])):c.getClass()===Tr?this._factory.createMultiLineString(f.toArray([])):c.getClass()===Jo?this._factory.createMultiPolygon(f.toArray([])):this._factory.createGeometryCollection(f.toArray([]))},Qi.prototype.editPolygon=function(o,s){var c=s.edit(o,this._factory);if(c===null&&(c=this._factory.createPolygon(null)),c.isEmpty())return c;var f=this.edit(c.getExteriorRing(),s);if(f===null||f.isEmpty())return this._factory.createPolygon();for(var g=new Et,_=0;_<c.getNumInteriorRing();_++){var M=this.edit(c.getInteriorRingN(_),s);M===null||M.isEmpty()||g.add(M)}return this._factory.createPolygon(f,g.toArray([]))},Qi.prototype.interfaces_=function(){return[]},Qi.prototype.getClass=function(){return Qi},Qi.GeometryEditorOperation=function(){},Pf.NoOpGeometryOperation.get=function(){return Jm},Pf.CoordinateOperation.get=function(){return Km},Pf.CoordinateSequenceOperation.get=function(){return Qm},Object.defineProperties(Qi,Pf);var Jm=l(function(){},"oe");Jm.prototype.edit=function(o,s){return o},Jm.prototype.interfaces_=function(){return[Qi.GeometryEditorOperation]},Jm.prototype.getClass=function(){return Jm};var Km=l(function(){},"se");Km.prototype.edit=function(o,s){var c=this.editCoordinates(o.getCoordinates(),o);return c===null?o:o instanceof Fi?s.createLinearRing(c):o instanceof ye?s.createLineString(c):o instanceof Ur?c.length>0?s.createPoint(c[0]):s.createPoint():o},Km.prototype.interfaces_=function(){return[Qi.GeometryEditorOperation]},Km.prototype.getClass=function(){return Km};var Qm=l(function(){},"ae");Qm.prototype.edit=function(o,s){return o instanceof Fi?s.createLinearRing(this.edit(o.getCoordinateSequence(),o)):o instanceof ye?s.createLineString(this.edit(o.getCoordinateSequence(),o)):o instanceof Ur?s.createPoint(this.edit(o.getCoordinateSequence(),o)):o},Qm.prototype.interfaces_=function(){return[Qi.GeometryEditorOperation]},Qm.prototype.getClass=function(){return Qm};var an=l(function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var o=arguments[0];this._coordinates=new Array(o).fill(null);for(var s=0;s<o;s++)this._coordinates[s]=new F}else if(ct(arguments[0],It)){var c=arguments[0];if(c===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=c.getDimension(),this._coordinates=new Array(c.size()).fill(null);for(var f=0;f<this._coordinates.length;f++)this._coordinates[f]=c.getCoordinateCopy(f)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var g=arguments[0],_=arguments[1];this._coordinates=g,this._dimension=_,g===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var M=arguments[0],N=arguments[1];this._coordinates=new Array(M).fill(null),this._dimension=N;for(var G=0;G<M;G++)this._coordinates[G]=new F}}},"ue"),rw={serialVersionUID:{configurable:!0}};an.prototype.setOrdinate=function(o,s,c){switch(s){case It.X:this._coordinates[o].x=c;break;case It.Y:this._coordinates[o].y=c;break;case It.Z:this._coordinates[o].z=c;break;default:throw new A("invalid ordinateIndex")}},an.prototype.size=function(){return this._coordinates.length},an.prototype.getOrdinate=function(o,s){switch(s){case It.X:return this._coordinates[o].x;case It.Y:return this._coordinates[o].y;case It.Z:return this._coordinates[o].z}return L.NaN},an.prototype.getCoordinate=function(){if(arguments.length===1){var o=arguments[0];return this._coordinates[o]}if(arguments.length===2){var s=arguments[0],c=arguments[1];c.x=this._coordinates[s].x,c.y=this._coordinates[s].y,c.z=this._coordinates[s].z}},an.prototype.getCoordinateCopy=function(o){return new F(this._coordinates[o])},an.prototype.getDimension=function(){return this._dimension},an.prototype.getX=function(o){return this._coordinates[o].x},an.prototype.clone=function(){for(var o=new Array(this.size()).fill(null),s=0;s<this._coordinates.length;s++)o[s]=this._coordinates[s].clone();return new an(o,this._dimension)},an.prototype.expandEnvelope=function(o){for(var s=0;s<this._coordinates.length;s++)o.expandToInclude(this._coordinates[s]);return o},an.prototype.copy=function(){for(var o=new Array(this.size()).fill(null),s=0;s<this._coordinates.length;s++)o[s]=this._coordinates[s].copy();return new an(o,this._dimension)},an.prototype.toString=function(){if(this._coordinates.length>0){var o=new St(17*this._coordinates.length);o.append("("),o.append(this._coordinates[0]);for(var s=1;s<this._coordinates.length;s++)o.append(", "),o.append(this._coordinates[s]);return o.append(")"),o.toString()}return"()"},an.prototype.getY=function(o){return this._coordinates[o].y},an.prototype.toCoordinateArray=function(){return this._coordinates},an.prototype.interfaces_=function(){return[It,t]},an.prototype.getClass=function(){return an},rw.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(an,rw);var Xs=l(function(){},"ce"),B2={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Xs.prototype.readResolve=function(){return Xs.instance()},Xs.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var o=arguments[0];return new an(o)}if(ct(arguments[0],It)){var s=arguments[0];return new an(s)}}else if(arguments.length===2){var c=arguments[0],f=arguments[1];return f>3&&(f=3),f<2?new an(c):new an(c,f)}},Xs.prototype.interfaces_=function(){return[K,t]},Xs.prototype.getClass=function(){return Xs},Xs.instance=function(){return Xs.instanceObject},B2.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},B2.instanceObject.get=function(){return new Xs},Object.defineProperties(Xs,B2);var nw=function(o){function s(){o.call(this),this.map_=new Map}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.get=function(c){return this.map_.get(c)||null},s.prototype.put=function(c,f){return this.map_.set(c,f),f},s.prototype.values=function(){for(var c=new Et,f=this.map_.values(),g=f.next();!g.done;)c.add(g.value),g=f.next();return c},s.prototype.entrySet=function(){var c=new lt;return this.map_.entries().forEach(function(f){return c.add(f)}),c},s.prototype.size=function(){return this.map_.size()},s}(X),tr=l(function o(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=o.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ds){var s=arguments[0];this._modelType=s,s===o.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var c=arguments[0];this._modelType=o.FIXED,this.setScale(c)}else if(arguments[0]instanceof o){var f=arguments[0];this._modelType=f._modelType,this._scale=f._scale}}},"t"),G2={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};tr.prototype.equals=function(o){if(!(o instanceof tr))return!1;var s=o;return this._modelType===s._modelType&&this._scale===s._scale},tr.prototype.compareTo=function(o){var s=o,c=this.getMaximumSignificantDigits(),f=s.getMaximumSignificantDigits();return new dt(c).compareTo(new dt(f))},tr.prototype.getScale=function(){return this._scale},tr.prototype.isFloating=function(){return this._modelType===tr.FLOATING||this._modelType===tr.FLOATING_SINGLE},tr.prototype.getType=function(){return this._modelType},tr.prototype.toString=function(){var o="UNKNOWN";return this._modelType===tr.FLOATING?o="Floating":this._modelType===tr.FLOATING_SINGLE?o="Floating-Single":this._modelType===tr.FIXED&&(o="Fixed (Scale="+this.getScale()+")"),o},tr.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var o=arguments[0];return L.isNaN(o)||this._modelType===tr.FLOATING_SINGLE?o:this._modelType===tr.FIXED?Math.round(o*this._scale)/this._scale:o}if(arguments[0]instanceof F){var s=arguments[0];if(this._modelType===tr.FLOATING)return null;s.x=this.makePrecise(s.x),s.y=this.makePrecise(s.y)}},tr.prototype.getMaximumSignificantDigits=function(){var o=16;return this._modelType===tr.FLOATING?o=16:this._modelType===tr.FLOATING_SINGLE?o=6:this._modelType===tr.FIXED&&(o=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),o},tr.prototype.setScale=function(o){this._scale=Math.abs(o)},tr.prototype.interfaces_=function(){return[t,j]},tr.prototype.getClass=function(){return tr},tr.mostPrecise=function(o,s){return o.compareTo(s)>=0?o:s},G2.serialVersionUID.get=function(){return 7777263578777804e3},G2.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(tr,G2);var ds=l(function o(s){this._name=s||null,o.nameToTypeMap.put(s,this)},"t"),V2={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ds.prototype.readResolve=function(){return ds.nameToTypeMap.get(this._name)},ds.prototype.toString=function(){return this._name},ds.prototype.interfaces_=function(){return[t]},ds.prototype.getClass=function(){return ds},V2.serialVersionUID.get=function(){return-552860263173159e4},V2.nameToTypeMap.get=function(){return new nw},Object.defineProperties(ds,V2),tr.Type=ds,tr.FIXED=new ds("FIXED"),tr.FLOATING=new ds("FLOATING"),tr.FLOATING_SINGLE=new ds("FLOATING SINGLE");var ge=l(function o(){this._precisionModel=new tr,this._SRID=0,this._coordinateSequenceFactory=o.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?ct(arguments[0],K)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof tr&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},"t"),iw={serialVersionUID:{configurable:!0}};ge.prototype.toGeometry=function(o){return o.isNull()?this.createPoint(null):o.getMinX()===o.getMaxX()&&o.getMinY()===o.getMaxY()?this.createPoint(new F(o.getMinX(),o.getMinY())):o.getMinX()===o.getMaxX()||o.getMinY()===o.getMaxY()?this.createLineString([new F(o.getMinX(),o.getMinY()),new F(o.getMaxX(),o.getMaxY())]):this.createPolygon(this.createLinearRing([new F(o.getMinX(),o.getMinY()),new F(o.getMinX(),o.getMaxY()),new F(o.getMaxX(),o.getMaxY()),new F(o.getMaxX(),o.getMinY()),new F(o.getMinX(),o.getMinY())]),null)},ge.prototype.createLineString=function(o){return o?o instanceof Array?new ye(this.getCoordinateSequenceFactory().create(o),this):ct(o,It)?new ye(o,this):void 0:new ye(this.getCoordinateSequenceFactory().create([]),this)},ge.prototype.createMultiLineString=function(){if(arguments.length===0)return new Tr(null,this);if(arguments.length===1){var o=arguments[0];return new Tr(o,this)}},ge.prototype.buildGeometry=function(o){for(var s=null,c=!1,f=!1,g=o.iterator();g.hasNext();){var _=g.next(),M=_.getClass();s===null&&(s=M),M!==s&&(c=!0),_.isGeometryCollectionOrDerived()&&(f=!0)}if(s===null)return this.createGeometryCollection();if(c||f)return this.createGeometryCollection(ge.toGeometryArray(o));var N=o.iterator().next();if(o.size()>1){if(N instanceof xr)return this.createMultiPolygon(ge.toPolygonArray(o));if(N instanceof ye)return this.createMultiLineString(ge.toLineStringArray(o));if(N instanceof Ur)return this.createMultiPoint(ge.toPointArray(o));Yt.shouldNeverReachHere("Unhandled class: "+N.getClass().getName())}return N},ge.prototype.createMultiPointFromCoords=function(o){return this.createMultiPoint(o!==null?this.getCoordinateSequenceFactory().create(o):null)},ge.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof F){var o=arguments[0];return this.createPoint(o!==null?this.getCoordinateSequenceFactory().create([o]):null)}if(ct(arguments[0],It)){var s=arguments[0];return new Ur(s,this)}}},ge.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ge.prototype.createPolygon=function(){if(arguments.length===0)return new xr(null,null,this);if(arguments.length===1){if(ct(arguments[0],It)){var o=arguments[0];return this.createPolygon(this.createLinearRing(o))}if(arguments[0]instanceof Array){var s=arguments[0];return this.createPolygon(this.createLinearRing(s))}if(arguments[0]instanceof Fi){var c=arguments[0];return this.createPolygon(c,null)}}else if(arguments.length===2){var f=arguments[0],g=arguments[1];return new xr(f,g,this)}},ge.prototype.getSRID=function(){return this._SRID},ge.prototype.createGeometryCollection=function(){if(arguments.length===0)return new te(null,this);if(arguments.length===1){var o=arguments[0];return new te(o,this)}},ge.prototype.createGeometry=function(o){return new Qi(this).edit(o,{edit:l(function(){if(arguments.length===2){var s=arguments[0];return this._coordinateSequenceFactory.create(s)}},"edit")})},ge.prototype.getPrecisionModel=function(){return this._precisionModel},ge.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var o=arguments[0];return this.createLinearRing(o!==null?this.getCoordinateSequenceFactory().create(o):null)}if(ct(arguments[0],It)){var s=arguments[0];return new Fi(s,this)}}},ge.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Jo(null,this);if(arguments.length===1){var o=arguments[0];return new Jo(o,this)}},ge.prototype.createMultiPoint=function(){if(arguments.length===0)return new Ki(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var o=arguments[0];return new Ki(o,this)}if(arguments[0]instanceof Array){var s=arguments[0];return this.createMultiPoint(s!==null?this.getCoordinateSequenceFactory().create(s):null)}if(ct(arguments[0],It)){var c=arguments[0];if(c===null)return this.createMultiPoint(new Array(0).fill(null));for(var f=new Array(c.size()).fill(null),g=0;g<c.size();g++){var _=this.getCoordinateSequenceFactory().create(1,c.getDimension());Te.copy(c,g,_,0,1),f[g]=this.createPoint(_)}return this.createMultiPoint(f)}}},ge.prototype.interfaces_=function(){return[t]},ge.prototype.getClass=function(){return ge},ge.toMultiPolygonArray=function(o){var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.toGeometryArray=function(o){if(o===null)return null;var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.getDefaultCoordinateSequenceFactory=function(){return Xs.instance()},ge.toMultiLineStringArray=function(o){var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.toLineStringArray=function(o){var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.toMultiPointArray=function(o){var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.toLinearRingArray=function(o){var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.toPointArray=function(o){var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.toPolygonArray=function(o){var s=new Array(o.size()).fill(null);return o.toArray(s)},ge.createPointFromInternalCoord=function(o,s){return s.getPrecisionModel().makePrecise(o),s.getFactory().createPoint(o)},iw.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(ge,iw);var ZL=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],M0=l(function(o){this.geometryFactory=o||new ge},"Ie");M0.prototype.read=function(o){var s,c=(s=typeof o=="string"?JSON.parse(o):o).type;if(!ms[c])throw new Error("Unknown GeoJSON type: "+s.type);return ZL.indexOf(c)!==-1?ms[c].apply(this,[s.coordinates]):c==="GeometryCollection"?ms[c].apply(this,[s.geometries]):ms[c].apply(this,[s])},M0.prototype.write=function(o){var s=o.getGeometryType();if(!Aa[s])throw new Error("Geometry is not supported");return Aa[s].apply(this,[o])};var ms={Feature:l(function(o){var s={};for(var c in o)s[c]=o[c];if(o.geometry){var f=o.geometry.type;if(!ms[f])throw new Error("Unknown GeoJSON type: "+o.type);s.geometry=this.read(o.geometry)}return o.bbox&&(s.bbox=ms.bbox.apply(this,[o.bbox])),s},"Feature"),FeatureCollection:l(function(o){var s={};if(o.features){s.features=[];for(var c=0;c<o.features.length;++c)s.features.push(this.read(o.features[c]))}return o.bbox&&(s.bbox=this.parse.bbox.apply(this,[o.bbox])),s},"FeatureCollection"),coordinates:l(function(o){for(var s=[],c=0;c<o.length;++c){var f=o[c];s.push(new F(f[0],f[1]))}return s},"coordinates"),bbox:l(function(o){return this.geometryFactory.createLinearRing([new F(o[0],o[1]),new F(o[2],o[1]),new F(o[2],o[3]),new F(o[0],o[3]),new F(o[0],o[1])])},"bbox"),Point:l(function(o){var s=new F(o[0],o[1]);return this.geometryFactory.createPoint(s)},"Point"),MultiPoint:l(function(o){for(var s=[],c=0;c<o.length;++c)s.push(ms.Point.apply(this,[o[c]]));return this.geometryFactory.createMultiPoint(s)},"MultiPoint"),LineString:l(function(o){var s=ms.coordinates.apply(this,[o]);return this.geometryFactory.createLineString(s)},"LineString"),MultiLineString:l(function(o){for(var s=[],c=0;c<o.length;++c)s.push(ms.LineString.apply(this,[o[c]]));return this.geometryFactory.createMultiLineString(s)},"MultiLineString"),Polygon:l(function(o){for(var s=ms.coordinates.apply(this,[o[0]]),c=this.geometryFactory.createLinearRing(s),f=[],g=1;g<o.length;++g){var _=o[g],M=ms.coordinates.apply(this,[_]),N=this.geometryFactory.createLinearRing(M);f.push(N)}return this.geometryFactory.createPolygon(c,f)},"Polygon"),MultiPolygon:l(function(o){for(var s=[],c=0;c<o.length;++c){var f=o[c];s.push(ms.Polygon.apply(this,[f]))}return this.geometryFactory.createMultiPolygon(s)},"MultiPolygon"),GeometryCollection:l(function(o){for(var s=[],c=0;c<o.length;++c){var f=o[c];s.push(this.read(f))}return this.geometryFactory.createGeometryCollection(s)},"GeometryCollection")},Aa={coordinate:l(function(o){return[o.x,o.y]},"coordinate"),Point:l(function(o){return{type:"Point",coordinates:Aa.coordinate.apply(this,[o.getCoordinate()])}},"Point"),MultiPoint:l(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=Aa.Point.apply(this,[f]);s.push(g.coordinates)}return{type:"MultiPoint",coordinates:s}},"MultiPoint"),LineString:l(function(o){for(var s=[],c=o.getCoordinates(),f=0;f<c.length;++f){var g=c[f];s.push(Aa.coordinate.apply(this,[g]))}return{type:"LineString",coordinates:s}},"LineString"),MultiLineString:l(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=Aa.LineString.apply(this,[f]);s.push(g.coordinates)}return{type:"MultiLineString",coordinates:s}},"MultiLineString"),Polygon:l(function(o){var s=[],c=Aa.LineString.apply(this,[o._shell]);s.push(c.coordinates);for(var f=0;f<o._holes.length;++f){var g=o._holes[f],_=Aa.LineString.apply(this,[g]);s.push(_.coordinates)}return{type:"Polygon",coordinates:s}},"Polygon"),MultiPolygon:l(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=Aa.Polygon.apply(this,[f]);s.push(g.coordinates)}return{type:"MultiPolygon",coordinates:s}},"MultiPolygon"),GeometryCollection:l(function(o){for(var s=[],c=0;c<o._geometries.length;++c){var f=o._geometries[c],g=f.getGeometryType();s.push(Aa[g].apply(this,[f]))}return{type:"GeometryCollection",geometries:s}},"GeometryCollection")},j2=l(function(o){this.geometryFactory=o||new ge,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new M0(this.geometryFactory)},"Ne");j2.prototype.read=function(o){var s=this.parser.read(o);return this.precisionModel.getType()===tr.FIXED&&this.reducePrecision(s),s},j2.prototype.reducePrecision=function(o){var s,c;if(o.coordinate)this.precisionModel.makePrecise(o.coordinate);else if(o.points)for(s=0,c=o.points.length;s<c;s++)this.precisionModel.makePrecise(o.points[s]);else if(o.geometries)for(s=0,c=o.geometries.length;s<c;s++)this.reducePrecision(o.geometries[s])};var ow=l(function(){this.parser=new M0(this.geometryFactory)},"Ce");ow.prototype.write=function(o){return this.parser.write(o)};var Tt=l(function(){},"Se"),T0={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Tt.prototype.interfaces_=function(){return[]},Tt.prototype.getClass=function(){return Tt},Tt.opposite=function(o){return o===Tt.LEFT?Tt.RIGHT:o===Tt.RIGHT?Tt.LEFT:o},T0.ON.get=function(){return 0},T0.LEFT.get=function(){return 1},T0.RIGHT.get=function(){return 2},Object.defineProperties(Tt,T0),(E.prototype=new Error).name="EmptyStackException",(T.prototype=new ki).add=function(o){return this.array_.push(o),!0},T.prototype.get=function(o){if(o<0||o>=this.size())throw new Error;return this.array_[o]},T.prototype.push=function(o){return this.array_.push(o),o},T.prototype.pop=function(o){if(this.array_.length===0)throw new E;return this.array_.pop()},T.prototype.peek=function(){if(this.array_.length===0)throw new E;return this.array_[this.array_.length-1]},T.prototype.empty=function(){return this.array_.length===0},T.prototype.isEmpty=function(){return this.empty()},T.prototype.search=function(o){return this.array_.indexOf(o)},T.prototype.size=function(){return this.array_.length},T.prototype.toArray=function(){for(var o=[],s=0,c=this.array_.length;s<c;s++)o.push(this.array_[s]);return o};var gs=l(function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null},"be");gs.prototype.getCoordinate=function(){return this._minCoord},gs.prototype.getRightmostSide=function(o,s){var c=this.getRightmostSideOfSegment(o,s);return c<0&&(c=this.getRightmostSideOfSegment(o,s-1)),c<0&&(this._minCoord=null,this.checkForRightmostCoordinate(o)),c},gs.prototype.findRightmostEdgeAtVertex=function(){var o=this._minDe.getEdge().getCoordinates();Yt.isTrue(this._minIndex>0&&this._minIndex<o.length,"rightmost point expected to be interior vertex of edge");var s=o[this._minIndex-1],c=o[this._minIndex+1],f=wt.computeOrientation(this._minCoord,c,s),g=!1;(s.y<this._minCoord.y&&c.y<this._minCoord.y&&f===wt.COUNTERCLOCKWISE||s.y>this._minCoord.y&&c.y>this._minCoord.y&&f===wt.CLOCKWISE)&&(g=!0),g&&(this._minIndex=this._minIndex-1)},gs.prototype.getRightmostSideOfSegment=function(o,s){var c=o.getEdge().getCoordinates();if(s<0||s+1>=c.length||c[s].y===c[s+1].y)return-1;var f=Tt.LEFT;return c[s].y<c[s+1].y&&(f=Tt.RIGHT),f},gs.prototype.getEdge=function(){return this._orientedDe},gs.prototype.checkForRightmostCoordinate=function(o){for(var s=o.getEdge().getCoordinates(),c=0;c<s.length-1;c++)(this._minCoord===null||s[c].x>this._minCoord.x)&&(this._minDe=o,this._minIndex=c,this._minCoord=s[c])},gs.prototype.findRightmostEdgeAtNode=function(){var o=this._minDe.getNode().getEdges();this._minDe=o.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},gs.prototype.findEdge=function(o){for(var s=o.iterator();s.hasNext();){var c=s.next();c.isForward()&&this.checkForRightmostCoordinate(c)}Yt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Tt.LEFT&&(this._orientedDe=this._minDe.getSym())},gs.prototype.interfaces_=function(){return[]},gs.prototype.getClass=function(){return gs};var Na=function(o){function s(c,f){o.call(this,s.msgWithCoord(c,f)),this.pt=f?new F(f):null,this.name="TopologyException"}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.getCoordinate=function(){return this.pt},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s.msgWithCoord=function(c,f){return f?c:c+" [ "+f+" ]"},s}(Wr),w0=l(function(){this.array_=[]},"Oe");w0.prototype.addLast=function(o){this.array_.push(o)},w0.prototype.removeFirst=function(){return this.array_.shift()},w0.prototype.isEmpty=function(){return this.array_.length===0};var di=l(function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new gs},"Te");di.prototype.clearVisitedEdges=function(){for(var o=this._dirEdgeList.iterator();o.hasNext();)o.next().setVisited(!1)},di.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},di.prototype.computeNodeDepth=function(o){for(var s=null,c=o.getEdges().iterator();c.hasNext();){var f=c.next();if(f.isVisited()||f.getSym().isVisited()){s=f;break}}if(s===null)throw new Na("unable to find edge to compute depths at "+o.getCoordinate());o.getEdges().computeDepths(s);for(var g=o.getEdges().iterator();g.hasNext();){var _=g.next();_.setVisited(!0),this.copySymDepths(_)}},di.prototype.computeDepth=function(o){this.clearVisitedEdges();var s=this._finder.getEdge();s.setEdgeDepths(Tt.RIGHT,o),this.copySymDepths(s),this.computeDepths(s)},di.prototype.create=function(o){this.addReachable(o),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},di.prototype.findResultEdges=function(){for(var o=this._dirEdgeList.iterator();o.hasNext();){var s=o.next();s.getDepth(Tt.RIGHT)>=1&&s.getDepth(Tt.LEFT)<=0&&!s.isInteriorAreaEdge()&&s.setInResult(!0)}},di.prototype.computeDepths=function(o){var s=new lt,c=new w0,f=o.getNode();for(c.addLast(f),s.add(f),o.setVisited(!0);!c.isEmpty();){var g=c.removeFirst();s.add(g),this.computeNodeDepth(g);for(var _=g.getEdges().iterator();_.hasNext();){var M=_.next().getSym();if(!M.isVisited()){var N=M.getNode();s.contains(N)||(c.addLast(N),s.add(N))}}}},di.prototype.compareTo=function(o){var s=o;return this._rightMostCoord.x<s._rightMostCoord.x?-1:this._rightMostCoord.x>s._rightMostCoord.x?1:0},di.prototype.getEnvelope=function(){if(this._env===null){for(var o=new Ct,s=this._dirEdgeList.iterator();s.hasNext();)for(var c=s.next().getEdge().getCoordinates(),f=0;f<c.length-1;f++)o.expandToInclude(c[f]);this._env=o}return this._env},di.prototype.addReachable=function(o){var s=new T;for(s.add(o);!s.empty();){var c=s.pop();this.add(c,s)}},di.prototype.copySymDepths=function(o){var s=o.getSym();s.setDepth(Tt.LEFT,o.getDepth(Tt.RIGHT)),s.setDepth(Tt.RIGHT,o.getDepth(Tt.LEFT))},di.prototype.add=function(o,s){o.setVisited(!0),this._nodes.add(o);for(var c=o.getEdges().iterator();c.hasNext();){var f=c.next();this._dirEdgeList.add(f);var g=f.getSym().getNode();g.isVisited()||s.push(g)}},di.prototype.getNodes=function(){return this._nodes},di.prototype.getDirectedEdges=function(){return this._dirEdgeList},di.prototype.interfaces_=function(){return[j]},di.prototype.getClass=function(){return di};var Ar=l(function o(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var s=arguments[0];this.init(s.length)}else if(Number.isInteger(arguments[0])){var c=arguments[0];this.init(1),this.location[Tt.ON]=c}else if(arguments[0]instanceof o){var f=arguments[0];if(this.init(f.location.length),f!==null)for(var g=0;g<this.location.length;g++)this.location[g]=f.location[g]}}else if(arguments.length===3){var _=arguments[0],M=arguments[1],N=arguments[2];this.init(3),this.location[Tt.ON]=_,this.location[Tt.LEFT]=M,this.location[Tt.RIGHT]=N}},"t");Ar.prototype.setAllLocations=function(o){for(var s=0;s<this.location.length;s++)this.location[s]=o},Ar.prototype.isNull=function(){for(var o=0;o<this.location.length;o++)if(this.location[o]!==H.NONE)return!1;return!0},Ar.prototype.setAllLocationsIfNull=function(o){for(var s=0;s<this.location.length;s++)this.location[s]===H.NONE&&(this.location[s]=o)},Ar.prototype.isLine=function(){return this.location.length===1},Ar.prototype.merge=function(o){if(o.location.length>this.location.length){var s=new Array(3).fill(null);s[Tt.ON]=this.location[Tt.ON],s[Tt.LEFT]=H.NONE,s[Tt.RIGHT]=H.NONE,this.location=s}for(var c=0;c<this.location.length;c++)this.location[c]===H.NONE&&c<o.location.length&&(this.location[c]=o.location[c])},Ar.prototype.getLocations=function(){return this.location},Ar.prototype.flip=function(){if(this.location.length<=1)return null;var o=this.location[Tt.LEFT];this.location[Tt.LEFT]=this.location[Tt.RIGHT],this.location[Tt.RIGHT]=o},Ar.prototype.toString=function(){var o=new St;return this.location.length>1&&o.append(H.toLocationSymbol(this.location[Tt.LEFT])),o.append(H.toLocationSymbol(this.location[Tt.ON])),this.location.length>1&&o.append(H.toLocationSymbol(this.location[Tt.RIGHT])),o.toString()},Ar.prototype.setLocations=function(o,s,c){this.location[Tt.ON]=o,this.location[Tt.LEFT]=s,this.location[Tt.RIGHT]=c},Ar.prototype.get=function(o){return o<this.location.length?this.location[o]:H.NONE},Ar.prototype.isArea=function(){return this.location.length>1},Ar.prototype.isAnyNull=function(){for(var o=0;o<this.location.length;o++)if(this.location[o]===H.NONE)return!0;return!1},Ar.prototype.setLocation=function(){if(arguments.length===1){var o=arguments[0];this.setLocation(Tt.ON,o)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.location[s]=c}},Ar.prototype.init=function(o){this.location=new Array(o).fill(null),this.setAllLocations(H.NONE)},Ar.prototype.isEqualOnSide=function(o,s){return this.location[s]===o.location[s]},Ar.prototype.allPositionsEqual=function(o){for(var s=0;s<this.location.length;s++)if(this.location[s]!==o)return!1;return!0},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar};var _r=l(function o(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var s=arguments[0];this.elt[0]=new Ar(s),this.elt[1]=new Ar(s)}else if(arguments[0]instanceof o){var c=arguments[0];this.elt[0]=new Ar(c.elt[0]),this.elt[1]=new Ar(c.elt[1])}}else if(arguments.length===2){var f=arguments[0],g=arguments[1];this.elt[0]=new Ar(H.NONE),this.elt[1]=new Ar(H.NONE),this.elt[f].setLocation(g)}else if(arguments.length===3){var _=arguments[0],M=arguments[1],N=arguments[2];this.elt[0]=new Ar(_,M,N),this.elt[1]=new Ar(_,M,N)}else if(arguments.length===4){var G=arguments[0],Z=arguments[1],st=arguments[2],ut=arguments[3];this.elt[0]=new Ar(H.NONE,H.NONE,H.NONE),this.elt[1]=new Ar(H.NONE,H.NONE,H.NONE),this.elt[G].setLocations(Z,st,ut)}},"t");_r.prototype.getGeometryCount=function(){var o=0;return this.elt[0].isNull()||o++,this.elt[1].isNull()||o++,o},_r.prototype.setAllLocations=function(o,s){this.elt[o].setAllLocations(s)},_r.prototype.isNull=function(o){return this.elt[o].isNull()},_r.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var o=arguments[0];this.setAllLocationsIfNull(0,o),this.setAllLocationsIfNull(1,o)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.elt[s].setAllLocationsIfNull(c)}},_r.prototype.isLine=function(o){return this.elt[o].isLine()},_r.prototype.merge=function(o){for(var s=0;s<2;s++)this.elt[s]===null&&o.elt[s]!==null?this.elt[s]=new Ar(o.elt[s]):this.elt[s].merge(o.elt[s])},_r.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},_r.prototype.getLocation=function(){if(arguments.length===1){var o=arguments[0];return this.elt[o].get(Tt.ON)}if(arguments.length===2){var s=arguments[0],c=arguments[1];return this.elt[s].get(c)}},_r.prototype.toString=function(){var o=new St;return this.elt[0]!==null&&(o.append("A:"),o.append(this.elt[0].toString())),this.elt[1]!==null&&(o.append(" B:"),o.append(this.elt[1].toString())),o.toString()},_r.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var o=arguments[0];return this.elt[o].isArea()}},_r.prototype.isAnyNull=function(o){return this.elt[o].isAnyNull()},_r.prototype.setLocation=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];this.elt[o].setLocation(Tt.ON,s)}else if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2];this.elt[c].setLocation(f,g)}},_r.prototype.isEqualOnSide=function(o,s){return this.elt[0].isEqualOnSide(o.elt[0],s)&&this.elt[1].isEqualOnSide(o.elt[1],s)},_r.prototype.allPositionsEqual=function(o,s){return this.elt[o].allPositionsEqual(s)},_r.prototype.toLine=function(o){this.elt[o].isArea()&&(this.elt[o]=new Ar(this.elt[o].location[0]))},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.toLineLabel=function(o){for(var s=new _r(H.NONE),c=0;c<2;c++)s.setLocation(c,o.getLocation(c));return s};var mn=l(function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Et,this._pts=new Et,this._label=new _r(H.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Et,this._geometryFactory=null;var o=arguments[0],s=arguments[1];this._geometryFactory=s,this.computePoints(o),this.computeRing()},"De");mn.prototype.computeRing=function(){if(this._ring!==null)return null;for(var o=new Array(this._pts.size()).fill(null),s=0;s<this._pts.size();s++)o[s]=this._pts.get(s);this._ring=this._geometryFactory.createLinearRing(o),this._isHole=wt.isCCW(this._ring.getCoordinates())},mn.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},mn.prototype.computePoints=function(o){this._startDe=o;var s=o,c=!0;do{if(s===null)throw new Na("Found null DirectedEdge");if(s.getEdgeRing()===this)throw new Na("Directed Edge visited twice during ring-building at "+s.getCoordinate());this._edges.add(s);var f=s.getLabel();Yt.isTrue(f.isArea()),this.mergeLabel(f),this.addPoints(s.getEdge(),s.isForward(),c),c=!1,this.setEdgeRing(s,this),s=this.getNext(s)}while(s!==this._startDe)},mn.prototype.getLinearRing=function(){return this._ring},mn.prototype.getCoordinate=function(o){return this._pts.get(o)},mn.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var o=this._startDe;do{var s=o.getNode().getEdges().getOutgoingDegree(this);s>this._maxNodeDegree&&(this._maxNodeDegree=s),o=this.getNext(o)}while(o!==this._startDe);this._maxNodeDegree*=2},mn.prototype.addPoints=function(o,s,c){var f=o.getCoordinates();if(s){var g=1;c&&(g=0);for(var _=g;_<f.length;_++)this._pts.add(f[_])}else{var M=f.length-2;c&&(M=f.length-1);for(var N=M;N>=0;N--)this._pts.add(f[N])}},mn.prototype.isHole=function(){return this._isHole},mn.prototype.setInResult=function(){var o=this._startDe;do o.getEdge().setInResult(!0),o=o.getNext();while(o!==this._startDe)},mn.prototype.containsPoint=function(o){var s=this.getLinearRing();if(!s.getEnvelopeInternal().contains(o)||!wt.isPointInRing(o,s.getCoordinates()))return!1;for(var c=this._holes.iterator();c.hasNext();)if(c.next().containsPoint(o))return!1;return!0},mn.prototype.addHole=function(o){this._holes.add(o)},mn.prototype.isShell=function(){return this._shell===null},mn.prototype.getLabel=function(){return this._label},mn.prototype.getEdges=function(){return this._edges},mn.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},mn.prototype.getShell=function(){return this._shell},mn.prototype.mergeLabel=function(){if(arguments.length===1){var o=arguments[0];this.mergeLabel(o,0),this.mergeLabel(o,1)}else if(arguments.length===2){var s=arguments[0],c=arguments[1],f=s.getLocation(c,Tt.RIGHT);if(f===H.NONE)return null;if(this._label.getLocation(c)===H.NONE)return this._label.setLocation(c,f),null}},mn.prototype.setShell=function(o){this._shell=o,o!==null&&o.addHole(this)},mn.prototype.toPolygon=function(o){for(var s=new Array(this._holes.size()).fill(null),c=0;c<this._holes.size();c++)s[c]=this._holes.get(c).getLinearRing();return o.createPolygon(this.getLinearRing(),s)},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var $L=function(o){function s(){var c=arguments[0],f=arguments[1];o.call(this,c,f)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.setEdgeRing=function(c,f){c.setMinEdgeRing(f)},s.prototype.getNext=function(c){return c.getNextMin()},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(mn),JL=function(o){function s(){var c=arguments[0],f=arguments[1];o.call(this,c,f)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.buildMinimalRings=function(){var c=new Et,f=this._startDe;do{if(f.getMinEdgeRing()===null){var g=new $L(f,this._geometryFactory);c.add(g)}f=f.getNext()}while(f!==this._startDe);return c},s.prototype.setEdgeRing=function(c,f){c.setEdgeRing(f)},s.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var c=this._startDe;do c.getNode().getEdges().linkMinimalDirectedEdges(this),c=c.getNext();while(c!==this._startDe)},s.prototype.getNext=function(c){return c.getNext()},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(mn),fo=l(function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var o=arguments[0];this._label=o}}},"Fe");fo.prototype.setVisited=function(o){this._isVisited=o},fo.prototype.setInResult=function(o){this._isInResult=o},fo.prototype.isCovered=function(){return this._isCovered},fo.prototype.isCoveredSet=function(){return this._isCoveredSet},fo.prototype.setLabel=function(o){this._label=o},fo.prototype.getLabel=function(){return this._label},fo.prototype.setCovered=function(o){this._isCovered=o,this._isCoveredSet=!0},fo.prototype.updateIM=function(o){Yt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(o)},fo.prototype.isInResult=function(){return this._isInResult},fo.prototype.isVisited=function(){return this._isVisited},fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo};var P0=function(o){function s(){o.call(this),this._coord=null,this._edges=null;var c=arguments[0],f=arguments[1];this._coord=c,this._edges=f,this._label=new _r(0,H.NONE)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.isIncidentEdgeInResult=function(){for(var c=this.getEdges().getEdges().iterator();c.hasNext();)if(c.next().getEdge().isInResult())return!0;return!1},s.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},s.prototype.getCoordinate=function(){return this._coord},s.prototype.print=function(c){c.println("node "+this._coord+" lbl: "+this._label)},s.prototype.computeIM=function(c){},s.prototype.computeMergedLocation=function(c,f){var g=H.NONE;if(g=this._label.getLocation(f),!c.isNull(f)){var _=c.getLocation(f);g!==H.BOUNDARY&&(g=_)}return g},s.prototype.setLabel=function(){if(arguments.length!==2)return o.prototype.setLabel.apply(this,arguments);var c=arguments[0],f=arguments[1];this._label===null?this._label=new _r(c,f):this._label.setLocation(c,f)},s.prototype.getEdges=function(){return this._edges},s.prototype.mergeLabel=function(){if(arguments[0]instanceof s){var c=arguments[0];this.mergeLabel(c._label)}else if(arguments[0]instanceof _r)for(var f=arguments[0],g=0;g<2;g++){var _=this.computeMergedLocation(f,g);this._label.getLocation(g)===H.NONE&&this._label.setLocation(g,_)}},s.prototype.add=function(c){this._edges.insert(c),c.setNode(this)},s.prototype.setLabelBoundary=function(c){if(this._label===null)return null;var f=H.NONE;this._label!==null&&(f=this._label.getLocation(c));var g=null;switch(f){case H.BOUNDARY:g=H.INTERIOR;break;case H.INTERIOR:default:g=H.BOUNDARY}this._label.setLocation(c,g)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(fo),ys=l(function(){this.nodeMap=new x,this.nodeFact=null;var o=arguments[0];this.nodeFact=o},"qe");ys.prototype.find=function(o){return this.nodeMap.get(o)},ys.prototype.addNode=function(){if(arguments[0]instanceof F){var o=arguments[0],s=this.nodeMap.get(o);return s===null&&(s=this.nodeFact.createNode(o),this.nodeMap.put(o,s)),s}if(arguments[0]instanceof P0){var c=arguments[0],f=this.nodeMap.get(c.getCoordinate());return f===null?(this.nodeMap.put(c.getCoordinate(),c),c):(f.mergeLabel(c),f)}},ys.prototype.print=function(o){for(var s=this.iterator();s.hasNext();)s.next().print(o)},ys.prototype.iterator=function(){return this.nodeMap.values().iterator()},ys.prototype.values=function(){return this.nodeMap.values()},ys.prototype.getBoundaryNodes=function(o){for(var s=new Et,c=this.iterator();c.hasNext();){var f=c.next();f.getLabel().getLocation(o)===H.BOUNDARY&&s.add(f)}return s},ys.prototype.add=function(o){var s=o.getCoordinate();this.addNode(s).add(o)},ys.prototype.interfaces_=function(){return[]},ys.prototype.getClass=function(){return ys};var wr=l(function(){},"Be"),tg={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.isNorthern=function(o){return o===wr.NE||o===wr.NW},wr.isOpposite=function(o,s){return o===s?!1:(o-s+4)%4===2},wr.commonHalfPlane=function(o,s){if(o===s)return o;if((o-s+4)%4===2)return-1;var c=o<s?o:s;return c===0&&(o>s?o:s)===3?3:c},wr.isInHalfPlane=function(o,s){return s===wr.SE?o===wr.SE||o===wr.SW:o===s||o===s+1},wr.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1];if(o===0&&s===0)throw new A("Cannot compute the quadrant for point ( "+o+", "+s+" )");return o>=0?s>=0?wr.NE:wr.SE:s>=0?wr.NW:wr.SW}if(arguments[0]instanceof F&&arguments[1]instanceof F){var c=arguments[0],f=arguments[1];if(f.x===c.x&&f.y===c.y)throw new A("Cannot compute the quadrant for two identical points "+c);return f.x>=c.x?f.y>=c.y?wr.NE:wr.SE:f.y>=c.y?wr.NW:wr.SW}},tg.NE.get=function(){return 0},tg.NW.get=function(){return 1},tg.SW.get=function(){return 2},tg.SE.get=function(){return 3},Object.defineProperties(wr,tg);var ri=l(function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var o=arguments[0];this._edge=o}else if(arguments.length===3){var s=arguments[0],c=arguments[1],f=arguments[2];this._edge=s,this.init(c,f),this._label=null}else if(arguments.length===4){var g=arguments[0],_=arguments[1],M=arguments[2],N=arguments[3];this._edge=g,this.init(_,M),this._label=N}},"Ue");ri.prototype.compareDirection=function(o){return this._dx===o._dx&&this._dy===o._dy?0:this._quadrant>o._quadrant?1:this._quadrant<o._quadrant?-1:wt.computeOrientation(o._p0,o._p1,this._p1)},ri.prototype.getDy=function(){return this._dy},ri.prototype.getCoordinate=function(){return this._p0},ri.prototype.setNode=function(o){this._node=o},ri.prototype.print=function(o){var s=Math.atan2(this._dy,this._dx),c=this.getClass().getName(),f=c.lastIndexOf("."),g=c.substring(f+1);o.print(" "+g+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+s+" "+this._label)},ri.prototype.compareTo=function(o){var s=o;return this.compareDirection(s)},ri.prototype.getDirectedCoordinate=function(){return this._p1},ri.prototype.getDx=function(){return this._dx},ri.prototype.getLabel=function(){return this._label},ri.prototype.getEdge=function(){return this._edge},ri.prototype.getQuadrant=function(){return this._quadrant},ri.prototype.getNode=function(){return this._node},ri.prototype.toString=function(){var o=Math.atan2(this._dy,this._dx),s=this.getClass().getName(),c=s.lastIndexOf(".");return" "+s.substring(c+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+o+" "+this._label},ri.prototype.computeLabel=function(o){},ri.prototype.init=function(o,s){this._p0=o,this._p1=s,this._dx=s.x-o.x,this._dy=s.y-o.y,this._quadrant=wr.quadrant(this._dx,this._dy),Yt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},ri.prototype.interfaces_=function(){return[j]},ri.prototype.getClass=function(){return ri};var U2=function(o){function s(){var c=arguments[0],f=arguments[1];if(o.call(this,c),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=f,f)this.init(c.getCoordinate(0),c.getCoordinate(1));else{var g=c.getNumPoints()-1;this.init(c.getCoordinate(g),c.getCoordinate(g-1))}this.computeDirectedLabel()}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.getNextMin=function(){return this._nextMin},s.prototype.getDepth=function(c){return this._depth[c]},s.prototype.setVisited=function(c){this._isVisited=c},s.prototype.computeDirectedLabel=function(){this._label=new _r(this._edge.getLabel()),this._isForward||this._label.flip()},s.prototype.getNext=function(){return this._next},s.prototype.setDepth=function(c,f){if(this._depth[c]!==-999&&this._depth[c]!==f)throw new Na("assigned depths do not match",this.getCoordinate());this._depth[c]=f},s.prototype.isInteriorAreaEdge=function(){for(var c=!0,f=0;f<2;f++)this._label.isArea(f)&&this._label.getLocation(f,Tt.LEFT)===H.INTERIOR&&this._label.getLocation(f,Tt.RIGHT)===H.INTERIOR||(c=!1);return c},s.prototype.setNextMin=function(c){this._nextMin=c},s.prototype.print=function(c){o.prototype.print.call(this,c),c.print(" "+this._depth[Tt.LEFT]+"/"+this._depth[Tt.RIGHT]),c.print(" ("+this.getDepthDelta()+")"),this._isInResult&&c.print(" inResult")},s.prototype.setMinEdgeRing=function(c){this._minEdgeRing=c},s.prototype.isLineEdge=function(){var c=this._label.isLine(0)||this._label.isLine(1),f=!this._label.isArea(0)||this._label.allPositionsEqual(0,H.EXTERIOR),g=!this._label.isArea(1)||this._label.allPositionsEqual(1,H.EXTERIOR);return c&&f&&g},s.prototype.setEdgeRing=function(c){this._edgeRing=c},s.prototype.getMinEdgeRing=function(){return this._minEdgeRing},s.prototype.getDepthDelta=function(){var c=this._edge.getDepthDelta();return this._isForward||(c=-c),c},s.prototype.setInResult=function(c){this._isInResult=c},s.prototype.getSym=function(){return this._sym},s.prototype.isForward=function(){return this._isForward},s.prototype.getEdge=function(){return this._edge},s.prototype.printEdge=function(c){this.print(c),c.print(" "),this._isForward?this._edge.print(c):this._edge.printReverse(c)},s.prototype.setSym=function(c){this._sym=c},s.prototype.setVisitedEdge=function(c){this.setVisited(c),this._sym.setVisited(c)},s.prototype.setEdgeDepths=function(c,f){var g=this.getEdge().getDepthDelta();this._isForward||(g=-g);var _=1;c===Tt.LEFT&&(_=-1);var M=Tt.opposite(c),N=f+g*_;this.setDepth(c,f),this.setDepth(M,N)},s.prototype.getEdgeRing=function(){return this._edgeRing},s.prototype.isInResult=function(){return this._isInResult},s.prototype.setNext=function(c){this._next=c},s.prototype.isVisited=function(){return this._isVisited},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s.depthFactor=function(c,f){return c===H.EXTERIOR&&f===H.INTERIOR?1:c===H.INTERIOR&&f===H.EXTERIOR?-1:0},s}(ri),Ef=l(function(){},"Xe");Ef.prototype.createNode=function(o){return new P0(o,null)},Ef.prototype.interfaces_=function(){return[]},Ef.prototype.getClass=function(){return Ef};var Zr=l(function(){if(this._edges=new Et,this._nodes=null,this._edgeEndList=new Et,arguments.length===0)this._nodes=new ys(new Ef);else if(arguments.length===1){var o=arguments[0];this._nodes=new ys(o)}},"Ye");Zr.prototype.printEdges=function(o){o.println("Edges:");for(var s=0;s<this._edges.size();s++){o.println("edge "+s+":");var c=this._edges.get(s);c.print(o),c.eiList.print(o)}},Zr.prototype.find=function(o){return this._nodes.find(o)},Zr.prototype.addNode=function(){if(arguments[0]instanceof P0){var o=arguments[0];return this._nodes.addNode(o)}if(arguments[0]instanceof F){var s=arguments[0];return this._nodes.addNode(s)}},Zr.prototype.getNodeIterator=function(){return this._nodes.iterator()},Zr.prototype.linkResultDirectedEdges=function(){for(var o=this._nodes.iterator();o.hasNext();)o.next().getEdges().linkResultDirectedEdges()},Zr.prototype.debugPrintln=function(o){Nt.out.println(o)},Zr.prototype.isBoundaryNode=function(o,s){var c=this._nodes.find(s);if(c===null)return!1;var f=c.getLabel();return f!==null&&f.getLocation(o)===H.BOUNDARY},Zr.prototype.linkAllDirectedEdges=function(){for(var o=this._nodes.iterator();o.hasNext();)o.next().getEdges().linkAllDirectedEdges()},Zr.prototype.matchInSameDirection=function(o,s,c,f){return!!o.equals(c)&&wt.computeOrientation(o,s,f)===wt.COLLINEAR&&wr.quadrant(o,s)===wr.quadrant(c,f)},Zr.prototype.getEdgeEnds=function(){return this._edgeEndList},Zr.prototype.debugPrint=function(o){Nt.out.print(o)},Zr.prototype.getEdgeIterator=function(){return this._edges.iterator()},Zr.prototype.findEdgeInSameDirection=function(o,s){for(var c=0;c<this._edges.size();c++){var f=this._edges.get(c),g=f.getCoordinates();if(this.matchInSameDirection(o,s,g[0],g[1])||this.matchInSameDirection(o,s,g[g.length-1],g[g.length-2]))return f}return null},Zr.prototype.insertEdge=function(o){this._edges.add(o)},Zr.prototype.findEdgeEnd=function(o){for(var s=this.getEdgeEnds().iterator();s.hasNext();){var c=s.next();if(c.getEdge()===o)return c}return null},Zr.prototype.addEdges=function(o){for(var s=o.iterator();s.hasNext();){var c=s.next();this._edges.add(c);var f=new U2(c,!0),g=new U2(c,!1);f.setSym(g),g.setSym(f),this.add(f),this.add(g)}},Zr.prototype.add=function(o){this._nodes.add(o),this._edgeEndList.add(o)},Zr.prototype.getNodes=function(){return this._nodes.values()},Zr.prototype.findEdge=function(o,s){for(var c=0;c<this._edges.size();c++){var f=this._edges.get(c),g=f.getCoordinates();if(o.equals(g[0])&&s.equals(g[1]))return f}return null},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.linkResultDirectedEdges=function(o){for(var s=o.iterator();s.hasNext();)s.next().getEdges().linkResultDirectedEdges()};var to=l(function(){this._geometryFactory=null,this._shellList=new Et;var o=arguments[0];this._geometryFactory=o},"ke");to.prototype.sortShellsAndHoles=function(o,s,c){for(var f=o.iterator();f.hasNext();){var g=f.next();g.isHole()?c.add(g):s.add(g)}},to.prototype.computePolygons=function(o){for(var s=new Et,c=o.iterator();c.hasNext();){var f=c.next().toPolygon(this._geometryFactory);s.add(f)}return s},to.prototype.placeFreeHoles=function(o,s){for(var c=s.iterator();c.hasNext();){var f=c.next();if(f.getShell()===null){var g=this.findEdgeRingContaining(f,o);if(g===null)throw new Na("unable to assign hole to a shell",f.getCoordinate(0));f.setShell(g)}}},to.prototype.buildMinimalEdgeRings=function(o,s,c){for(var f=new Et,g=o.iterator();g.hasNext();){var _=g.next();if(_.getMaxNodeDegree()>2){_.linkDirectedEdgesForMinimalEdgeRings();var M=_.buildMinimalRings(),N=this.findShell(M);N!==null?(this.placePolygonHoles(N,M),s.add(N)):c.addAll(M)}else f.add(_)}return f},to.prototype.containsPoint=function(o){for(var s=this._shellList.iterator();s.hasNext();)if(s.next().containsPoint(o))return!0;return!1},to.prototype.buildMaximalEdgeRings=function(o){for(var s=new Et,c=o.iterator();c.hasNext();){var f=c.next();if(f.isInResult()&&f.getLabel().isArea()&&f.getEdgeRing()===null){var g=new JL(f,this._geometryFactory);s.add(g),g.setInResult()}}return s},to.prototype.placePolygonHoles=function(o,s){for(var c=s.iterator();c.hasNext();){var f=c.next();f.isHole()&&f.setShell(o)}},to.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},to.prototype.findEdgeRingContaining=function(o,s){for(var c=o.getLinearRing(),f=c.getEnvelopeInternal(),g=c.getCoordinateN(0),_=null,M=null,N=s.iterator();N.hasNext();){var G=N.next(),Z=G.getLinearRing(),st=Z.getEnvelopeInternal();_!==null&&(M=_.getLinearRing().getEnvelopeInternal());var ut=!1;st.contains(f)&&wt.isPointInRing(g,Z.getCoordinates())&&(ut=!0),ut&&(_===null||M.contains(st))&&(_=G)}return _},to.prototype.findShell=function(o){for(var s=0,c=null,f=o.iterator();f.hasNext();){var g=f.next();g.isHole()||(c=g,s++)}return Yt.isTrue(s<=1,"found two shells in MinimalEdgeRing list"),c},to.prototype.add=function(){if(arguments.length===1){var o=arguments[0];this.add(o.getEdgeEnds(),o.getNodes())}else if(arguments.length===2){var s=arguments[0],c=arguments[1];Zr.linkResultDirectedEdges(c);var f=this.buildMaximalEdgeRings(s),g=new Et,_=this.buildMinimalEdgeRings(f,this._shellList,g);this.sortShellsAndHoles(_,this._shellList,g),this.placeFreeHoles(this._shellList,g)}},to.prototype.interfaces_=function(){return[]},to.prototype.getClass=function(){return to};var Of=l(function(){},"je");Of.prototype.getBounds=function(){},Of.prototype.interfaces_=function(){return[]},Of.prototype.getClass=function(){return Of};var Ko=l(function(){this._bounds=null,this._item=null;var o=arguments[0],s=arguments[1];this._bounds=o,this._item=s},"He");Ko.prototype.getItem=function(){return this._item},Ko.prototype.getBounds=function(){return this._bounds},Ko.prototype.interfaces_=function(){return[Of,t]},Ko.prototype.getClass=function(){return Ko};var ka=l(function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)},"We");ka.prototype.poll=function(){if(this.isEmpty())return null;var o=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),o},ka.prototype.size=function(){return this._size},ka.prototype.reorder=function(o){for(var s=null,c=this._items.get(o);2*o<=this._size&&((s=2*o)!==this._size&&this._items.get(s+1).compareTo(this._items.get(s))<0&&s++,this._items.get(s).compareTo(c)<0);o=s)this._items.set(o,this._items.get(s));this._items.set(o,c)},ka.prototype.clear=function(){this._size=0,this._items.clear()},ka.prototype.isEmpty=function(){return this._size===0},ka.prototype.add=function(o){this._items.add(null),this._size+=1;var s=this._size;for(this._items.set(0,o);o.compareTo(this._items.get(Math.trunc(s/2)))<0;s/=2)this._items.set(s,this._items.get(Math.trunc(s/2)));this._items.set(s,o)},ka.prototype.interfaces_=function(){return[]},ka.prototype.getClass=function(){return ka};var Ol=l(function(){},"Ke");Ol.prototype.visitItem=function(o){},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol};var rp=l(function(){},"Je");rp.prototype.insert=function(o,s){},rp.prototype.remove=function(o,s){},rp.prototype.query=function(){},rp.prototype.interfaces_=function(){return[]},rp.prototype.getClass=function(){return rp};var Sn=l(function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var o=arguments[0];this._level=o}}},"Qe"),sw={serialVersionUID:{configurable:!0}};Sn.prototype.getLevel=function(){return this._level},Sn.prototype.size=function(){return this._childBoundables.size()},Sn.prototype.getChildBoundables=function(){return this._childBoundables},Sn.prototype.addChildBoundable=function(o){Yt.isTrue(this._bounds===null),this._childBoundables.add(o)},Sn.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Sn.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Sn.prototype.interfaces_=function(){return[Of,t]},Sn.prototype.getClass=function(){return Sn},sw.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Sn,sw);var Qo=l(function(){},"$e");Qo.reverseOrder=function(){return{compare:l(function(o,s){return s.compareTo(o)},"compare")}},Qo.min=function(o){return Qo.sort(o),o.get(0)},Qo.sort=function(o,s){var c=o.toArray();s?bt.sort(c,s):bt.sort(c);for(var f=o.iterator(),g=0,_=c.length;g<_;g++)f.next(),f.set(c[g])},Qo.singletonList=function(o){var s=new Et;return s.add(o),s};var gn=l(function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var o=arguments[0],s=arguments[1],c=arguments[2];this._boundable1=o,this._boundable2=s,this._itemDistance=c,this._distance=this.distance()},"tn");gn.prototype.expandToQueue=function(o,s){var c=gn.isComposite(this._boundable1),f=gn.isComposite(this._boundable2);if(c&&f)return gn.area(this._boundable1)>gn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,o,s),null):(this.expand(this._boundable2,this._boundable1,o,s),null);if(c)return this.expand(this._boundable1,this._boundable2,o,s),null;if(f)return this.expand(this._boundable2,this._boundable1,o,s),null;throw new A("neither boundable is composite")},gn.prototype.isLeaves=function(){return!(gn.isComposite(this._boundable1)||gn.isComposite(this._boundable2))},gn.prototype.compareTo=function(o){var s=o;return this._distance<s._distance?-1:this._distance>s._distance?1:0},gn.prototype.expand=function(o,s,c,f){for(var g=o.getChildBoundables().iterator();g.hasNext();){var _=g.next(),M=new gn(_,s,this._itemDistance);M.getDistance()<f&&c.add(M)}},gn.prototype.getBoundable=function(o){return o===0?this._boundable1:this._boundable2},gn.prototype.getDistance=function(){return this._distance},gn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},gn.prototype.interfaces_=function(){return[j]},gn.prototype.getClass=function(){return gn},gn.area=function(o){return o.getBounds().getArea()},gn.isComposite=function(o){return o instanceof Sn};var kn=l(function o(){if(this._root=null,this._built=!1,this._itemBoundables=new Et,this._nodeCapacity=null,arguments.length===0){var s=o.DEFAULT_NODE_CAPACITY;this._nodeCapacity=s}else if(arguments.length===1){var c=arguments[0];Yt.isTrue(c>1,"Node capacity must be greater than 1"),this._nodeCapacity=c}},"t"),E0={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};kn.prototype.getNodeCapacity=function(){return this._nodeCapacity},kn.prototype.lastNode=function(o){return o.get(o.size()-1)},kn.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var o=0,s=arguments[0].getChildBoundables().iterator();s.hasNext();){var c=s.next();c instanceof Sn?o+=this.size(c):c instanceof Ko&&(o+=1)}return o}},kn.prototype.removeItem=function(o,s){for(var c=null,f=o.getChildBoundables().iterator();f.hasNext();){var g=f.next();g instanceof Ko&&g.getItem()===s&&(c=g)}return c!==null&&(o.getChildBoundables().remove(c),!0)},kn.prototype.itemsTree=function(){if(arguments.length===0){this.build();var o=this.itemsTree(this._root);return o===null?new Et:o}if(arguments.length===1){for(var s=arguments[0],c=new Et,f=s.getChildBoundables().iterator();f.hasNext();){var g=f.next();if(g instanceof Sn){var _=this.itemsTree(g);_!==null&&c.add(_)}else g instanceof Ko?c.add(g.getItem()):Yt.shouldNeverReachHere()}return c.size()<=0?null:c}},kn.prototype.insert=function(o,s){Yt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ko(o,s))},kn.prototype.boundablesAtLevel=function(){if(arguments.length===1){var o=arguments[0],s=new Et;return this.boundablesAtLevel(o,this._root,s),s}if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2];if(Yt.isTrue(c>-2),f.getLevel()===c)return g.add(f),null;for(var _=f.getChildBoundables().iterator();_.hasNext();){var M=_.next();M instanceof Sn?this.boundablesAtLevel(c,M,g):(Yt.isTrue(M instanceof Ko),c===-1&&g.add(M))}return null}},kn.prototype.query=function(){if(arguments.length===1){var o=arguments[0];this.build();var s=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),o)&&this.query(o,this._root,s),s}if(arguments.length===2){var c=arguments[0],f=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),c)&&this.query(c,this._root,f)}else if(arguments.length===3){if(ct(arguments[2],Ol)&&arguments[0]instanceof Object&&arguments[1]instanceof Sn)for(var g=arguments[0],_=arguments[1],M=arguments[2],N=_.getChildBoundables(),G=0;G<N.size();G++){var Z=N.get(G);this.getIntersectsOp().intersects(Z.getBounds(),g)&&(Z instanceof Sn?this.query(g,Z,M):Z instanceof Ko?M.visitItem(Z.getItem()):Yt.shouldNeverReachHere())}else if(ct(arguments[2],ki)&&arguments[0]instanceof Object&&arguments[1]instanceof Sn)for(var st=arguments[0],ut=arguments[1],Ot=arguments[2],Dt=ut.getChildBoundables(),Bt=0;Bt<Dt.size();Bt++){var Wt=Dt.get(Bt);this.getIntersectsOp().intersects(Wt.getBounds(),st)&&(Wt instanceof Sn?this.query(st,Wt,Ot):Wt instanceof Ko?Ot.add(Wt.getItem()):Yt.shouldNeverReachHere())}}},kn.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},kn.prototype.getRoot=function(){return this.build(),this._root},kn.prototype.remove=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),o)&&this.remove(o,this._root,s)}if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2],_=this.removeItem(f,g);if(_)return!0;for(var M=null,N=f.getChildBoundables().iterator();N.hasNext();){var G=N.next();if(this.getIntersectsOp().intersects(G.getBounds(),c)&&G instanceof Sn&&(_=this.remove(c,G,g))){M=G;break}}return M!==null&&M.getChildBoundables().isEmpty()&&f.getChildBoundables().remove(M),_}},kn.prototype.createHigherLevels=function(o,s){Yt.isTrue(!o.isEmpty());var c=this.createParentBoundables(o,s+1);return c.size()===1?c.get(0):this.createHigherLevels(c,s+1)},kn.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var o=0,s=arguments[0].getChildBoundables().iterator();s.hasNext();){var c=s.next();if(c instanceof Sn){var f=this.depth(c);f>o&&(o=f)}}return o+1}},kn.prototype.createParentBoundables=function(o,s){Yt.isTrue(!o.isEmpty());var c=new Et;c.add(this.createNode(s));var f=new Et(o);Qo.sort(f,this.getComparator());for(var g=f.iterator();g.hasNext();){var _=g.next();this.lastNode(c).getChildBoundables().size()===this.getNodeCapacity()&&c.add(this.createNode(s)),this.lastNode(c).addChildBoundable(_)}return c},kn.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},kn.prototype.interfaces_=function(){return[t]},kn.prototype.getClass=function(){return kn},kn.compareDoubles=function(o,s){return o>s?1:o<s?-1:0},E0.IntersectsOp.get=function(){return KL},E0.serialVersionUID.get=function(){return-3886435814360241e3},E0.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(kn,E0);var KL=l(function(){},"rn"),Df=l(function(){},"on");Df.prototype.distance=function(o,s){},Df.prototype.interfaces_=function(){return[]},Df.prototype.getClass=function(){return Df};var aw=function(o){function s(f){f=f||s.DEFAULT_NODE_CAPACITY,o.call(this,f)}l(s,"n"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return s.prototype.createParentBoundablesFromVerticalSlices=function(f,g){Yt.isTrue(f.length>0);for(var _=new Et,M=0;M<f.length;M++)_.addAll(this.createParentBoundablesFromVerticalSlice(f[M],g));return _},s.prototype.createNode=function(f){return new lw(f)},s.prototype.size=function(){return arguments.length===0?o.prototype.size.call(this):o.prototype.size.apply(this,arguments)},s.prototype.insert=function(){if(arguments.length!==2)return o.prototype.insert.apply(this,arguments);var f=arguments[0],g=arguments[1];if(f.isNull())return null;o.prototype.insert.call(this,f,g)},s.prototype.getIntersectsOp=function(){return s.intersectsOp},s.prototype.verticalSlices=function(f,g){for(var _=Math.trunc(Math.ceil(f.size()/g)),M=new Array(g).fill(null),N=f.iterator(),G=0;G<g;G++){M[G]=new Et;for(var Z=0;N.hasNext()&&Z<_;){var st=N.next();M[G].add(st),Z++}}return M},s.prototype.query=function(){if(arguments.length===1){var f=arguments[0];return o.prototype.query.call(this,f)}if(arguments.length===2){var g=arguments[0],_=arguments[1];o.prototype.query.call(this,g,_)}else if(arguments.length===3){if(ct(arguments[2],Ol)&&arguments[0]instanceof Object&&arguments[1]instanceof Sn){var M=arguments[0],N=arguments[1],G=arguments[2];o.prototype.query.call(this,M,N,G)}else if(ct(arguments[2],ki)&&arguments[0]instanceof Object&&arguments[1]instanceof Sn){var Z=arguments[0],st=arguments[1],ut=arguments[2];o.prototype.query.call(this,Z,st,ut)}}},s.prototype.getComparator=function(){return s.yComparator},s.prototype.createParentBoundablesFromVerticalSlice=function(f,g){return o.prototype.createParentBoundables.call(this,f,g)},s.prototype.remove=function(){if(arguments.length===2){var f=arguments[0],g=arguments[1];return o.prototype.remove.call(this,f,g)}return o.prototype.remove.apply(this,arguments)},s.prototype.depth=function(){return arguments.length===0?o.prototype.depth.call(this):o.prototype.depth.apply(this,arguments)},s.prototype.createParentBoundables=function(f,g){Yt.isTrue(!f.isEmpty());var _=Math.trunc(Math.ceil(f.size()/this.getNodeCapacity())),M=new Et(f);Qo.sort(M,s.xComparator);var N=this.verticalSlices(M,Math.trunc(Math.ceil(Math.sqrt(_))));return this.createParentBoundablesFromVerticalSlices(N,g)},s.prototype.nearestNeighbour=function(){if(arguments.length===1){if(ct(arguments[0],Df)){var f=arguments[0],g=new gn(this.getRoot(),this.getRoot(),f);return this.nearestNeighbour(g)}if(arguments[0]instanceof gn){var _=arguments[0];return this.nearestNeighbour(_,L.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof s&&ct(arguments[1],Df)){var M=arguments[0],N=arguments[1],G=new gn(this.getRoot(),M.getRoot(),N);return this.nearestNeighbour(G)}if(arguments[0]instanceof gn&&typeof arguments[1]=="number"){var Z=arguments[0],st=arguments[1],ut=null,Ot=new ka;for(Ot.add(Z);!Ot.isEmpty()&&st>0;){var Dt=Ot.poll(),Bt=Dt.getDistance();if(Bt>=st)break;Dt.isLeaves()?(st=Bt,ut=Dt):Dt.expandToQueue(Ot,st)}return[ut.getBoundable(0).getItem(),ut.getBoundable(1).getItem()]}}else if(arguments.length===3){var Wt=arguments[0],Cr=arguments[1],vn=arguments[2],_i=new Ko(Wt,Cr),ta=new gn(this.getRoot(),_i,vn);return this.nearestNeighbour(ta)[0]}},s.prototype.interfaces_=function(){return[rp,t]},s.prototype.getClass=function(){return s},s.centreX=function(f){return s.avg(f.getMinX(),f.getMaxX())},s.avg=function(f,g){return(f+g)/2},s.centreY=function(f){return s.avg(f.getMinY(),f.getMaxY())},c.STRtreeNode.get=function(){return lw},c.serialVersionUID.get=function(){return 0x39920f7d5f261e0},c.xComparator.get=function(){return{interfaces_:l(function(){return[$]},"interfaces_"),compare:l(function(f,g){return o.compareDoubles(s.centreX(f.getBounds()),s.centreX(g.getBounds()))},"compare")}},c.yComparator.get=function(){return{interfaces_:l(function(){return[$]},"interfaces_"),compare:l(function(f,g){return o.compareDoubles(s.centreY(f.getBounds()),s.centreY(g.getBounds()))},"compare")}},c.intersectsOp.get=function(){return{interfaces_:l(function(){return[o.IntersectsOp]},"interfaces_"),intersects:l(function(f,g){return f.intersects(g)},"intersects")}},c.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(s,c),s}(kn),lw=function(o){function s(){var c=arguments[0];o.call(this,c)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.computeBounds=function(){for(var c=null,f=this.getChildBoundables().iterator();f.hasNext();){var g=f.next();c===null?c=new Ct(g.getBounds()):c.expandToInclude(g.getBounds())}return c},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(Sn),Bi=l(function(){},"un");Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi},Bi.relativeSign=function(o,s){return o<s?-1:o>s?1:0},Bi.compare=function(o,s,c){if(s.equals2D(c))return 0;var f=Bi.relativeSign(s.x,c.x),g=Bi.relativeSign(s.y,c.y);switch(o){case 0:return Bi.compareValue(f,g);case 1:return Bi.compareValue(g,f);case 2:return Bi.compareValue(g,-f);case 3:return Bi.compareValue(-f,g);case 4:return Bi.compareValue(-f,-g);case 5:return Bi.compareValue(-g,-f);case 6:return Bi.compareValue(-g,f);case 7:return Bi.compareValue(f,-g)}return Yt.shouldNeverReachHere("invalid octant value"),0},Bi.compareValue=function(o,s){return o<0?-1:o>0?1:s<0?-1:s>0?1:0};var Dl=l(function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var o=arguments[0],s=arguments[1],c=arguments[2],f=arguments[3];this._segString=o,this.coord=new F(s),this.segmentIndex=c,this._segmentOctant=f,this._isInterior=!s.equals2D(o.getCoordinate(c))},"ln");Dl.prototype.getCoordinate=function(){return this.coord},Dl.prototype.print=function(o){o.print(this.coord),o.print(" seg # = "+this.segmentIndex)},Dl.prototype.compareTo=function(o){var s=o;return this.segmentIndex<s.segmentIndex?-1:this.segmentIndex>s.segmentIndex?1:this.coord.equals2D(s.coord)?0:Bi.compare(this._segmentOctant,this.coord,s.coord)},Dl.prototype.isEndPoint=function(o){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===o},Dl.prototype.isInterior=function(){return this._isInterior},Dl.prototype.interfaces_=function(){return[j]},Dl.prototype.getClass=function(){return Dl};var mi=l(function(){this._nodeMap=new x,this._edge=null;var o=arguments[0];this._edge=o},"cn");mi.prototype.getSplitCoordinates=function(){var o=new et;this.addEndpoints();for(var s=this.iterator(),c=s.next();s.hasNext();){var f=s.next();this.addEdgeCoordinates(c,f,o),c=f}return o.toCoordinateArray()},mi.prototype.addCollapsedNodes=function(){var o=new Et;this.findCollapsesFromInsertedNodes(o),this.findCollapsesFromExistingVertices(o);for(var s=o.iterator();s.hasNext();){var c=s.next().intValue();this.add(this._edge.getCoordinate(c),c)}},mi.prototype.print=function(o){o.println("Intersections:");for(var s=this.iterator();s.hasNext();)s.next().print(o)},mi.prototype.findCollapsesFromExistingVertices=function(o){for(var s=0;s<this._edge.size()-2;s++){var c=this._edge.getCoordinate(s),f=this._edge.getCoordinate(s+2);c.equals2D(f)&&o.add(new dt(s+1))}},mi.prototype.addEdgeCoordinates=function(o,s,c){var f=this._edge.getCoordinate(s.segmentIndex),g=s.isInterior()||!s.coord.equals2D(f);c.add(new F(o.coord),!1);for(var _=o.segmentIndex+1;_<=s.segmentIndex;_++)c.add(this._edge.getCoordinate(_));g&&c.add(new F(s.coord))},mi.prototype.iterator=function(){return this._nodeMap.values().iterator()},mi.prototype.addSplitEdges=function(o){this.addEndpoints(),this.addCollapsedNodes();for(var s=this.iterator(),c=s.next();s.hasNext();){var f=s.next(),g=this.createSplitEdge(c,f);o.add(g),c=f}},mi.prototype.findCollapseIndex=function(o,s,c){if(!o.coord.equals2D(s.coord))return!1;var f=s.segmentIndex-o.segmentIndex;return s.isInterior()||f--,f===1&&(c[0]=o.segmentIndex+1,!0)},mi.prototype.findCollapsesFromInsertedNodes=function(o){for(var s=new Array(1).fill(null),c=this.iterator(),f=c.next();c.hasNext();){var g=c.next();this.findCollapseIndex(f,g,s)&&o.add(new dt(s[0])),f=g}},mi.prototype.getEdge=function(){return this._edge},mi.prototype.addEndpoints=function(){var o=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(o),o)},mi.prototype.createSplitEdge=function(o,s){var c=s.segmentIndex-o.segmentIndex+2,f=this._edge.getCoordinate(s.segmentIndex),g=s.isInterior()||!s.coord.equals2D(f);g||c--;var _=new Array(c).fill(null),M=0;_[M++]=new F(o.coord);for(var N=o.segmentIndex+1;N<=s.segmentIndex;N++)_[M++]=this._edge.getCoordinate(N);return g&&(_[M]=new F(s.coord)),new ln(_,this._edge.getData())},mi.prototype.add=function(o,s){var c=new Dl(this._edge,o,s,this._edge.getSegmentOctant(s)),f=this._nodeMap.get(c);return f!==null?(Yt.isTrue(f.coord.equals2D(o),"Found equal nodes with different coordinates"),f):(this._nodeMap.put(c,c),c)},mi.prototype.checkSplitEdgesCorrectness=function(o){var s=this._edge.getCoordinates(),c=o.get(0).getCoordinate(0);if(!c.equals2D(s[0]))throw new Wr("bad split edge start point at "+c);var f=o.get(o.size()-1).getCoordinates(),g=f[f.length-1];if(!g.equals2D(s[s.length-1]))throw new Wr("bad split edge end point at "+g)},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var np=l(function(){},"pn");np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},np.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1];if(o===0&&s===0)throw new A("Cannot compute the octant for point ( "+o+", "+s+" )");var c=Math.abs(o),f=Math.abs(s);return o>=0?s>=0?c>=f?0:1:c>=f?7:6:s>=0?c>=f?3:2:c>=f?4:5}if(arguments[0]instanceof F&&arguments[1]instanceof F){var g=arguments[0],_=arguments[1],M=_.x-g.x,N=_.y-g.y;if(M===0&&N===0)throw new A("Cannot compute the octant for two identical points "+g);return np.octant(M,N)}};var Ys=l(function(){},"hn");Ys.prototype.getCoordinates=function(){},Ys.prototype.size=function(){},Ys.prototype.getCoordinate=function(o){},Ys.prototype.isClosed=function(){},Ys.prototype.setData=function(o){},Ys.prototype.getData=function(){},Ys.prototype.interfaces_=function(){return[]},Ys.prototype.getClass=function(){return Ys};var eg=l(function(){},"fn");eg.prototype.addIntersection=function(o,s){},eg.prototype.interfaces_=function(){return[Ys]},eg.prototype.getClass=function(){return eg};var ln=l(function(){this._nodeList=new mi(this),this._pts=null,this._data=null;var o=arguments[0],s=arguments[1];this._pts=o,this._data=s},"gn");ln.prototype.getCoordinates=function(){return this._pts},ln.prototype.size=function(){return this._pts.length},ln.prototype.getCoordinate=function(o){return this._pts[o]},ln.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},ln.prototype.getSegmentOctant=function(o){return o===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(o),this.getCoordinate(o+1))},ln.prototype.setData=function(o){this._data=o},ln.prototype.safeOctant=function(o,s){return o.equals2D(s)?0:np.octant(o,s)},ln.prototype.getData=function(){return this._data},ln.prototype.addIntersection=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];this.addIntersectionNode(o,s)}else if(arguments.length===4){var c=arguments[0],f=arguments[1],g=arguments[3],_=new F(c.getIntersection(g));this.addIntersection(_,f)}},ln.prototype.toString=function(){return br.toLineString(new an(this._pts))},ln.prototype.getNodeList=function(){return this._nodeList},ln.prototype.addIntersectionNode=function(o,s){var c=s,f=c+1;if(f<this._pts.length){var g=this._pts[f];o.equals2D(g)&&(c=f)}return this._nodeList.add(o,c)},ln.prototype.addIntersections=function(o,s,c){for(var f=0;f<o.getIntersectionNum();f++)this.addIntersection(o,s,c,f)},ln.prototype.interfaces_=function(){return[eg]},ln.prototype.getClass=function(){return ln},ln.getNodedSubstrings=function(){if(arguments.length===1){var o=arguments[0],s=new Et;return ln.getNodedSubstrings(o,s),s}if(arguments.length===2)for(var c=arguments[0],f=arguments[1],g=c.iterator();g.hasNext();)g.next().getNodeList().addSplitEdges(f)};var Ut=l(function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new F,this.p1=new F;else if(arguments.length===1){var o=arguments[0];this.p0=new F(o.p0),this.p1=new F(o.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var s=arguments[0],c=arguments[1],f=arguments[2],g=arguments[3];this.p0=new F(s,c),this.p1=new F(f,g)}},"dn"),uw={serialVersionUID:{configurable:!0}};Ut.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},Ut.prototype.orientationIndex=function(){if(arguments[0]instanceof Ut){var o=arguments[0],s=wt.orientationIndex(this.p0,this.p1,o.p0),c=wt.orientationIndex(this.p0,this.p1,o.p1);return s>=0&&c>=0||s<=0&&c<=0?Math.max(s,c):0}if(arguments[0]instanceof F){var f=arguments[0];return wt.orientationIndex(this.p0,this.p1,f)}},Ut.prototype.toGeometry=function(o){return o.createLineString([this.p0,this.p1])},Ut.prototype.isVertical=function(){return this.p0.x===this.p1.x},Ut.prototype.equals=function(o){if(!(o instanceof Ut))return!1;var s=o;return this.p0.equals(s.p0)&&this.p1.equals(s.p1)},Ut.prototype.intersection=function(o){var s=new Ji;return s.computeIntersection(this.p0,this.p1,o.p0,o.p1),s.hasIntersection()?s.getIntersection(0):null},Ut.prototype.project=function(){if(arguments[0]instanceof F){var o=arguments[0];if(o.equals(this.p0)||o.equals(this.p1))return new F(o);var s=this.projectionFactor(o),c=new F;return c.x=this.p0.x+s*(this.p1.x-this.p0.x),c.y=this.p0.y+s*(this.p1.y-this.p0.y),c}if(arguments[0]instanceof Ut){var f=arguments[0],g=this.projectionFactor(f.p0),_=this.projectionFactor(f.p1);if(g>=1&&_>=1||g<=0&&_<=0)return null;var M=this.project(f.p0);g<0&&(M=this.p0),g>1&&(M=this.p1);var N=this.project(f.p1);return _<0&&(N=this.p0),_>1&&(N=this.p1),new Ut(M,N)}},Ut.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Ut.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Ut.prototype.getCoordinate=function(o){return o===0?this.p0:this.p1},Ut.prototype.distancePerpendicular=function(o){return wt.distancePointLinePerpendicular(o,this.p0,this.p1)},Ut.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Ut.prototype.midPoint=function(){return Ut.midPoint(this.p0,this.p1)},Ut.prototype.projectionFactor=function(o){if(o.equals(this.p0))return 0;if(o.equals(this.p1))return 1;var s=this.p1.x-this.p0.x,c=this.p1.y-this.p0.y,f=s*s+c*c;return f<=0?L.NaN:((o.x-this.p0.x)*s+(o.y-this.p0.y)*c)/f},Ut.prototype.closestPoints=function(o){var s=this.intersection(o);if(s!==null)return[s,s];var c=new Array(2).fill(null),f=L.MAX_VALUE,g=null,_=this.closestPoint(o.p0);f=_.distance(o.p0),c[0]=_,c[1]=o.p0;var M=this.closestPoint(o.p1);(g=M.distance(o.p1))<f&&(f=g,c[0]=M,c[1]=o.p1);var N=o.closestPoint(this.p0);(g=N.distance(this.p0))<f&&(f=g,c[0]=this.p0,c[1]=N);var G=o.closestPoint(this.p1);return(g=G.distance(this.p1))<f&&(f=g,c[0]=this.p1,c[1]=G),c},Ut.prototype.closestPoint=function(o){var s=this.projectionFactor(o);return s>0&&s<1?this.project(o):this.p0.distance(o)<this.p1.distance(o)?this.p0:this.p1},Ut.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},Ut.prototype.getLength=function(){return this.p0.distance(this.p1)},Ut.prototype.compareTo=function(o){var s=o,c=this.p0.compareTo(s.p0);return c!==0?c:this.p1.compareTo(s.p1)},Ut.prototype.reverse=function(){var o=this.p0;this.p0=this.p1,this.p1=o},Ut.prototype.equalsTopo=function(o){return this.p0.equals(o.p0)&&(this.p1.equals(o.p1)||this.p0.equals(o.p1))&&this.p1.equals(o.p0)},Ut.prototype.lineIntersection=function(o){try{return At.intersection(this.p0,this.p1,o.p0,o.p1)}catch(s){if(!(s instanceof Qe))throw s}return null},Ut.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},Ut.prototype.pointAlongOffset=function(o,s){var c=this.p0.x+o*(this.p1.x-this.p0.x),f=this.p0.y+o*(this.p1.y-this.p0.y),g=this.p1.x-this.p0.x,_=this.p1.y-this.p0.y,M=Math.sqrt(g*g+_*_),N=0,G=0;if(s!==0){if(M<=0)throw new Error("Cannot compute offset from zero-length line segment");N=s*g/M,G=s*_/M}return new F(c-G,f+N)},Ut.prototype.setCoordinates=function(){if(arguments.length===1){var o=arguments[0];this.setCoordinates(o.p0,o.p1)}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this.p0.x=s.x,this.p0.y=s.y,this.p1.x=c.x,this.p1.y=c.y}},Ut.prototype.segmentFraction=function(o){var s=this.projectionFactor(o);return s<0?s=0:(s>1||L.isNaN(s))&&(s=1),s},Ut.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Ut.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Ut.prototype.distance=function(){if(arguments[0]instanceof Ut){var o=arguments[0];return wt.distanceLineLine(this.p0,this.p1,o.p0,o.p1)}if(arguments[0]instanceof F){var s=arguments[0];return wt.distancePointLine(s,this.p0,this.p1)}},Ut.prototype.pointAlong=function(o){var s=new F;return s.x=this.p0.x+o*(this.p1.x-this.p0.x),s.y=this.p0.y+o*(this.p1.y-this.p0.y),s},Ut.prototype.hashCode=function(){var o=L.doubleToLongBits(this.p0.x);o^=31*L.doubleToLongBits(this.p0.y);var s=Math.trunc(o)^Math.trunc(o>>32),c=L.doubleToLongBits(this.p1.x);return c^=31*L.doubleToLongBits(this.p1.y),s^(Math.trunc(c)^Math.trunc(c>>32))},Ut.prototype.interfaces_=function(){return[j,t]},Ut.prototype.getClass=function(){return Ut},Ut.midPoint=function(o,s){return new F((o.x+s.x)/2,(o.y+s.y)/2)},uw.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Ut,uw);var rg=l(function(){this.tempEnv1=new Ct,this.tempEnv2=new Ct,this._overlapSeg1=new Ut,this._overlapSeg2=new Ut},"_n");rg.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var o=arguments[0],s=arguments[1],c=arguments[2],f=arguments[3];o.getLineSegment(s,this._overlapSeg1),c.getLineSegment(f,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},rg.prototype.interfaces_=function(){return[]},rg.prototype.getClass=function(){return rg};var eo=l(function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var o=arguments[0],s=arguments[1],c=arguments[2],f=arguments[3];this._pts=o,this._start=s,this._end=c,this._context=f},"mn");eo.prototype.getLineSegment=function(o,s){s.p0=this._pts[o],s.p1=this._pts[o+1]},eo.prototype.computeSelect=function(o,s,c,f){var g=this._pts[s],_=this._pts[c];if(f.tempEnv1.init(g,_),c-s==1)return f.select(this,s),null;if(!o.intersects(f.tempEnv1))return null;var M=Math.trunc((s+c)/2);s<M&&this.computeSelect(o,s,M,f),M<c&&this.computeSelect(o,M,c,f)},eo.prototype.getCoordinates=function(){for(var o=new Array(this._end-this._start+1).fill(null),s=0,c=this._start;c<=this._end;c++)o[s++]=this._pts[c];return o},eo.prototype.computeOverlaps=function(o,s){this.computeOverlapsInternal(this._start,this._end,o,o._start,o._end,s)},eo.prototype.setId=function(o){this._id=o},eo.prototype.select=function(o,s){this.computeSelect(o,this._start,this._end,s)},eo.prototype.getEnvelope=function(){if(this._env===null){var o=this._pts[this._start],s=this._pts[this._end];this._env=new Ct(o,s)}return this._env},eo.prototype.getEndIndex=function(){return this._end},eo.prototype.getStartIndex=function(){return this._start},eo.prototype.getContext=function(){return this._context},eo.prototype.getId=function(){return this._id},eo.prototype.computeOverlapsInternal=function(o,s,c,f,g,_){var M=this._pts[o],N=this._pts[s],G=c._pts[f],Z=c._pts[g];if(s-o==1&&g-f==1)return _.overlap(this,o,c,f),null;if(_.tempEnv1.init(M,N),_.tempEnv2.init(G,Z),!_.tempEnv1.intersects(_.tempEnv2))return null;var st=Math.trunc((o+s)/2),ut=Math.trunc((f+g)/2);o<st&&(f<ut&&this.computeOverlapsInternal(o,st,c,f,ut,_),ut<g&&this.computeOverlapsInternal(o,st,c,ut,g,_)),st<s&&(f<ut&&this.computeOverlapsInternal(st,s,c,f,ut,_),ut<g&&this.computeOverlapsInternal(st,s,c,ut,g,_))},eo.prototype.interfaces_=function(){return[]},eo.prototype.getClass=function(){return eo};var vs=l(function(){},"vn");vs.prototype.interfaces_=function(){return[]},vs.prototype.getClass=function(){return vs},vs.getChainStartIndices=function(o){var s=0,c=new Et;c.add(new dt(s));do{var f=vs.findChainEnd(o,s);c.add(new dt(f)),s=f}while(s<o.length-1);return vs.toIntArray(c)},vs.findChainEnd=function(o,s){for(var c=s;c<o.length-1&&o[c].equals2D(o[c+1]);)c++;if(c>=o.length-1)return o.length-1;for(var f=wr.quadrant(o[c],o[c+1]),g=s+1;g<o.length&&!(!o[g-1].equals2D(o[g])&&wr.quadrant(o[g-1],o[g])!==f);)g++;return g-1},vs.getChains=function(){if(arguments.length===1){var o=arguments[0];return vs.getChains(o,null)}if(arguments.length===2){for(var s=arguments[0],c=arguments[1],f=new Et,g=vs.getChainStartIndices(s),_=0;_<g.length-1;_++){var M=new eo(s,g[_],g[_+1],c);f.add(M)}return f}},vs.toIntArray=function(o){for(var s=new Array(o.size()).fill(null),c=0;c<s.length;c++)s[c]=o.get(c).intValue();return s};var Wu=l(function(){},"In");Wu.prototype.computeNodes=function(o){},Wu.prototype.getNodedSubstrings=function(){},Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu};var ng=l(function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var o=arguments[0];this.setSegmentIntersector(o)}}},"En");ng.prototype.setSegmentIntersector=function(o){this._segInt=o},ng.prototype.interfaces_=function(){return[Wu]},ng.prototype.getClass=function(){return ng};var z2=function(o){function s(f){f?o.call(this,f):o.call(this),this._monoChains=new Et,this._index=new aw,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}l(s,"e"),o&&(s.__proto__=o),(s.prototype=Object.create(o&&o.prototype)).constructor=s;var c={SegmentOverlapAction:{configurable:!0}};return s.prototype.getMonotoneChains=function(){return this._monoChains},s.prototype.getNodedSubstrings=function(){return ln.getNodedSubstrings(this._nodedSegStrings)},s.prototype.getIndex=function(){return this._index},s.prototype.add=function(f){for(var g=vs.getChains(f.getCoordinates(),f).iterator();g.hasNext();){var _=g.next();_.setId(this._idCounter++),this._index.insert(_.getEnvelope(),_),this._monoChains.add(_)}},s.prototype.computeNodes=function(f){this._nodedSegStrings=f;for(var g=f.iterator();g.hasNext();)this.add(g.next());this.intersectChains()},s.prototype.intersectChains=function(){for(var f=new cw(this._segInt),g=this._monoChains.iterator();g.hasNext();)for(var _=g.next(),M=this._index.query(_.getEnvelope()).iterator();M.hasNext();){var N=M.next();if(N.getId()>_.getId()&&(_.computeOverlaps(N,f),this._nOverlaps++),this._segInt.isDone())return null}},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},c.SegmentOverlapAction.get=function(){return cw},Object.defineProperties(s,c),s}(ng),cw=function(o){function s(){o.call(this),this._si=null;var c=arguments[0];this._si=c}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.overlap=function(){if(arguments.length!==4)return o.prototype.overlap.apply(this,arguments);var c=arguments[0],f=arguments[1],g=arguments[2],_=arguments[3],M=c.getContext(),N=g.getContext();this._si.processIntersections(M,f,N,_)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(rg),er=l(function o(){if(this._quadrantSegments=o.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=o.CAP_ROUND,this._joinStyle=o.JOIN_ROUND,this._mitreLimit=o.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=o.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var s=arguments[0];this.setQuadrantSegments(s)}else if(arguments.length===2){var c=arguments[0],f=arguments[1];this.setQuadrantSegments(c),this.setEndCapStyle(f)}else if(arguments.length===4){var g=arguments[0],_=arguments[1],M=arguments[2],N=arguments[3];this.setQuadrantSegments(g),this.setEndCapStyle(_),this.setJoinStyle(M),this.setMitreLimit(N)}}},"t"),Ra={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};er.prototype.getEndCapStyle=function(){return this._endCapStyle},er.prototype.isSingleSided=function(){return this._isSingleSided},er.prototype.setQuadrantSegments=function(o){this._quadrantSegments=o,this._quadrantSegments===0&&(this._joinStyle=er.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=er.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),o<=0&&(this._quadrantSegments=1),this._joinStyle!==er.JOIN_ROUND&&(this._quadrantSegments=er.DEFAULT_QUADRANT_SEGMENTS)},er.prototype.getJoinStyle=function(){return this._joinStyle},er.prototype.setJoinStyle=function(o){this._joinStyle=o},er.prototype.setSimplifyFactor=function(o){this._simplifyFactor=o<0?0:o},er.prototype.getSimplifyFactor=function(){return this._simplifyFactor},er.prototype.getQuadrantSegments=function(){return this._quadrantSegments},er.prototype.setEndCapStyle=function(o){this._endCapStyle=o},er.prototype.getMitreLimit=function(){return this._mitreLimit},er.prototype.setMitreLimit=function(o){this._mitreLimit=o},er.prototype.setSingleSided=function(o){this._isSingleSided=o},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er},er.bufferDistanceError=function(o){var s=Math.PI/2/o;return 1-Math.cos(s/2)},Ra.CAP_ROUND.get=function(){return 1},Ra.CAP_FLAT.get=function(){return 2},Ra.CAP_SQUARE.get=function(){return 3},Ra.JOIN_ROUND.get=function(){return 1},Ra.JOIN_MITRE.get=function(){return 2},Ra.JOIN_BEVEL.get=function(){return 3},Ra.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ra.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ra.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(er,Ra);var en=l(function(o){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=wt.COUNTERCLOCKWISE,this._inputLine=o||null},"Ln"),ig={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};en.prototype.isDeletable=function(o,s,c,f){var g=this._inputLine[o],_=this._inputLine[s],M=this._inputLine[c];return!!this.isConcave(g,_,M)&&!!this.isShallow(g,_,M,f)&&this.isShallowSampled(g,_,o,c,f)},en.prototype.deleteShallowConcavities=function(){for(var o=1,s=this.findNextNonDeletedIndex(o),c=this.findNextNonDeletedIndex(s),f=!1;c<this._inputLine.length;){var g=!1;this.isDeletable(o,s,c,this._distanceTol)&&(this._isDeleted[s]=en.DELETE,g=!0,f=!0),o=g?c:s,s=this.findNextNonDeletedIndex(o),c=this.findNextNonDeletedIndex(s)}return f},en.prototype.isShallowConcavity=function(o,s,c,f){return wt.computeOrientation(o,s,c)!==this._angleOrientation?!1:wt.distancePointLine(s,o,c)<f},en.prototype.isShallowSampled=function(o,s,c,f,g){var _=Math.trunc((f-c)/en.NUM_PTS_TO_CHECK);_<=0&&(_=1);for(var M=c;M<f;M+=_)if(!this.isShallow(o,s,this._inputLine[M],g))return!1;return!0},en.prototype.isConcave=function(o,s,c){var f=wt.computeOrientation(o,s,c)===this._angleOrientation;return f},en.prototype.simplify=function(o){this._distanceTol=Math.abs(o),o<0&&(this._angleOrientation=wt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var s=!1;do s=this.deleteShallowConcavities();while(s);return this.collapseLine()},en.prototype.findNextNonDeletedIndex=function(o){for(var s=o+1;s<this._inputLine.length&&this._isDeleted[s]===en.DELETE;)s++;return s},en.prototype.isShallow=function(o,s,c,f){return wt.distancePointLine(s,o,c)<f},en.prototype.collapseLine=function(){for(var o=new et,s=0;s<this._inputLine.length;s++)this._isDeleted[s]!==en.DELETE&&o.add(this._inputLine[s]);return o.toCoordinateArray()},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.simplify=function(o,s){return new en(o).simplify(s)},ig.INIT.get=function(){return 0},ig.DELETE.get=function(){return 1},ig.KEEP.get=function(){return 1},ig.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(en,ig);var mo=l(function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Et},"wn"),pw={COORDINATE_ARRAY_TYPE:{configurable:!0}};mo.prototype.getCoordinates=function(){return this._ptList.toArray(mo.COORDINATE_ARRAY_TYPE)},mo.prototype.setPrecisionModel=function(o){this._precisionModel=o},mo.prototype.addPt=function(o){var s=new F(o);if(this._precisionModel.makePrecise(s),this.isRedundant(s))return null;this._ptList.add(s)},mo.prototype.revere=function(){},mo.prototype.addPts=function(o,s){if(s)for(var c=0;c<o.length;c++)this.addPt(o[c]);else for(var f=o.length-1;f>=0;f--)this.addPt(o[f])},mo.prototype.isRedundant=function(o){if(this._ptList.size()<1)return!1;var s=this._ptList.get(this._ptList.size()-1);return o.distance(s)<this._minimimVertexDistance},mo.prototype.toString=function(){return new ge().createLineString(this.getCoordinates()).toString()},mo.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var o=new F(this._ptList.get(0)),s=this._ptList.get(this._ptList.size()-1);if(o.equals(s))return null;this._ptList.add(o)},mo.prototype.setMinimumVertexDistance=function(o){this._minimimVertexDistance=o},mo.prototype.interfaces_=function(){return[]},mo.prototype.getClass=function(){return mo},pw.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(mo,pw);var xe=l(function(){},"Tn"),ip={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe},xe.toDegrees=function(o){return 180*o/Math.PI},xe.normalize=function(o){for(;o>Math.PI;)o-=xe.PI_TIMES_2;for(;o<=-Math.PI;)o+=xe.PI_TIMES_2;return o},xe.angle=function(){if(arguments.length===1){var o=arguments[0];return Math.atan2(o.y,o.x)}if(arguments.length===2){var s=arguments[0],c=arguments[1],f=c.x-s.x,g=c.y-s.y;return Math.atan2(g,f)}},xe.isAcute=function(o,s,c){var f=o.x-s.x,g=o.y-s.y;return f*(c.x-s.x)+g*(c.y-s.y)>0},xe.isObtuse=function(o,s,c){var f=o.x-s.x,g=o.y-s.y;return f*(c.x-s.x)+g*(c.y-s.y)<0},xe.interiorAngle=function(o,s,c){var f=xe.angle(s,o),g=xe.angle(s,c);return Math.abs(g-f)},xe.normalizePositive=function(o){if(o<0){for(;o<0;)o+=xe.PI_TIMES_2;o>=xe.PI_TIMES_2&&(o=0)}else{for(;o>=xe.PI_TIMES_2;)o-=xe.PI_TIMES_2;o<0&&(o=0)}return o},xe.angleBetween=function(o,s,c){var f=xe.angle(s,o),g=xe.angle(s,c);return xe.diff(f,g)},xe.diff=function(o,s){var c=null;return(c=o<s?s-o:o-s)>Math.PI&&(c=2*Math.PI-c),c},xe.toRadians=function(o){return o*Math.PI/180},xe.getTurn=function(o,s){var c=Math.sin(s-o);return c>0?xe.COUNTERCLOCKWISE:c<0?xe.CLOCKWISE:xe.NONE},xe.angleBetweenOriented=function(o,s,c){var f=xe.angle(s,o),g=xe.angle(s,c)-f;return g<=-Math.PI?g+xe.PI_TIMES_2:g>Math.PI?g-xe.PI_TIMES_2:g},ip.PI_TIMES_2.get=function(){return 2*Math.PI},ip.PI_OVER_2.get=function(){return Math.PI/2},ip.PI_OVER_4.get=function(){return Math.PI/4},ip.COUNTERCLOCKWISE.get=function(){return wt.COUNTERCLOCKWISE},ip.CLOCKWISE.get=function(){return wt.CLOCKWISE},ip.NONE.get=function(){return wt.COLLINEAR},Object.defineProperties(xe,ip);var Fr=l(function o(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Ut,this._seg1=new Ut,this._offset0=new Ut,this._offset1=new Ut,this._side=0,this._hasNarrowConcaveAngle=!1;var s=arguments[0],c=arguments[1],f=arguments[2];this._precisionModel=s,this._bufParams=c,this._li=new Ji,this._filletAngleQuantum=Math.PI/2/c.getQuadrantSegments(),c.getQuadrantSegments()>=8&&c.getJoinStyle()===er.JOIN_ROUND&&(this._closingSegLengthFactor=o.MAX_CLOSING_SEG_LEN_FACTOR),this.init(f)},"t"),og={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Fr.prototype.addNextSegment=function(o,s){if(this._s0=this._s1,this._s1=this._s2,this._s2=o,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var c=wt.computeOrientation(this._s0,this._s1,this._s2),f=c===wt.CLOCKWISE&&this._side===Tt.LEFT||c===wt.COUNTERCLOCKWISE&&this._side===Tt.RIGHT;c===0?this.addCollinear(s):f?this.addOutsideTurn(c,s):this.addInsideTurn(c,s)},Fr.prototype.addLineEndCap=function(o,s){var c=new Ut(o,s),f=new Ut;this.computeOffsetSegment(c,Tt.LEFT,this._distance,f);var g=new Ut;this.computeOffsetSegment(c,Tt.RIGHT,this._distance,g);var _=s.x-o.x,M=s.y-o.y,N=Math.atan2(M,_);switch(this._bufParams.getEndCapStyle()){case er.CAP_ROUND:this._segList.addPt(f.p1),this.addFilletArc(s,N+Math.PI/2,N-Math.PI/2,wt.CLOCKWISE,this._distance),this._segList.addPt(g.p1);break;case er.CAP_FLAT:this._segList.addPt(f.p1),this._segList.addPt(g.p1);break;case er.CAP_SQUARE:var G=new F;G.x=Math.abs(this._distance)*Math.cos(N),G.y=Math.abs(this._distance)*Math.sin(N);var Z=new F(f.p1.x+G.x,f.p1.y+G.y),st=new F(g.p1.x+G.x,g.p1.y+G.y);this._segList.addPt(Z),this._segList.addPt(st)}},Fr.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Fr.prototype.addMitreJoin=function(o,s,c,f){var g=!0,_=null;try{_=At.intersection(s.p0,s.p1,c.p0,c.p1),(f<=0?1:_.distance(o)/Math.abs(f))>this._bufParams.getMitreLimit()&&(g=!1)}catch(M){if(!(M instanceof Qe))throw M;_=new F(0,0),g=!1}g?this._segList.addPt(_):this.addLimitedMitreJoin(s,c,f,this._bufParams.getMitreLimit())},Fr.prototype.addFilletCorner=function(o,s,c,f,g){var _=s.x-o.x,M=s.y-o.y,N=Math.atan2(M,_),G=c.x-o.x,Z=c.y-o.y,st=Math.atan2(Z,G);f===wt.CLOCKWISE?N<=st&&(N+=2*Math.PI):N>=st&&(N-=2*Math.PI),this._segList.addPt(s),this.addFilletArc(o,N,st,f,g),this._segList.addPt(c)},Fr.prototype.addOutsideTurn=function(o,s){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Fr.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===er.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===er.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(s&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,o,this._distance),this._segList.addPt(this._offset1.p0))},Fr.prototype.createSquare=function(o){this._segList.addPt(new F(o.x+this._distance,o.y+this._distance)),this._segList.addPt(new F(o.x+this._distance,o.y-this._distance)),this._segList.addPt(new F(o.x-this._distance,o.y-this._distance)),this._segList.addPt(new F(o.x-this._distance,o.y+this._distance)),this._segList.closeRing()},Fr.prototype.addSegments=function(o,s){this._segList.addPts(o,s)},Fr.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Fr.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Fr.prototype.initSideSegments=function(o,s,c){this._s1=o,this._s2=s,this._side=c,this._seg1.setCoordinates(o,s),this.computeOffsetSegment(this._seg1,c,this._distance,this._offset1)},Fr.prototype.addLimitedMitreJoin=function(o,s,c,f){var g=this._seg0.p1,_=xe.angle(g,this._seg0.p0),M=xe.angleBetweenOriented(this._seg0.p0,g,this._seg1.p1)/2,N=xe.normalize(_+M),G=xe.normalize(N+Math.PI),Z=f*c,st=c-Z*Math.abs(Math.sin(M)),ut=g.x+Z*Math.cos(G),Ot=g.y+Z*Math.sin(G),Dt=new F(ut,Ot),Bt=new Ut(g,Dt),Wt=Bt.pointAlongOffset(1,st),Cr=Bt.pointAlongOffset(1,-st);this._side===Tt.LEFT?(this._segList.addPt(Wt),this._segList.addPt(Cr)):(this._segList.addPt(Cr),this._segList.addPt(Wt))},Fr.prototype.computeOffsetSegment=function(o,s,c,f){var g=s===Tt.LEFT?1:-1,_=o.p1.x-o.p0.x,M=o.p1.y-o.p0.y,N=Math.sqrt(_*_+M*M),G=g*c*_/N,Z=g*c*M/N;f.p0.x=o.p0.x-Z,f.p0.y=o.p0.y+G,f.p1.x=o.p1.x-Z,f.p1.y=o.p1.y+G},Fr.prototype.addFilletArc=function(o,s,c,f,g){var _=f===wt.CLOCKWISE?-1:1,M=Math.abs(s-c),N=Math.trunc(M/this._filletAngleQuantum+.5);if(N<1)return null;for(var G=M/N,Z=0,st=new F;Z<M;){var ut=s+_*Z;st.x=o.x+g*Math.cos(ut),st.y=o.y+g*Math.sin(ut),this._segList.addPt(st),Z+=G}},Fr.prototype.addInsideTurn=function(o,s){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Fr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var c=new F((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(c);var f=new F((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(f)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Fr.prototype.createCircle=function(o){var s=new F(o.x+this._distance,o.y);this._segList.addPt(s),this.addFilletArc(o,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Fr.prototype.addBevelJoin=function(o,s){this._segList.addPt(o.p1),this._segList.addPt(s.p0)},Fr.prototype.init=function(o){this._distance=o,this._maxCurveSegmentError=o*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new mo,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(o*Fr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Fr.prototype.addCollinear=function(o){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===er.JOIN_BEVEL||this._bufParams.getJoinStyle()===er.JOIN_MITRE?(o&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,wt.CLOCKWISE,this._distance))},Fr.prototype.closeRing=function(){this._segList.closeRing()},Fr.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},og.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},og.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},og.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},og.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Fr,og);var Gi=l(function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var o=arguments[0],s=arguments[1];this._precisionModel=o,this._bufParams=s},"Mn");Gi.prototype.getOffsetCurve=function(o,s){if(this._distance=s,s===0)return null;var c=s<0,f=Math.abs(s),g=this.getSegGen(f);o.length<=1?this.computePointCurve(o[0],g):this.computeOffsetCurve(o,c,g);var _=g.getCoordinates();return c&&O.reverse(_),_},Gi.prototype.computeSingleSidedBufferCurve=function(o,s,c){var f=this.simplifyTolerance(this._distance);if(s){c.addSegments(o,!0);var g=en.simplify(o,-f),_=g.length-1;c.initSideSegments(g[_],g[_-1],Tt.LEFT),c.addFirstSegment();for(var M=_-2;M>=0;M--)c.addNextSegment(g[M],!0)}else{c.addSegments(o,!1);var N=en.simplify(o,f),G=N.length-1;c.initSideSegments(N[0],N[1],Tt.LEFT),c.addFirstSegment();for(var Z=2;Z<=G;Z++)c.addNextSegment(N[Z],!0)}c.addLastSegment(),c.closeRing()},Gi.prototype.computeRingBufferCurve=function(o,s,c){var f=this.simplifyTolerance(this._distance);s===Tt.RIGHT&&(f=-f);var g=en.simplify(o,f),_=g.length-1;c.initSideSegments(g[_-1],g[0],s);for(var M=1;M<=_;M++){var N=M!==1;c.addNextSegment(g[M],N)}c.closeRing()},Gi.prototype.computeLineBufferCurve=function(o,s){var c=this.simplifyTolerance(this._distance),f=en.simplify(o,c),g=f.length-1;s.initSideSegments(f[0],f[1],Tt.LEFT);for(var _=2;_<=g;_++)s.addNextSegment(f[_],!0);s.addLastSegment(),s.addLineEndCap(f[g-1],f[g]);var M=en.simplify(o,-c),N=M.length-1;s.initSideSegments(M[N],M[N-1],Tt.LEFT);for(var G=N-2;G>=0;G--)s.addNextSegment(M[G],!0);s.addLastSegment(),s.addLineEndCap(M[1],M[0]),s.closeRing()},Gi.prototype.computePointCurve=function(o,s){switch(this._bufParams.getEndCapStyle()){case er.CAP_ROUND:s.createCircle(o);break;case er.CAP_SQUARE:s.createSquare(o)}},Gi.prototype.getLineCurve=function(o,s){if(this._distance=s,s<0&&!this._bufParams.isSingleSided()||s===0)return null;var c=Math.abs(s),f=this.getSegGen(c);if(o.length<=1)this.computePointCurve(o[0],f);else if(this._bufParams.isSingleSided()){var g=s<0;this.computeSingleSidedBufferCurve(o,g,f)}else this.computeLineBufferCurve(o,f);return f.getCoordinates()},Gi.prototype.getBufferParameters=function(){return this._bufParams},Gi.prototype.simplifyTolerance=function(o){return o*this._bufParams.getSimplifyFactor()},Gi.prototype.getRingCurve=function(o,s,c){if(this._distance=c,o.length<=2)return this.getLineCurve(o,c);if(c===0)return Gi.copyCoordinates(o);var f=this.getSegGen(c);return this.computeRingBufferCurve(o,s,f),f.getCoordinates()},Gi.prototype.computeOffsetCurve=function(o,s,c){var f=this.simplifyTolerance(this._distance);if(s){var g=en.simplify(o,-f),_=g.length-1;c.initSideSegments(g[_],g[_-1],Tt.LEFT),c.addFirstSegment();for(var M=_-2;M>=0;M--)c.addNextSegment(g[M],!0)}else{var N=en.simplify(o,f),G=N.length-1;c.initSideSegments(N[0],N[1],Tt.LEFT),c.addFirstSegment();for(var Z=2;Z<=G;Z++)c.addNextSegment(N[Z],!0)}c.addLastSegment()},Gi.prototype.getSegGen=function(o){return new Fr(this._precisionModel,this._bufParams,o)},Gi.prototype.interfaces_=function(){return[]},Gi.prototype.getClass=function(){return Gi},Gi.copyCoordinates=function(o){for(var s=new Array(o.length).fill(null),c=0;c<s.length;c++)s[c]=new F(o[c]);return s};var op=l(function(){this._subgraphs=null,this._seg=new Ut,this._cga=new wt;var o=arguments[0];this._subgraphs=o},"An"),hw={DepthSegment:{configurable:!0}};op.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var o=arguments[0],s=new Et,c=this._subgraphs.iterator();c.hasNext();){var f=c.next(),g=f.getEnvelope();o.y<g.getMinY()||o.y>g.getMaxY()||this.findStabbedSegments(o,f.getDirectedEdges(),s)}return s}if(arguments.length===3){if(ct(arguments[2],ki)&&arguments[0]instanceof F&&arguments[1]instanceof U2){for(var _=arguments[0],M=arguments[1],N=arguments[2],G=M.getEdge().getCoordinates(),Z=0;Z<G.length-1;Z++)if(this._seg.p0=G[Z],this._seg.p1=G[Z+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<_.x)&&!(this._seg.isHorizontal()||_.y<this._seg.p0.y||_.y>this._seg.p1.y||wt.computeOrientation(this._seg.p0,this._seg.p1,_)===wt.RIGHT)){var st=M.getDepth(Tt.LEFT);this._seg.p0.equals(G[Z])||(st=M.getDepth(Tt.RIGHT));var ut=new Zu(this._seg,st);N.add(ut)}}else if(ct(arguments[2],ki)&&arguments[0]instanceof F&&ct(arguments[1],ki))for(var Ot=arguments[0],Dt=arguments[1],Bt=arguments[2],Wt=Dt.iterator();Wt.hasNext();){var Cr=Wt.next();Cr.isForward()&&this.findStabbedSegments(Ot,Cr,Bt)}}},op.prototype.getDepth=function(o){var s=this.findStabbedSegments(o);return s.size()===0?0:Qo.min(s)._leftDepth},op.prototype.interfaces_=function(){return[]},op.prototype.getClass=function(){return op},hw.DepthSegment.get=function(){return Zu},Object.defineProperties(op,hw);var Zu=l(function(){this._upwardSeg=null,this._leftDepth=null;var o=arguments[0],s=arguments[1];this._upwardSeg=new Ut(o),this._leftDepth=s},"Gn");Zu.prototype.compareTo=function(o){var s=o;if(this._upwardSeg.minX()>=s._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=s._upwardSeg.minX())return-1;var c=this._upwardSeg.orientationIndex(s._upwardSeg);return c!==0||(c=-1*s._upwardSeg.orientationIndex(this._upwardSeg))!=0?c:this._upwardSeg.compareTo(s._upwardSeg)},Zu.prototype.compareX=function(o,s){var c=o.p0.compareTo(s.p0);return c!==0?c:o.p1.compareTo(s.p1)},Zu.prototype.toString=function(){return this._upwardSeg.toString()},Zu.prototype.interfaces_=function(){return[j]},Zu.prototype.getClass=function(){return Zu};var rr=l(function(o,s,c){this.p0=o||null,this.p1=s||null,this.p2=c||null},"qn");rr.prototype.area=function(){return rr.area(this.p0,this.p1,this.p2)},rr.prototype.signedArea=function(){return rr.signedArea(this.p0,this.p1,this.p2)},rr.prototype.interpolateZ=function(o){if(o===null)throw new A("Supplied point is null.");return rr.interpolateZ(o,this.p0,this.p1,this.p2)},rr.prototype.longestSideLength=function(){return rr.longestSideLength(this.p0,this.p1,this.p2)},rr.prototype.isAcute=function(){return rr.isAcute(this.p0,this.p1,this.p2)},rr.prototype.circumcentre=function(){return rr.circumcentre(this.p0,this.p1,this.p2)},rr.prototype.area3D=function(){return rr.area3D(this.p0,this.p1,this.p2)},rr.prototype.centroid=function(){return rr.centroid(this.p0,this.p1,this.p2)},rr.prototype.inCentre=function(){return rr.inCentre(this.p0,this.p1,this.p2)},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.area=function(o,s,c){return Math.abs(((c.x-o.x)*(s.y-o.y)-(s.x-o.x)*(c.y-o.y))/2)},rr.signedArea=function(o,s,c){return((c.x-o.x)*(s.y-o.y)-(s.x-o.x)*(c.y-o.y))/2},rr.det=function(o,s,c,f){return o*f-s*c},rr.interpolateZ=function(o,s,c,f){var g=s.x,_=s.y,M=c.x-g,N=f.x-g,G=c.y-_,Z=f.y-_,st=M*Z-N*G,ut=o.x-g,Ot=o.y-_,Dt=(Z*ut-N*Ot)/st,Bt=(-G*ut+M*Ot)/st;return s.z+Dt*(c.z-s.z)+Bt*(f.z-s.z)},rr.longestSideLength=function(o,s,c){var f=o.distance(s),g=s.distance(c),_=c.distance(o),M=f;return g>M&&(M=g),_>M&&(M=_),M},rr.isAcute=function(o,s,c){return!!xe.isAcute(o,s,c)&&!!xe.isAcute(s,c,o)&&!!xe.isAcute(c,o,s)},rr.circumcentre=function(o,s,c){var f=c.x,g=c.y,_=o.x-f,M=o.y-g,N=s.x-f,G=s.y-g,Z=2*rr.det(_,M,N,G),st=rr.det(M,_*_+M*M,G,N*N+G*G),ut=rr.det(_,_*_+M*M,N,N*N+G*G);return new F(f-st/Z,g+ut/Z)},rr.perpendicularBisector=function(o,s){var c=s.x-o.x,f=s.y-o.y,g=new At(o.x+c/2,o.y+f/2,1),_=new At(o.x-f+c/2,o.y+c+f/2,1);return new At(g,_)},rr.angleBisector=function(o,s,c){var f=s.distance(o),g=f/(f+s.distance(c)),_=c.x-o.x,M=c.y-o.y;return new F(o.x+g*_,o.y+g*M)},rr.area3D=function(o,s,c){var f=s.x-o.x,g=s.y-o.y,_=s.z-o.z,M=c.x-o.x,N=c.y-o.y,G=c.z-o.z,Z=g*G-_*N,st=_*M-f*G,ut=f*N-g*M,Ot=Z*Z+st*st+ut*ut,Dt=Math.sqrt(Ot)/2;return Dt},rr.centroid=function(o,s,c){var f=(o.x+s.x+c.x)/3,g=(o.y+s.y+c.y)/3;return new F(f,g)},rr.inCentre=function(o,s,c){var f=s.distance(c),g=o.distance(c),_=o.distance(s),M=f+g+_,N=(f*o.x+g*s.x+_*c.x)/M,G=(f*o.y+g*s.y+_*c.y)/M;return new F(N,G)};var No=l(function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var o=arguments[0],s=arguments[1],c=arguments[2];this._inputGeom=o,this._distance=s,this._curveBuilder=c},"Bn");No.prototype.addPoint=function(o){if(this._distance<=0)return null;var s=o.getCoordinates(),c=this._curveBuilder.getLineCurve(s,this._distance);this.addCurve(c,H.EXTERIOR,H.INTERIOR)},No.prototype.addPolygon=function(o){var s=this._distance,c=Tt.LEFT;this._distance<0&&(s=-this._distance,c=Tt.RIGHT);var f=o.getExteriorRing(),g=O.removeRepeatedPoints(f.getCoordinates());if(this._distance<0&&this.isErodedCompletely(f,this._distance)||this._distance<=0&&g.length<3)return null;this.addPolygonRing(g,s,c,H.EXTERIOR,H.INTERIOR);for(var _=0;_<o.getNumInteriorRing();_++){var M=o.getInteriorRingN(_),N=O.removeRepeatedPoints(M.getCoordinates());this._distance>0&&this.isErodedCompletely(M,-this._distance)||this.addPolygonRing(N,s,Tt.opposite(c),H.INTERIOR,H.EXTERIOR)}},No.prototype.isTriangleErodedCompletely=function(o,s){var c=new rr(o[0],o[1],o[2]),f=c.inCentre();return wt.distancePointLine(f,c.p0,c.p1)<Math.abs(s)},No.prototype.addLineString=function(o){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var s=O.removeRepeatedPoints(o.getCoordinates()),c=this._curveBuilder.getLineCurve(s,this._distance);this.addCurve(c,H.EXTERIOR,H.INTERIOR)},No.prototype.addCurve=function(o,s,c){if(o===null||o.length<2)return null;var f=new ln(o,new _r(0,H.BOUNDARY,s,c));this._curveList.add(f)},No.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},No.prototype.addPolygonRing=function(o,s,c,f,g){if(s===0&&o.length<Fi.MINIMUM_VALID_SIZE)return null;var _=f,M=g;o.length>=Fi.MINIMUM_VALID_SIZE&&wt.isCCW(o)&&(_=g,M=f,c=Tt.opposite(c));var N=this._curveBuilder.getRingCurve(o,c,s);this.addCurve(N,_,M)},No.prototype.add=function(o){if(o.isEmpty())return null;o instanceof xr?this.addPolygon(o):o instanceof ye?this.addLineString(o):o instanceof Ur?this.addPoint(o):o instanceof Ki?this.addCollection(o):o instanceof Tr?this.addCollection(o):o instanceof Jo?this.addCollection(o):o instanceof te&&this.addCollection(o)},No.prototype.isErodedCompletely=function(o,s){var c=o.getCoordinates();if(c.length<4)return s<0;if(c.length===4)return this.isTriangleErodedCompletely(c,s);var f=o.getEnvelopeInternal(),g=Math.min(f.getHeight(),f.getWidth());return s<0&&2*Math.abs(s)>g},No.prototype.addCollection=function(o){for(var s=0;s<o.getNumGeometries();s++){var c=o.getGeometryN(s);this.add(c)}},No.prototype.interfaces_=function(){return[]},No.prototype.getClass=function(){return No};var Lf=l(function(){},"Vn");Lf.prototype.locate=function(o){},Lf.prototype.interfaces_=function(){return[]},Lf.prototype.getClass=function(){return Lf};var qs=l(function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var o=arguments[0];this._parent=o,this._atStart=!0,this._index=0,this._max=o.getNumGeometries()},"Un");qs.prototype.next=function(){if(this._atStart)return this._atStart=!1,qs.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new n;var o=this._parent.getGeometryN(this._index++);return o instanceof te?(this._subcollectionIterator=new qs(o),this._subcollectionIterator.next()):o},qs.prototype.remove=function(){throw new Error(this.getClass().getName())},qs.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},qs.prototype.interfaces_=function(){return[La]},qs.prototype.getClass=function(){return qs},qs.isAtomic=function(o){return!(o instanceof te)};var go=l(function(){this._geom=null;var o=arguments[0];this._geom=o},"zn");go.prototype.locate=function(o){return go.locate(o,this._geom)},go.prototype.interfaces_=function(){return[Lf]},go.prototype.getClass=function(){return go},go.isPointInRing=function(o,s){return!!s.getEnvelopeInternal().intersects(o)&&wt.isPointInRing(o,s.getCoordinates())},go.containsPointInPolygon=function(o,s){if(s.isEmpty())return!1;var c=s.getExteriorRing();if(!go.isPointInRing(o,c))return!1;for(var f=0;f<s.getNumInteriorRing();f++){var g=s.getInteriorRingN(f);if(go.isPointInRing(o,g))return!1}return!0},go.containsPoint=function(o,s){if(s instanceof xr)return go.containsPointInPolygon(o,s);if(s instanceof te)for(var c=new qs(s);c.hasNext();){var f=c.next();if(f!==s&&go.containsPoint(o,f))return!0}return!1},go.locate=function(o,s){return s.isEmpty()?H.EXTERIOR:go.containsPoint(o,s)?H.INTERIOR:H.EXTERIOR};var ni=l(function(){this._edgeMap=new x,this._edgeList=null,this._ptInAreaLocation=[H.NONE,H.NONE]},"Xn");ni.prototype.getNextCW=function(o){this.getEdges();var s=this._edgeList.indexOf(o),c=s-1;return s===0&&(c=this._edgeList.size()-1),this._edgeList.get(c)},ni.prototype.propagateSideLabels=function(o){for(var s=H.NONE,c=this.iterator();c.hasNext();){var f=c.next().getLabel();f.isArea(o)&&f.getLocation(o,Tt.LEFT)!==H.NONE&&(s=f.getLocation(o,Tt.LEFT))}if(s===H.NONE)return null;for(var g=s,_=this.iterator();_.hasNext();){var M=_.next(),N=M.getLabel();if(N.getLocation(o,Tt.ON)===H.NONE&&N.setLocation(o,Tt.ON,g),N.isArea(o)){var G=N.getLocation(o,Tt.LEFT),Z=N.getLocation(o,Tt.RIGHT);if(Z!==H.NONE){if(Z!==g)throw new Na("side location conflict",M.getCoordinate());G===H.NONE&&Yt.shouldNeverReachHere("found single null side (at "+M.getCoordinate()+")"),g=G}else Yt.isTrue(N.getLocation(o,Tt.LEFT)===H.NONE,"found single null side"),N.setLocation(o,Tt.RIGHT,g),N.setLocation(o,Tt.LEFT,g)}}},ni.prototype.getCoordinate=function(){var o=this.iterator();return o.hasNext()?o.next().getCoordinate():null},ni.prototype.print=function(o){Nt.out.println("EdgeEndStar: "+this.getCoordinate());for(var s=this.iterator();s.hasNext();)s.next().print(o)},ni.prototype.isAreaLabelsConsistent=function(o){return this.computeEdgeEndLabels(o.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},ni.prototype.checkAreaLabelsConsistent=function(o){var s=this.getEdges();if(s.size()<=0)return!0;var c=s.size()-1,f=s.get(c).getLabel().getLocation(o,Tt.LEFT);Yt.isTrue(f!==H.NONE,"Found unlabelled area edge");for(var g=f,_=this.iterator();_.hasNext();){var M=_.next().getLabel();Yt.isTrue(M.isArea(o),"Found non-area edge");var N=M.getLocation(o,Tt.LEFT),G=M.getLocation(o,Tt.RIGHT);if(N===G||G!==g)return!1;g=N}return!0},ni.prototype.findIndex=function(o){this.iterator();for(var s=0;s<this._edgeList.size();s++)if(this._edgeList.get(s)===o)return s;return-1},ni.prototype.iterator=function(){return this.getEdges().iterator()},ni.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new Et(this._edgeMap.values())),this._edgeList},ni.prototype.getLocation=function(o,s,c){return this._ptInAreaLocation[o]===H.NONE&&(this._ptInAreaLocation[o]=go.locate(s,c[o].getGeometry())),this._ptInAreaLocation[o]},ni.prototype.toString=function(){var o=new St;o.append("EdgeEndStar: "+this.getCoordinate()),o.append("\n");for(var s=this.iterator();s.hasNext();){var c=s.next();o.append(c),o.append("\n")}return o.toString()},ni.prototype.computeEdgeEndLabels=function(o){for(var s=this.iterator();s.hasNext();)s.next().computeLabel(o)},ni.prototype.computeLabelling=function(o){this.computeEdgeEndLabels(o[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var s=[!1,!1],c=this.iterator();c.hasNext();)for(var f=c.next().getLabel(),g=0;g<2;g++)f.isLine(g)&&f.getLocation(g)===H.BOUNDARY&&(s[g]=!0);for(var _=this.iterator();_.hasNext();)for(var M=_.next(),N=M.getLabel(),G=0;G<2;G++)if(N.isAnyNull(G)){var Z=H.NONE;if(s[G])Z=H.EXTERIOR;else{var st=M.getCoordinate();Z=this.getLocation(G,st,o)}N.setAllLocationsIfNull(G,Z)}},ni.prototype.getDegree=function(){return this._edgeMap.size()},ni.prototype.insertEdgeEnd=function(o,s){this._edgeMap.put(o,s),this._edgeList=null},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni};var QL=function(o){function s(){o.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var c=null,f=null,g=this._SCANNING_FOR_INCOMING,_=0;_<this._resultAreaEdgeList.size();_++){var M=this._resultAreaEdgeList.get(_),N=M.getSym();if(M.getLabel().isArea())switch(c===null&&M.isInResult()&&(c=M),g){case this._SCANNING_FOR_INCOMING:if(!N.isInResult())continue;f=N,g=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!M.isInResult())continue;f.setNext(M),g=this._SCANNING_FOR_INCOMING}}if(g===this._LINKING_TO_OUTGOING){if(c===null)throw new Na("no outgoing dirEdge found",this.getCoordinate());Yt.isTrue(c.isInResult(),"unable to link last incoming dirEdge"),f.setNext(c)}},s.prototype.insert=function(c){var f=c;this.insertEdgeEnd(f,f)},s.prototype.getRightmostEdge=function(){var c=this.getEdges(),f=c.size();if(f<1)return null;var g=c.get(0);if(f===1)return g;var _=c.get(f-1),M=g.getQuadrant(),N=_.getQuadrant();return wr.isNorthern(M)&&wr.isNorthern(N)?g:wr.isNorthern(M)||wr.isNorthern(N)?g.getDy()!==0?g:_.getDy()!==0?_:(Yt.shouldNeverReachHere("found two horizontal edges incident on node"),null):_},s.prototype.print=function(c){Nt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var f=this.iterator();f.hasNext();){var g=f.next();c.print("out "),g.print(c),c.println(),c.print("in "),g.getSym().print(c),c.println()}},s.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Et;for(var c=this.iterator();c.hasNext();){var f=c.next();(f.isInResult()||f.getSym().isInResult())&&this._resultAreaEdgeList.add(f)}return this._resultAreaEdgeList},s.prototype.updateLabelling=function(c){for(var f=this.iterator();f.hasNext();){var g=f.next().getLabel();g.setAllLocationsIfNull(0,c.getLocation(0)),g.setAllLocationsIfNull(1,c.getLocation(1))}},s.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var c=null,f=null,g=this._edgeList.size()-1;g>=0;g--){var _=this._edgeList.get(g),M=_.getSym();f===null&&(f=M),c!==null&&M.setNext(c),c=_}f.setNext(c)},s.prototype.computeDepths=function(){if(arguments.length===1){var c=arguments[0],f=this.findIndex(c),g=c.getDepth(Tt.LEFT),_=c.getDepth(Tt.RIGHT),M=this.computeDepths(f+1,this._edgeList.size(),g);if(this.computeDepths(0,f,M)!==_)throw new Na("depth mismatch at "+c.getCoordinate())}else if(arguments.length===3){for(var N=arguments[0],G=arguments[1],Z=arguments[2],st=N;st<G;st++){var ut=this._edgeList.get(st);ut.setEdgeDepths(Tt.RIGHT,Z),Z=ut.getDepth(Tt.LEFT)}return Z}},s.prototype.mergeSymLabels=function(){for(var c=this.iterator();c.hasNext();){var f=c.next();f.getLabel().merge(f.getSym().getLabel())}},s.prototype.linkMinimalDirectedEdges=function(c){for(var f=null,g=null,_=this._SCANNING_FOR_INCOMING,M=this._resultAreaEdgeList.size()-1;M>=0;M--){var N=this._resultAreaEdgeList.get(M),G=N.getSym();switch(f===null&&N.getEdgeRing()===c&&(f=N),_){case this._SCANNING_FOR_INCOMING:if(G.getEdgeRing()!==c)continue;g=G,_=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(N.getEdgeRing()!==c)continue;g.setNextMin(N),_=this._SCANNING_FOR_INCOMING}}_===this._LINKING_TO_OUTGOING&&(Yt.isTrue(f!==null,"found null for first outgoing dirEdge"),Yt.isTrue(f.getEdgeRing()===c,"unable to link last incoming dirEdge"),g.setNextMin(f))},s.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var c=0,f=this.iterator();f.hasNext();)f.next().isInResult()&&c++;return c}if(arguments.length===1){for(var g=arguments[0],_=0,M=this.iterator();M.hasNext();)M.next().getEdgeRing()===g&&_++;return _}},s.prototype.getLabel=function(){return this._label},s.prototype.findCoveredLineEdges=function(){for(var c=H.NONE,f=this.iterator();f.hasNext();){var g=f.next(),_=g.getSym();if(!g.isLineEdge()){if(g.isInResult()){c=H.INTERIOR;break}if(_.isInResult()){c=H.EXTERIOR;break}}}if(c===H.NONE)return null;for(var M=c,N=this.iterator();N.hasNext();){var G=N.next(),Z=G.getSym();G.isLineEdge()?G.getEdge().setCovered(M===H.INTERIOR):(G.isInResult()&&(M=H.EXTERIOR),Z.isInResult()&&(M=H.INTERIOR))}},s.prototype.computeLabelling=function(c){o.prototype.computeLabelling.call(this,c),this._label=new _r(H.NONE);for(var f=this.iterator();f.hasNext();)for(var g=f.next().getEdge().getLabel(),_=0;_<2;_++){var M=g.getLocation(_);M!==H.INTERIOR&&M!==H.BOUNDARY||this._label.setLocation(_,H.INTERIOR)}},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(ni),fw=function(o){function s(){o.apply(this,arguments)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.createNode=function(c){return new P0(c,new QL)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(Ef),Ll=l(function o(){this._pts=null,this._orientation=null;var s=arguments[0];this._pts=s,this._orientation=o.orientation(s)},"t");Ll.prototype.compareTo=function(o){var s=o;return Ll.compareOriented(this._pts,this._orientation,s._pts,s._orientation)},Ll.prototype.interfaces_=function(){return[j]},Ll.prototype.getClass=function(){return Ll},Ll.orientation=function(o){return O.increasingDirection(o)===1},Ll.compareOriented=function(o,s,c,f){for(var g=s?1:-1,_=f?1:-1,M=s?o.length:-1,N=f?c.length:-1,G=s?0:o.length-1,Z=f?0:c.length-1;;){var st=o[G].compareTo(c[Z]);if(st!==0)return st;var ut=(G+=g)===M,Ot=(Z+=_)===N;if(ut&&!Ot)return-1;if(!ut&&Ot)return 1;if(ut&&Ot)return 0}};var ts=l(function(){this._edges=new Et,this._ocaMap=new x},"Hn");ts.prototype.print=function(o){o.print("MULTILINESTRING ( ");for(var s=0;s<this._edges.size();s++){var c=this._edges.get(s);s>0&&o.print(","),o.print("(");for(var f=c.getCoordinates(),g=0;g<f.length;g++)g>0&&o.print(","),o.print(f[g].x+" "+f[g].y);o.println(")")}o.print(") ")},ts.prototype.addAll=function(o){for(var s=o.iterator();s.hasNext();)this.add(s.next())},ts.prototype.findEdgeIndex=function(o){for(var s=0;s<this._edges.size();s++)if(this._edges.get(s).equals(o))return s;return-1},ts.prototype.iterator=function(){return this._edges.iterator()},ts.prototype.getEdges=function(){return this._edges},ts.prototype.get=function(o){return this._edges.get(o)},ts.prototype.findEqualEdge=function(o){var s=new Ll(o.getCoordinates());return this._ocaMap.get(s)},ts.prototype.add=function(o){this._edges.add(o);var s=new Ll(o.getCoordinates());this._ocaMap.put(s,o)},ts.prototype.interfaces_=function(){return[]},ts.prototype.getClass=function(){return ts};var $u=l(function(){},"Wn");$u.prototype.processIntersections=function(o,s,c,f){},$u.prototype.isDone=function(){},$u.prototype.interfaces_=function(){return[]},$u.prototype.getClass=function(){return $u};var yo=l(function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var o=arguments[0];this._li=o},"Kn");yo.prototype.isTrivialIntersection=function(o,s,c,f){if(o===c&&this._li.getIntersectionNum()===1){if(yo.isAdjacentSegments(s,f))return!0;if(o.isClosed()){var g=o.size()-1;if(s===0&&f===g||f===0&&s===g)return!0}}return!1},yo.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},yo.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},yo.prototype.getLineIntersector=function(){return this._li},yo.prototype.hasProperIntersection=function(){return this._hasProper},yo.prototype.processIntersections=function(o,s,c,f){if(o===c&&s===f)return null;this.numTests++;var g=o.getCoordinates()[s],_=o.getCoordinates()[s+1],M=c.getCoordinates()[f],N=c.getCoordinates()[f+1];this._li.computeIntersection(g,_,M,N),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(o,s,c,f)||(this._hasIntersection=!0,o.addIntersections(this._li,s,0),c.addIntersections(this._li,f,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},yo.prototype.hasIntersection=function(){return this._hasIntersection},yo.prototype.isDone=function(){return!1},yo.prototype.hasInteriorIntersection=function(){return this._hasInterior},yo.prototype.interfaces_=function(){return[$u]},yo.prototype.getClass=function(){return yo},yo.isAdjacentSegments=function(o,s){return Math.abs(o-s)===1};var bs=l(function(){this.coord=null,this.segmentIndex=null,this.dist=null;var o=arguments[0],s=arguments[1],c=arguments[2];this.coord=new F(o),this.segmentIndex=s,this.dist=c},"Jn");bs.prototype.getSegmentIndex=function(){return this.segmentIndex},bs.prototype.getCoordinate=function(){return this.coord},bs.prototype.print=function(o){o.print(this.coord),o.print(" seg # = "+this.segmentIndex),o.println(" dist = "+this.dist)},bs.prototype.compareTo=function(o){var s=o;return this.compare(s.segmentIndex,s.dist)},bs.prototype.isEndPoint=function(o){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===o},bs.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},bs.prototype.getDistance=function(){return this.dist},bs.prototype.compare=function(o,s){return this.segmentIndex<o?-1:this.segmentIndex>o?1:this.dist<s?-1:this.dist>s?1:0},bs.prototype.interfaces_=function(){return[j]},bs.prototype.getClass=function(){return bs};var Ws=l(function(){this._nodeMap=new x,this.edge=null;var o=arguments[0];this.edge=o},"Qn");Ws.prototype.print=function(o){o.println("Intersections:");for(var s=this.iterator();s.hasNext();)s.next().print(o)},Ws.prototype.iterator=function(){return this._nodeMap.values().iterator()},Ws.prototype.addSplitEdges=function(o){this.addEndpoints();for(var s=this.iterator(),c=s.next();s.hasNext();){var f=s.next(),g=this.createSplitEdge(c,f);o.add(g),c=f}},Ws.prototype.addEndpoints=function(){var o=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[o],o,0)},Ws.prototype.createSplitEdge=function(o,s){var c=s.segmentIndex-o.segmentIndex+2,f=this.edge.pts[s.segmentIndex],g=s.dist>0||!s.coord.equals2D(f);g||c--;var _=new Array(c).fill(null),M=0;_[M++]=new F(o.coord);for(var N=o.segmentIndex+1;N<=s.segmentIndex;N++)_[M++]=this.edge.pts[N];return g&&(_[M]=s.coord),new O0(_,new _r(this.edge._label))},Ws.prototype.add=function(o,s,c){var f=new bs(o,s,c),g=this._nodeMap.get(f);return g!==null?g:(this._nodeMap.put(f,f),f)},Ws.prototype.isIntersection=function(o){for(var s=this.iterator();s.hasNext();)if(s.next().coord.equals(o))return!0;return!1},Ws.prototype.interfaces_=function(){return[]},Ws.prototype.getClass=function(){return Ws};var Ju=l(function(){},"Zn");Ju.prototype.getChainStartIndices=function(o){var s=0,c=new Et;c.add(new dt(s));do{var f=this.findChainEnd(o,s);c.add(new dt(f)),s=f}while(s<o.length-1);return Ju.toIntArray(c)},Ju.prototype.findChainEnd=function(o,s){for(var c=wr.quadrant(o[s],o[s+1]),f=s+1;f<o.length&&wr.quadrant(o[f-1],o[f])===c;)f++;return f-1},Ju.prototype.interfaces_=function(){return[]},Ju.prototype.getClass=function(){return Ju},Ju.toIntArray=function(o){for(var s=new Array(o.size()).fill(null),c=0;c<s.length;c++)s[c]=o.get(c).intValue();return s};var Fa=l(function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Ct,this.env2=new Ct;var o=arguments[0];this.e=o,this.pts=o.getCoordinates();var s=new Ju;this.startIndex=s.getChainStartIndices(this.pts)},"$n");Fa.prototype.getCoordinates=function(){return this.pts},Fa.prototype.getMaxX=function(o){var s=this.pts[this.startIndex[o]].x,c=this.pts[this.startIndex[o+1]].x;return s>c?s:c},Fa.prototype.getMinX=function(o){var s=this.pts[this.startIndex[o]].x,c=this.pts[this.startIndex[o+1]].x;return s<c?s:c},Fa.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var o=arguments[0],s=arguments[1],c=arguments[2],f=arguments[3];this.computeIntersectsForChain(this.startIndex[o],this.startIndex[o+1],s,s.startIndex[c],s.startIndex[c+1],f)}else if(arguments.length===6){var g=arguments[0],_=arguments[1],M=arguments[2],N=arguments[3],G=arguments[4],Z=arguments[5],st=this.pts[g],ut=this.pts[_],Ot=M.pts[N],Dt=M.pts[G];if(_-g==1&&G-N==1)return Z.addIntersections(this.e,g,M.e,N),null;if(this.env1.init(st,ut),this.env2.init(Ot,Dt),!this.env1.intersects(this.env2))return null;var Bt=Math.trunc((g+_)/2),Wt=Math.trunc((N+G)/2);g<Bt&&(N<Wt&&this.computeIntersectsForChain(g,Bt,M,N,Wt,Z),Wt<G&&this.computeIntersectsForChain(g,Bt,M,Wt,G,Z)),Bt<_&&(N<Wt&&this.computeIntersectsForChain(Bt,_,M,N,Wt,Z),Wt<G&&this.computeIntersectsForChain(Bt,_,M,Wt,G,Z))}},Fa.prototype.getStartIndexes=function(){return this.startIndex},Fa.prototype.computeIntersects=function(o,s){for(var c=0;c<this.startIndex.length-1;c++)for(var f=0;f<o.startIndex.length-1;f++)this.computeIntersectsForChain(c,o,f,s)},Fa.prototype.interfaces_=function(){return[]},Fa.prototype.getClass=function(){return Fa};var Yn=l(function o(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var s=0;s<2;s++)for(var c=0;c<3;c++)this._depth[s][c]=o.NULL_VALUE},"t"),dw={NULL_VALUE:{configurable:!0}};Yn.prototype.getDepth=function(o,s){return this._depth[o][s]},Yn.prototype.setDepth=function(o,s,c){this._depth[o][s]=c},Yn.prototype.isNull=function(){if(arguments.length===0){for(var o=0;o<2;o++)for(var s=0;s<3;s++)if(this._depth[o][s]!==Yn.NULL_VALUE)return!1;return!0}if(arguments.length===1){var c=arguments[0];return this._depth[c][1]===Yn.NULL_VALUE}if(arguments.length===2){var f=arguments[0],g=arguments[1];return this._depth[f][g]===Yn.NULL_VALUE}},Yn.prototype.normalize=function(){for(var o=0;o<2;o++)if(!this.isNull(o)){var s=this._depth[o][1];this._depth[o][2]<s&&(s=this._depth[o][2]),s<0&&(s=0);for(var c=1;c<3;c++){var f=0;this._depth[o][c]>s&&(f=1),this._depth[o][c]=f}}},Yn.prototype.getDelta=function(o){return this._depth[o][Tt.RIGHT]-this._depth[o][Tt.LEFT]},Yn.prototype.getLocation=function(o,s){return this._depth[o][s]<=0?H.EXTERIOR:H.INTERIOR},Yn.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Yn.prototype.add=function(){if(arguments.length===1)for(var o=arguments[0],s=0;s<2;s++)for(var c=1;c<3;c++){var f=o.getLocation(s,c);f!==H.EXTERIOR&&f!==H.INTERIOR||(this.isNull(s,c)?this._depth[s][c]=Yn.depthAtLocation(f):this._depth[s][c]+=Yn.depthAtLocation(f))}else if(arguments.length===3){var g=arguments[0],_=arguments[1];arguments[2]===H.INTERIOR&&this._depth[g][_]++}},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn},Yn.depthAtLocation=function(o){return o===H.EXTERIOR?0:o===H.INTERIOR?1:Yn.NULL_VALUE},dw.NULL_VALUE.get=function(){return-1},Object.defineProperties(Yn,dw);var O0=function(o){function s(){if(o.call(this),this.pts=null,this._env=null,this.eiList=new Ws(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Yn,this._depthDelta=0,arguments.length===1){var c=arguments[0];s.call(this,c,null)}else if(arguments.length===2){var f=arguments[0],g=arguments[1];this.pts=f,this._label=g}}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.getDepth=function(){return this._depth},s.prototype.getCollapsedEdge=function(){var c=new Array(2).fill(null);return c[0]=this.pts[0],c[1]=this.pts[1],new s(c,_r.toLineLabel(this._label))},s.prototype.isIsolated=function(){return this._isIsolated},s.prototype.getCoordinates=function(){return this.pts},s.prototype.setIsolated=function(c){this._isIsolated=c},s.prototype.setName=function(c){this._name=c},s.prototype.equals=function(c){if(!(c instanceof s))return!1;var f=c;if(this.pts.length!==f.pts.length)return!1;for(var g=!0,_=!0,M=this.pts.length,N=0;N<this.pts.length;N++)if(this.pts[N].equals2D(f.pts[N])||(g=!1),this.pts[N].equals2D(f.pts[--M])||(_=!1),!g&&!_)return!1;return!0},s.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var c=arguments[0];return this.pts[c]}},s.prototype.print=function(c){c.print("edge "+this._name+": "),c.print("LINESTRING (");for(var f=0;f<this.pts.length;f++)f>0&&c.print(","),c.print(this.pts[f].x+" "+this.pts[f].y);c.print(") "+this._label+" "+this._depthDelta)},s.prototype.computeIM=function(c){s.updateIM(this._label,c)},s.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},s.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},s.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},s.prototype.getDepthDelta=function(){return this._depthDelta},s.prototype.getNumPoints=function(){return this.pts.length},s.prototype.printReverse=function(c){c.print("edge "+this._name+": ");for(var f=this.pts.length-1;f>=0;f--)c.print(this.pts[f]+" ");c.println("")},s.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Fa(this)),this._mce},s.prototype.getEnvelope=function(){if(this._env===null){this._env=new Ct;for(var c=0;c<this.pts.length;c++)this._env.expandToInclude(this.pts[c])}return this._env},s.prototype.addIntersection=function(c,f,g,_){var M=new F(c.getIntersection(_)),N=f,G=c.getEdgeDistance(g,_),Z=N+1;if(Z<this.pts.length){var st=this.pts[Z];M.equals2D(st)&&(N=Z,G=0)}this.eiList.add(M,N,G)},s.prototype.toString=function(){var c=new St;c.append("edge "+this._name+": "),c.append("LINESTRING (");for(var f=0;f<this.pts.length;f++)f>0&&c.append(","),c.append(this.pts[f].x+" "+this.pts[f].y);return c.append(") "+this._label+" "+this._depthDelta),c.toString()},s.prototype.isPointwiseEqual=function(c){if(this.pts.length!==c.pts.length)return!1;for(var f=0;f<this.pts.length;f++)if(!this.pts[f].equals2D(c.pts[f]))return!1;return!0},s.prototype.setDepthDelta=function(c){this._depthDelta=c},s.prototype.getEdgeIntersectionList=function(){return this.eiList},s.prototype.addIntersections=function(c,f,g){for(var _=0;_<c.getIntersectionNum();_++)this.addIntersection(c,f,g,_)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s.updateIM=function(){if(arguments.length!==2)return o.prototype.updateIM.apply(this,arguments);var c=arguments[0],f=arguments[1];f.setAtLeastIfValid(c.getLocation(0,Tt.ON),c.getLocation(1,Tt.ON),1),c.isArea()&&(f.setAtLeastIfValid(c.getLocation(0,Tt.LEFT),c.getLocation(1,Tt.LEFT),2),f.setAtLeastIfValid(c.getLocation(0,Tt.RIGHT),c.getLocation(1,Tt.RIGHT),2))},s}(fo),gi=l(function(o){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new ts,this._bufParams=o||null},"ii");gi.prototype.setWorkingPrecisionModel=function(o){this._workingPrecisionModel=o},gi.prototype.insertUniqueEdge=function(o){var s=this._edgeList.findEqualEdge(o);if(s!==null){var c=s.getLabel(),f=o.getLabel();s.isPointwiseEqual(o)||(f=new _r(o.getLabel())).flip(),c.merge(f);var g=gi.depthDelta(f),_=s.getDepthDelta()+g;s.setDepthDelta(_)}else this._edgeList.add(o),o.setDepthDelta(gi.depthDelta(o.getLabel()))},gi.prototype.buildSubgraphs=function(o,s){for(var c=new Et,f=o.iterator();f.hasNext();){var g=f.next(),_=g.getRightmostCoordinate(),M=new op(c).getDepth(_);g.computeDepth(M),g.findResultEdges(),c.add(g),s.add(g.getDirectedEdges(),g.getNodes())}},gi.prototype.createSubgraphs=function(o){for(var s=new Et,c=o.getNodes().iterator();c.hasNext();){var f=c.next();if(!f.isVisited()){var g=new di;g.create(f),s.add(g)}}return Qo.sort(s,Qo.reverseOrder()),s},gi.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},gi.prototype.getNoder=function(o){if(this._workingNoder!==null)return this._workingNoder;var s=new z2,c=new Ji;return c.setPrecisionModel(o),s.setSegmentIntersector(new yo(c)),s},gi.prototype.buffer=function(o,s){var c=this._workingPrecisionModel;c===null&&(c=o.getPrecisionModel()),this._geomFact=o.getFactory();var f=new Gi(c,this._bufParams),g=new No(o,s,f).getCurves();if(g.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(g,c),this._graph=new Zr(new fw),this._graph.addEdges(this._edgeList.getEdges());var _=this.createSubgraphs(this._graph),M=new to(this._geomFact);this.buildSubgraphs(_,M);var N=M.getPolygons();return N.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(N)},gi.prototype.computeNodedEdges=function(o,s){var c=this.getNoder(s);c.computeNodes(o);for(var f=c.getNodedSubstrings().iterator();f.hasNext();){var g=f.next(),_=g.getCoordinates();if(_.length!==2||!_[0].equals2D(_[1])){var M=g.getData(),N=new O0(g.getCoordinates(),new _r(M));this.insertUniqueEdge(N)}}},gi.prototype.setNoder=function(o){this._workingNoder=o},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},gi.depthDelta=function(o){var s=o.getLocation(0,Tt.LEFT),c=o.getLocation(0,Tt.RIGHT);return s===H.INTERIOR&&c===H.EXTERIOR?1:s===H.EXTERIOR&&c===H.INTERIOR?-1:0},gi.convertSegStrings=function(o){for(var s=new ge,c=new Et;o.hasNext();){var f=o.next(),g=s.createLineString(f.getCoordinates());c.add(g)}return s.buildGeometry(c)};var Al=l(function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var o=arguments[0],s=arguments[1];this._noder=o,this._scaleFactor=s,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var c=arguments[0],f=arguments[1],g=arguments[2],_=arguments[3];this._noder=c,this._scaleFactor=f,this._offsetX=g,this._offsetY=_,this._isScaled=!this.isIntegerPrecision()}},"ri");Al.prototype.rescale=function(){if(ct(arguments[0],Rr))for(var o=arguments[0].iterator();o.hasNext();){var s=o.next();this.rescale(s.getCoordinates())}else if(arguments[0]instanceof Array){for(var c=arguments[0],f=0;f<c.length;f++)c[f].x=c[f].x/this._scaleFactor+this._offsetX,c[f].y=c[f].y/this._scaleFactor+this._offsetY;c.length===2&&c[0].equals2D(c[1])&&Nt.out.println(c)}},Al.prototype.scale=function(){if(ct(arguments[0],Rr)){for(var o=arguments[0],s=new Et,c=o.iterator();c.hasNext();){var f=c.next();s.add(new ln(this.scale(f.getCoordinates()),f.getData()))}return s}if(arguments[0]instanceof Array){for(var g=arguments[0],_=new Array(g.length).fill(null),M=0;M<g.length;M++)_[M]=new F(Math.round((g[M].x-this._offsetX)*this._scaleFactor),Math.round((g[M].y-this._offsetY)*this._scaleFactor),g[M].z);return O.removeRepeatedPoints(_)}},Al.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},Al.prototype.getNodedSubstrings=function(){var o=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(o),o},Al.prototype.computeNodes=function(o){var s=o;this._isScaled&&(s=this.scale(o)),this._noder.computeNodes(s)},Al.prototype.interfaces_=function(){return[Wu]},Al.prototype.getClass=function(){return Al};var xs=l(function(){this._li=new Ji,this._segStrings=null;var o=arguments[0];this._segStrings=o},"oi"),mw={fact:{configurable:!0}};xs.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var o=this._segStrings.iterator();o.hasNext();){var s=o.next().getCoordinates();this.checkEndPtVertexIntersections(s[0],this._segStrings),this.checkEndPtVertexIntersections(s[s.length-1],this._segStrings)}else if(arguments.length===2){for(var c=arguments[0],f=arguments[1].iterator();f.hasNext();)for(var g=f.next().getCoordinates(),_=1;_<g.length-1;_++)if(g[_].equals(c))throw new Wr("found endpt/interior pt intersection at index "+_+" :pt "+c)}},xs.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var o=this._segStrings.iterator();o.hasNext();)for(var s=o.next(),c=this._segStrings.iterator();c.hasNext();){var f=c.next();this.checkInteriorIntersections(s,f)}else if(arguments.length===2)for(var g=arguments[0],_=arguments[1],M=g.getCoordinates(),N=_.getCoordinates(),G=0;G<M.length-1;G++)for(var Z=0;Z<N.length-1;Z++)this.checkInteriorIntersections(g,G,_,Z);else if(arguments.length===4){var st=arguments[0],ut=arguments[1],Ot=arguments[2],Dt=arguments[3];if(st===Ot&&ut===Dt)return null;var Bt=st.getCoordinates()[ut],Wt=st.getCoordinates()[ut+1],Cr=Ot.getCoordinates()[Dt],vn=Ot.getCoordinates()[Dt+1];if(this._li.computeIntersection(Bt,Wt,Cr,vn),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,Bt,Wt)||this.hasInteriorIntersection(this._li,Cr,vn)))throw new Wr("found non-noded intersection at "+Bt+"-"+Wt+" and "+Cr+"-"+vn)}},xs.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},xs.prototype.checkCollapses=function(){if(arguments.length===0)for(var o=this._segStrings.iterator();o.hasNext();){var s=o.next();this.checkCollapses(s)}else if(arguments.length===1)for(var c=arguments[0].getCoordinates(),f=0;f<c.length-2;f++)this.checkCollapse(c[f],c[f+1],c[f+2])},xs.prototype.hasInteriorIntersection=function(o,s,c){for(var f=0;f<o.getIntersectionNum();f++){var g=o.getIntersection(f);if(!g.equals(s)&&!g.equals(c))return!0}return!1},xs.prototype.checkCollapse=function(o,s,c){if(o.equals(c))throw new Wr("found non-noded collapse at "+xs.fact.createLineString([o,s,c]))},xs.prototype.interfaces_=function(){return[]},xs.prototype.getClass=function(){return xs},mw.fact.get=function(){return new ge},Object.defineProperties(xs,mw);var Vi=l(function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var o=arguments[0],s=arguments[1],c=arguments[2];if(this._originalPt=o,this._pt=o,this._scaleFactor=s,this._li=c,s<=0)throw new A("Scale factor must be non-zero");s!==1&&(this._pt=new F(this.scale(o.x),this.scale(o.y)),this._p0Scaled=new F,this._p1Scaled=new F),this.initCorners(this._pt)},"ai"),gw={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Vi.prototype.intersectsScaled=function(o,s){var c=Math.min(o.x,s.x),f=Math.max(o.x,s.x),g=Math.min(o.y,s.y),_=Math.max(o.y,s.y),M=this._maxx<c||this._minx>f||this._maxy<g||this._miny>_;if(M)return!1;var N=this.intersectsToleranceSquare(o,s);return Yt.isTrue(!(M&&N),"Found bad envelope test"),N},Vi.prototype.initCorners=function(o){this._minx=o.x-.5,this._maxx=o.x+.5,this._miny=o.y-.5,this._maxy=o.y+.5,this._corner[0]=new F(this._maxx,this._maxy),this._corner[1]=new F(this._minx,this._maxy),this._corner[2]=new F(this._minx,this._miny),this._corner[3]=new F(this._maxx,this._miny)},Vi.prototype.intersects=function(o,s){return this._scaleFactor===1?this.intersectsScaled(o,s):(this.copyScaled(o,this._p0Scaled),this.copyScaled(s,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Vi.prototype.scale=function(o){return Math.round(o*this._scaleFactor)},Vi.prototype.getCoordinate=function(){return this._originalPt},Vi.prototype.copyScaled=function(o,s){s.x=this.scale(o.x),s.y=this.scale(o.y)},Vi.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var o=Vi.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Ct(this._originalPt.x-o,this._originalPt.x+o,this._originalPt.y-o,this._originalPt.y+o)}return this._safeEnv},Vi.prototype.intersectsPixelClosure=function(o,s){return this._li.computeIntersection(o,s,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(o,s,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(o,s,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(o,s,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},Vi.prototype.intersectsToleranceSquare=function(o,s){var c=!1,f=!1;return this._li.computeIntersection(o,s,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(o,s,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(c=!0),this._li.computeIntersection(o,s,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(f=!0),this._li.computeIntersection(o,s,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!c||!f)||!!o.equals(this._pt)||!!s.equals(this._pt))))},Vi.prototype.addSnappedNode=function(o,s){var c=o.getCoordinate(s),f=o.getCoordinate(s+1);return!!this.intersects(c,f)&&(o.addIntersection(this.getCoordinate(),s),!0)},Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi},gw.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Vi,gw);var sg=l(function(){this.tempEnv1=new Ct,this.selectedSegment=new Ut},"li");sg.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var o=arguments[0],s=arguments[1];o.getLineSegment(s,this.selectedSegment),this.select(this.selectedSegment)}}},sg.prototype.interfaces_=function(){return[]},sg.prototype.getClass=function(){return sg};var Af=l(function(){this._index=null;var o=arguments[0];this._index=o},"ci"),yw={HotPixelSnapAction:{configurable:!0}};Af.prototype.snap=function(){if(arguments.length===1){var o=arguments[0];return this.snap(o,null,-1)}if(arguments.length===3){var s=arguments[0],c=arguments[1],f=arguments[2],g=s.getSafeEnvelope(),_=new vw(s,c,f);return this._index.query(g,{interfaces_:l(function(){return[Ol]},"interfaces_"),visitItem:l(function(M){M.select(g,_)},"visitItem")}),_.isNodeAdded()}},Af.prototype.interfaces_=function(){return[]},Af.prototype.getClass=function(){return Af},yw.HotPixelSnapAction.get=function(){return vw},Object.defineProperties(Af,yw);var vw=function(o){function s(){o.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var c=arguments[0],f=arguments[1],g=arguments[2];this._hotPixel=c,this._parentEdge=f,this._hotPixelVertexIndex=g}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.isNodeAdded=function(){return this._isNodeAdded},s.prototype.select=function(){if(arguments.length!==2)return o.prototype.select.apply(this,arguments);var c=arguments[0],f=arguments[1],g=c.getContext();if(this._parentEdge!==null&&g===this._parentEdge&&f===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(g,f)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(sg),sp=l(function(){this._li=null,this._interiorIntersections=null;var o=arguments[0];this._li=o,this._interiorIntersections=new Et},"fi");sp.prototype.processIntersections=function(o,s,c,f){if(o===c&&s===f)return null;var g=o.getCoordinates()[s],_=o.getCoordinates()[s+1],M=c.getCoordinates()[f],N=c.getCoordinates()[f+1];if(this._li.computeIntersection(g,_,M,N),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var G=0;G<this._li.getIntersectionNum();G++)this._interiorIntersections.add(this._li.getIntersection(G));o.addIntersections(this._li,s,0),c.addIntersections(this._li,f,1)}},sp.prototype.isDone=function(){return!1},sp.prototype.getInteriorIntersections=function(){return this._interiorIntersections},sp.prototype.interfaces_=function(){return[$u]},sp.prototype.getClass=function(){return sp};var Zs=l(function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var o=arguments[0];this._pm=o,this._li=new Ji,this._li.setPrecisionModel(o),this._scaleFactor=o.getScale()},"gi");Zs.prototype.checkCorrectness=function(o){var s=ln.getNodedSubstrings(o),c=new xs(s);try{c.checkValid()}catch(f){if(!(f instanceof vr))throw f;f.printStackTrace()}},Zs.prototype.getNodedSubstrings=function(){return ln.getNodedSubstrings(this._nodedSegStrings)},Zs.prototype.snapRound=function(o,s){var c=this.findInteriorIntersections(o,s);this.computeIntersectionSnaps(c),this.computeVertexSnaps(o)},Zs.prototype.findInteriorIntersections=function(o,s){var c=new sp(s);return this._noder.setSegmentIntersector(c),this._noder.computeNodes(o),c.getInteriorIntersections()},Zs.prototype.computeVertexSnaps=function(){if(ct(arguments[0],Rr))for(var o=arguments[0].iterator();o.hasNext();){var s=o.next();this.computeVertexSnaps(s)}else if(arguments[0]instanceof ln)for(var c=arguments[0],f=c.getCoordinates(),g=0;g<f.length;g++){var _=new Vi(f[g],this._scaleFactor,this._li);this._pointSnapper.snap(_,c,g)&&c.addIntersection(f[g],g)}},Zs.prototype.computeNodes=function(o){this._nodedSegStrings=o,this._noder=new z2,this._pointSnapper=new Af(this._noder.getIndex()),this.snapRound(o,this._li)},Zs.prototype.computeIntersectionSnaps=function(o){for(var s=o.iterator();s.hasNext();){var c=s.next(),f=new Vi(c,this._scaleFactor,this._li);this._pointSnapper.snap(f)}},Zs.prototype.interfaces_=function(){return[Wu]},Zs.prototype.getClass=function(){return Zs};var qn=l(function(){if(this._argGeom=null,this._distance=null,this._bufParams=new er,this._resultGeometry=null,this._saveException=null,arguments.length===1){var o=arguments[0];this._argGeom=o}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this._argGeom=s,this._bufParams=c}},"di"),Nf={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};qn.prototype.bufferFixedPrecision=function(o){var s=new Al(new Zs(new tr(1)),o.getScale()),c=new gi(this._bufParams);c.setWorkingPrecisionModel(o),c.setNoder(s),this._resultGeometry=c.buffer(this._argGeom,this._distance)},qn.prototype.bufferReducedPrecision=function(){var o=this;if(arguments.length===0){for(var s=qn.MAX_PRECISION_DIGITS;s>=0;s--){try{o.bufferReducedPrecision(s)}catch(_){if(!(_ instanceof Na))throw _;o._saveException=_}if(o._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var c=arguments[0],f=qn.precisionScaleFactor(this._argGeom,this._distance,c),g=new tr(f);this.bufferFixedPrecision(g)}},qn.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var o=this._argGeom.getFactory().getPrecisionModel();o.getType()===tr.FIXED?this.bufferFixedPrecision(o):this.bufferReducedPrecision()},qn.prototype.setQuadrantSegments=function(o){this._bufParams.setQuadrantSegments(o)},qn.prototype.bufferOriginalPrecision=function(){try{var o=new gi(this._bufParams);this._resultGeometry=o.buffer(this._argGeom,this._distance)}catch(s){if(!(s instanceof Wr))throw s;this._saveException=s}},qn.prototype.getResultGeometry=function(o){return this._distance=o,this.computeGeometry(),this._resultGeometry},qn.prototype.setEndCapStyle=function(o){this._bufParams.setEndCapStyle(o)},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},qn.bufferOp=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];return new qn(o).getResultGeometry(s)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Jt&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],g=arguments[2],_=new qn(c);return _.setQuadrantSegments(g),_.getResultGeometry(f)}if(arguments[2]instanceof er&&arguments[0]instanceof Jt&&typeof arguments[1]=="number"){var M=arguments[0],N=arguments[1],G=arguments[2];return new qn(M,G).getResultGeometry(N)}}else if(arguments.length===4){var Z=arguments[0],st=arguments[1],ut=arguments[2],Ot=arguments[3],Dt=new qn(Z);return Dt.setQuadrantSegments(ut),Dt.setEndCapStyle(Ot),Dt.getResultGeometry(st)}},qn.precisionScaleFactor=function(o,s,c){var f=o.getEnvelopeInternal(),g=ft.max(Math.abs(f.getMaxX()),Math.abs(f.getMaxY()),Math.abs(f.getMinX()),Math.abs(f.getMinY()))+2*(s>0?s:0),_=c-Math.trunc(Math.log(g)/Math.log(10)+1);return Math.pow(10,_)},Nf.CAP_ROUND.get=function(){return er.CAP_ROUND},Nf.CAP_BUTT.get=function(){return er.CAP_FLAT},Nf.CAP_FLAT.get=function(){return er.CAP_FLAT},Nf.CAP_SQUARE.get=function(){return er.CAP_SQUARE},Nf.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(qn,Nf);var yi=l(function(){this._pt=[new F,new F],this._distance=L.NaN,this._isNull=!0},"_i");yi.prototype.getCoordinates=function(){return this._pt},yi.prototype.getCoordinate=function(o){return this._pt[o]},yi.prototype.setMinimum=function(){if(arguments.length===1){var o=arguments[0];this.setMinimum(o._pt[0],o._pt[1])}else if(arguments.length===2){var s=arguments[0],c=arguments[1];if(this._isNull)return this.initialize(s,c),null;var f=s.distance(c);f<this._distance&&this.initialize(s,c,f)}},yi.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var o=arguments[0],s=arguments[1];this._pt[0].setCoordinate(o),this._pt[1].setCoordinate(s),this._distance=o.distance(s),this._isNull=!1}else if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2];this._pt[0].setCoordinate(c),this._pt[1].setCoordinate(f),this._distance=g,this._isNull=!1}},yi.prototype.getDistance=function(){return this._distance},yi.prototype.setMaximum=function(){if(arguments.length===1){var o=arguments[0];this.setMaximum(o._pt[0],o._pt[1])}else if(arguments.length===2){var s=arguments[0],c=arguments[1];if(this._isNull)return this.initialize(s,c),null;var f=s.distance(c);f>this._distance&&this.initialize(s,c,f)}},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi};var $s=l(function(){},"mi");$s.prototype.interfaces_=function(){return[]},$s.prototype.getClass=function(){return $s},$s.computeDistance=function(){if(arguments[2]instanceof yi&&arguments[0]instanceof ye&&arguments[1]instanceof F)for(var o=arguments[0],s=arguments[1],c=arguments[2],f=o.getCoordinates(),g=new Ut,_=0;_<f.length-1;_++){g.setCoordinates(f[_],f[_+1]);var M=g.closestPoint(s);c.setMinimum(M,s)}else if(arguments[2]instanceof yi&&arguments[0]instanceof xr&&arguments[1]instanceof F){var N=arguments[0],G=arguments[1],Z=arguments[2];$s.computeDistance(N.getExteriorRing(),G,Z);for(var st=0;st<N.getNumInteriorRing();st++)$s.computeDistance(N.getInteriorRingN(st),G,Z)}else if(arguments[2]instanceof yi&&arguments[0]instanceof Jt&&arguments[1]instanceof F){var ut=arguments[0],Ot=arguments[1],Dt=arguments[2];if(ut instanceof ye)$s.computeDistance(ut,Ot,Dt);else if(ut instanceof xr)$s.computeDistance(ut,Ot,Dt);else if(ut instanceof te)for(var Bt=ut,Wt=0;Wt<Bt.getNumGeometries();Wt++){var Cr=Bt.getGeometryN(Wt);$s.computeDistance(Cr,Ot,Dt)}else Dt.setMinimum(ut.getCoordinate(),Ot)}else if(arguments[2]instanceof yi&&arguments[0]instanceof Ut&&arguments[1]instanceof F){var vn=arguments[0],_i=arguments[1],ta=arguments[2],Vl=vn.closestPoint(_i);ta.setMinimum(Vl,_i)}};var Ku=l(function(o){this._maxPtDist=new yi,this._inputGeom=o||null},"vi"),H2={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Ku.prototype.computeMaxMidpointDistance=function(o){var s=new Nl(this._inputGeom);o.apply(s),this._maxPtDist.setMaximum(s.getMaxPointDistance())},Ku.prototype.computeMaxVertexDistance=function(o){var s=new ap(this._inputGeom);o.apply(s),this._maxPtDist.setMaximum(s.getMaxPointDistance())},Ku.prototype.findDistance=function(o){return this.computeMaxVertexDistance(o),this.computeMaxMidpointDistance(o),this._maxPtDist.getDistance()},Ku.prototype.getDistancePoints=function(){return this._maxPtDist},Ku.prototype.interfaces_=function(){return[]},Ku.prototype.getClass=function(){return Ku},H2.MaxPointDistanceFilter.get=function(){return ap},H2.MaxMidpointDistanceFilter.get=function(){return Nl},Object.defineProperties(Ku,H2);var ap=l(function(o){this._maxPtDist=new yi,this._minPtDist=new yi,this._geom=o||null},"Ei");ap.prototype.filter=function(o){this._minPtDist.initialize(),$s.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ap.prototype.getMaxPointDistance=function(){return this._maxPtDist},ap.prototype.interfaces_=function(){return[Ai]},ap.prototype.getClass=function(){return ap};var Nl=l(function(o){this._maxPtDist=new yi,this._minPtDist=new yi,this._geom=o||null},"xi");Nl.prototype.filter=function(o,s){if(s===0)return null;var c=o.getCoordinate(s-1),f=o.getCoordinate(s),g=new F((c.x+f.x)/2,(c.y+f.y)/2);this._minPtDist.initialize(),$s.computeDistance(this._geom,g,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Nl.prototype.isDone=function(){return!1},Nl.prototype.isGeometryChanged=function(){return!1},Nl.prototype.getMaxPointDistance=function(){return this._maxPtDist},Nl.prototype.interfaces_=function(){return[fe]},Nl.prototype.getClass=function(){return Nl};var Ba=l(function(o){this._comps=o||null},"Ni");Ba.prototype.filter=function(o){o instanceof xr&&this._comps.add(o)},Ba.prototype.interfaces_=function(){return[qt]},Ba.prototype.getClass=function(){return Ba},Ba.getPolygons=function(){if(arguments.length===1){var o=arguments[0];return Ba.getPolygons(o,new Et)}if(arguments.length===2){var s=arguments[0],c=arguments[1];return s instanceof xr?c.add(s):s instanceof te&&s.apply(new Ba(c)),c}};var Wn=l(function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var o=arguments[0];this._lines=o}else if(arguments.length===2){var s=arguments[0],c=arguments[1];this._lines=s,this._isForcedToLineString=c}},"Ci");Wn.prototype.filter=function(o){if(this._isForcedToLineString&&o instanceof Fi){var s=o.getFactory().createLineString(o.getCoordinateSequence());return this._lines.add(s),null}o instanceof ye&&this._lines.add(o)},Wn.prototype.setForceToLineString=function(o){this._isForcedToLineString=o},Wn.prototype.interfaces_=function(){return[Zo]},Wn.prototype.getClass=function(){return Wn},Wn.getGeometry=function(){if(arguments.length===1){var o=arguments[0];return o.getFactory().buildGeometry(Wn.getLines(o))}if(arguments.length===2){var s=arguments[0],c=arguments[1];return s.getFactory().buildGeometry(Wn.getLines(s,c))}},Wn.getLines=function(){if(arguments.length===1){var o=arguments[0];return Wn.getLines(o,!1)}if(arguments.length===2){if(ct(arguments[0],Rr)&&ct(arguments[1],Rr)){for(var s=arguments[0],c=arguments[1],f=s.iterator();f.hasNext();){var g=f.next();Wn.getLines(g,c)}return c}if(arguments[0]instanceof Jt&&typeof arguments[1]=="boolean"){var _=arguments[0],M=arguments[1],N=new Et;return _.apply(new Wn(N,M)),N}if(arguments[0]instanceof Jt&&ct(arguments[1],Rr)){var G=arguments[0],Z=arguments[1];return G instanceof ye?Z.add(G):G.apply(new Wn(Z)),Z}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&ct(arguments[0],Rr)&&ct(arguments[1],Rr)){for(var st=arguments[0],ut=arguments[1],Ot=arguments[2],Dt=st.iterator();Dt.hasNext();){var Bt=Dt.next();Wn.getLines(Bt,ut,Ot)}return ut}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Jt&&ct(arguments[1],Rr)){var Wt=arguments[0],Cr=arguments[1],vn=arguments[2];return Wt.apply(new Wn(Cr,vn)),Cr}}};var es=l(function(){if(this._boundaryRule=Hn.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var o=arguments[0];if(o===null)throw new A("Rule must be non-null");this._boundaryRule=o}}},"Si");es.prototype.locateInternal=function(){if(arguments[0]instanceof F&&arguments[1]instanceof xr){var o=arguments[0],s=arguments[1];if(s.isEmpty())return H.EXTERIOR;var c=s.getExteriorRing(),f=this.locateInPolygonRing(o,c);if(f===H.EXTERIOR)return H.EXTERIOR;if(f===H.BOUNDARY)return H.BOUNDARY;for(var g=0;g<s.getNumInteriorRing();g++){var _=s.getInteriorRingN(g),M=this.locateInPolygonRing(o,_);if(M===H.INTERIOR)return H.EXTERIOR;if(M===H.BOUNDARY)return H.BOUNDARY}return H.INTERIOR}if(arguments[0]instanceof F&&arguments[1]instanceof ye){var N=arguments[0],G=arguments[1];if(!G.getEnvelopeInternal().intersects(N))return H.EXTERIOR;var Z=G.getCoordinates();return G.isClosed()||!N.equals(Z[0])&&!N.equals(Z[Z.length-1])?wt.isOnLine(N,Z)?H.INTERIOR:H.EXTERIOR:H.BOUNDARY}if(arguments[0]instanceof F&&arguments[1]instanceof Ur){var st=arguments[0];return arguments[1].getCoordinate().equals2D(st)?H.INTERIOR:H.EXTERIOR}},es.prototype.locateInPolygonRing=function(o,s){return s.getEnvelopeInternal().intersects(o)?wt.locatePointInRing(o,s.getCoordinates()):H.EXTERIOR},es.prototype.intersects=function(o,s){return this.locate(o,s)!==H.EXTERIOR},es.prototype.updateLocationInfo=function(o){o===H.INTERIOR&&(this._isIn=!0),o===H.BOUNDARY&&this._numBoundaries++},es.prototype.computeLocation=function(o,s){if(s instanceof Ur&&this.updateLocationInfo(this.locateInternal(o,s)),s instanceof ye)this.updateLocationInfo(this.locateInternal(o,s));else if(s instanceof xr)this.updateLocationInfo(this.locateInternal(o,s));else if(s instanceof Tr)for(var c=s,f=0;f<c.getNumGeometries();f++){var g=c.getGeometryN(f);this.updateLocationInfo(this.locateInternal(o,g))}else if(s instanceof Jo)for(var _=s,M=0;M<_.getNumGeometries();M++){var N=_.getGeometryN(M);this.updateLocationInfo(this.locateInternal(o,N))}else if(s instanceof te)for(var G=new qs(s);G.hasNext();){var Z=G.next();Z!==s&&this.computeLocation(o,Z)}},es.prototype.locate=function(o,s){return s.isEmpty()?H.EXTERIOR:s instanceof ye?this.locateInternal(o,s):s instanceof xr?this.locateInternal(o,s):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(o,s),this._boundaryRule.isInBoundary(this._numBoundaries)?H.BOUNDARY:this._numBoundaries>0||this._isIn?H.INTERIOR:H.EXTERIOR)},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es};var vi=l(function o(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var s=arguments[0],c=arguments[1];o.call(this,s,o.INSIDE_AREA,c)}else if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2];this._component=f,this._segIndex=g,this._pt=_}},"t"),bw={INSIDE_AREA:{configurable:!0}};vi.prototype.isInsideArea=function(){return this._segIndex===vi.INSIDE_AREA},vi.prototype.getCoordinate=function(){return this._pt},vi.prototype.getGeometryComponent=function(){return this._component},vi.prototype.getSegmentIndex=function(){return this._segIndex},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi},bw.INSIDE_AREA.get=function(){return-1},Object.defineProperties(vi,bw);var kl=l(function(o){this._pts=o||null},"wi");kl.prototype.filter=function(o){o instanceof Ur&&this._pts.add(o)},kl.prototype.interfaces_=function(){return[qt]},kl.prototype.getClass=function(){return kl},kl.getPoints=function(){if(arguments.length===1){var o=arguments[0];return o instanceof Ur?Qo.singletonList(o):kl.getPoints(o,new Et)}if(arguments.length===2){var s=arguments[0],c=arguments[1];return s instanceof Ur?c.add(s):s instanceof te&&s.apply(new kl(c)),c}};var lp=l(function(){this._locations=null;var o=arguments[0];this._locations=o},"Oi");lp.prototype.filter=function(o){(o instanceof Ur||o instanceof ye||o instanceof xr)&&this._locations.add(new vi(o,0,o.getCoordinate()))},lp.prototype.interfaces_=function(){return[qt]},lp.prototype.getClass=function(){return lp},lp.getLocations=function(o){var s=new Et;return o.apply(new lp(s)),s};var Zn=l(function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new es,this._minDistanceLocation=null,this._minDistance=L.MAX_VALUE,arguments.length===2){var o=arguments[0],s=arguments[1];this._geom=[o,s],this._terminateDistance=0}else if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=c,this._geom[1]=f,this._terminateDistance=g}},"Ti");Zn.prototype.computeContainmentDistance=function(){if(arguments.length===0){var o=new Array(2).fill(null);if(this.computeContainmentDistance(0,o),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,o)}else if(arguments.length===2){var s=arguments[0],c=arguments[1],f=1-s,g=Ba.getPolygons(this._geom[s]);if(g.size()>0){var _=lp.getLocations(this._geom[f]);if(this.computeContainmentDistance(_,g,c),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[f]=c[0],this._minDistanceLocation[s]=c[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ct(arguments[0],ki)&&ct(arguments[1],ki)){for(var M=arguments[0],N=arguments[1],G=arguments[2],Z=0;Z<M.size();Z++)for(var st=M.get(Z),ut=0;ut<N.size();ut++)if(this.computeContainmentDistance(st,N.get(ut),G),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof vi&&arguments[1]instanceof xr){var Ot=arguments[0],Dt=arguments[1],Bt=arguments[2],Wt=Ot.getCoordinate();if(H.EXTERIOR!==this._ptLocator.locate(Wt,Dt))return this._minDistance=0,Bt[0]=Ot,Bt[1]=new vi(Dt,Wt),null}}},Zn.prototype.computeMinDistanceLinesPoints=function(o,s,c){for(var f=0;f<o.size();f++)for(var g=o.get(f),_=0;_<s.size();_++){var M=s.get(_);if(this.computeMinDistance(g,M,c),this._minDistance<=this._terminateDistance)return null}},Zn.prototype.computeFacetDistance=function(){var o=new Array(2).fill(null),s=Wn.getLines(this._geom[0]),c=Wn.getLines(this._geom[1]),f=kl.getPoints(this._geom[0]),g=kl.getPoints(this._geom[1]);return this.computeMinDistanceLines(s,c,o),this.updateMinDistance(o,!1),this._minDistance<=this._terminateDistance?null:(o[0]=null,o[1]=null,this.computeMinDistanceLinesPoints(s,g,o),this.updateMinDistance(o,!1),this._minDistance<=this._terminateDistance?null:(o[0]=null,o[1]=null,this.computeMinDistanceLinesPoints(c,f,o),this.updateMinDistance(o,!0),this._minDistance<=this._terminateDistance?null:(o[0]=null,o[1]=null,this.computeMinDistancePoints(f,g,o),void this.updateMinDistance(o,!1))))},Zn.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Zn.prototype.updateMinDistance=function(o,s){if(o[0]===null)return null;s?(this._minDistanceLocation[0]=o[1],this._minDistanceLocation[1]=o[0]):(this._minDistanceLocation[0]=o[0],this._minDistanceLocation[1]=o[1])},Zn.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Zn.prototype.computeMinDistance=function(){if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof ye&&arguments[1]instanceof Ur){var o=arguments[0],s=arguments[1],c=arguments[2];if(o.getEnvelopeInternal().distance(s.getEnvelopeInternal())>this._minDistance)return null;for(var f=o.getCoordinates(),g=s.getCoordinate(),_=0;_<f.length-1;_++){var M=wt.distancePointLine(g,f[_],f[_+1]);if(M<this._minDistance){this._minDistance=M;var N=new Ut(f[_],f[_+1]).closestPoint(g);c[0]=new vi(o,_,N),c[1]=new vi(s,0,g)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ye&&arguments[1]instanceof ye){var G=arguments[0],Z=arguments[1],st=arguments[2];if(G.getEnvelopeInternal().distance(Z.getEnvelopeInternal())>this._minDistance)return null;for(var ut=G.getCoordinates(),Ot=Z.getCoordinates(),Dt=0;Dt<ut.length-1;Dt++)for(var Bt=0;Bt<Ot.length-1;Bt++){var Wt=wt.distanceLineLine(ut[Dt],ut[Dt+1],Ot[Bt],Ot[Bt+1]);if(Wt<this._minDistance){this._minDistance=Wt;var Cr=new Ut(ut[Dt],ut[Dt+1]),vn=new Ut(Ot[Bt],Ot[Bt+1]),_i=Cr.closestPoints(vn);st[0]=new vi(G,Dt,_i[0]),st[1]=new vi(Z,Bt,_i[1])}if(this._minDistance<=this._terminateDistance)return null}}}},Zn.prototype.computeMinDistancePoints=function(o,s,c){for(var f=0;f<o.size();f++)for(var g=o.get(f),_=0;_<s.size();_++){var M=s.get(_),N=g.getCoordinate().distance(M.getCoordinate());if(N<this._minDistance&&(this._minDistance=N,c[0]=new vi(g,0,g.getCoordinate()),c[1]=new vi(M,0,M.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Zn.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new A("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Zn.prototype.computeMinDistanceLines=function(o,s,c){for(var f=0;f<o.size();f++)for(var g=o.get(f),_=0;_<s.size();_++){var M=s.get(_);if(this.computeMinDistance(g,M,c),this._minDistance<=this._terminateDistance)return null}},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.distance=function(o,s){return new Zn(o,s).distance()},Zn.isWithinDistance=function(o,s,c){return new Zn(o,s,c).distance()<=c},Zn.nearestPoints=function(o,s){return new Zn(o,s).nearestPoints()};var ii=l(function(){this._pt=[new F,new F],this._distance=L.NaN,this._isNull=!0},"Ri");ii.prototype.getCoordinates=function(){return this._pt},ii.prototype.getCoordinate=function(o){return this._pt[o]},ii.prototype.setMinimum=function(){if(arguments.length===1){var o=arguments[0];this.setMinimum(o._pt[0],o._pt[1])}else if(arguments.length===2){var s=arguments[0],c=arguments[1];if(this._isNull)return this.initialize(s,c),null;var f=s.distance(c);f<this._distance&&this.initialize(s,c,f)}},ii.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var o=arguments[0],s=arguments[1];this._pt[0].setCoordinate(o),this._pt[1].setCoordinate(s),this._distance=o.distance(s),this._isNull=!1}else if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2];this._pt[0].setCoordinate(c),this._pt[1].setCoordinate(f),this._distance=g,this._isNull=!1}},ii.prototype.toString=function(){return br.toLineString(this._pt[0],this._pt[1])},ii.prototype.getDistance=function(){return this._distance},ii.prototype.setMaximum=function(){if(arguments.length===1){var o=arguments[0];this.setMaximum(o._pt[0],o._pt[1])}else if(arguments.length===2){var s=arguments[0],c=arguments[1];if(this._isNull)return this.initialize(s,c),null;var f=s.distance(c);f>this._distance&&this.initialize(s,c,f)}},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii};var _s=l(function(){},"Pi");_s.prototype.interfaces_=function(){return[]},_s.prototype.getClass=function(){return _s},_s.computeDistance=function(){if(arguments[2]instanceof ii&&arguments[0]instanceof ye&&arguments[1]instanceof F)for(var o=arguments[0],s=arguments[1],c=arguments[2],f=new Ut,g=o.getCoordinates(),_=0;_<g.length-1;_++){f.setCoordinates(g[_],g[_+1]);var M=f.closestPoint(s);c.setMinimum(M,s)}else if(arguments[2]instanceof ii&&arguments[0]instanceof xr&&arguments[1]instanceof F){var N=arguments[0],G=arguments[1],Z=arguments[2];_s.computeDistance(N.getExteriorRing(),G,Z);for(var st=0;st<N.getNumInteriorRing();st++)_s.computeDistance(N.getInteriorRingN(st),G,Z)}else if(arguments[2]instanceof ii&&arguments[0]instanceof Jt&&arguments[1]instanceof F){var ut=arguments[0],Ot=arguments[1],Dt=arguments[2];if(ut instanceof ye)_s.computeDistance(ut,Ot,Dt);else if(ut instanceof xr)_s.computeDistance(ut,Ot,Dt);else if(ut instanceof te)for(var Bt=ut,Wt=0;Wt<Bt.getNumGeometries();Wt++){var Cr=Bt.getGeometryN(Wt);_s.computeDistance(Cr,Ot,Dt)}else Dt.setMinimum(ut.getCoordinate(),Ot)}else if(arguments[2]instanceof ii&&arguments[0]instanceof Ut&&arguments[1]instanceof F){var vn=arguments[0],_i=arguments[1],ta=arguments[2],Vl=vn.closestPoint(_i);ta.setMinimum(Vl,_i)}};var ko=l(function(){this._g0=null,this._g1=null,this._ptDist=new ii,this._densifyFrac=0;var o=arguments[0],s=arguments[1];this._g0=o,this._g1=s},"Di"),X2={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ko.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ko.prototype.setDensifyFraction=function(o){if(o>1||o<=0)throw new A("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=o},ko.prototype.compute=function(o,s){this.computeOrientedDistance(o,s,this._ptDist),this.computeOrientedDistance(s,o,this._ptDist)},ko.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ko.prototype.computeOrientedDistance=function(o,s,c){var f=new up(s);if(o.apply(f),c.setMaximum(f.getMaxPointDistance()),this._densifyFrac>0){var g=new Rl(s,this._densifyFrac);o.apply(g),c.setMaximum(g.getMaxPointDistance())}},ko.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ko.prototype.interfaces_=function(){return[]},ko.prototype.getClass=function(){return ko},ko.distance=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1];return new ko(o,s).distance()}if(arguments.length===3){var c=arguments[0],f=arguments[1],g=arguments[2],_=new ko(c,f);return _.setDensifyFraction(g),_.distance()}},X2.MaxPointDistanceFilter.get=function(){return up},X2.MaxDensifiedByFractionDistanceFilter.get=function(){return Rl},Object.defineProperties(ko,X2);var up=l(function(){this._maxPtDist=new ii,this._minPtDist=new ii,this._euclideanDist=new _s,this._geom=null;var o=arguments[0];this._geom=o},"Ai");up.prototype.filter=function(o){this._minPtDist.initialize(),_s.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},up.prototype.getMaxPointDistance=function(){return this._maxPtDist},up.prototype.interfaces_=function(){return[Ai]},up.prototype.getClass=function(){return up};var Rl=l(function(){this._maxPtDist=new ii,this._minPtDist=new ii,this._geom=null,this._numSubSegs=0;var o=arguments[0],s=arguments[1];this._geom=o,this._numSubSegs=Math.trunc(Math.round(1/s))},"Fi");Rl.prototype.filter=function(o,s){if(s===0)return null;for(var c=o.getCoordinate(s-1),f=o.getCoordinate(s),g=(f.x-c.x)/this._numSubSegs,_=(f.y-c.y)/this._numSubSegs,M=0;M<this._numSubSegs;M++){var N=c.x+M*g,G=c.y+M*_,Z=new F(N,G);this._minPtDist.initialize(),_s.computeDistance(this._geom,Z,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Rl.prototype.isDone=function(){return!1},Rl.prototype.isGeometryChanged=function(){return!1},Rl.prototype.getMaxPointDistance=function(){return this._maxPtDist},Rl.prototype.interfaces_=function(){return[fe]},Rl.prototype.getClass=function(){return Rl};var ro=l(function(o,s,c){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=o||null,this._bufDistance=s||null,this._result=c||null},"Gi"),Y2={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};ro.prototype.checkMaximumDistance=function(o,s,c){var f=new ko(s,o);if(f.setDensifyFraction(.25),this._maxDistanceFound=f.orientedDistance(),this._maxDistanceFound>c){this._isValid=!1;var g=f.getCoordinates();this._errorLocation=g[1],this._errorIndicator=o.getFactory().createLineString(g),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+br.toLineString(g[0],g[1])+")"}},ro.prototype.isValid=function(){var o=Math.abs(this._bufDistance),s=ro.MAX_DISTANCE_DIFF_FRAC*o;return this._minValidDistance=o-s,this._maxValidDistance=o+s,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),ro.VERBOSE&&Nt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},ro.prototype.checkNegativeValid=function(){if(!(this._input instanceof xr||this._input instanceof Jo||this._input instanceof te))return null;var o=this.getPolygonLines(this._input);if(this.checkMinimumDistance(o,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(o,this._result,this._maxValidDistance)},ro.prototype.getErrorIndicator=function(){return this._errorIndicator},ro.prototype.checkMinimumDistance=function(o,s,c){var f=new Zn(o,s,c);if(this._minDistanceFound=f.distance(),this._minDistanceFound<c){this._isValid=!1;var g=f.nearestPoints();this._errorLocation=f.nearestPoints()[1],this._errorIndicator=o.getFactory().createLineString(g),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+br.toLineString(g[0],g[1])+" )"}},ro.prototype.checkPositiveValid=function(){var o=this._result.getBoundary();if(this.checkMinimumDistance(this._input,o,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,o,this._maxValidDistance)},ro.prototype.getErrorLocation=function(){return this._errorLocation},ro.prototype.getPolygonLines=function(o){for(var s=new Et,c=new Wn(s),f=Ba.getPolygons(o).iterator();f.hasNext();)f.next().apply(c);return o.getFactory().buildGeometry(s)},ro.prototype.getErrorMessage=function(){return this._errMsg},ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro},Y2.VERBOSE.get=function(){return!1},Y2.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(ro,Y2);var $n=l(function(o,s,c){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=o||null,this._distance=s||null,this._result=c||null},"Bi"),q2={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};$n.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},$n.prototype.checkEnvelope=function(){if(this._distance<0)return null;var o=this._distance*$n.MAX_ENV_DIFF_FRAC;o===0&&(o=.001);var s=new Ct(this._input.getEnvelopeInternal());s.expandBy(this._distance);var c=new Ct(this._result.getEnvelopeInternal());c.expandBy(o),c.contains(s)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(c)),this.report("Envelope")},$n.prototype.checkDistance=function(){var o=new ro(this._input,this._distance,this._result);o.isValid()||(this._isValid=!1,this._errorMsg=o.getErrorMessage(),this._errorLocation=o.getErrorLocation(),this._errorIndicator=o.getErrorIndicator()),this.report("Distance")},$n.prototype.checkArea=function(){var o=this._input.getArea(),s=this._result.getArea();this._distance>0&&o>s&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&o<s&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},$n.prototype.checkPolygonal=function(){this._result instanceof xr||this._result instanceof Jo||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},$n.prototype.getErrorIndicator=function(){return this._errorIndicator},$n.prototype.getErrorLocation=function(){return this._errorLocation},$n.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},$n.prototype.report=function(o){if(!$n.VERBOSE)return null;Nt.out.println("Check "+o+": "+(this._isValid?"passed":"FAILED"))},$n.prototype.getErrorMessage=function(){return this._errorMsg},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.isValidMsg=function(o,s,c){var f=new $n(o,s,c);return f.isValid()?null:f.getErrorMessage()},$n.isValid=function(o,s,c){return!!new $n(o,s,c).isValid()},q2.VERBOSE.get=function(){return!1},q2.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties($n,q2);var Cs=l(function(){this._pts=null,this._data=null;var o=arguments[0],s=arguments[1];this._pts=o,this._data=s},"Ui");Cs.prototype.getCoordinates=function(){return this._pts},Cs.prototype.size=function(){return this._pts.length},Cs.prototype.getCoordinate=function(o){return this._pts[o]},Cs.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Cs.prototype.getSegmentOctant=function(o){return o===this._pts.length-1?-1:np.octant(this.getCoordinate(o),this.getCoordinate(o+1))},Cs.prototype.setData=function(o){this._data=o},Cs.prototype.getData=function(){return this._data},Cs.prototype.toString=function(){return br.toLineString(new an(this._pts))},Cs.prototype.interfaces_=function(){return[Ys]},Cs.prototype.getClass=function(){return Cs};var Rn=l(function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var o=arguments[0];this._li=o,this._interiorIntersection=null},"zi");Rn.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Rn.prototype.setCheckEndSegmentsOnly=function(o){this._isCheckEndSegmentsOnly=o},Rn.prototype.getIntersectionSegments=function(){return this._intSegments},Rn.prototype.count=function(){return this._intersectionCount},Rn.prototype.getIntersections=function(){return this._intersections},Rn.prototype.setFindAllIntersections=function(o){this._findAllIntersections=o},Rn.prototype.setKeepIntersections=function(o){this._keepIntersections=o},Rn.prototype.processIntersections=function(o,s,c,f){if(!this._findAllIntersections&&this.hasIntersection()||o===c&&s===f||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(o,s)||this.isEndSegment(c,f)))return null;var g=o.getCoordinates()[s],_=o.getCoordinates()[s+1],M=c.getCoordinates()[f],N=c.getCoordinates()[f+1];this._li.computeIntersection(g,_,M,N),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=g,this._intSegments[1]=_,this._intSegments[2]=M,this._intSegments[3]=N,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Rn.prototype.isEndSegment=function(o,s){return s===0||s>=o.size()-2},Rn.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Rn.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},Rn.prototype.interfaces_=function(){return[$u]},Rn.prototype.getClass=function(){return Rn},Rn.createAllIntersectionsFinder=function(o){var s=new Rn(o);return s.setFindAllIntersections(!0),s},Rn.createAnyIntersectionFinder=function(o){return new Rn(o)},Rn.createIntersectionCounter=function(o){var s=new Rn(o);return s.setFindAllIntersections(!0),s.setKeepIntersections(!1),s};var rs=l(function(){this._li=new Ji,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var o=arguments[0];this._segStrings=o},"Xi");rs.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},rs.prototype.getIntersections=function(){return this._segInt.getIntersections()},rs.prototype.isValid=function(){return this.execute(),this._isValid},rs.prototype.setFindAllIntersections=function(o){this._findAllIntersections=o},rs.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Rn(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var o=new z2;if(o.setSegmentIntersector(this._segInt),o.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},rs.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Na(this.getErrorMessage(),this._segInt.getInteriorIntersection())},rs.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var o=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+br.toLineString(o[0],o[1])+" and "+br.toLineString(o[2],o[3])},rs.prototype.interfaces_=function(){return[]},rs.prototype.getClass=function(){return rs},rs.computeIntersections=function(o){var s=new rs(o);return s.setFindAllIntersections(!0),s.isValid(),s.getIntersections()};var Qu=l(function o(){this._nv=null;var s=arguments[0];this._nv=new rs(o.toSegmentStrings(s))},"t");Qu.prototype.checkValid=function(){this._nv.checkValid()},Qu.prototype.interfaces_=function(){return[]},Qu.prototype.getClass=function(){return Qu},Qu.toSegmentStrings=function(o){for(var s=new Et,c=o.iterator();c.hasNext();){var f=c.next();s.add(new Cs(f.getCoordinates(),f))}return s},Qu.checkValid=function(o){new Qu(o).checkValid()};var cp=l(function(o){this._mapOp=o},"ki");cp.prototype.map=function(o){for(var s=new Et,c=0;c<o.getNumGeometries();c++){var f=this._mapOp.map(o.getGeometryN(c));f.isEmpty()||s.add(f)}return o.getFactory().createGeometryCollection(ge.toGeometryArray(s))},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp},cp.map=function(o,s){return new cp(s).map(o)};var Ss=l(function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Et,this._resultLineList=new Et;var o=arguments[0],s=arguments[1],c=arguments[2];this._op=o,this._geometryFactory=s,this._ptLocator=c},"ji");Ss.prototype.collectLines=function(o){for(var s=this._op.getGraph().getEdgeEnds().iterator();s.hasNext();){var c=s.next();this.collectLineEdge(c,o,this._lineEdgesList),this.collectBoundaryTouchEdge(c,o,this._lineEdgesList)}},Ss.prototype.labelIsolatedLine=function(o,s){var c=this._ptLocator.locate(o.getCoordinate(),this._op.getArgGeometry(s));o.getLabel().setLocation(s,c)},Ss.prototype.build=function(o){return this.findCoveredLineEdges(),this.collectLines(o),this.buildLines(o),this._resultLineList},Ss.prototype.collectLineEdge=function(o,s,c){var f=o.getLabel(),g=o.getEdge();o.isLineEdge()&&(o.isVisited()||!oe.isResultOfOp(f,s)||g.isCovered()||(c.add(g),o.setVisitedEdge(!0)))},Ss.prototype.findCoveredLineEdges=function(){for(var o=this._op.getGraph().getNodes().iterator();o.hasNext();)o.next().getEdges().findCoveredLineEdges();for(var s=this._op.getGraph().getEdgeEnds().iterator();s.hasNext();){var c=s.next(),f=c.getEdge();if(c.isLineEdge()&&!f.isCoveredSet()){var g=this._op.isCoveredByA(c.getCoordinate());f.setCovered(g)}}},Ss.prototype.labelIsolatedLines=function(o){for(var s=o.iterator();s.hasNext();){var c=s.next(),f=c.getLabel();c.isIsolated()&&(f.isNull(0)?this.labelIsolatedLine(c,0):this.labelIsolatedLine(c,1))}},Ss.prototype.buildLines=function(o){for(var s=this._lineEdgesList.iterator();s.hasNext();){var c=s.next(),f=this._geometryFactory.createLineString(c.getCoordinates());this._resultLineList.add(f),c.setInResult(!0)}},Ss.prototype.collectBoundaryTouchEdge=function(o,s,c){var f=o.getLabel();return o.isLineEdge()||o.isVisited()||o.isInteriorAreaEdge()||o.getEdge().isInResult()?null:(Yt.isTrue(!(o.isInResult()||o.getSym().isInResult())||!o.getEdge().isInResult()),void(oe.isResultOfOp(f,s)&&s===oe.INTERSECTION&&(c.add(o.getEdge()),o.setVisitedEdge(!0))))},Ss.prototype.interfaces_=function(){return[]},Ss.prototype.getClass=function(){return Ss};var pp=l(function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Et;var o=arguments[0],s=arguments[1];this._op=o,this._geometryFactory=s},"Hi");pp.prototype.filterCoveredNodeToPoint=function(o){var s=o.getCoordinate();if(!this._op.isCoveredByLA(s)){var c=this._geometryFactory.createPoint(s);this._resultPointList.add(c)}},pp.prototype.extractNonCoveredResultNodes=function(o){for(var s=this._op.getGraph().getNodes().iterator();s.hasNext();){var c=s.next();if(!c.isInResult()&&!c.isIncidentEdgeInResult()&&(c.getEdges().getDegree()===0||o===oe.INTERSECTION)){var f=c.getLabel();oe.isResultOfOp(f,o)&&this.filterCoveredNodeToPoint(c)}}},pp.prototype.build=function(o){return this.extractNonCoveredResultNodes(o),this._resultPointList},pp.prototype.interfaces_=function(){return[]},pp.prototype.getClass=function(){return pp};var ji=l(function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1},"Wi");ji.prototype.transformPoint=function(o,s){return this._factory.createPoint(this.transformCoordinates(o.getCoordinateSequence(),o))},ji.prototype.transformPolygon=function(o,s){var c=!0,f=this.transformLinearRing(o.getExteriorRing(),o);f!==null&&f instanceof Fi&&!f.isEmpty()||(c=!1);for(var g=new Et,_=0;_<o.getNumInteriorRing();_++){var M=this.transformLinearRing(o.getInteriorRingN(_),o);M===null||M.isEmpty()||(M instanceof Fi||(c=!1),g.add(M))}if(c)return this._factory.createPolygon(f,g.toArray([]));var N=new Et;return f!==null&&N.add(f),N.addAll(g),this._factory.buildGeometry(N)},ji.prototype.createCoordinateSequence=function(o){return this._factory.getCoordinateSequenceFactory().create(o)},ji.prototype.getInputGeometry=function(){return this._inputGeom},ji.prototype.transformMultiLineString=function(o,s){for(var c=new Et,f=0;f<o.getNumGeometries();f++){var g=this.transformLineString(o.getGeometryN(f),o);g!==null&&(g.isEmpty()||c.add(g))}return this._factory.buildGeometry(c)},ji.prototype.transformCoordinates=function(o,s){return this.copy(o)},ji.prototype.transformLineString=function(o,s){return this._factory.createLineString(this.transformCoordinates(o.getCoordinateSequence(),o))},ji.prototype.transformMultiPoint=function(o,s){for(var c=new Et,f=0;f<o.getNumGeometries();f++){var g=this.transformPoint(o.getGeometryN(f),o);g!==null&&(g.isEmpty()||c.add(g))}return this._factory.buildGeometry(c)},ji.prototype.transformMultiPolygon=function(o,s){for(var c=new Et,f=0;f<o.getNumGeometries();f++){var g=this.transformPolygon(o.getGeometryN(f),o);g!==null&&(g.isEmpty()||c.add(g))}return this._factory.buildGeometry(c)},ji.prototype.copy=function(o){return o.copy()},ji.prototype.transformGeometryCollection=function(o,s){for(var c=new Et,f=0;f<o.getNumGeometries();f++){var g=this.transform(o.getGeometryN(f));g!==null&&(this._pruneEmptyGeometry&&g.isEmpty()||c.add(g))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ge.toGeometryArray(c)):this._factory.buildGeometry(c)},ji.prototype.transform=function(o){if(this._inputGeom=o,this._factory=o.getFactory(),o instanceof Ur)return this.transformPoint(o,null);if(o instanceof Ki)return this.transformMultiPoint(o,null);if(o instanceof Fi)return this.transformLinearRing(o,null);if(o instanceof ye)return this.transformLineString(o,null);if(o instanceof Tr)return this.transformMultiLineString(o,null);if(o instanceof xr)return this.transformPolygon(o,null);if(o instanceof Jo)return this.transformMultiPolygon(o,null);if(o instanceof te)return this.transformGeometryCollection(o,null);throw new A("Unknown Geometry subtype: "+o.getClass().getName())},ji.prototype.transformLinearRing=function(o,s){var c=this.transformCoordinates(o.getCoordinateSequence(),o);if(c===null)return this._factory.createLinearRing(null);var f=c.size();return f>0&&f<4&&!this._preserveType?this._factory.createLineString(c):this._factory.createLinearRing(c)},ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji};var Js=l(function o(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Ut,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ye&&typeof arguments[1]=="number"){var s=arguments[0],c=arguments[1];o.call(this,s.getCoordinates(),c)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var f=arguments[0],g=arguments[1];this._srcPts=f,this._isClosed=o.isClosed(f),this._snapTolerance=g}},"t");Js.prototype.snapVertices=function(o,s){for(var c=this._isClosed?o.size()-1:o.size(),f=0;f<c;f++){var g=o.get(f),_=this.findSnapForVertex(g,s);_!==null&&(o.set(f,new F(_)),f===0&&this._isClosed&&o.set(o.size()-1,new F(_)))}},Js.prototype.findSnapForVertex=function(o,s){for(var c=0;c<s.length;c++){if(o.equals2D(s[c]))return null;if(o.distance(s[c])<this._snapTolerance)return s[c]}return null},Js.prototype.snapTo=function(o){var s=new et(this._srcPts);return this.snapVertices(s,o),this.snapSegments(s,o),s.toCoordinateArray()},Js.prototype.snapSegments=function(o,s){if(s.length===0)return null;var c=s.length;s[0].equals2D(s[s.length-1])&&(c=s.length-1);for(var f=0;f<c;f++){var g=s[f],_=this.findSegmentIndexToSnap(g,o);_>=0&&o.add(_+1,new F(g),!1)}},Js.prototype.findSegmentIndexToSnap=function(o,s){for(var c=L.MAX_VALUE,f=-1,g=0;g<s.size()-1;g++){if(this._seg.p0=s.get(g),this._seg.p1=s.get(g+1),this._seg.p0.equals2D(o)||this._seg.p1.equals2D(o)){if(this._allowSnappingToSourceVertices)continue;return-1}var _=this._seg.distance(o);_<this._snapTolerance&&_<c&&(c=_,f=g)}return f},Js.prototype.setAllowSnappingToSourceVertices=function(o){this._allowSnappingToSourceVertices=o},Js.prototype.interfaces_=function(){return[]},Js.prototype.getClass=function(){return Js},Js.isClosed=function(o){return!(o.length<=1)&&o[0].equals2D(o[o.length-1])};var un=l(function(o){this._srcGeom=o||null},"Ji"),xw={SNAP_PRECISION_FACTOR:{configurable:!0}};un.prototype.snapTo=function(o,s){var c=this.extractTargetCoordinates(o);return new _w(s,c).transform(this._srcGeom)},un.prototype.snapToSelf=function(o,s){var c=this.extractTargetCoordinates(this._srcGeom),f=new _w(o,c,!0).transform(this._srcGeom),g=f;return s&&ct(g,Nn)&&(g=f.buffer(0)),g},un.prototype.computeSnapTolerance=function(o){return this.computeMinimumSegmentLength(o)/10},un.prototype.extractTargetCoordinates=function(o){for(var s=new I,c=o.getCoordinates(),f=0;f<c.length;f++)s.add(c[f]);return s.toArray(new Array(0).fill(null))},un.prototype.computeMinimumSegmentLength=function(o){for(var s=L.MAX_VALUE,c=0;c<o.length-1;c++){var f=o[c].distance(o[c+1]);f<s&&(s=f)}return s},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.snap=function(o,s,c){var f=new Array(2).fill(null),g=new un(o);f[0]=g.snapTo(s,c);var _=new un(s);return f[1]=_.snapTo(f[0],c),f},un.computeOverlaySnapTolerance=function(){if(arguments.length===1){var o=arguments[0],s=un.computeSizeBasedSnapTolerance(o),c=o.getPrecisionModel();if(c.getType()===tr.FIXED){var f=1/c.getScale()*2/1.415;f>s&&(s=f)}return s}if(arguments.length===2){var g=arguments[0],_=arguments[1];return Math.min(un.computeOverlaySnapTolerance(g),un.computeOverlaySnapTolerance(_))}},un.computeSizeBasedSnapTolerance=function(o){var s=o.getEnvelopeInternal();return Math.min(s.getHeight(),s.getWidth())*un.SNAP_PRECISION_FACTOR},un.snapToSelf=function(o,s,c){return new un(o).snapToSelf(s,c)},xw.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(un,xw);var _w=function(o){function s(c,f,g){o.call(this),this._snapTolerance=c||null,this._snapPts=f||null,this._isSelfSnap=g!==void 0&&g}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.snapLine=function(c,f){var g=new Js(c,this._snapTolerance);return g.setAllowSnappingToSourceVertices(this._isSelfSnap),g.snapTo(f)},s.prototype.transformCoordinates=function(c,f){var g=c.toCoordinateArray(),_=this.snapLine(g,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(_)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(ji),bi=l(function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},"$i");bi.prototype.getCommon=function(){return L.longBitsToDouble(this._commonBits)},bi.prototype.add=function(o){var s=L.doubleToLongBits(o);if(this._isFirst)return this._commonBits=s,this._commonSignExp=bi.signExpBits(this._commonBits),this._isFirst=!1,null;if(bi.signExpBits(s)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=bi.numCommonMostSigMantissaBits(this._commonBits,s),this._commonBits=bi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},bi.prototype.toString=function(){if(arguments.length===1){var o=arguments[0],s=L.longBitsToDouble(o),c="0000000000000000000000000000000000000000000000000000000000000000"+L.toBinaryString(o),f=c.substring(c.length-64);return f.substring(0,1)+" "+f.substring(1,12)+"(exp) "+f.substring(12)+" [ "+s+" ]"}},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi},bi.getBit=function(o,s){return(o&1<<s)!=0?1:0},bi.signExpBits=function(o){return o>>52},bi.zeroLowerBits=function(o,s){return o&~((1<<s)-1)},bi.numCommonMostSigMantissaBits=function(o,s){for(var c=0,f=52;f>=0;f--){if(bi.getBit(o,f)!==bi.getBit(s,f))return c;c++}return 52};var Fl=l(function(){this._commonCoord=null,this._ccFilter=new hp},"tr"),W2={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Fl.prototype.addCommonBits=function(o){var s=new Bl(this._commonCoord);o.apply(s),o.geometryChanged()},Fl.prototype.removeCommonBits=function(o){if(this._commonCoord.x===0&&this._commonCoord.y===0)return o;var s=new F(this._commonCoord);s.x=-s.x,s.y=-s.y;var c=new Bl(s);return o.apply(c),o.geometryChanged(),o},Fl.prototype.getCommonCoordinate=function(){return this._commonCoord},Fl.prototype.add=function(o){o.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Fl.prototype.interfaces_=function(){return[]},Fl.prototype.getClass=function(){return Fl},W2.CommonCoordinateFilter.get=function(){return hp},W2.Translater.get=function(){return Bl},Object.defineProperties(Fl,W2);var hp=l(function(){this._commonBitsX=new bi,this._commonBitsY=new bi},"nr");hp.prototype.filter=function(o){this._commonBitsX.add(o.x),this._commonBitsY.add(o.y)},hp.prototype.getCommonCoordinate=function(){return new F(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},hp.prototype.interfaces_=function(){return[Ai]},hp.prototype.getClass=function(){return hp};var Bl=l(function(){this.trans=null;var o=arguments[0];this.trans=o},"ir");Bl.prototype.filter=function(o,s){var c=o.getOrdinate(s,0)+this.trans.x,f=o.getOrdinate(s,1)+this.trans.y;o.setOrdinate(s,0,c),o.setOrdinate(s,1,f)},Bl.prototype.isDone=function(){return!1},Bl.prototype.isGeometryChanged=function(){return!0},Bl.prototype.interfaces_=function(){return[fe]},Bl.prototype.getClass=function(){return Bl};var Fn=l(function(o,s){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=o,this._geom[1]=s,this.computeSnapTolerance()},"rr");Fn.prototype.selfSnap=function(o){return new un(o).snapTo(o,this._snapTolerance)},Fn.prototype.removeCommonBits=function(o){this._cbr=new Fl,this._cbr.add(o[0]),this._cbr.add(o[1]);var s=new Array(2).fill(null);return s[0]=this._cbr.removeCommonBits(o[0].copy()),s[1]=this._cbr.removeCommonBits(o[1].copy()),s},Fn.prototype.prepareResult=function(o){return this._cbr.addCommonBits(o),o},Fn.prototype.getResultGeometry=function(o){var s=this.snap(this._geom),c=oe.overlayOp(s[0],s[1],o);return this.prepareResult(c)},Fn.prototype.checkValid=function(o){o.isValid()||Nt.out.println("Snapped geometry is invalid")},Fn.prototype.computeSnapTolerance=function(){this._snapTolerance=un.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Fn.prototype.snap=function(o){var s=this.removeCommonBits(o);return un.snap(s[0],s[1],this._snapTolerance)},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.overlayOp=function(o,s,c){return new Fn(o,s).getResultGeometry(c)},Fn.union=function(o,s){return Fn.overlayOp(o,s,oe.UNION)},Fn.intersection=function(o,s){return Fn.overlayOp(o,s,oe.INTERSECTION)},Fn.symDifference=function(o,s){return Fn.overlayOp(o,s,oe.SYMDIFFERENCE)},Fn.difference=function(o,s){return Fn.overlayOp(o,s,oe.DIFFERENCE)};var xi=l(function(o,s){this._geom=new Array(2).fill(null),this._geom[0]=o,this._geom[1]=s},"or");xi.prototype.getResultGeometry=function(o){var s=null,c=!1,f=null;try{s=oe.overlayOp(this._geom[0],this._geom[1],o),c=!0}catch(g){if(!(g instanceof Wr))throw g;f=g}if(!c)try{s=Fn.overlayOp(this._geom[0],this._geom[1],o)}catch(g){throw g instanceof Wr?f:g}return s},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi},xi.overlayOp=function(o,s,c){return new xi(o,s).getResultGeometry(c)},xi.union=function(o,s){return xi.overlayOp(o,s,oe.UNION)},xi.intersection=function(o,s){return xi.overlayOp(o,s,oe.INTERSECTION)},xi.symDifference=function(o,s){return xi.overlayOp(o,s,oe.SYMDIFFERENCE)},xi.difference=function(o,s){return xi.overlayOp(o,s,oe.DIFFERENCE)};var ag=l(function(){this.mce=null,this.chainIndex=null;var o=arguments[0],s=arguments[1];this.mce=o,this.chainIndex=s},"sr");ag.prototype.computeIntersections=function(o,s){this.mce.computeIntersectsForChain(this.chainIndex,o.mce,o.chainIndex,s)},ag.prototype.interfaces_=function(){return[]},ag.prototype.getClass=function(){return ag};var no=l(function o(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var s=arguments[0],c=arguments[1];this._eventType=o.DELETE,this._xValue=s,this._insertEvent=c}else if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2];this._eventType=o.INSERT,this._label=f,this._xValue=g,this._obj=_}},"t"),Z2={INSERT:{configurable:!0},DELETE:{configurable:!0}};no.prototype.isDelete=function(){return this._eventType===no.DELETE},no.prototype.setDeleteEventIndex=function(o){this._deleteEventIndex=o},no.prototype.getObject=function(){return this._obj},no.prototype.compareTo=function(o){var s=o;return this._xValue<s._xValue?-1:this._xValue>s._xValue?1:this._eventType<s._eventType?-1:this._eventType>s._eventType?1:0},no.prototype.getInsertEvent=function(){return this._insertEvent},no.prototype.isInsert=function(){return this._eventType===no.INSERT},no.prototype.isSameLabel=function(o){return this._label!==null&&this._label===o._label},no.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},no.prototype.interfaces_=function(){return[j]},no.prototype.getClass=function(){return no},Z2.INSERT.get=function(){return 1},Z2.DELETE.get=function(){return 2},Object.defineProperties(no,Z2);var D0=l(function(){},"lr");D0.prototype.interfaces_=function(){return[]},D0.prototype.getClass=function(){return D0};var Jn=l(function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var o=arguments[0],s=arguments[1],c=arguments[2];this._li=o,this._includeProper=s,this._recordIsolated=c},"cr");Jn.prototype.isTrivialIntersection=function(o,s,c,f){if(o===c&&this._li.getIntersectionNum()===1){if(Jn.isAdjacentSegments(s,f))return!0;if(o.isClosed()){var g=o.getNumPoints()-1;if(s===0&&f===g||f===0&&s===g)return!0}}return!1},Jn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Jn.prototype.setIsDoneIfProperInt=function(o){this._isDoneWhenProperInt=o},Jn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Jn.prototype.isBoundaryPointInternal=function(o,s){for(var c=s.iterator();c.hasNext();){var f=c.next().getCoordinate();if(o.isIntersection(f))return!0}return!1},Jn.prototype.hasProperIntersection=function(){return this._hasProper},Jn.prototype.hasIntersection=function(){return this._hasIntersection},Jn.prototype.isDone=function(){return this._isDone},Jn.prototype.isBoundaryPoint=function(o,s){return s!==null&&(!!this.isBoundaryPointInternal(o,s[0])||!!this.isBoundaryPointInternal(o,s[1]))},Jn.prototype.setBoundaryNodes=function(o,s){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=o,this._bdyNodes[1]=s},Jn.prototype.addIntersections=function(o,s,c,f){if(o===c&&s===f)return null;this.numTests++;var g=o.getCoordinates()[s],_=o.getCoordinates()[s+1],M=c.getCoordinates()[f],N=c.getCoordinates()[f+1];this._li.computeIntersection(g,_,M,N),this._li.hasIntersection()&&(this._recordIsolated&&(o.setIsolated(!1),c.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(o,s,c,f)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(o.addIntersections(this._li,s,0),c.addIntersections(this._li,f,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn},Jn.isAdjacentSegments=function(o,s){return Math.abs(o-s)===1};var tA=function(o){function s(){o.call(this),this.events=new Et,this.nOverlaps=null}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.prepareEvents=function(){Qo.sort(this.events);for(var c=0;c<this.events.size();c++){var f=this.events.get(c);f.isDelete()&&f.getInsertEvent().setDeleteEventIndex(c)}},s.prototype.computeIntersections=function(){if(arguments.length===1){var c=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var f=0;f<this.events.size();f++){var g=this.events.get(f);if(g.isInsert()&&this.processOverlaps(f,g.getDeleteEventIndex(),g,c),c.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Jn&&ct(arguments[0],ki)&&ct(arguments[1],ki)){var _=arguments[0],M=arguments[1],N=arguments[2];this.addEdges(_,_),this.addEdges(M,M),this.computeIntersections(N)}else if(typeof arguments[2]=="boolean"&&ct(arguments[0],ki)&&arguments[1]instanceof Jn){var G=arguments[0],Z=arguments[1];arguments[2]?this.addEdges(G,null):this.addEdges(G),this.computeIntersections(Z)}}},s.prototype.addEdge=function(c,f){for(var g=c.getMonotoneChainEdge(),_=g.getStartIndexes(),M=0;M<_.length-1;M++){var N=new ag(g,M),G=new no(f,g.getMinX(M),N);this.events.add(G),this.events.add(new no(g.getMaxX(M),G))}},s.prototype.processOverlaps=function(c,f,g,_){for(var M=g.getObject(),N=c;N<f;N++){var G=this.events.get(N);if(G.isInsert()){var Z=G.getObject();g.isSameLabel(G)||(M.computeIntersections(Z,_),this.nOverlaps++)}}},s.prototype.addEdges=function(){if(arguments.length===1)for(var c=arguments[0].iterator();c.hasNext();){var f=c.next();this.addEdge(f,f)}else if(arguments.length===2)for(var g=arguments[0],_=arguments[1],M=g.iterator();M.hasNext();){var N=M.next();this.addEdge(N,_)}},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(D0),Ks=l(function(){this._min=L.POSITIVE_INFINITY,this._max=L.NEGATIVE_INFINITY},"hr"),Cw={NodeComparator:{configurable:!0}};Ks.prototype.getMin=function(){return this._min},Ks.prototype.intersects=function(o,s){return!(this._min>s||this._max<o)},Ks.prototype.getMax=function(){return this._max},Ks.prototype.toString=function(){return br.toLineString(new F(this._min,0),new F(this._max,0))},Ks.prototype.interfaces_=function(){return[]},Ks.prototype.getClass=function(){return Ks},Cw.NodeComparator.get=function(){return lg},Object.defineProperties(Ks,Cw);var lg=l(function(){},"gr");lg.prototype.compare=function(o,s){var c=o,f=s,g=(c._min+c._max)/2,_=(f._min+f._max)/2;return g<_?-1:g>_?1:0},lg.prototype.interfaces_=function(){return[$]},lg.prototype.getClass=function(){return lg};var eA=function(o){function s(){o.call(this),this._item=null;var c=arguments[0],f=arguments[1],g=arguments[2];this._min=c,this._max=f,this._item=g}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.query=function(c,f,g){if(!this.intersects(c,f))return null;g.visitItem(this._item)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(Ks),rA=function(o){function s(){o.call(this),this._node1=null,this._node2=null;var c=arguments[0],f=arguments[1];this._node1=c,this._node2=f,this.buildExtent(this._node1,this._node2)}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.buildExtent=function(c,f){this._min=Math.min(c._min,f._min),this._max=Math.max(c._max,f._max)},s.prototype.query=function(c,f,g){if(!this.intersects(c,f))return null;this._node1!==null&&this._node1.query(c,f,g),this._node2!==null&&this._node2.query(c,f,g)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(Ks),Qs=l(function(){this._leaves=new Et,this._root=null,this._level=0},"_r");Qs.prototype.buildTree=function(){Qo.sort(this._leaves,new Ks.NodeComparator);for(var o=this._leaves,s=null,c=new Et;;){if(this.buildLevel(o,c),c.size()===1)return c.get(0);s=o,o=c,c=s}},Qs.prototype.insert=function(o,s,c){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new eA(o,s,c))},Qs.prototype.query=function(o,s,c){this.init(),this._root.query(o,s,c)},Qs.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Qs.prototype.printNode=function(o){Nt.out.println(br.toLineString(new F(o._min,this._level),new F(o._max,this._level)))},Qs.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Qs.prototype.buildLevel=function(o,s){this._level++,s.clear();for(var c=0;c<o.size();c+=2){var f=o.get(c);if((c+1<o.size()?o.get(c):null)===null)s.add(f);else{var g=new rA(o.get(c),o.get(c+1));s.add(g)}}},Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs};var kf=l(function(){this._items=new Et},"mr");kf.prototype.visitItem=function(o){this._items.add(o)},kf.prototype.getItems=function(){return this._items},kf.prototype.interfaces_=function(){return[Ol]},kf.prototype.getClass=function(){return kf};var Rf=l(function(){this._index=null;var o=arguments[0];if(!ct(o,Nn))throw new A("Argument must be Polygonal");this._index=new tc(o)},"vr"),$2={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Rf.prototype.locate=function(o){var s=new En(o),c=new Ff(s);return this._index.query(o.y,o.y,c),s.getLocation()},Rf.prototype.interfaces_=function(){return[Lf]},Rf.prototype.getClass=function(){return Rf},$2.SegmentVisitor.get=function(){return Ff},$2.IntervalIndexedGeometry.get=function(){return tc},Object.defineProperties(Rf,$2);var Ff=l(function(){this._counter=null;var o=arguments[0];this._counter=o},"Er");Ff.prototype.visitItem=function(o){var s=o;this._counter.countSegment(s.getCoordinate(0),s.getCoordinate(1))},Ff.prototype.interfaces_=function(){return[Ol]},Ff.prototype.getClass=function(){return Ff};var tc=l(function(){this._index=new Qs;var o=arguments[0];this.init(o)},"xr");tc.prototype.init=function(o){for(var s=Wn.getLines(o).iterator();s.hasNext();){var c=s.next().getCoordinates();this.addLine(c)}},tc.prototype.addLine=function(o){for(var s=1;s<o.length;s++){var c=new Ut(o[s-1],o[s]),f=Math.min(c.p0.y,c.p1.y),g=Math.max(c.p0.y,c.p1.y);this._index.insert(f,g,c)}},tc.prototype.query=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1],c=new kf;return this._index.query(o,s,c),c.getItems()}if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2];this._index.query(f,g,_)}},tc.prototype.interfaces_=function(){return[]},tc.prototype.getClass=function(){return tc};var ug=function(o){function s(){if(o.call(this),this._parentGeom=null,this._lineEdgeMap=new nw,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new es,arguments.length===2){var c=arguments[0],f=arguments[1],g=Hn.OGC_SFS_BOUNDARY_RULE;this._argIndex=c,this._parentGeom=f,this._boundaryNodeRule=g,f!==null&&this.add(f)}else if(arguments.length===3){var _=arguments[0],M=arguments[1],N=arguments[2];this._argIndex=_,this._parentGeom=M,this._boundaryNodeRule=N,M!==null&&this.add(M)}}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.insertBoundaryPoint=function(c,f){var g=this._nodes.addNode(f).getLabel(),_=1;H.NONE,g.getLocation(c,Tt.ON)===H.BOUNDARY&&_++;var M=s.determineBoundary(this._boundaryNodeRule,_);g.setLocation(c,M)},s.prototype.computeSelfNodes=function(){if(arguments.length===2){var c=arguments[0],f=arguments[1];return this.computeSelfNodes(c,f,!1)}if(arguments.length===3){var g=arguments[0],_=arguments[1],M=arguments[2],N=new Jn(g,!0,!1);N.setIsDoneIfProperInt(M);var G=this.createEdgeSetIntersector(),Z=this._parentGeom instanceof Fi||this._parentGeom instanceof xr||this._parentGeom instanceof Jo,st=_||!Z;return G.computeIntersections(this._edges,N,st),this.addSelfIntersectionNodes(this._argIndex),N}},s.prototype.computeSplitEdges=function(c){for(var f=this._edges.iterator();f.hasNext();)f.next().eiList.addSplitEdges(c)},s.prototype.computeEdgeIntersections=function(c,f,g){var _=new Jn(f,g,!0);return _.setBoundaryNodes(this.getBoundaryNodes(),c.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,c._edges,_),_},s.prototype.getGeometry=function(){return this._parentGeom},s.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},s.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},s.prototype.addPoint=function(){if(arguments[0]instanceof Ur){var c=arguments[0].getCoordinate();this.insertPoint(this._argIndex,c,H.INTERIOR)}else if(arguments[0]instanceof F){var f=arguments[0];this.insertPoint(this._argIndex,f,H.INTERIOR)}},s.prototype.addPolygon=function(c){this.addPolygonRing(c.getExteriorRing(),H.EXTERIOR,H.INTERIOR);for(var f=0;f<c.getNumInteriorRing();f++){var g=c.getInteriorRingN(f);this.addPolygonRing(g,H.INTERIOR,H.EXTERIOR)}},s.prototype.addEdge=function(c){this.insertEdge(c);var f=c.getCoordinates();this.insertPoint(this._argIndex,f[0],H.BOUNDARY),this.insertPoint(this._argIndex,f[f.length-1],H.BOUNDARY)},s.prototype.addLineString=function(c){var f=O.removeRepeatedPoints(c.getCoordinates());if(f.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=f[0],null;var g=new O0(f,new _r(this._argIndex,H.INTERIOR));this._lineEdgeMap.put(c,g),this.insertEdge(g),Yt.isTrue(f.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,f[0]),this.insertBoundaryPoint(this._argIndex,f[f.length-1])},s.prototype.getInvalidPoint=function(){return this._invalidPoint},s.prototype.getBoundaryPoints=function(){for(var c=this.getBoundaryNodes(),f=new Array(c.size()).fill(null),g=0,_=c.iterator();_.hasNext();){var M=_.next();f[g++]=M.getCoordinate().copy()}return f},s.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},s.prototype.addSelfIntersectionNode=function(c,f,g){if(this.isBoundaryNode(c,f))return null;g===H.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(c,f):this.insertPoint(c,f,g)},s.prototype.addPolygonRing=function(c,f,g){if(c.isEmpty())return null;var _=O.removeRepeatedPoints(c.getCoordinates());if(_.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=_[0],null;var M=f,N=g;wt.isCCW(_)&&(M=g,N=f);var G=new O0(_,new _r(this._argIndex,H.BOUNDARY,M,N));this._lineEdgeMap.put(c,G),this.insertEdge(G),this.insertPoint(this._argIndex,_[0],H.BOUNDARY)},s.prototype.insertPoint=function(c,f,g){var _=this._nodes.addNode(f),M=_.getLabel();M===null?_._label=new _r(c,g):M.setLocation(c,g)},s.prototype.createEdgeSetIntersector=function(){return new tA},s.prototype.addSelfIntersectionNodes=function(c){for(var f=this._edges.iterator();f.hasNext();)for(var g=f.next(),_=g.getLabel().getLocation(c),M=g.eiList.iterator();M.hasNext();){var N=M.next();this.addSelfIntersectionNode(c,N.coord,_)}},s.prototype.add=function(){if(arguments.length!==1)return o.prototype.add.apply(this,arguments);var c=arguments[0];if(c.isEmpty())return null;if(c instanceof Jo&&(this._useBoundaryDeterminationRule=!1),c instanceof xr)this.addPolygon(c);else if(c instanceof ye)this.addLineString(c);else if(c instanceof Ur)this.addPoint(c);else if(c instanceof Ki)this.addCollection(c);else if(c instanceof Tr)this.addCollection(c);else if(c instanceof Jo)this.addCollection(c);else{if(!(c instanceof te))throw new Error(c.getClass().getName());this.addCollection(c)}},s.prototype.addCollection=function(c){for(var f=0;f<c.getNumGeometries();f++){var g=c.getGeometryN(f);this.add(g)}},s.prototype.locate=function(c){return ct(this._parentGeom,Nn)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Rf(this._parentGeom)),this._areaPtLocator.locate(c)):this._ptLocator.locate(c,this._parentGeom)},s.prototype.findEdge=function(){if(arguments.length===1){var c=arguments[0];return this._lineEdgeMap.get(c)}return o.prototype.findEdge.apply(this,arguments)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s.determineBoundary=function(c,f){return c.isInBoundary(f)?H.BOUNDARY:H.INTERIOR},s}(Zr),Bf=l(function(){if(this._li=new Ji,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var o=arguments[0];this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new ug(0,o)}else if(arguments.length===2){var s=arguments[0],c=arguments[1],f=Hn.OGC_SFS_BOUNDARY_RULE;s.getPrecisionModel().compareTo(c.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(c.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ug(0,s,f),this._arg[1]=new ug(1,c,f)}else if(arguments.length===3){var g=arguments[0],_=arguments[1],M=arguments[2];g.getPrecisionModel().compareTo(_.getPrecisionModel())>=0?this.setComputationPrecision(g.getPrecisionModel()):this.setComputationPrecision(_.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ug(0,g,M),this._arg[1]=new ug(1,_,M)}},"Cr");Bf.prototype.getArgGeometry=function(o){return this._arg[o].getGeometry()},Bf.prototype.setComputationPrecision=function(o){this._resultPrecisionModel=o,this._li.setPrecisionModel(this._resultPrecisionModel)},Bf.prototype.interfaces_=function(){return[]},Bf.prototype.getClass=function(){return Bf};var ec=l(function(){},"Sr");ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec},ec.map=function(){if(arguments[0]instanceof Jt&&ct(arguments[1],ec.MapOp)){for(var o=arguments[0],s=arguments[1],c=new Et,f=0;f<o.getNumGeometries();f++){var g=s.map(o.getGeometryN(f));g!==null&&c.add(g)}return o.getFactory().buildGeometry(c)}if(ct(arguments[0],Rr)&&ct(arguments[1],ec.MapOp)){for(var _=arguments[0],M=arguments[1],N=new Et,G=_.iterator();G.hasNext();){var Z=G.next(),st=M.map(Z);st!==null&&N.add(st)}return N}},ec.MapOp=function(){};var oe=function(o){function s(){var c=arguments[0],f=arguments[1];o.call(this,c,f),this._ptLocator=new es,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new ts,this._resultPolyList=new Et,this._resultLineList=new Et,this._resultPointList=new Et,this._graph=new Zr(new fw),this._geomFact=c.getFactory()}return l(s,"e"),o&&(s.__proto__=o),s.prototype=Object.create(o&&o.prototype),s.prototype.constructor=s,s.prototype.insertUniqueEdge=function(c){var f=this._edgeList.findEqualEdge(c);if(f!==null){var g=f.getLabel(),_=c.getLabel();f.isPointwiseEqual(c)||(_=new _r(c.getLabel())).flip();var M=f.getDepth();M.isNull()&&M.add(g),M.add(_),g.merge(_)}else this._edgeList.add(c)},s.prototype.getGraph=function(){return this._graph},s.prototype.cancelDuplicateResultEdges=function(){for(var c=this._graph.getEdgeEnds().iterator();c.hasNext();){var f=c.next(),g=f.getSym();f.isInResult()&&g.isInResult()&&(f.setInResult(!1),g.setInResult(!1))}},s.prototype.isCoveredByLA=function(c){return!!this.isCovered(c,this._resultLineList)||!!this.isCovered(c,this._resultPolyList)},s.prototype.computeGeometry=function(c,f,g,_){var M=new Et;return M.addAll(c),M.addAll(f),M.addAll(g),M.isEmpty()?s.createEmptyResult(_,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(M)},s.prototype.mergeSymLabels=function(){for(var c=this._graph.getNodes().iterator();c.hasNext();)c.next().getEdges().mergeSymLabels()},s.prototype.isCovered=function(c,f){for(var g=f.iterator();g.hasNext();){var _=g.next();if(this._ptLocator.locate(c,_)!==H.EXTERIOR)return!0}return!1},s.prototype.replaceCollapsedEdges=function(){for(var c=new Et,f=this._edgeList.iterator();f.hasNext();){var g=f.next();g.isCollapsed()&&(f.remove(),c.add(g.getCollapsedEdge()))}this._edgeList.addAll(c)},s.prototype.updateNodeLabelling=function(){for(var c=this._graph.getNodes().iterator();c.hasNext();){var f=c.next(),g=f.getEdges().getLabel();f.getLabel().merge(g)}},s.prototype.getResultGeometry=function(c){return this.computeOverlay(c),this._resultGeom},s.prototype.insertUniqueEdges=function(c){for(var f=c.iterator();f.hasNext();){var g=f.next();this.insertUniqueEdge(g)}},s.prototype.computeOverlay=function(c){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var f=new Et;this._arg[0].computeSplitEdges(f),this._arg[1].computeSplitEdges(f),this.insertUniqueEdges(f),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Qu.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(c),this.cancelDuplicateResultEdges();var g=new to(this._geomFact);g.add(this._graph),this._resultPolyList=g.getPolygons();var _=new Ss(this,this._geomFact,this._ptLocator);this._resultLineList=_.build(c);var M=new pp(this,this._geomFact,this._ptLocator);this._resultPointList=M.build(c),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,c)},s.prototype.labelIncompleteNode=function(c,f){var g=this._ptLocator.locate(c.getCoordinate(),this._arg[f].getGeometry());c.getLabel().setLocation(f,g)},s.prototype.copyPoints=function(c){for(var f=this._arg[c].getNodeIterator();f.hasNext();){var g=f.next();this._graph.addNode(g.getCoordinate()).setLabel(c,g.getLabel().getLocation(c))}},s.prototype.findResultAreaEdges=function(c){for(var f=this._graph.getEdgeEnds().iterator();f.hasNext();){var g=f.next(),_=g.getLabel();_.isArea()&&!g.isInteriorAreaEdge()&&s.isResultOfOp(_.getLocation(0,Tt.RIGHT),_.getLocation(1,Tt.RIGHT),c)&&g.setInResult(!0)}},s.prototype.computeLabelsFromDepths=function(){for(var c=this._edgeList.iterator();c.hasNext();){var f=c.next(),g=f.getLabel(),_=f.getDepth();if(!_.isNull()){_.normalize();for(var M=0;M<2;M++)g.isNull(M)||!g.isArea()||_.isNull(M)||(_.getDelta(M)===0?g.toLine(M):(Yt.isTrue(!_.isNull(M,Tt.LEFT),"depth of LEFT side has not been initialized"),g.setLocation(M,Tt.LEFT,_.getLocation(M,Tt.LEFT)),Yt.isTrue(!_.isNull(M,Tt.RIGHT),"depth of RIGHT side has not been initialized"),g.setLocation(M,Tt.RIGHT,_.getLocation(M,Tt.RIGHT))))}}},s.prototype.computeLabelling=function(){for(var c=this._graph.getNodes().iterator();c.hasNext();)c.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},s.prototype.labelIncompleteNodes=function(){for(var c=this._graph.getNodes().iterator();c.hasNext();){var f=c.next(),g=f.getLabel();f.isIsolated()&&(g.isNull(0)?this.labelIncompleteNode(f,0):this.labelIncompleteNode(f,1)),f.getEdges().updateLabelling(g)}},s.prototype.isCoveredByA=function(c){return!!this.isCovered(c,this._resultPolyList)},s.prototype.interfaces_=function(){return[]},s.prototype.getClass=function(){return s},s}(Bf);oe.overlayOp=function(o,s,c){return new oe(o,s).getResultGeometry(c)},oe.intersection=function(o,s){if(o.isEmpty()||s.isEmpty())return oe.createEmptyResult(oe.INTERSECTION,o,s,o.getFactory());if(o.isGeometryCollection()){var c=s;return cp.map(o,{interfaces_:l(function(){return[ec.MapOp]},"interfaces_"),map:l(function(f){return f.intersection(c)},"map")})}return o.checkNotGeometryCollection(o),o.checkNotGeometryCollection(s),xi.overlayOp(o,s,oe.INTERSECTION)},oe.symDifference=function(o,s){if(o.isEmpty()||s.isEmpty()){if(o.isEmpty()&&s.isEmpty())return oe.createEmptyResult(oe.SYMDIFFERENCE,o,s,o.getFactory());if(o.isEmpty())return s.copy();if(s.isEmpty())return o.copy()}return o.checkNotGeometryCollection(o),o.checkNotGeometryCollection(s),xi.overlayOp(o,s,oe.SYMDIFFERENCE)},oe.resultDimension=function(o,s,c){var f=s.getDimension(),g=c.getDimension(),_=-1;switch(o){case oe.INTERSECTION:_=Math.min(f,g);break;case oe.UNION:_=Math.max(f,g);break;case oe.DIFFERENCE:_=f;break;case oe.SYMDIFFERENCE:_=Math.max(f,g)}return _},oe.createEmptyResult=function(o,s,c,f){var g=null;switch(oe.resultDimension(o,s,c)){case-1:g=f.createGeometryCollection(new Array(0).fill(null));break;case 0:g=f.createPoint();break;case 1:g=f.createLineString();break;case 2:g=f.createPolygon()}return g},oe.difference=function(o,s){return o.isEmpty()?oe.createEmptyResult(oe.DIFFERENCE,o,s,o.getFactory()):s.isEmpty()?o.copy():(o.checkNotGeometryCollection(o),o.checkNotGeometryCollection(s),xi.overlayOp(o,s,oe.DIFFERENCE))},oe.isResultOfOp=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1],c=o.getLocation(0),f=o.getLocation(1);return oe.isResultOfOp(c,f,s)}if(arguments.length===3){var g=arguments[0],_=arguments[1],M=arguments[2];switch(g===H.BOUNDARY&&(g=H.INTERIOR),_===H.BOUNDARY&&(_=H.INTERIOR),M){case oe.INTERSECTION:return g===H.INTERIOR&&_===H.INTERIOR;case oe.UNION:return g===H.INTERIOR||_===H.INTERIOR;case oe.DIFFERENCE:return g===H.INTERIOR&&_!==H.INTERIOR;case oe.SYMDIFFERENCE:return g===H.INTERIOR&&_!==H.INTERIOR||g!==H.INTERIOR&&_===H.INTERIOR}return!1}},oe.INTERSECTION=1,oe.UNION=2,oe.DIFFERENCE=3,oe.SYMDIFFERENCE=4;var Gl=l(function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new es,this._seg=new Ut;var o=arguments[0],s=arguments[1];this._g=o,this._boundaryDistanceTolerance=s,this._linework=this.extractLinework(o)},"br");Gl.prototype.isWithinToleranceOfBoundary=function(o){for(var s=0;s<this._linework.getNumGeometries();s++)for(var c=this._linework.getGeometryN(s).getCoordinateSequence(),f=0;f<c.size()-1;f++)if(c.getCoordinate(f,this._seg.p0),c.getCoordinate(f+1,this._seg.p1),this._seg.distance(o)<=this._boundaryDistanceTolerance)return!0;return!1},Gl.prototype.getLocation=function(o){return this.isWithinToleranceOfBoundary(o)?H.BOUNDARY:this._ptLocator.locate(o,this._g)},Gl.prototype.extractLinework=function(o){var s=new Gf;o.apply(s);var c=s.getLinework(),f=ge.toLineStringArray(c);return o.getFactory().createMultiLineString(f)},Gl.prototype.interfaces_=function(){return[]},Gl.prototype.getClass=function(){return Gl};var Gf=l(function(){this._linework=null,this._linework=new Et},"wr");Gf.prototype.getLinework=function(){return this._linework},Gf.prototype.filter=function(o){if(o instanceof xr){var s=o;this._linework.add(s.getExteriorRing());for(var c=0;c<s.getNumInteriorRing();c++)this._linework.add(s.getInteriorRingN(c))}},Gf.prototype.interfaces_=function(){return[qt]},Gf.prototype.getClass=function(){return Gf};var rc=l(function(){this._g=null,this._doLeft=!0,this._doRight=!0;var o=arguments[0];this._g=o},"Or");rc.prototype.extractPoints=function(o,s,c){for(var f=o.getCoordinates(),g=0;g<f.length-1;g++)this.computeOffsetPoints(f[g],f[g+1],s,c)},rc.prototype.setSidesToGenerate=function(o,s){this._doLeft=o,this._doRight=s},rc.prototype.getPoints=function(o){for(var s=new Et,c=Wn.getLines(this._g).iterator();c.hasNext();){var f=c.next();this.extractPoints(f,o,s)}return s},rc.prototype.computeOffsetPoints=function(o,s,c,f){var g=s.x-o.x,_=s.y-o.y,M=Math.sqrt(g*g+_*_),N=c*g/M,G=c*_/M,Z=(s.x+o.x)/2,st=(s.y+o.y)/2;if(this._doLeft){var ut=new F(Z-G,st+N);f.add(ut)}if(this._doRight){var Ot=new F(Z+G,st-N);f.add(Ot)}},rc.prototype.interfaces_=function(){return[]},rc.prototype.getClass=function(){return rc};var vo=l(function o(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=o.TOLERANCE,this._testCoords=new Et;var s=arguments[0],c=arguments[1],f=arguments[2];this._boundaryDistanceTolerance=o.computeBoundaryDistanceTolerance(s,c),this._geom=[s,c,f],this._locFinder=[new Gl(this._geom[0],this._boundaryDistanceTolerance),new Gl(this._geom[1],this._boundaryDistanceTolerance),new Gl(this._geom[2],this._boundaryDistanceTolerance)]},"t"),Sw={TOLERANCE:{configurable:!0}};vo.prototype.reportResult=function(o,s,c){Nt.out.println("Overlay result invalid - A:"+H.toLocationSymbol(s[0])+" B:"+H.toLocationSymbol(s[1])+" expected:"+(c?"i":"e")+" actual:"+H.toLocationSymbol(s[2]))},vo.prototype.isValid=function(o){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var s=this.checkValid(o);return s},vo.prototype.checkValid=function(){if(arguments.length===1){for(var o=arguments[0],s=0;s<this._testCoords.size();s++){var c=this._testCoords.get(s);if(!this.checkValid(o,c))return this._invalidLocation=c,!1}return!0}if(arguments.length===2){var f=arguments[0],g=arguments[1];return this._location[0]=this._locFinder[0].getLocation(g),this._location[1]=this._locFinder[1].getLocation(g),this._location[2]=this._locFinder[2].getLocation(g),!!vo.hasLocation(this._location,H.BOUNDARY)||this.isValidResult(f,this._location)}},vo.prototype.addTestPts=function(o){var s=new rc(o);this._testCoords.addAll(s.getPoints(5*this._boundaryDistanceTolerance))},vo.prototype.isValidResult=function(o,s){var c=oe.isResultOfOp(s[0],s[1],o),f=!(c^s[2]===H.INTERIOR);return f||this.reportResult(o,s,c),f},vo.prototype.getInvalidLocation=function(){return this._invalidLocation},vo.prototype.interfaces_=function(){return[]},vo.prototype.getClass=function(){return vo},vo.hasLocation=function(o,s){for(var c=0;c<3;c++)if(o[c]===s)return!0;return!1},vo.computeBoundaryDistanceTolerance=function(o,s){return Math.min(un.computeSizeBasedSnapTolerance(o),un.computeSizeBasedSnapTolerance(s))},vo.isValid=function(o,s,c,f){return new vo(o,s,f).isValid(c)},Sw.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(vo,Sw);var bo=l(function o(s){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=o.extractFactory(s),this._inputGeoms=s},"t");bo.prototype.extractElements=function(o,s){if(o===null)return null;for(var c=0;c<o.getNumGeometries();c++){var f=o.getGeometryN(c);this._skipEmpty&&f.isEmpty()||s.add(f)}},bo.prototype.combine=function(){for(var o=new Et,s=this._inputGeoms.iterator();s.hasNext();){var c=s.next();this.extractElements(c,o)}return o.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(o)},bo.prototype.interfaces_=function(){return[]},bo.prototype.getClass=function(){return bo},bo.combine=function(){if(arguments.length===1){var o=arguments[0];return new bo(o).combine()}if(arguments.length===2){var s=arguments[0],c=arguments[1];return new bo(bo.createList(s,c)).combine()}if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2];return new bo(bo.createList(f,g,_)).combine()}},bo.extractFactory=function(o){return o.isEmpty()?null:o.iterator().next().getFactory()},bo.createList=function(){if(arguments.length===2){var o=arguments[0],s=arguments[1],c=new Et;return c.add(o),c.add(s),c}if(arguments.length===3){var f=arguments[0],g=arguments[1],_=arguments[2],M=new Et;return M.add(f),M.add(g),M.add(_),M}};var yn=l(function(){this._inputPolys=null,this._geomFactory=null;var o=arguments[0];this._inputPolys=o,this._inputPolys===null&&(this._inputPolys=new Et)},"Dr"),Iw={STRTREE_NODE_CAPACITY:{configurable:!0}};yn.prototype.reduceToGeometries=function(o){for(var s=new Et,c=o.iterator();c.hasNext();){var f=c.next(),g=null;ct(f,ki)?g=this.unionTree(f):f instanceof Jt&&(g=f),s.add(g)}return s},yn.prototype.extractByEnvelope=function(o,s,c){for(var f=new Et,g=0;g<s.getNumGeometries();g++){var _=s.getGeometryN(g);_.getEnvelopeInternal().intersects(o)?f.add(_):c.add(_)}return this._geomFactory.buildGeometry(f)},yn.prototype.unionOptimized=function(o,s){var c=o.getEnvelopeInternal(),f=s.getEnvelopeInternal();if(!c.intersects(f))return bo.combine(o,s);if(o.getNumGeometries()<=1&&s.getNumGeometries()<=1)return this.unionActual(o,s);var g=c.intersection(f);return this.unionUsingEnvelopeIntersection(o,s,g)},yn.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var o=new aw(yn.STRTREE_NODE_CAPACITY),s=this._inputPolys.iterator();s.hasNext();){var c=s.next();o.insert(c.getEnvelopeInternal(),c)}this._inputPolys=null;var f=o.itemsTree();return this.unionTree(f)},yn.prototype.binaryUnion=function(){if(arguments.length===1){var o=arguments[0];return this.binaryUnion(o,0,o.size())}if(arguments.length===3){var s=arguments[0],c=arguments[1],f=arguments[2];if(f-c<=1){var g=yn.getGeometry(s,c);return this.unionSafe(g,null)}if(f-c==2)return this.unionSafe(yn.getGeometry(s,c),yn.getGeometry(s,c+1));var _=Math.trunc((f+c)/2),M=this.binaryUnion(s,c,_),N=this.binaryUnion(s,_,f);return this.unionSafe(M,N)}},yn.prototype.repeatedUnion=function(o){for(var s=null,c=o.iterator();c.hasNext();){var f=c.next();s=s===null?f.copy():s.union(f)}return s},yn.prototype.unionSafe=function(o,s){return o===null&&s===null?null:o===null?s.copy():s===null?o.copy():this.unionOptimized(o,s)},yn.prototype.unionActual=function(o,s){return yn.restrictToPolygons(o.union(s))},yn.prototype.unionTree=function(o){var s=this.reduceToGeometries(o);return this.binaryUnion(s)},yn.prototype.unionUsingEnvelopeIntersection=function(o,s,c){var f=new Et,g=this.extractByEnvelope(c,o,f),_=this.extractByEnvelope(c,s,f),M=this.unionActual(g,_);return f.add(M),bo.combine(f)},yn.prototype.bufferUnion=function(){if(arguments.length===1){var o=arguments[0];return o.get(0).getFactory().buildGeometry(o).buffer(0)}if(arguments.length===2){var s=arguments[0],c=arguments[1];return s.getFactory().createGeometryCollection([s,c]).buffer(0)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn},yn.restrictToPolygons=function(o){if(ct(o,Nn))return o;var s=Ba.getPolygons(o);return s.size()===1?s.get(0):o.getFactory().createMultiPolygon(ge.toPolygonArray(s))},yn.getGeometry=function(o,s){return s>=o.size()?null:o.get(s)},yn.union=function(o){return new yn(o).union()},Iw.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(yn,Iw);var cg=l(function(){},"Ar");cg.prototype.interfaces_=function(){return[]},cg.prototype.getClass=function(){return cg},cg.union=function(o,s){if(o.isEmpty()||s.isEmpty()){if(o.isEmpty()&&s.isEmpty())return oe.createEmptyResult(oe.UNION,o,s,o.getFactory());if(o.isEmpty())return s.copy();if(s.isEmpty())return o.copy()}return o.checkNotGeometryCollection(o),o.checkNotGeometryCollection(s),xi.overlayOp(o,s,oe.UNION)},r.GeoJSONReader=j2,r.GeoJSONWriter=ow,r.OverlayOp=oe,r.UnionOp=cg,r.BufferOp=qn,Object.defineProperty(r,"__esModule",{value:!0})})});var P3=Lt((Sy,zd)=>{y();var uj=200,L9="__lodash_hash_undefined__",cj=800,pj=16,A9=9007199254740991,N9="[object Arguments]",hj="[object Array]",fj="[object AsyncFunction]",dj="[object Boolean]",mj="[object Date]",gj="[object Error]",k9="[object Function]",yj="[object GeneratorFunction]",vj="[object Map]",bj="[object Number]",xj="[object Null]",R9="[object Object]",_j="[object Proxy]",Cj="[object RegExp]",Sj="[object Set]",Ij="[object String]",Mj="[object Undefined]",Tj="[object WeakMap]",wj="[object ArrayBuffer]",Pj="[object DataView]",Ej="[object Float32Array]",Oj="[object Float64Array]",Dj="[object Int8Array]",Lj="[object Int16Array]",Aj="[object Int32Array]",Nj="[object Uint8Array]",kj="[object Uint8ClampedArray]",Rj="[object Uint16Array]",Fj="[object Uint32Array]",Bj=/[\\^$.*+?()[\]{}|]/g,Gj=/^\[object .+?Constructor\]$/,Vj=/^(?:0|[1-9]\d*)$/,pn={};pn[Ej]=pn[Oj]=pn[Dj]=pn[Lj]=pn[Aj]=pn[Nj]=pn[kj]=pn[Rj]=pn[Fj]=!0;pn[N9]=pn[hj]=pn[wj]=pn[dj]=pn[Pj]=pn[mj]=pn[gj]=pn[k9]=pn[vj]=pn[bj]=pn[R9]=pn[Cj]=pn[Sj]=pn[Ij]=pn[Tj]=!1;var F9=typeof global=="object"&&global&&global.Object===Object&&global,jj=typeof self=="object"&&self&&self.Object===Object&&self,Ty=F9||jj||Function("return this")(),B9=typeof Sy=="object"&&Sy&&!Sy.nodeType&&Sy,Iy=B9&&typeof zd=="object"&&zd&&!zd.nodeType&&zd,G9=Iy&&Iy.exports===B9,v3=G9&&F9.process,S9=function(){try{var r=Iy&&Iy.require&&Iy.require("util").types;return r||v3&&v3.binding&&v3.binding("util")}catch(t){}}(),I9=S9&&S9.isTypedArray;function Uj(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}l(Uj,"apply");function zj(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}l(zj,"baseTimes");function Hj(r){return function(t){return r(t)}}l(Hj,"baseUnary");function Xj(r,t){return r==null?void 0:r[t]}l(Xj,"getValue");function Yj(r,t){return function(e){return r(t(e))}}l(Yj,"overArg");var qj=Array.prototype,Wj=Function.prototype,Nb=Object.prototype,b3=Ty["__core-js_shared__"],kb=Wj.toString,hu=Nb.hasOwnProperty,M9=function(){var r=/[^.]+$/.exec(b3&&b3.keys&&b3.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),V9=Nb.toString,Zj=kb.call(Object),$j=RegExp("^"+kb.call(hu).replace(Bj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Lb=G9?Ty.Buffer:void 0,T9=Ty.Symbol,w9=Ty.Uint8Array,P9=Lb?Lb.allocUnsafe:void 0,j9=Yj(Object.getPrototypeOf,Object),E9=Object.create,Jj=Nb.propertyIsEnumerable,Kj=qj.splice,Oh=T9?T9.toStringTag:void 0,Ab=function(){try{var r=M3(Object,"defineProperty");return r({},"",{}),r}catch(t){}}(),Qj=Lb?Lb.isBuffer:void 0,O9=Math.max,tU=Date.now,U9=M3(Ty,"Map"),My=M3(Object,"create"),eU=function(){function r(){}return l(r,"object"),function(t){if(!Lh(t))return{};if(E9)return E9(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function Dh(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}l(Dh,"Hash");function rU(){this.__data__=My?My(null):{},this.size=0}l(rU,"hashClear");function nU(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}l(nU,"hashDelete");function iU(r){var t=this.__data__;if(My){var e=t[r];return e===L9?void 0:e}return hu.call(t,r)?t[r]:void 0}l(iU,"hashGet");function oU(r){var t=this.__data__;return My?t[r]!==void 0:hu.call(t,r)}l(oU,"hashHas");function sU(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=My&&t===void 0?L9:t,this}l(sU,"hashSet");Dh.prototype.clear=rU;Dh.prototype.delete=nU;Dh.prototype.get=iU;Dh.prototype.has=oU;Dh.prototype.set=sU;function fu(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}l(fu,"ListCache");function aU(){this.__data__=[],this.size=0}l(aU,"listCacheClear");function lU(r){var t=this.__data__,e=Rb(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():Kj.call(t,e,1),--this.size,!0}l(lU,"listCacheDelete");function uU(r){var t=this.__data__,e=Rb(t,r);return e<0?void 0:t[e][1]}l(uU,"listCacheGet");function cU(r){return Rb(this.__data__,r)>-1}l(cU,"listCacheHas");function pU(r,t){var e=this.__data__,n=Rb(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}l(pU,"listCacheSet");fu.prototype.clear=aU;fu.prototype.delete=lU;fu.prototype.get=uU;fu.prototype.has=cU;fu.prototype.set=pU;function Hd(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}l(Hd,"MapCache");function hU(){this.size=0,this.__data__={hash:new Dh,map:new(U9||fu),string:new Dh}}l(hU,"mapCacheClear");function fU(r){var t=Bb(this,r).delete(r);return this.size-=t?1:0,t}l(fU,"mapCacheDelete");function dU(r){return Bb(this,r).get(r)}l(dU,"mapCacheGet");function mU(r){return Bb(this,r).has(r)}l(mU,"mapCacheHas");function gU(r,t){var e=Bb(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}l(gU,"mapCacheSet");Hd.prototype.clear=hU;Hd.prototype.delete=fU;Hd.prototype.get=dU;Hd.prototype.has=mU;Hd.prototype.set=gU;function Xd(r){var t=this.__data__=new fu(r);this.size=t.size}l(Xd,"Stack");function yU(){this.__data__=new fu,this.size=0}l(yU,"stackClear");function vU(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}l(vU,"stackDelete");function bU(r){return this.__data__.get(r)}l(bU,"stackGet");function xU(r){return this.__data__.has(r)}l(xU,"stackHas");function _U(r,t){var e=this.__data__;if(e instanceof fu){var n=e.__data__;if(!U9||n.length<uj-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new Hd(n)}return e.set(r,t),this.size=e.size,this}l(_U,"stackSet");Xd.prototype.clear=yU;Xd.prototype.delete=vU;Xd.prototype.get=bU;Xd.prototype.has=xU;Xd.prototype.set=_U;function CU(r,t){var e=S3(r),n=!e&&C3(r),i=!e&&!n&&Y9(r),a=!e&&!n&&!i&&W9(r),u=e||n||i||a,h=u?zj(r.length,String):[],d=h.length;for(var m in r)(t||hu.call(r,m))&&!(u&&(m=="length"||i&&(m=="offset"||m=="parent")||a&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||H9(m,d)))&&h.push(m);return h}l(CU,"arrayLikeKeys");function x3(r,t,e){(e!==void 0&&!Gb(r[t],e)||e===void 0&&!(t in r))&&I3(r,t,e)}l(x3,"assignMergeValue");function SU(r,t,e){var n=r[t];(!(hu.call(r,t)&&Gb(n,e))||e===void 0&&!(t in r))&&I3(r,t,e)}l(SU,"assignValue");function Rb(r,t){for(var e=r.length;e--;)if(Gb(r[e][0],t))return e;return-1}l(Rb,"assocIndexOf");function I3(r,t,e){t=="__proto__"&&Ab?Ab(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}l(I3,"baseAssignValue");var IU=FU();function Fb(r){return r==null?r===void 0?Mj:xj:Oh&&Oh in Object(r)?BU(r):HU(r)}l(Fb,"baseGetTag");function D9(r){return wy(r)&&Fb(r)==N9}l(D9,"baseIsArguments");function MU(r){if(!Lh(r)||UU(r))return!1;var t=w3(r)?$j:Gj;return t.test(WU(r))}l(MU,"baseIsNative");function TU(r){return wy(r)&&q9(r.length)&&!!pn[Fb(r)]}l(TU,"baseIsTypedArray");function wU(r){if(!Lh(r))return zU(r);var t=X9(r),e=[];for(var n in r)n=="constructor"&&(t||!hu.call(r,n))||e.push(n);return e}l(wU,"baseKeysIn");function z9(r,t,e,n,i){r!==t&&IU(t,function(a,u){if(i||(i=new Xd),Lh(a))PU(r,t,u,e,z9,n,i);else{var h=n?n(_3(r,u),a,u+"",r,t,i):void 0;h===void 0&&(h=a),x3(r,u,h)}},Z9)}l(z9,"baseMerge");function PU(r,t,e,n,i,a,u){var h=_3(r,e),d=_3(t,e),m=u.get(d);if(m){x3(r,e,m);return}var v=a?a(h,d,e+"",r,t,u):void 0,x=v===void 0;if(x){var S=S3(d),I=!S&&Y9(d),w=!S&&!I&&W9(d);v=d,S||I||w?S3(h)?v=h:ZU(h)?v=NU(h):I?(x=!1,v=DU(d,!0)):w?(x=!1,v=AU(d,!0)):v=[]:$U(d)||C3(d)?(v=h,C3(h)?v=JU(h):(!Lh(h)||w3(h))&&(v=GU(d))):x=!1}x&&(u.set(d,v),i(v,d,n,a,u),u.delete(d)),x3(r,e,v)}l(PU,"baseMergeDeep");function EU(r,t){return YU(XU(r,t,$9),r+"")}l(EU,"baseRest");var OU=Ab?function(r,t){return Ab(r,"toString",{configurable:!0,enumerable:!1,value:QU(t),writable:!0})}:$9;function DU(r,t){if(t)return r.slice();var e=r.length,n=P9?P9(e):new r.constructor(e);return r.copy(n),n}l(DU,"cloneBuffer");function LU(r){var t=new r.constructor(r.byteLength);return new w9(t).set(new w9(r)),t}l(LU,"cloneArrayBuffer");function AU(r,t){var e=t?LU(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}l(AU,"cloneTypedArray");function NU(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t}l(NU,"copyArray");function kU(r,t,e,n){var i=!e;e||(e={});for(var a=-1,u=t.length;++a<u;){var h=t[a],d=n?n(e[h],r[h],h,e,r):void 0;d===void 0&&(d=r[h]),i?I3(e,h,d):SU(e,h,d)}return e}l(kU,"copyObject");function RU(r){return EU(function(t,e){var n=-1,i=e.length,a=i>1?e[i-1]:void 0,u=i>2?e[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,u&&VU(e[0],e[1],u)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var h=e[n];h&&r(t,h,n,a)}return t})}l(RU,"createAssigner");function FU(r){return function(t,e,n){for(var i=-1,a=Object(t),u=n(t),h=u.length;h--;){var d=u[r?h:++i];if(e(a[d],d,a)===!1)break}return t}}l(FU,"createBaseFor");function Bb(r,t){var e=r.__data__;return jU(t)?e[typeof t=="string"?"string":"hash"]:e.map}l(Bb,"getMapData");function M3(r,t){var e=Xj(r,t);return MU(e)?e:void 0}l(M3,"getNative");function BU(r){var t=hu.call(r,Oh),e=r[Oh];try{r[Oh]=void 0;var n=!0}catch(a){}var i=V9.call(r);return n&&(t?r[Oh]=e:delete r[Oh]),i}l(BU,"getRawTag");function GU(r){return typeof r.constructor=="function"&&!X9(r)?eU(j9(r)):{}}l(GU,"initCloneObject");function H9(r,t){var e=typeof r;return t=t==null?A9:t,!!t&&(e=="number"||e!="symbol"&&Vj.test(r))&&r>-1&&r%1==0&&r<t}l(H9,"isIndex");function VU(r,t,e){if(!Lh(e))return!1;var n=typeof t;return(n=="number"?T3(e)&&H9(t,e.length):n=="string"&&t in e)?Gb(e[t],r):!1}l(VU,"isIterateeCall");function jU(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}l(jU,"isKeyable");function UU(r){return!!M9&&M9 in r}l(UU,"isMasked");function X9(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Nb;return r===e}l(X9,"isPrototype");function zU(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}l(zU,"nativeKeysIn");function HU(r){return V9.call(r)}l(HU,"objectToString");function XU(r,t,e){return t=O9(t===void 0?r.length-1:t,0),function(){for(var n=arguments,i=-1,a=O9(n.length-t,0),u=Array(a);++i<a;)u[i]=n[t+i];i=-1;for(var h=Array(t+1);++i<t;)h[i]=n[i];return h[t]=e(u),Uj(r,this,h)}}l(XU,"overRest");function _3(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}l(_3,"safeGet");var YU=qU(OU);function qU(r){var t=0,e=0;return function(){var n=tU(),i=pj-(n-e);if(e=n,i>0){if(++t>=cj)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}l(qU,"shortOut");function WU(r){if(r!=null){try{return kb.call(r)}catch(t){}try{return r+""}catch(t){}}return""}l(WU,"toSource");function Gb(r,t){return r===t||r!==r&&t!==t}l(Gb,"eq");var C3=D9(function(){return arguments}())?D9:function(r){return wy(r)&&hu.call(r,"callee")&&!Jj.call(r,"callee")},S3=Array.isArray;function T3(r){return r!=null&&q9(r.length)&&!w3(r)}l(T3,"isArrayLike");function ZU(r){return wy(r)&&T3(r)}l(ZU,"isArrayLikeObject");var Y9=Qj||tz;function w3(r){if(!Lh(r))return!1;var t=Fb(r);return t==k9||t==yj||t==fj||t==_j}l(w3,"isFunction");function q9(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=A9}l(q9,"isLength");function Lh(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}l(Lh,"isObject");function wy(r){return r!=null&&typeof r=="object"}l(wy,"isObjectLike");function $U(r){if(!wy(r)||Fb(r)!=R9)return!1;var t=j9(r);if(t===null)return!0;var e=hu.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&kb.call(e)==Zj}l($U,"isPlainObject");var W9=I9?Hj(I9):TU;function JU(r){return kU(r,Z9(r))}l(JU,"toPlainObject");function Z9(r){return T3(r)?CU(r,!0):wU(r)}l(Z9,"keysIn");var KU=RU(function(r,t,e){z9(r,t,e)});function QU(r){return function(){return r}}l(QU,"constant");function $9(r){return r}l($9,"identity");function tz(){return!1}l(tz,"stubFalse");zd.exports=KU});var z3=Lt((Oy,qd)=>{y();var Pz=200,y8="__lodash_hash_undefined__",Ez=800,Oz=16,v8=9007199254740991,b8="[object Arguments]",Dz="[object Array]",Lz="[object AsyncFunction]",Az="[object Boolean]",Nz="[object Date]",kz="[object Error]",x8="[object Function]",Rz="[object GeneratorFunction]",Fz="[object Map]",Bz="[object Number]",Gz="[object Null]",_8="[object Object]",Vz="[object Proxy]",jz="[object RegExp]",Uz="[object Set]",zz="[object String]",Hz="[object Undefined]",Xz="[object WeakMap]",Yz="[object ArrayBuffer]",qz="[object DataView]",Wz="[object Float32Array]",Zz="[object Float64Array]",$z="[object Int8Array]",Jz="[object Int16Array]",Kz="[object Int32Array]",Qz="[object Uint8Array]",tH="[object Uint8ClampedArray]",eH="[object Uint16Array]",rH="[object Uint32Array]",nH=/[\\^$.*+?()[\]{}|]/g,iH=/^\[object .+?Constructor\]$/,oH=/^(?:0|[1-9]\d*)$/,hn={};hn[Wz]=hn[Zz]=hn[$z]=hn[Jz]=hn[Kz]=hn[Qz]=hn[tH]=hn[eH]=hn[rH]=!0;hn[b8]=hn[Dz]=hn[Yz]=hn[Az]=hn[qz]=hn[Nz]=hn[kz]=hn[x8]=hn[Fz]=hn[Bz]=hn[_8]=hn[jz]=hn[Uz]=hn[zz]=hn[Xz]=!1;var C8=typeof global=="object"&&global&&global.Object===Object&&global,sH=typeof self=="object"&&self&&self.Object===Object&&self,Ay=C8||sH||Function("return this")(),S8=typeof Oy=="object"&&Oy&&!Oy.nodeType&&Oy,Dy=S8&&typeof qd=="object"&&qd&&!qd.nodeType&&qd,I8=Dy&&Dy.exports===S8,L3=I8&&C8.process,l8=function(){try{var r=Dy&&Dy.require&&Dy.require("util").types;return r||L3&&L3.binding&&L3.binding("util")}catch(t){}}(),u8=l8&&l8.isTypedArray;function M8(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}l(M8,"apply");function aH(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}l(aH,"baseTimes");function lH(r){return function(t){return r(t)}}l(lH,"baseUnary");function uH(r,t){return r==null?void 0:r[t]}l(uH,"getValue");function cH(r,t){return function(e){return r(t(e))}}l(cH,"overArg");var pH=Array.prototype,hH=Function.prototype,Hb=Object.prototype,A3=Ay["__core-js_shared__"],Xb=hH.toString,gu=Hb.hasOwnProperty,c8=function(){var r=/[^.]+$/.exec(A3&&A3.keys&&A3.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),T8=Hb.toString,fH=Xb.call(Object),dH=RegExp("^"+Xb.call(gu).replace(nH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ub=I8?Ay.Buffer:void 0,p8=Ay.Symbol,h8=Ay.Uint8Array,f8=Ub?Ub.allocUnsafe:void 0,w8=cH(Object.getPrototypeOf,Object),d8=Object.create,mH=Hb.propertyIsEnumerable,gH=pH.splice,Nh=p8?p8.toStringTag:void 0,zb=function(){try{var r=V3(Object,"defineProperty");return r({},"",{}),r}catch(t){}}(),yH=Ub?Ub.isBuffer:void 0,m8=Math.max,vH=Date.now,P8=V3(Ay,"Map"),Ly=V3(Object,"create"),bH=function(){function r(){}return l(r,"object"),function(t){if(!mu(t))return{};if(d8)return d8(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}();function kh(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}l(kh,"Hash");function xH(){this.__data__=Ly?Ly(null):{},this.size=0}l(xH,"hashClear");function _H(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}l(_H,"hashDelete");function CH(r){var t=this.__data__;if(Ly){var e=t[r];return e===y8?void 0:e}return gu.call(t,r)?t[r]:void 0}l(CH,"hashGet");function SH(r){var t=this.__data__;return Ly?t[r]!==void 0:gu.call(t,r)}l(SH,"hashHas");function IH(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Ly&&t===void 0?y8:t,this}l(IH,"hashSet");kh.prototype.clear=xH;kh.prototype.delete=_H;kh.prototype.get=CH;kh.prototype.has=SH;kh.prototype.set=IH;function yu(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}l(yu,"ListCache");function MH(){this.__data__=[],this.size=0}l(MH,"listCacheClear");function TH(r){var t=this.__data__,e=Yb(t,r);if(e<0)return!1;var n=t.length-1;return e==n?t.pop():gH.call(t,e,1),--this.size,!0}l(TH,"listCacheDelete");function wH(r){var t=this.__data__,e=Yb(t,r);return e<0?void 0:t[e][1]}l(wH,"listCacheGet");function PH(r){return Yb(this.__data__,r)>-1}l(PH,"listCacheHas");function EH(r,t){var e=this.__data__,n=Yb(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this}l(EH,"listCacheSet");yu.prototype.clear=MH;yu.prototype.delete=TH;yu.prototype.get=wH;yu.prototype.has=PH;yu.prototype.set=EH;function Wd(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}l(Wd,"MapCache");function OH(){this.size=0,this.__data__={hash:new kh,map:new(P8||yu),string:new kh}}l(OH,"mapCacheClear");function DH(r){var t=Wb(this,r).delete(r);return this.size-=t?1:0,t}l(DH,"mapCacheDelete");function LH(r){return Wb(this,r).get(r)}l(LH,"mapCacheGet");function AH(r){return Wb(this,r).has(r)}l(AH,"mapCacheHas");function NH(r,t){var e=Wb(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this}l(NH,"mapCacheSet");Wd.prototype.clear=OH;Wd.prototype.delete=DH;Wd.prototype.get=LH;Wd.prototype.has=AH;Wd.prototype.set=NH;function Zd(r){var t=this.__data__=new yu(r);this.size=t.size}l(Zd,"Stack");function kH(){this.__data__=new yu,this.size=0}l(kH,"stackClear");function RH(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}l(RH,"stackDelete");function FH(r){return this.__data__.get(r)}l(FH,"stackGet");function BH(r){return this.__data__.has(r)}l(BH,"stackHas");function GH(r,t){var e=this.__data__;if(e instanceof yu){var n=e.__data__;if(!P8||n.length<Pz-1)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new Wd(n)}return e.set(r,t),this.size=e.size,this}l(GH,"stackSet");Zd.prototype.clear=kH;Zd.prototype.delete=RH;Zd.prototype.get=FH;Zd.prototype.has=BH;Zd.prototype.set=GH;function VH(r,t){var e=F3(r),n=!e&&R3(r),i=!e&&!n&&A8(r),a=!e&&!n&&!i&&k8(r),u=e||n||i||a,h=u?aH(r.length,String):[],d=h.length;for(var m in r)(t||gu.call(r,m))&&!(u&&(m=="length"||i&&(m=="offset"||m=="parent")||a&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||D8(m,d)))&&h.push(m);return h}l(VH,"arrayLikeKeys");function N3(r,t,e){(e!==void 0&&!Zb(r[t],e)||e===void 0&&!(t in r))&&B3(r,t,e)}l(N3,"assignMergeValue");function jH(r,t,e){var n=r[t];(!(gu.call(r,t)&&Zb(n,e))||e===void 0&&!(t in r))&&B3(r,t,e)}l(jH,"assignValue");function Yb(r,t){for(var e=r.length;e--;)if(Zb(r[e][0],t))return e;return-1}l(Yb,"assocIndexOf");function B3(r,t,e){t=="__proto__"&&zb?zb(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}l(B3,"baseAssignValue");var UH=tX();function qb(r){return r==null?r===void 0?Hz:Gz:Nh&&Nh in Object(r)?eX(r):aX(r)}l(qb,"baseGetTag");function g8(r){return Ny(r)&&qb(r)==b8}l(g8,"baseIsArguments");function zH(r){if(!mu(r)||oX(r))return!1;var t=U3(r)?dH:iH;return t.test(pX(r))}l(zH,"baseIsNative");function HH(r){return Ny(r)&&N8(r.length)&&!!hn[qb(r)]}l(HH,"baseIsTypedArray");function XH(r){if(!mu(r))return sX(r);var t=L8(r),e=[];for(var n in r)n=="constructor"&&(t||!gu.call(r,n))||e.push(n);return e}l(XH,"baseKeysIn");function G3(r,t,e,n,i){r!==t&&UH(t,function(a,u){if(i||(i=new Zd),mu(a))YH(r,t,u,e,G3,n,i);else{var h=n?n(k3(r,u),a,u+"",r,t,i):void 0;h===void 0&&(h=a),N3(r,u,h)}},R8)}l(G3,"baseMerge");function YH(r,t,e,n,i,a,u){var h=k3(r,e),d=k3(t,e),m=u.get(d);if(m){N3(r,e,m);return}var v=a?a(h,d,e+"",r,t,u):void 0,x=v===void 0;if(x){var S=F3(d),I=!S&&A8(d),w=!S&&!I&&k8(d);v=d,S||I||w?F3(h)?v=h:hX(h)?v=JH(h):I?(x=!1,v=WH(d,!0)):w?(x=!1,v=$H(d,!0)):v=[]:fX(d)||R3(d)?(v=h,R3(h)?v=dX(h):(!mu(h)||U3(h))&&(v=rX(d))):x=!1}x&&(u.set(d,v),i(v,d,n,a,u),u.delete(d)),N3(r,e,v)}l(YH,"baseMergeDeep");function E8(r,t){return uX(lX(r,t,F8),r+"")}l(E8,"baseRest");var qH=zb?function(r,t){return zb(r,"toString",{configurable:!0,enumerable:!1,value:yX(t),writable:!0})}:F8;function WH(r,t){if(t)return r.slice();var e=r.length,n=f8?f8(e):new r.constructor(e);return r.copy(n),n}l(WH,"cloneBuffer");function ZH(r){var t=new r.constructor(r.byteLength);return new h8(t).set(new h8(r)),t}l(ZH,"cloneArrayBuffer");function $H(r,t){var e=t?ZH(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}l($H,"cloneTypedArray");function JH(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t}l(JH,"copyArray");function KH(r,t,e,n){var i=!e;e||(e={});for(var a=-1,u=t.length;++a<u;){var h=t[a],d=n?n(e[h],r[h],h,e,r):void 0;d===void 0&&(d=r[h]),i?B3(e,h,d):jH(e,h,d)}return e}l(KH,"copyObject");function QH(r){return E8(function(t,e){var n=-1,i=e.length,a=i>1?e[i-1]:void 0,u=i>2?e[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,u&&nX(e[0],e[1],u)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var h=e[n];h&&r(t,h,n,a)}return t})}l(QH,"createAssigner");function tX(r){return function(t,e,n){for(var i=-1,a=Object(t),u=n(t),h=u.length;h--;){var d=u[r?h:++i];if(e(a[d],d,a)===!1)break}return t}}l(tX,"createBaseFor");function O8(r,t,e,n,i,a){return mu(r)&&mu(t)&&(a.set(t,r),G3(r,t,void 0,O8,a),a.delete(t)),r}l(O8,"customDefaultsMerge");function Wb(r,t){var e=r.__data__;return iX(t)?e[typeof t=="string"?"string":"hash"]:e.map}l(Wb,"getMapData");function V3(r,t){var e=uH(r,t);return zH(e)?e:void 0}l(V3,"getNative");function eX(r){var t=gu.call(r,Nh),e=r[Nh];try{r[Nh]=void 0;var n=!0}catch(a){}var i=T8.call(r);return n&&(t?r[Nh]=e:delete r[Nh]),i}l(eX,"getRawTag");function rX(r){return typeof r.constructor=="function"&&!L8(r)?bH(w8(r)):{}}l(rX,"initCloneObject");function D8(r,t){var e=typeof r;return t=t==null?v8:t,!!t&&(e=="number"||e!="symbol"&&oH.test(r))&&r>-1&&r%1==0&&r<t}l(D8,"isIndex");function nX(r,t,e){if(!mu(e))return!1;var n=typeof t;return(n=="number"?j3(e)&&D8(t,e.length):n=="string"&&t in e)?Zb(e[t],r):!1}l(nX,"isIterateeCall");function iX(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}l(iX,"isKeyable");function oX(r){return!!c8&&c8 in r}l(oX,"isMasked");function L8(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Hb;return r===e}l(L8,"isPrototype");function sX(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}l(sX,"nativeKeysIn");function aX(r){return T8.call(r)}l(aX,"objectToString");function lX(r,t,e){return t=m8(t===void 0?r.length-1:t,0),function(){for(var n=arguments,i=-1,a=m8(n.length-t,0),u=Array(a);++i<a;)u[i]=n[t+i];i=-1;for(var h=Array(t+1);++i<t;)h[i]=n[i];return h[t]=e(u),M8(r,this,h)}}l(lX,"overRest");function k3(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}l(k3,"safeGet");var uX=cX(qH);function cX(r){var t=0,e=0;return function(){var n=vH(),i=Oz-(n-e);if(e=n,i>0){if(++t>=Ez)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}l(cX,"shortOut");function pX(r){if(r!=null){try{return Xb.call(r)}catch(t){}try{return r+""}catch(t){}}return""}l(pX,"toSource");function Zb(r,t){return r===t||r!==r&&t!==t}l(Zb,"eq");var R3=g8(function(){return arguments}())?g8:function(r){return Ny(r)&&gu.call(r,"callee")&&!mH.call(r,"callee")},F3=Array.isArray;function j3(r){return r!=null&&N8(r.length)&&!U3(r)}l(j3,"isArrayLike");function hX(r){return Ny(r)&&j3(r)}l(hX,"isArrayLikeObject");var A8=yH||vX;function U3(r){if(!mu(r))return!1;var t=qb(r);return t==x8||t==Rz||t==Lz||t==Vz}l(U3,"isFunction");function N8(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=v8}l(N8,"isLength");function mu(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}l(mu,"isObject");function Ny(r){return r!=null&&typeof r=="object"}l(Ny,"isObjectLike");function fX(r){if(!Ny(r)||qb(r)!=_8)return!1;var t=w8(r);if(t===null)return!0;var e=gu.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Xb.call(e)==fH}l(fX,"isPlainObject");var k8=u8?lH(u8):HH;function dX(r){return KH(r,R8(r))}l(dX,"toPlainObject");var mX=E8(function(r){return r.push(void 0,O8),M8(gX,void 0,r)});function R8(r){return j3(r)?VH(r,!0):XH(r)}l(R8,"keysIn");var gX=QH(function(r,t,e,n){G3(r,t,e,n)});function yX(r){return function(){return r}}l(yX,"constant");function F8(r){return r}l(F8,"identity");function vX(){return!1}l(vX,"stubFalse");qd.exports=mX});var EO=Lt((T9t,jy)=>{"use strict";y();var kX=!1,Gh=!1,CO=!0,SO=!1,C={},IO=!1;typeof jy<"u"&&jy.exports?(jy.exports=C,IO=!0):typeof document<"u"?window.ClipperLib=C:self.ClipperLib=C;var ax;IO?(ci="chrome",ax="Netscape"):(ci=navigator.userAgent.toString().toLowerCase(),ax=navigator.appName);var ci,dr={};ci.indexOf("chrome")!=-1&&ci.indexOf("chromium")==-1?dr.chrome=1:dr.chrome=0;ci.indexOf("chromium")!=-1?dr.chromium=1:dr.chromium=0;ci.indexOf("safari")!=-1&&ci.indexOf("chrome")==-1&&ci.indexOf("chromium")==-1?dr.safari=1:dr.safari=0;ci.indexOf("firefox")!=-1?dr.firefox=1:dr.firefox=0;ci.indexOf("firefox/17")!=-1?dr.firefox17=1:dr.firefox17=0;ci.indexOf("firefox/15")!=-1?dr.firefox15=1:dr.firefox15=0;ci.indexOf("firefox/3")!=-1?dr.firefox3=1:dr.firefox3=0;ci.indexOf("opera")!=-1?dr.opera=1:dr.opera=0;ci.indexOf("msie 10")!=-1?dr.msie10=1:dr.msie10=0;ci.indexOf("msie 9")!=-1?dr.msie9=1:dr.msie9=0;ci.indexOf("msie 8")!=-1?dr.msie8=1:dr.msie8=0;ci.indexOf("msie 7")!=-1?dr.msie7=1:dr.msie7=0;ci.indexOf("msie ")!=-1?dr.msie=1:dr.msie=0;C.biginteger_used=null;var Lc,RX=0xdeadbeefcafe,xO=(RX&16777215)==15715070;function Mt(r,t,e){C.biginteger_used=1,r!=null&&(typeof r=="number"&&typeof t>"u"?this.fromInt(r):typeof r=="number"?this.fromNumber(r,t,e):t==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,t))}l(Mt,"BigInteger");function Ir(){return new Mt(null)}l(Ir,"nbi");function FX(r,t,e,n,i,a){for(;--a>=0;){var u=t*this[r++]+e[n]+i;i=Math.floor(u/67108864),e[n++]=u&67108863}return i}l(FX,"am1");function BX(r,t,e,n,i,a){for(var u=t&32767,h=t>>15;--a>=0;){var d=this[r]&32767,m=this[r++]>>15,v=h*d+m*u;d=u*d+((v&32767)<<15)+e[n]+(i&1073741823),i=(d>>>30)+(v>>>15)+h*m+(i>>>30),e[n++]=d&1073741823}return i}l(BX,"am2");function GX(r,t,e,n,i,a){for(var u=t&16383,h=t>>14;--a>=0;){var d=this[r]&16383,m=this[r++]>>14,v=h*d+m*u;d=u*d+((v&16383)<<14)+e[n]+i,i=(d>>28)+(v>>14)+h*m,e[n++]=d&268435455}return i}l(GX,"am3");xO&&ax=="Microsoft Internet Explorer"?(Mt.prototype.am=BX,Lc=30):xO&&ax!="Netscape"?(Mt.prototype.am=FX,Lc=26):(Mt.prototype.am=GX,Lc=28);Mt.prototype.DB=Lc;Mt.prototype.DM=(1<<Lc)-1;Mt.prototype.DV=1<<Lc;var fI=52;Mt.prototype.FV=Math.pow(2,fI);Mt.prototype.F1=fI-Lc;Mt.prototype.F2=2*Lc-fI;var VX="0123456789abcdefghijklmnopqrstuvwxyz",ux=new Array,em,Rs;em=48;for(Rs=0;Rs<=9;++Rs)ux[em++]=Rs;em=97;for(Rs=10;Rs<36;++Rs)ux[em++]=Rs;em=65;for(Rs=10;Rs<36;++Rs)ux[em++]=Rs;function _O(r){return VX.charAt(r)}l(_O,"int2char");function MO(r,t){var e=ux[r.charCodeAt(t)];return e==null?-1:e}l(MO,"intAt");function jX(r){for(var t=this.t-1;t>=0;--t)r[t]=this[t];r.t=this.t,r.s=this.s}l(jX,"bnpCopyTo");function UX(r){this.t=1,this.s=r<0?-1:0,r>0?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0}l(UX,"bnpFromInt");function Dc(r){var t=Ir();return t.fromInt(r),t}l(Dc,"nbv");function zX(r,t){var e;if(t==16)e=4;else if(t==8)e=3;else if(t==256)e=8;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else{this.fromRadix(r,t);return}this.t=0,this.s=0;for(var n=r.length,i=!1,a=0;--n>=0;){var u=e==8?r[n]&255:MO(r,n);if(u<0){r.charAt(n)=="-"&&(i=!0);continue}i=!1,a==0?this[this.t++]=u:a+e>this.DB?(this[this.t-1]|=(u&(1<<this.DB-a)-1)<<a,this[this.t++]=u>>this.DB-a):this[this.t-1]|=u<<a,a+=e,a>=this.DB&&(a-=this.DB)}e==8&&(r[0]&128)!=0&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&Mt.ZERO.subTo(this,this)}l(zX,"bnpFromString");function HX(){for(var r=this.s&this.DM;this.t>0&&this[this.t-1]==r;)--this.t}l(HX,"bnpClamp");function XX(r){if(this.s<0)return"-"+this.negate().toString(r);var t;if(r==16)t=4;else if(r==8)t=3;else if(r==2)t=1;else if(r==32)t=5;else if(r==4)t=2;else return this.toRadix(r);var e=(1<<t)-1,n,i=!1,a="",u=this.t,h=this.DB-u*this.DB%t;if(u-- >0)for(h<this.DB&&(n=this[u]>>h)>0&&(i=!0,a=_O(n));u>=0;)h<t?(n=(this[u]&(1<<h)-1)<<t-h,n|=this[--u]>>(h+=this.DB-t)):(n=this[u]>>(h-=t)&e,h<=0&&(h+=this.DB,--u)),n>0&&(i=!0),i&&(a+=_O(n));return i?a:"0"}l(XX,"bnToString");function YX(){var r=Ir();return Mt.ZERO.subTo(this,r),r}l(YX,"bnNegate");function qX(){return this.s<0?this.negate():this}l(qX,"bnAbs");function WX(r){var t=this.s-r.s;if(t!=0)return t;var e=this.t;if(t=e-r.t,t!=0)return this.s<0?-t:t;for(;--e>=0;)if((t=this[e]-r[e])!=0)return t;return 0}l(WX,"bnCompareTo");function cx(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}l(cx,"nbits");function ZX(){return this.t<=0?0:this.DB*(this.t-1)+cx(this[this.t-1]^this.s&this.DM)}l(ZX,"bnBitLength");function $X(r,t){var e;for(e=this.t-1;e>=0;--e)t[e+r]=this[e];for(e=r-1;e>=0;--e)t[e]=0;t.t=this.t+r,t.s=this.s}l($X,"bnpDLShiftTo");function JX(r,t){for(var e=r;e<this.t;++e)t[e-r]=this[e];t.t=Math.max(this.t-r,0),t.s=this.s}l(JX,"bnpDRShiftTo");function KX(r,t){var e=r%this.DB,n=this.DB-e,i=(1<<n)-1,a=Math.floor(r/this.DB),u=this.s<<e&this.DM,h;for(h=this.t-1;h>=0;--h)t[h+a+1]=this[h]>>n|u,u=(this[h]&i)<<e;for(h=a-1;h>=0;--h)t[h]=0;t[a]=u,t.t=this.t+a+1,t.s=this.s,t.clamp()}l(KX,"bnpLShiftTo");function QX(r,t){t.s=this.s;var e=Math.floor(r/this.DB);if(e>=this.t){t.t=0;return}var n=r%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[e]>>n;for(var u=e+1;u<this.t;++u)t[u-e-1]|=(this[u]&a)<<i,t[u-e]=this[u]>>n;n>0&&(t[this.t-e-1]|=(this.s&a)<<i),t.t=this.t-e,t.clamp()}l(QX,"bnpRShiftTo");function tY(r,t){for(var e=0,n=0,i=Math.min(r.t,this.t);e<i;)n+=this[e]-r[e],t[e++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n-=r.s;e<this.t;)n+=this[e],t[e++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;e<r.t;)n-=r[e],t[e++]=n&this.DM,n>>=this.DB;n-=r.s}t.s=n<0?-1:0,n<-1?t[e++]=this.DV+n:n>0&&(t[e++]=n),t.t=e,t.clamp()}l(tY,"bnpSubTo");function eY(r,t){var e=this.abs(),n=r.abs(),i=e.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+e.t]=e.am(0,n[i],t,i,0,e.t);t.s=0,t.clamp(),this.s!=r.s&&Mt.ZERO.subTo(t,t)}l(eY,"bnpMultiplyTo");function rY(r){for(var t=this.abs(),e=r.t=2*t.t;--e>=0;)r[e]=0;for(e=0;e<t.t-1;++e){var n=t.am(e,t[e],r,2*e,0,1);(r[e+t.t]+=t.am(e+1,2*t[e],r,2*e+1,n,t.t-e-1))>=t.DV&&(r[e+t.t]-=t.DV,r[e+t.t+1]=1)}r.t>0&&(r[r.t-1]+=t.am(e,t[e],r,2*e,0,1)),r.s=0,r.clamp()}l(rY,"bnpSquareTo");function nY(r,t,e){var n=r.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t!=null&&t.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=Ir());var a=Ir(),u=this.s,h=r.s,d=this.DB-cx(n[n.t-1]);d>0?(n.lShiftTo(d,a),i.lShiftTo(d,e)):(n.copyTo(a),i.copyTo(e));var m=a.t,v=a[m-1];if(v!=0){var x=v*(1<<this.F1)+(m>1?a[m-2]>>this.F2:0),S=this.FV/x,I=(1<<this.F1)/x,w=1<<this.F2,E=e.t,T=E-m,D=t==null?Ir():t;for(a.dlShiftTo(T,D),e.compareTo(D)>=0&&(e[e.t++]=1,e.subTo(D,e)),Mt.ONE.dlShiftTo(m,D),D.subTo(a,a);a.t<m;)a[a.t++]=0;for(;--T>=0;){var A=e[--E]==v?this.DM:Math.floor(e[E]*S+(e[E-1]+w)*I);if((e[E]+=a.am(0,A,e,T,0,m))<A)for(a.dlShiftTo(T,D),e.subTo(D,e);e[E]<--A;)e.subTo(D,e)}t!=null&&(e.drShiftTo(m,t),u!=h&&Mt.ZERO.subTo(t,t)),e.t=m,e.clamp(),d>0&&e.rShiftTo(d,e),u<0&&Mt.ZERO.subTo(e,e)}}}l(nY,"bnpDivRemTo");function iY(r){var t=Ir();return this.abs().divRemTo(r,null,t),this.s<0&&t.compareTo(Mt.ZERO)>0&&r.subTo(t,t),t}l(iY,"bnMod");function Vh(r){this.m=r}l(Vh,"Classic");function oY(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}l(oY,"cConvert");function sY(r){return r}l(sY,"cRevert");function aY(r){r.divRemTo(this.m,null,r)}l(aY,"cReduce");function lY(r,t,e){r.multiplyTo(t,e),this.reduce(e)}l(lY,"cMulTo");function uY(r,t){r.squareTo(t),this.reduce(t)}l(uY,"cSqrTo");Vh.prototype.convert=oY;Vh.prototype.revert=sY;Vh.prototype.reduce=aY;Vh.prototype.mulTo=lY;Vh.prototype.sqrTo=uY;function cY(){if(this.t<1)return 0;var r=this[0];if((r&1)==0)return 0;var t=r&3;return t=t*(2-(r&15)*t)&15,t=t*(2-(r&255)*t)&255,t=t*(2-((r&65535)*t&65535))&65535,t=t*(2-r*t%this.DV)%this.DV,t>0?this.DV-t:-t}l(cY,"bnpInvDigit");function jh(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}l(jh,"Montgomery");function pY(r){var t=Ir();return r.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),r.s<0&&t.compareTo(Mt.ZERO)>0&&this.m.subTo(t,t),t}l(pY,"montConvert");function hY(r){var t=Ir();return r.copyTo(t),this.reduce(t),t}l(hY,"montRevert");function fY(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var t=0;t<this.m.t;++t){var e=r[t]&32767,n=e*this.mpl+((e*this.mph+(r[t]>>15)*this.mpl&this.um)<<15)&r.DM;for(e=t+this.m.t,r[e]+=this.m.am(0,n,r,t,0,this.m.t);r[e]>=r.DV;)r[e]-=r.DV,r[++e]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}l(fY,"montReduce");function dY(r,t){r.squareTo(t),this.reduce(t)}l(dY,"montSqrTo");function mY(r,t,e){r.multiplyTo(t,e),this.reduce(e)}l(mY,"montMulTo");jh.prototype.convert=pY;jh.prototype.revert=hY;jh.prototype.reduce=fY;jh.prototype.mulTo=mY;jh.prototype.sqrTo=dY;function gY(){return(this.t>0?this[0]&1:this.s)==0}l(gY,"bnpIsEven");function yY(r,t){if(r>4294967295||r<1)return Mt.ONE;var e=Ir(),n=Ir(),i=t.convert(this),a=cx(r)-1;for(i.copyTo(e);--a>=0;)if(t.sqrTo(e,n),(r&1<<a)>0)t.mulTo(n,i,e);else{var u=e;e=n,n=u}return t.revert(e)}l(yY,"bnpExp");function vY(r,t){var e;return r<256||t.isEven()?e=new Vh(t):e=new jh(t),this.exp(r,e)}l(vY,"bnModPowInt");Mt.prototype.copyTo=jX;Mt.prototype.fromInt=UX;Mt.prototype.fromString=zX;Mt.prototype.clamp=HX;Mt.prototype.dlShiftTo=$X;Mt.prototype.drShiftTo=JX;Mt.prototype.lShiftTo=KX;Mt.prototype.rShiftTo=QX;Mt.prototype.subTo=tY;Mt.prototype.multiplyTo=eY;Mt.prototype.squareTo=rY;Mt.prototype.divRemTo=nY;Mt.prototype.invDigit=cY;Mt.prototype.isEven=gY;Mt.prototype.exp=yY;Mt.prototype.toString=XX;Mt.prototype.negate=YX;Mt.prototype.abs=qX;Mt.prototype.compareTo=WX;Mt.prototype.bitLength=ZX;Mt.prototype.mod=iY;Mt.prototype.modPowInt=vY;Mt.ZERO=Dc(0);Mt.ONE=Dc(1);function bY(){var r=Ir();return this.copyTo(r),r}l(bY,"bnClone");function xY(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}l(xY,"bnIntValue");function _Y(){return this.t==0?this.s:this[0]<<24>>24}l(_Y,"bnByteValue");function CY(){return this.t==0?this.s:this[0]<<16>>16}l(CY,"bnShortValue");function SY(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}l(SY,"bnpChunkSize");function IY(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}l(IY,"bnSigNum");function MY(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var t=this.chunkSize(r),e=Math.pow(r,t),n=Dc(e),i=Ir(),a=Ir(),u="";for(this.divRemTo(n,i,a);i.signum()>0;)u=(e+a.intValue()).toString(r).substr(1)+u,i.divRemTo(n,i,a);return a.intValue().toString(r)+u}l(MY,"bnpToRadix");function TY(r,t){this.fromInt(0),t==null&&(t=10);for(var e=this.chunkSize(t),n=Math.pow(t,e),i=!1,a=0,u=0,h=0;h<r.length;++h){var d=MO(r,h);if(d<0){r.charAt(h)=="-"&&this.signum()==0&&(i=!0);continue}u=t*u+d,++a>=e&&(this.dMultiply(n),this.dAddOffset(u,0),a=0,u=0)}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(u,0)),i&&Mt.ZERO.subTo(this,this)}l(TY,"bnpFromRadix");function wY(r,t,e){if(typeof t=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,e),this.testBit(r-1)||this.bitwiseTo(Mt.ONE.shiftLeft(r-1),dI,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(Mt.ONE.shiftLeft(r-1),this);else{var n=new Array,i=r&7;n.length=(r>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}l(wY,"bnpFromNumber");function PY(){var r=this.t,t=new Array;t[0]=this.s;var e=this.DB-r*this.DB%8,n,i=0;if(r-- >0)for(e<this.DB&&(n=this[r]>>e)!=(this.s&this.DM)>>e&&(t[i++]=n|this.s<<this.DB-e);r>=0;)e<8?(n=(this[r]&(1<<e)-1)<<8-e,n|=this[--r]>>(e+=this.DB-8)):(n=this[r]>>(e-=8)&255,e<=0&&(e+=this.DB,--r)),(n&128)!=0&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}l(PY,"bnToByteArray");function EY(r){return this.compareTo(r)==0}l(EY,"bnEquals");function OY(r){return this.compareTo(r)<0?this:r}l(OY,"bnMin");function DY(r){return this.compareTo(r)>0?this:r}l(DY,"bnMax");function LY(r,t,e){var n,i,a=Math.min(r.t,this.t);for(n=0;n<a;++n)e[n]=t(this[n],r[n]);if(r.t<this.t){for(i=r.s&this.DM,n=a;n<this.t;++n)e[n]=t(this[n],i);e.t=this.t}else{for(i=this.s&this.DM,n=a;n<r.t;++n)e[n]=t(i,r[n]);e.t=r.t}e.s=t(this.s,r.s),e.clamp()}l(LY,"bnpBitwiseTo");function AY(r,t){return r&t}l(AY,"op_and");function NY(r){var t=Ir();return this.bitwiseTo(r,AY,t),t}l(NY,"bnAnd");function dI(r,t){return r|t}l(dI,"op_or");function kY(r){var t=Ir();return this.bitwiseTo(r,dI,t),t}l(kY,"bnOr");function TO(r,t){return r^t}l(TO,"op_xor");function RY(r){var t=Ir();return this.bitwiseTo(r,TO,t),t}l(RY,"bnXor");function wO(r,t){return r&~t}l(wO,"op_andnot");function FY(r){var t=Ir();return this.bitwiseTo(r,wO,t),t}l(FY,"bnAndNot");function BY(){for(var r=Ir(),t=0;t<this.t;++t)r[t]=this.DM&~this[t];return r.t=this.t,r.s=~this.s,r}l(BY,"bnNot");function GY(r){var t=Ir();return r<0?this.rShiftTo(-r,t):this.lShiftTo(r,t),t}l(GY,"bnShiftLeft");function VY(r){var t=Ir();return r<0?this.lShiftTo(-r,t):this.rShiftTo(r,t),t}l(VY,"bnShiftRight");function jY(r){if(r==0)return-1;var t=0;return(r&65535)==0&&(r>>=16,t+=16),(r&255)==0&&(r>>=8,t+=8),(r&15)==0&&(r>>=4,t+=4),(r&3)==0&&(r>>=2,t+=2),(r&1)==0&&++t,t}l(jY,"lbit");function UY(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*this.DB+jY(this[r]);return this.s<0?this.t*this.DB:-1}l(UY,"bnGetLowestSetBit");function zY(r){for(var t=0;r!=0;)r&=r-1,++t;return t}l(zY,"cbit");function HY(){for(var r=0,t=this.s&this.DM,e=0;e<this.t;++e)r+=zY(this[e]^t);return r}l(HY,"bnBitCount");function XY(r){var t=Math.floor(r/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<r%this.DB)!=0}l(XY,"bnTestBit");function YY(r,t){var e=Mt.ONE.shiftLeft(r);return this.bitwiseTo(e,t,e),e}l(YY,"bnpChangeBit");function qY(r){return this.changeBit(r,dI)}l(qY,"bnSetBit");function WY(r){return this.changeBit(r,wO)}l(WY,"bnClearBit");function ZY(r){return this.changeBit(r,TO)}l(ZY,"bnFlipBit");function $Y(r,t){for(var e=0,n=0,i=Math.min(r.t,this.t);e<i;)n+=this[e]+r[e],t[e++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n+=r.s;e<this.t;)n+=this[e],t[e++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;e<r.t;)n+=r[e],t[e++]=n&this.DM,n>>=this.DB;n+=r.s}t.s=n<0?-1:0,n>0?t[e++]=n:n<-1&&(t[e++]=this.DV+n),t.t=e,t.clamp()}l($Y,"bnpAddTo");function JY(r){var t=Ir();return this.addTo(r,t),t}l(JY,"bnAdd");function KY(r){var t=Ir();return this.subTo(r,t),t}l(KY,"bnSubtract");function QY(r){var t=Ir();return this.multiplyTo(r,t),t}l(QY,"bnMultiply");function tq(){var r=Ir();return this.squareTo(r),r}l(tq,"bnSquare");function eq(r){var t=Ir();return this.divRemTo(r,t,null),t}l(eq,"bnDivide");function rq(r){var t=Ir();return this.divRemTo(r,null,t),t}l(rq,"bnRemainder");function nq(r){var t=Ir(),e=Ir();return this.divRemTo(r,t,e),new Array(t,e)}l(nq,"bnDivideAndRemainder");function iq(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}l(iq,"bnpDMultiply");function oq(r,t){if(r!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=r;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}l(oq,"bnpDAddOffset");function Uy(){}l(Uy,"NullExp");function PO(r){return r}l(PO,"nNop");function sq(r,t,e){r.multiplyTo(t,e)}l(sq,"nMulTo");function aq(r,t){r.squareTo(t)}l(aq,"nSqrTo");Uy.prototype.convert=PO;Uy.prototype.revert=PO;Uy.prototype.mulTo=sq;Uy.prototype.sqrTo=aq;function lq(r){return this.exp(r,new Uy)}l(lq,"bnPow");function uq(r,t,e){var n=Math.min(this.t+r.t,t);for(e.s=0,e.t=n;n>0;)e[--n]=0;var i;for(i=e.t-this.t;n<i;++n)e[n+this.t]=this.am(0,r[n],e,n,0,this.t);for(i=Math.min(r.t,t);n<i;++n)this.am(0,r[n],e,n,0,t-n);e.clamp()}l(uq,"bnpMultiplyLowerTo");function cq(r,t,e){--t;var n=e.t=this.t+r.t-t;for(e.s=0;--n>=0;)e[n]=0;for(n=Math.max(t-this.t,0);n<r.t;++n)e[this.t+n-t]=this.am(t-n,r[n],e,0,0,this.t+n-t);e.clamp(),e.drShiftTo(1,e)}l(cq,"bnpMultiplyUpperTo");function rm(r){this.r2=Ir(),this.q3=Ir(),Mt.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}l(rm,"Barrett");function pq(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var t=Ir();return r.copyTo(t),this.reduce(t),t}l(pq,"barrettConvert");function hq(r){return r}l(hq,"barrettRevert");function fq(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}l(fq,"barrettReduce");function dq(r,t){r.squareTo(t),this.reduce(t)}l(dq,"barrettSqrTo");function mq(r,t,e){r.multiplyTo(t,e),this.reduce(e)}l(mq,"barrettMulTo");rm.prototype.convert=pq;rm.prototype.revert=hq;rm.prototype.reduce=fq;rm.prototype.mulTo=mq;rm.prototype.sqrTo=dq;function gq(r,t){var e=r.bitLength(),n,i=Dc(1),a;if(e<=0)return i;e<18?n=1:e<48?n=3:e<144?n=4:e<768?n=5:n=6,e<8?a=new Vh(t):t.isEven()?a=new rm(t):a=new jh(t);var u=new Array,h=3,d=n-1,m=(1<<n)-1;if(u[1]=a.convert(this),n>1){var v=Ir();for(a.sqrTo(u[1],v);h<=m;)u[h]=Ir(),a.mulTo(v,u[h-2],u[h]),h+=2}var x=r.t-1,S,I=!0,w=Ir(),E;for(e=cx(r[x])-1;x>=0;){for(e>=d?S=r[x]>>e-d&m:(S=(r[x]&(1<<e+1)-1)<<d-e,x>0&&(S|=r[x-1]>>this.DB+e-d)),h=n;(S&1)==0;)S>>=1,--h;if((e-=h)<0&&(e+=this.DB,--x),I)u[S].copyTo(i),I=!1;else{for(;h>1;)a.sqrTo(i,w),a.sqrTo(w,i),h-=2;h>0?a.sqrTo(i,w):(E=i,i=w,w=E),a.mulTo(w,u[S],i)}for(;x>=0&&(r[x]&1<<e)==0;)a.sqrTo(i,w),E=i,i=w,w=E,--e<0&&(e=this.DB-1,--x)}return a.revert(i)}l(gq,"bnModPow");function yq(r){var t=this.s<0?this.negate():this.clone(),e=r.s<0?r.negate():r.clone();if(t.compareTo(e)<0){var n=t;t=e,e=n}var i=t.getLowestSetBit(),a=e.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),e.rShiftTo(a,e));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),t.compareTo(e)>=0?(t.subTo(e,t),t.rShiftTo(1,t)):(e.subTo(t,e),e.rShiftTo(1,e));return a>0&&e.lShiftTo(a,e),e}l(yq,"bnGCD");function vq(r){if(r<=0)return 0;var t=this.DV%r,e=this.s<0?r-1:0;if(this.t>0)if(t==0)e=this[0]%r;else for(var n=this.t-1;n>=0;--n)e=(t*e+this[n])%r;return e}l(vq,"bnpModInt");function bq(r){var t=r.isEven();if(this.isEven()&&t||r.signum()==0)return Mt.ZERO;for(var e=r.clone(),n=this.clone(),i=Dc(1),a=Dc(0),u=Dc(0),h=Dc(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),t?((!i.isEven()||!a.isEven())&&(i.addTo(this,i),a.subTo(r,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(r,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?((!u.isEven()||!h.isEven())&&(u.addTo(this,u),h.subTo(r,h)),u.rShiftTo(1,u)):h.isEven()||h.subTo(r,h),h.rShiftTo(1,h);e.compareTo(n)>=0?(e.subTo(n,e),t&&i.subTo(u,i),a.subTo(h,a)):(n.subTo(e,n),t&&u.subTo(i,u),h.subTo(a,h))}if(n.compareTo(Mt.ONE)!=0)return Mt.ZERO;if(h.compareTo(r)>=0)return h.subtract(r);if(h.signum()<0)h.addTo(r,h);else return h;return h.signum()<0?h.add(r):h}l(bq,"bnModInverse");var To=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],xq=(1<<26)/To[To.length-1];function _q(r){var t,e=this.abs();if(e.t==1&&e[0]<=To[To.length-1]){for(t=0;t<To.length;++t)if(e[0]==To[t])return!0;return!1}if(e.isEven())return!1;for(t=1;t<To.length;){for(var n=To[t],i=t+1;i<To.length&&n<xq;)n*=To[i++];for(n=e.modInt(n);t<i;)if(n%To[t++]==0)return!1}return e.millerRabin(r)}l(_q,"bnIsProbablePrime");function Cq(r){var t=this.subtract(Mt.ONE),e=t.getLowestSetBit();if(e<=0)return!1;var n=t.shiftRight(e);r=r+1>>1,r>To.length&&(r=To.length);for(var i=Ir(),a=0;a<r;++a){i.fromInt(To[Math.floor(Math.random()*To.length)]);var u=i.modPow(n,this);if(u.compareTo(Mt.ONE)!=0&&u.compareTo(t)!=0){for(var h=1;h++<e&&u.compareTo(t)!=0;)if(u=u.modPowInt(2,this),u.compareTo(Mt.ONE)==0)return!1;if(u.compareTo(t)!=0)return!1}}return!0}l(Cq,"bnpMillerRabin");Mt.prototype.chunkSize=SY;Mt.prototype.toRadix=MY;Mt.prototype.fromRadix=TY;Mt.prototype.fromNumber=wY;Mt.prototype.bitwiseTo=LY;Mt.prototype.changeBit=YY;Mt.prototype.addTo=$Y;Mt.prototype.dMultiply=iq;Mt.prototype.dAddOffset=oq;Mt.prototype.multiplyLowerTo=uq;Mt.prototype.multiplyUpperTo=cq;Mt.prototype.modInt=vq;Mt.prototype.millerRabin=Cq;Mt.prototype.clone=bY;Mt.prototype.intValue=xY;Mt.prototype.byteValue=_Y;Mt.prototype.shortValue=CY;Mt.prototype.signum=IY;Mt.prototype.toByteArray=PY;Mt.prototype.equals=EY;Mt.prototype.min=OY;Mt.prototype.max=DY;Mt.prototype.and=NY;Mt.prototype.or=kY;Mt.prototype.xor=RY;Mt.prototype.andNot=FY;Mt.prototype.not=BY;Mt.prototype.shiftLeft=GY;Mt.prototype.shiftRight=VY;Mt.prototype.getLowestSetBit=UY;Mt.prototype.bitCount=HY;Mt.prototype.testBit=XY;Mt.prototype.setBit=qY;Mt.prototype.clearBit=WY;Mt.prototype.flipBit=ZY;Mt.prototype.add=JY;Mt.prototype.subtract=KY;Mt.prototype.multiply=QY;Mt.prototype.divide=eq;Mt.prototype.remainder=rq;Mt.prototype.divideAndRemainder=nq;Mt.prototype.modPow=gq;Mt.prototype.modInverse=bq;Mt.prototype.pow=lq;Mt.prototype.gcd=yq;Mt.prototype.isProbablePrime=_q;Mt.prototype.square=tq;var Ke=Mt;Ke.prototype.IsNegative=function(){return this.compareTo(Ke.ZERO)==-1};Ke.op_Equality=function(r,t){return r.compareTo(t)==0};Ke.op_Inequality=function(r,t){return r.compareTo(t)!=0};Ke.op_GreaterThan=function(r,t){return r.compareTo(t)>0};Ke.op_LessThan=function(r,t){return r.compareTo(t)<0};Ke.op_Addition=function(r,t){return new Ke(r).add(new Ke(t))};Ke.op_Subtraction=function(r,t){return new Ke(r).subtract(new Ke(t))};Ke.Int128Mul=function(r,t){return new Ke(r).multiply(new Ke(t))};Ke.op_Division=function(r,t){return r.divide(t)};Ke.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof lx>"u"&&(lx=l(function(r,t){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in t.prototype)(typeof r.prototype[e]>"u"||r.prototype[e]==Object.prototype[e])&&(r.prototype[e]=t.prototype[e]);for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),i=0;i<n.length;i++)typeof Object.getOwnPropertyDescriptor(r.prototype,n[i])>"u"&&Object.defineProperty(r.prototype,n[i],Object.getOwnPropertyDescriptor(t.prototype,n[i]));for(e in t)typeof r[e]>"u"&&(r[e]=t[e]);r.$baseCtor=t}},"Inherit"));var lx;C.Path=function(){return[]};C.Paths=function(){return[]};C.DoublePoint=function(){var r=arguments;this.X=0,this.Y=0,r.length==1?(this.X=r[0].X,this.Y=r[0].Y):r.length==2&&(this.X=r[0],this.Y=r[1])};C.DoublePoint0=function(){this.X=0,this.Y=0};C.DoublePoint1=function(r){this.X=r.X,this.Y=r.Y};C.DoublePoint2=function(r,t){this.X=r,this.Y=t};C.PolyNode=function(){this.m_Parent=null,this.m_polygon=new C.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};C.PolyNode.prototype.IsHoleNode=function(){for(var r=!0,t=this.m_Parent;t!==null;)r=!r,t=t.m_Parent;return r};C.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};C.PolyNode.prototype.Contour=function(){return this.m_polygon};C.PolyNode.prototype.AddChild=function(r){var t=this.m_Childs.length;this.m_Childs.push(r),r.m_Parent=this,r.m_Index=t};C.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};C.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};C.PolyNode.prototype.Childs=function(){return this.m_Childs};C.PolyNode.prototype.Parent=function(){return this.m_Parent};C.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};C.PolyTree=function(){this.m_AllPolys=[],C.PolyNode.call(this)};C.PolyTree.prototype.Clear=function(){for(var r=0,t=this.m_AllPolys.length;r<t;r++)this.m_AllPolys[r]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};C.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};C.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};lx(C.PolyTree,C.PolyNode);C.Math_Abs_Int64=C.Math_Abs_Int32=C.Math_Abs_Double=function(r){return Math.abs(r)};C.Math_Max_Int32_Int32=function(r,t){return Math.max(r,t)};dr.msie||dr.opera||dr.safari?C.Cast_Int32=function(r){return r|0}:C.Cast_Int32=function(r){return~~r};dr.chrome?C.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):~~r}:dr.firefox&&typeof Number.toInteger=="function"?C.Cast_Int64=function(r){return Number.toInteger(r)}:dr.msie7||dr.msie8?C.Cast_Int64=function(r){return parseInt(r,10)}:dr.msie?C.Cast_Int64=function(r){return r<-2147483648||r>2147483647?r<0?Math.ceil(r):Math.floor(r):r|0}:C.Cast_Int64=function(r){return r<0?Math.ceil(r):Math.floor(r)};C.Clear=function(r){r.length=0};C.PI=3.141592653589793;C.PI2=2*3.141592653589793;C.IntPoint=function(){var r=arguments,t=r.length;if(this.X=0,this.Y=0,Gh)if(this.Z=0,t==3)this.X=r[0],this.Y=r[1],this.Z=r[2];else if(t==2)this.X=r[0],this.Y=r[1],this.Z=0;else if(t==1)if(r[0]instanceof C.DoublePoint){var e=r[0];this.X=C.Clipper.Round(e.X),this.Y=C.Clipper.Round(e.Y),this.Z=0}else{var n=r[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=r[0],this.Y=r[1];else if(t==1)if(r[0]instanceof C.DoublePoint){var e=r[0];this.X=C.Clipper.Round(e.X),this.Y=C.Clipper.Round(e.Y)}else{var n=r[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};C.IntPoint.op_Equality=function(r,t){return r.X==t.X&&r.Y==t.Y};C.IntPoint.op_Inequality=function(r,t){return r.X!=t.X||r.Y!=t.Y};Gh?(C.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},C.IntPoint1=function(r){this.X=r.X,this.Y=r.Y,this.Z=r.Z},C.IntPoint1dp=function(r){this.X=C.Clipper.Round(r.X),this.Y=C.Clipper.Round(r.Y),this.Z=0},C.IntPoint2=function(r,t){this.X=r,this.Y=t,this.Z=0},C.IntPoint3=function(r,t,e){this.X=r,this.Y=t,this.Z=e}):(C.IntPoint0=function(){this.X=0,this.Y=0},C.IntPoint1=function(r){this.X=r.X,this.Y=r.Y},C.IntPoint1dp=function(r){this.X=C.Clipper.Round(r.X),this.Y=C.Clipper.Round(r.Y)},C.IntPoint2=function(r,t){this.X=r,this.Y=t});C.IntRect=function(){var r=arguments,t=r.length;t==4?(this.left=r[0],this.top=r[1],this.right=r[2],this.bottom=r[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};C.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};C.IntRect1=function(r){this.left=r.left,this.top=r.top,this.right=r.right,this.bottom=r.bottom};C.IntRect4=function(r,t,e,n){this.left=r,this.top=t,this.right=e,this.bottom=n};C.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};C.PolyType={ptSubject:0,ptClip:1};C.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};C.JoinType={jtSquare:0,jtRound:1,jtMiter:2};C.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};SO&&(C.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});C.EdgeSide={esLeft:0,esRight:1};C.Direction={dRightToLeft:0,dLeftToRight:1};C.TEdge=function(){this.Bot=new C.IntPoint,this.Curr=new C.IntPoint,this.Top=new C.IntPoint,this.Delta=new C.IntPoint,this.Dx=0,this.PolyTyp=C.PolyType.ptSubject,this.Side=C.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};C.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new C.IntPoint};C.MyIntersectNodeSort=function(){};C.MyIntersectNodeSort.Compare=function(r,t){return t.Pt.Y-r.Pt.Y};C.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};C.Scanbeam=function(){this.Y=0,this.Next=null};C.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};C.OutPt=function(){this.Idx=0,this.Pt=new C.IntPoint,this.Next=null,this.Prev=null};C.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new C.IntPoint};C.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};C.ClipperBase.horizontal=-9007199254740992;C.ClipperBase.Skip=-2;C.ClipperBase.Unassigned=-1;C.ClipperBase.tolerance=1e-20;kX?(C.ClipperBase.loRange=46340,C.ClipperBase.hiRange=46340):(C.ClipperBase.loRange=47453132,C.ClipperBase.hiRange=0xfffffffffffff);C.ClipperBase.near_zero=function(r){return r>-C.ClipperBase.tolerance&&r<C.ClipperBase.tolerance};C.ClipperBase.IsHorizontal=function(r){return r.Delta.Y===0};C.ClipperBase.prototype.PointIsVertex=function(r,t){var e=t;do{if(C.IntPoint.op_Equality(e.Pt,r))return!0;e=e.Next}while(e!=t);return!1};C.ClipperBase.prototype.PointOnLineSegment=function(r,t,e,n){return n?r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&Ke.op_Equality(Ke.Int128Mul(r.X-t.X,e.Y-t.Y),Ke.Int128Mul(e.X-t.X,r.Y-t.Y)):r.X==t.X&&r.Y==t.Y||r.X==e.X&&r.Y==e.Y||r.X>t.X==r.X<e.X&&r.Y>t.Y==r.Y<e.Y&&(r.X-t.X)*(e.Y-t.Y)==(e.X-t.X)*(r.Y-t.Y)};C.ClipperBase.prototype.PointOnPolygon=function(r,t,e){for(var n=t;;){if(this.PointOnLineSegment(r,n.Pt,n.Next.Pt,e))return!0;if(n=n.Next,n==t)break}return!1};C.ClipperBase.prototype.SlopesEqual=C.ClipperBase.SlopesEqual=function(){var r=arguments,t=r.length,e,n,i,a,u,h,d;return t==3?(e=r[0],n=r[1],d=r[2],d?Ke.op_Equality(Ke.Int128Mul(e.Delta.Y,n.Delta.X),Ke.Int128Mul(e.Delta.X,n.Delta.Y)):C.Cast_Int64(e.Delta.Y*n.Delta.X)==C.Cast_Int64(e.Delta.X*n.Delta.Y)):t==4?(i=r[0],a=r[1],u=r[2],d=r[3],d?Ke.op_Equality(Ke.Int128Mul(i.Y-a.Y,a.X-u.X),Ke.Int128Mul(i.X-a.X,a.Y-u.Y)):C.Cast_Int64((i.Y-a.Y)*(a.X-u.X))-C.Cast_Int64((i.X-a.X)*(a.Y-u.Y))===0):(i=r[0],a=r[1],u=r[2],h=r[3],d=r[4],d?Ke.op_Equality(Ke.Int128Mul(i.Y-a.Y,u.X-h.X),Ke.Int128Mul(i.X-a.X,u.Y-h.Y)):C.Cast_Int64((i.Y-a.Y)*(u.X-h.X))-C.Cast_Int64((i.X-a.X)*(u.Y-h.Y))===0)};C.ClipperBase.SlopesEqual3=function(r,t,e){return e?Ke.op_Equality(Ke.Int128Mul(r.Delta.Y,t.Delta.X),Ke.Int128Mul(r.Delta.X,t.Delta.Y)):C.Cast_Int64(r.Delta.Y*t.Delta.X)==C.Cast_Int64(r.Delta.X*t.Delta.Y)};C.ClipperBase.SlopesEqual4=function(r,t,e,n){return n?Ke.op_Equality(Ke.Int128Mul(r.Y-t.Y,t.X-e.X),Ke.Int128Mul(r.X-t.X,t.Y-e.Y)):C.Cast_Int64((r.Y-t.Y)*(t.X-e.X))-C.Cast_Int64((r.X-t.X)*(t.Y-e.Y))===0};C.ClipperBase.SlopesEqual5=function(r,t,e,n,i){return i?Ke.op_Equality(Ke.Int128Mul(r.Y-t.Y,e.X-n.X),Ke.Int128Mul(r.X-t.X,e.Y-n.Y)):C.Cast_Int64((r.Y-t.Y)*(e.X-n.X))-C.Cast_Int64((r.X-t.X)*(e.Y-n.Y))===0};C.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var r=0,t=this.m_edges.length;r<t;++r){for(var e=0,n=this.m_edges[r].length;e<n;++e)this.m_edges[r][e]=null;C.Clear(this.m_edges[r])}C.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};C.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var r=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=r}this.m_CurrentLM=null};C.ClipperBase.prototype.RangeTest=function(r,t){t.Value?(r.X>C.ClipperBase.hiRange||r.Y>C.ClipperBase.hiRange||-r.X>C.ClipperBase.hiRange||-r.Y>C.ClipperBase.hiRange)&&C.Error("Coordinate outside allowed range in RangeTest()."):(r.X>C.ClipperBase.loRange||r.Y>C.ClipperBase.loRange||-r.X>C.ClipperBase.loRange||-r.Y>C.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(r,t))};C.ClipperBase.prototype.InitEdge=function(r,t,e,n){r.Next=t,r.Prev=e,r.Curr.X=n.X,r.Curr.Y=n.Y,r.OutIdx=-1};C.ClipperBase.prototype.InitEdge2=function(r,t){r.Curr.Y>=r.Next.Curr.Y?(r.Bot.X=r.Curr.X,r.Bot.Y=r.Curr.Y,r.Top.X=r.Next.Curr.X,r.Top.Y=r.Next.Curr.Y):(r.Top.X=r.Curr.X,r.Top.Y=r.Curr.Y,r.Bot.X=r.Next.Curr.X,r.Bot.Y=r.Next.Curr.Y),this.SetDx(r),r.PolyTyp=t};C.ClipperBase.prototype.FindNextLocMin=function(r){for(var t;;){for(;C.IntPoint.op_Inequality(r.Bot,r.Prev.Bot)||C.IntPoint.op_Equality(r.Curr,r.Top);)r=r.Next;if(r.Dx!=C.ClipperBase.horizontal&&r.Prev.Dx!=C.ClipperBase.horizontal)break;for(;r.Prev.Dx==C.ClipperBase.horizontal;)r=r.Prev;for(t=r;r.Dx==C.ClipperBase.horizontal;)r=r.Next;if(r.Top.Y!=r.Prev.Bot.Y){t.Prev.Bot.X<r.Bot.X&&(r=t);break}}return r};C.ClipperBase.prototype.ProcessBound=function(r,t){var e=r,n=r,i,a;if(r.Dx==C.ClipperBase.horizontal&&(t?a=r.Prev.Bot.X:a=r.Next.Bot.X,r.Bot.X!=a&&this.ReverseHorizontal(r)),n.OutIdx!=C.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=C.ClipperBase.Skip;)n=n.Next;if(n.Dx==C.ClipperBase.horizontal&&n.Next.OutIdx!=C.ClipperBase.Skip){for(i=n;i.Prev.Dx==C.ClipperBase.horizontal;)i=i.Prev;i.Prev.Top.X==n.Next.Top.X?t||(n=i.Prev):i.Prev.Top.X>n.Next.Top.X&&(n=i.Prev)}for(;r!=n;)r.NextInLML=r.Next,r.Dx==C.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),r=r.Next;r.Dx==C.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Prev.Top.X&&this.ReverseHorizontal(r),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=C.ClipperBase.Skip;)n=n.Prev;if(n.Dx==C.ClipperBase.horizontal&&n.Prev.OutIdx!=C.ClipperBase.Skip){for(i=n;i.Next.Dx==C.ClipperBase.horizontal;)i=i.Next;i.Next.Top.X==n.Prev.Top.X?t||(n=i.Next):i.Next.Top.X>n.Prev.Top.X&&(n=i.Next)}for(;r!=n;)r.NextInLML=r.Prev,r.Dx==C.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),r=r.Prev;r.Dx==C.ClipperBase.horizontal&&r!=e&&r.Bot.X!=r.Next.Top.X&&this.ReverseHorizontal(r),n=n.Prev}if(n.OutIdx==C.ClipperBase.Skip){if(r=n,t){for(;r.Top.Y==r.Next.Bot.Y;)r=r.Next;for(;r!=n&&r.Dx==C.ClipperBase.horizontal;)r=r.Prev}else{for(;r.Top.Y==r.Prev.Bot.Y;)r=r.Prev;for(;r!=n&&r.Dx==C.ClipperBase.horizontal;)r=r.Next}if(r==n)t?n=r.Next:n=r.Prev;else{t?r=n.Next:r=n.Prev;var u=new C.LocalMinima;u.Next=null,u.Y=r.Bot.Y,u.LeftBound=null,u.RightBound=r,u.RightBound.WindDelta=0,n=this.ProcessBound(u.RightBound,t),this.InsertLocalMinima(u)}}return n};C.ClipperBase.prototype.AddPath=function(r,t,e){CO?!e&&t==C.PolyType.ptClip&&C.Error("AddPath: Open paths must be subject."):e||C.Error("AddPath: Open paths have been disabled.");var n=r.length-1;if(e)for(;n>0&&C.IntPoint.op_Equality(r[n],r[0]);)--n;for(;n>0&&C.IntPoint.op_Equality(r[n],r[n-1]);)--n;if(e&&n<2||!e&&n<1)return!1;for(var i=new Array,a=0;a<=n;a++)i.push(new C.TEdge);var u=!0;i[1].Curr.X=r[1].X,i[1].Curr.Y=r[1].Y;var h={Value:this.m_UseFullRange};this.RangeTest(r[0],h),this.m_UseFullRange=h.Value,h.Value=this.m_UseFullRange,this.RangeTest(r[n],h),this.m_UseFullRange=h.Value,this.InitEdge(i[0],i[1],i[n],r[0]),this.InitEdge(i[n],i[0],i[n-1],r[n]);for(var a=n-1;a>=1;--a)h.Value=this.m_UseFullRange,this.RangeTest(r[a],h),this.m_UseFullRange=h.Value,this.InitEdge(i[a],i[a+1],i[a-1],r[a]);for(var d=i[0],m=d,v=d;;){if(C.IntPoint.op_Equality(m.Curr,m.Next.Curr)){if(m==m.Next)break;m==d&&(d=m.Next),m=this.RemoveEdge(m),v=m;continue}if(m.Prev==m.Next)break;if(e&&C.ClipperBase.SlopesEqual(m.Prev.Curr,m.Curr,m.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(m.Prev.Curr,m.Curr,m.Next.Curr))){m==d&&(d=m.Next),m=this.RemoveEdge(m),m=m.Prev,v=m;continue}if(m=m.Next,m==v)break}if(!e&&m==m.Next||e&&m.Prev==m.Next)return!1;e||(this.m_HasOpenPaths=!0,d.Prev.OutIdx=C.ClipperBase.Skip);var x=d;m=d;do this.InitEdge2(m,t),m=m.Next,u&&m.Curr.Y!=d.Curr.Y&&(u=!1);while(m!=d);if(u){if(e)return!1;m.Prev.OutIdx=C.ClipperBase.Skip,m.Prev.Bot.X<m.Prev.Top.X&&this.ReverseHorizontal(m.Prev);var S=new C.LocalMinima;for(S.Next=null,S.Y=m.Bot.Y,S.LeftBound=null,S.RightBound=m,S.RightBound.Side=C.EdgeSide.esRight,S.RightBound.WindDelta=0;m.Next.OutIdx!=C.ClipperBase.Skip;)m.NextInLML=m.Next,m.Bot.X!=m.Prev.Top.X&&this.ReverseHorizontal(m),m=m.Next;return this.InsertLocalMinima(S),this.m_edges.push(i),!0}this.m_edges.push(i);for(var I,w=null;m=this.FindNextLocMin(m),m!=w;){w==null&&(w=m);var S=new C.LocalMinima;S.Next=null,S.Y=m.Bot.Y,m.Dx<m.Prev.Dx?(S.LeftBound=m.Prev,S.RightBound=m,I=!1):(S.LeftBound=m,S.RightBound=m.Prev,I=!0),S.LeftBound.Side=C.EdgeSide.esLeft,S.RightBound.Side=C.EdgeSide.esRight,e?S.LeftBound.Next==S.RightBound?S.LeftBound.WindDelta=-1:S.LeftBound.WindDelta=1:S.LeftBound.WindDelta=0,S.RightBound.WindDelta=-S.LeftBound.WindDelta,m=this.ProcessBound(S.LeftBound,I);var E=this.ProcessBound(S.RightBound,!I);S.LeftBound.OutIdx==C.ClipperBase.Skip?S.LeftBound=null:S.RightBound.OutIdx==C.ClipperBase.Skip&&(S.RightBound=null),this.InsertLocalMinima(S),I||(m=E)}return!0};C.ClipperBase.prototype.AddPaths=function(r,t,e){for(var n=!1,i=0,a=r.length;i<a;++i)this.AddPath(r[i],t,e)&&(n=!0);return n};C.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(r,t,e){return C.IntPoint.op_Equality(r,e)||C.IntPoint.op_Equality(r,t)||C.IntPoint.op_Equality(e,t)?!1:r.X!=e.X?t.X>r.X==t.X<e.X:t.Y>r.Y==t.Y<e.Y};C.ClipperBase.prototype.RemoveEdge=function(r){r.Prev.Next=r.Next,r.Next.Prev=r.Prev;var t=r.Next;return r.Prev=null,t};C.ClipperBase.prototype.SetDx=function(r){r.Delta.X=r.Top.X-r.Bot.X,r.Delta.Y=r.Top.Y-r.Bot.Y,r.Delta.Y===0?r.Dx=C.ClipperBase.horizontal:r.Dx=r.Delta.X/r.Delta.Y};C.ClipperBase.prototype.InsertLocalMinima=function(r){if(this.m_MinimaList===null)this.m_MinimaList=r;else if(r.Y>=this.m_MinimaList.Y)r.Next=this.m_MinimaList,this.m_MinimaList=r;else{for(var t=this.m_MinimaList;t.Next!==null&&r.Y<t.Next.Y;)t=t.Next;r.Next=t.Next,t.Next=r}};C.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};C.ClipperBase.prototype.ReverseHorizontal=function(r){var t=r.Top.X;r.Top.X=r.Bot.X,r.Bot.X=t,Gh&&(t=r.Top.Z,r.Top.Z=r.Bot.Z,r.Bot.Z=t)};C.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var r=this.m_MinimaList;r!=null;){var t=r.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=C.EdgeSide.esLeft,t.OutIdx=C.ClipperBase.Unassigned),t=r.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=C.EdgeSide.esRight,t.OutIdx=C.ClipperBase.Unassigned),r=r.Next}};C.Clipper=function(r){typeof r>"u"&&(r=0),this.m_PolyOuts=null,this.m_ClipType=C.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=C.PolyFillType.pftEvenOdd,this.m_SubjFillType=C.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,C.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=C.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&r)!==0,this.StrictlySimple=(2&r)!==0,this.PreserveCollinear=(4&r)!==0,Gh&&(this.ZFillFunction=null)};C.Clipper.ioReverseSolution=1;C.Clipper.ioStrictlySimple=2;C.Clipper.ioPreserveCollinear=4;C.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),C.ClipperBase.prototype.Clear.call(this))};C.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var r=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=r}};C.Clipper.prototype.Reset=function(){C.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var r=this.m_MinimaList;r!==null;)this.InsertScanbeam(r.Y),r=r.Next};C.Clipper.prototype.InsertScanbeam=function(r){if(this.m_Scanbeam===null)this.m_Scanbeam=new C.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=r;else if(r>this.m_Scanbeam.Y){var t=new C.Scanbeam;t.Y=r,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var e=this.m_Scanbeam;e.Next!==null&&r<=e.Next.Y;)e=e.Next;if(r==e.Y)return;var t=new C.Scanbeam;t.Y=r,t.Next=e.Next,e.Next=t}};C.Clipper.prototype.Execute=function(){var r=arguments,t=r.length,e=r[1]instanceof C.PolyTree;if(t==4&&!e){var n=r[0],i=r[1],a=r[2],u=r[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&C.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,C.Clear(i),this.m_SubjFillType=a,this.m_ClipFillType=u,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var h=this.ExecuteInternal();h&&this.BuildResult(i)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return h}else if(t==4&&e){var n=r[0],d=r[1],a=r[2],u=r[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=a,this.m_ClipFillType=u,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var h=this.ExecuteInternal();h&&this.BuildResult2(d)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return h}else if(t==2&&!e){var n=r[0],i=r[1];return this.Execute(n,i,C.PolyFillType.pftEvenOdd,C.PolyFillType.pftEvenOdd)}else if(t==2&&e){var n=r[0],d=r[1];return this.Execute(n,d,C.PolyFillType.pftEvenOdd,C.PolyFillType.pftEvenOdd)}};C.Clipper.prototype.FixHoleLinkage=function(r){if(!(r.FirstLeft===null||r.IsHole!=r.FirstLeft.IsHole&&r.FirstLeft.Pts!==null)){for(var t=r.FirstLeft;t!==null&&(t.IsHole==r.IsHole||t.Pts===null);)t=t.FirstLeft;r.FirstLeft=t}};C.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var r=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(r),C.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(r,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),r=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var e=0,n=this.m_PolyOuts.length;e<n;e++){var i=this.m_PolyOuts[e];i.Pts===null||i.IsOpen||(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)}this.JoinCommonEdges();for(var e=0,n=this.m_PolyOuts.length;e<n;e++){var i=this.m_PolyOuts[e];i.Pts!==null&&!i.IsOpen&&this.FixupOutPolygon(i)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{C.Clear(this.m_Joins),C.Clear(this.m_GhostJoins)}};C.Clipper.prototype.PopScanbeam=function(){var r=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,r};C.Clipper.prototype.DisposeAllPolyPts=function(){for(var r=0,t=this.m_PolyOuts.length;r<t;++r)this.DisposeOutRec(r);C.Clear(this.m_PolyOuts)};C.Clipper.prototype.DisposeOutRec=function(r){var t=this.m_PolyOuts[r];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[r]=null};C.Clipper.prototype.DisposeOutPts=function(r){if(r!==null){var t=null;for(r.Prev.Next=null;r!==null;)t=r,r=r.Next,t=null}};C.Clipper.prototype.AddJoin=function(r,t,e){var n=new C.Join;n.OutPt1=r,n.OutPt2=t,n.OffPt.X=e.X,n.OffPt.Y=e.Y,this.m_Joins.push(n)};C.Clipper.prototype.AddGhostJoin=function(r,t){var e=new C.Join;e.OutPt1=r,e.OffPt.X=t.X,e.OffPt.Y=t.Y,this.m_GhostJoins.push(e)};Gh&&(C.Clipper.prototype.SetZ=function(r,t){r.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,r):this.ZFillFunction(t.Top,t.Bot,r))});C.Clipper.prototype.InsertLocalMinimaIntoAEL=function(r){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==r;){var t=this.m_CurrentLM.LeftBound,e=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(n=this.AddOutPt(e,e.Bot))):e==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(e,t),this.SetWindingCount(t),e.WindCnt=t.WindCnt,e.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,e,t.Bot)),this.InsertScanbeam(t.Top.Y)),e!=null&&(C.ClipperBase.IsHorizontal(e)?this.AddEdgeToSEL(e):this.InsertScanbeam(e.Top.Y)),!(t==null||e==null)){if(n!==null&&C.ClipperBase.IsHorizontal(e)&&this.m_GhostJoins.length>0&&e.WindDelta!==0)for(var i=0,a=this.m_GhostJoins.length;i<a;i++){var u=this.m_GhostJoins[i];this.HorzSegmentsOverlap(u.OutPt1.Pt,u.OffPt,e.Bot,e.Top)&&this.AddJoin(u.OutPt1,n,u.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&C.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var h=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,h,t.Top)}if(t.NextInAEL!=e){if(e.OutIdx>=0&&e.PrevInAEL.OutIdx>=0&&C.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var h=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(n,h,e.Top)}var d=t.NextInAEL;if(d!==null)for(;d!=e;)this.IntersectEdges(e,d,t.Curr,!1),d=d.NextInAEL}}}};C.Clipper.prototype.InsertEdgeIntoAEL=function(r,t){if(this.m_ActiveEdges===null)r.PrevInAEL=null,r.NextInAEL=null,this.m_ActiveEdges=r;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,r))r.PrevInAEL=null,r.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=r,this.m_ActiveEdges=r;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,r);)t=t.NextInAEL;r.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=r),r.PrevInAEL=t,t.NextInAEL=r}};C.Clipper.prototype.E2InsertsBeforeE1=function(r,t){return t.Curr.X==r.Curr.X?t.Top.Y>r.Top.Y?t.Top.X<C.Clipper.TopX(r,t.Top.Y):r.Top.X>C.Clipper.TopX(t,r.Top.Y):t.Curr.X<r.Curr.X};C.Clipper.prototype.IsEvenOddFillType=function(r){return r.PolyTyp==C.PolyType.ptSubject?this.m_SubjFillType==C.PolyFillType.pftEvenOdd:this.m_ClipFillType==C.PolyFillType.pftEvenOdd};C.Clipper.prototype.IsEvenOddAltFillType=function(r){return r.PolyTyp==C.PolyType.ptSubject?this.m_ClipFillType==C.PolyFillType.pftEvenOdd:this.m_SubjFillType==C.PolyFillType.pftEvenOdd};C.Clipper.prototype.IsContributing=function(r){var t,e;switch(r.PolyTyp==C.PolyType.ptSubject?(t=this.m_SubjFillType,e=this.m_ClipFillType):(t=this.m_ClipFillType,e=this.m_SubjFillType),t){case C.PolyFillType.pftEvenOdd:if(r.WindDelta===0&&r.WindCnt!=1)return!1;break;case C.PolyFillType.pftNonZero:if(Math.abs(r.WindCnt)!=1)return!1;break;case C.PolyFillType.pftPositive:if(r.WindCnt!=1)return!1;break;default:if(r.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case C.ClipType.ctIntersection:switch(e){case C.PolyFillType.pftEvenOdd:case C.PolyFillType.pftNonZero:return r.WindCnt2!==0;case C.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case C.ClipType.ctUnion:switch(e){case C.PolyFillType.pftEvenOdd:case C.PolyFillType.pftNonZero:return r.WindCnt2===0;case C.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}case C.ClipType.ctDifference:if(r.PolyTyp==C.PolyType.ptSubject)switch(e){case C.PolyFillType.pftEvenOdd:case C.PolyFillType.pftNonZero:return r.WindCnt2===0;case C.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else switch(e){case C.PolyFillType.pftEvenOdd:case C.PolyFillType.pftNonZero:return r.WindCnt2!==0;case C.PolyFillType.pftPositive:return r.WindCnt2>0;default:return r.WindCnt2<0}case C.ClipType.ctXor:if(r.WindDelta===0)switch(e){case C.PolyFillType.pftEvenOdd:case C.PolyFillType.pftNonZero:return r.WindCnt2===0;case C.PolyFillType.pftPositive:return r.WindCnt2<=0;default:return r.WindCnt2>=0}else return!0}return!0};C.Clipper.prototype.SetWindingCount=function(r){for(var t=r.PrevInAEL;t!==null&&(t.PolyTyp!=r.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)r.WindCnt=r.WindDelta===0?1:r.WindDelta,r.WindCnt2=0,t=this.m_ActiveEdges;else if(r.WindDelta===0&&this.m_ClipType!=C.ClipType.ctUnion)r.WindCnt=1,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(r)){if(r.WindDelta===0){for(var e=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(e=!e),n=n.PrevInAEL;r.WindCnt=e?0:1}else r.WindCnt=r.WindDelta;r.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta:r.WindCnt=r.WindDelta===0?1:r.WindDelta:r.WindDelta===0?r.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*r.WindDelta<0?r.WindCnt=t.WindCnt:r.WindCnt=t.WindCnt+r.WindDelta,r.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(r))for(;t!=r;)t.WindDelta!==0&&(r.WindCnt2=r.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=r;)r.WindCnt2+=t.WindDelta,t=t.NextInAEL};C.Clipper.prototype.AddEdgeToSEL=function(r){this.m_SortedEdges===null?(this.m_SortedEdges=r,r.PrevInSEL=null,r.NextInSEL=null):(r.NextInSEL=this.m_SortedEdges,r.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=r,this.m_SortedEdges=r)};C.Clipper.prototype.CopyAELToSEL=function(){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r=r.NextInAEL};C.Clipper.prototype.SwapPositionsInAEL=function(r,t){if(!(r.NextInAEL==r.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(r.NextInAEL==t){var e=t.NextInAEL;e!==null&&(e.PrevInAEL=r);var n=r.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=r,r.PrevInAEL=t,r.NextInAEL=e}else if(t.NextInAEL==r){var e=r.NextInAEL;e!==null&&(e.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=r),r.PrevInAEL=n,r.NextInAEL=t,t.PrevInAEL=r,t.NextInAEL=e}else{var e=r.NextInAEL,n=r.PrevInAEL;r.NextInAEL=t.NextInAEL,r.NextInAEL!==null&&(r.NextInAEL.PrevInAEL=r),r.PrevInAEL=t.PrevInAEL,r.PrevInAEL!==null&&(r.PrevInAEL.NextInAEL=r),t.NextInAEL=e,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}r.PrevInAEL===null?this.m_ActiveEdges=r:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};C.Clipper.prototype.SwapPositionsInSEL=function(r,t){if(!(r.NextInSEL===null&&r.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(r.NextInSEL==t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=r);var n=r.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=r,r.PrevInSEL=t,r.NextInSEL=e}else if(t.NextInSEL==r){var e=r.NextInSEL;e!==null&&(e.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=r),r.PrevInSEL=n,r.NextInSEL=t,t.PrevInSEL=r,t.NextInSEL=e}else{var e=r.NextInSEL,n=r.PrevInSEL;r.NextInSEL=t.NextInSEL,r.NextInSEL!==null&&(r.NextInSEL.PrevInSEL=r),r.PrevInSEL=t.PrevInSEL,r.PrevInSEL!==null&&(r.PrevInSEL.NextInSEL=r),t.NextInSEL=e,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}r.PrevInSEL===null?this.m_SortedEdges=r:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};C.Clipper.prototype.AddLocalMaxPoly=function(r,t,e){this.AddOutPt(r,e),t.WindDelta==0&&this.AddOutPt(t,e),r.OutIdx==t.OutIdx?(r.OutIdx=-1,t.OutIdx=-1):r.OutIdx<t.OutIdx?this.AppendPolygon(r,t):this.AppendPolygon(t,r)};C.Clipper.prototype.AddLocalMinPoly=function(r,t,e){var n,i,a;if(C.ClipperBase.IsHorizontal(t)||r.Dx>t.Dx?(n=this.AddOutPt(r,e),t.OutIdx=r.OutIdx,r.Side=C.EdgeSide.esLeft,t.Side=C.EdgeSide.esRight,i=r,i.PrevInAEL==t?a=t.PrevInAEL:a=i.PrevInAEL):(n=this.AddOutPt(t,e),r.OutIdx=t.OutIdx,r.Side=C.EdgeSide.esRight,t.Side=C.EdgeSide.esLeft,i=t,i.PrevInAEL==r?a=r.PrevInAEL:a=i.PrevInAEL),a!==null&&a.OutIdx>=0&&C.Clipper.TopX(a,e.Y)==C.Clipper.TopX(i,e.Y)&&C.ClipperBase.SlopesEqual(i,a,this.m_UseFullRange)&&i.WindDelta!==0&&a.WindDelta!==0){var u=this.AddOutPt(a,e);this.AddJoin(n,u,i.Top)}return n};C.Clipper.prototype.CreateOutRec=function(){var r=new C.OutRec;return r.Idx=-1,r.IsHole=!1,r.IsOpen=!1,r.FirstLeft=null,r.Pts=null,r.BottomPt=null,r.PolyNode=null,this.m_PolyOuts.push(r),r.Idx=this.m_PolyOuts.length-1,r};C.Clipper.prototype.AddOutPt=function(r,t){var e=r.Side==C.EdgeSide.esLeft;if(r.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=r.WindDelta===0;var i=new C.OutPt;return n.Pts=i,i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=i,i.Prev=i,n.IsOpen||this.SetHoleState(r,n),Gh&&(C.IntPoint.op_Equality(t,r.Bot)?(i.Pt.X=r.Bot.X,i.Pt.Y=r.Bot.Y,i.Pt.Z=r.Bot.Z):C.IntPoint.op_Equality(t,r.Top)?(i.Pt.X=r.Top.X,i.Pt.Y=r.Top.Y,i.Pt.Z=r.Top.Z):this.SetZ(i.Pt,r)),r.OutIdx=n.Idx,i}else{var n=this.m_PolyOuts[r.OutIdx],a=n.Pts;if(e&&C.IntPoint.op_Equality(t,a.Pt))return a;if(!e&&C.IntPoint.op_Equality(t,a.Prev.Pt))return a.Prev;var i=new C.OutPt;return i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=a,i.Prev=a.Prev,i.Prev.Next=i,a.Prev=i,e&&(n.Pts=i),Gh&&(C.IntPoint.op_Equality(t,r.Bot)?(i.Pt.X=r.Bot.X,i.Pt.Y=r.Bot.Y,i.Pt.Z=r.Bot.Z):C.IntPoint.op_Equality(t,r.Top)?(i.Pt.X=r.Top.X,i.Pt.Y=r.Top.Y,i.Pt.Z=r.Top.Z):this.SetZ(i.Pt,r)),i}};C.Clipper.prototype.SwapPoints=function(r,t){var e=new C.IntPoint(r.Value);r.Value.X=t.Value.X,r.Value.Y=t.Value.Y,t.Value.X=e.X,t.Value.Y=e.Y};C.Clipper.prototype.HorzSegmentsOverlap=function(r,t,e,n){return r.X>e.X==r.X<n.X||t.X>e.X==t.X<n.X||e.X>r.X==e.X<t.X||n.X>r.X==n.X<t.X||r.X==e.X&&t.X==n.X?!0:r.X==n.X&&t.X==e.X};C.Clipper.prototype.InsertPolyPtBetween=function(r,t,e){var n=new C.OutPt;return n.Pt.X=e.X,n.Pt.Y=e.Y,t==r.Next?(r.Next=n,t.Prev=n,n.Next=t,n.Prev=r):(t.Next=n,r.Prev=n,n.Next=r,n.Prev=t),n};C.Clipper.prototype.SetHoleState=function(r,t){for(var e=!1,n=r.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(e=!e,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;e&&(t.IsHole=!0)};C.Clipper.prototype.GetDx=function(r,t){return r.Y==t.Y?C.ClipperBase.horizontal:(t.X-r.X)/(t.Y-r.Y)};C.Clipper.prototype.FirstIsBottomPt=function(r,t){for(var e=r.Prev;C.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Prev;var n=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=r.Next;C.IntPoint.op_Equality(e.Pt,r.Pt)&&e!=r;)e=e.Next;var i=Math.abs(this.GetDx(r.Pt,e.Pt));for(e=t.Prev;C.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Prev;var a=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;C.IntPoint.op_Equality(e.Pt,t.Pt)&&e!=t;)e=e.Next;var u=Math.abs(this.GetDx(t.Pt,e.Pt));return n>=a&&n>=u||i>=a&&i>=u};C.Clipper.prototype.GetBottomPt=function(r){for(var t=null,e=r.Next;e!=r;)e.Pt.Y>r.Pt.Y?(r=e,t=null):e.Pt.Y==r.Pt.Y&&e.Pt.X<=r.Pt.X&&(e.Pt.X<r.Pt.X?(t=null,r=e):e.Next!=r&&e.Prev!=r&&(t=e)),e=e.Next;if(t!==null)for(;t!=e;)for(this.FirstIsBottomPt(e,t)||(r=t),t=t.Next;C.IntPoint.op_Inequality(t.Pt,r.Pt);)t=t.Next;return r};C.Clipper.prototype.GetLowermostRec=function(r,t){r.BottomPt===null&&(r.BottomPt=this.GetBottomPt(r.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var e=r.BottomPt,n=t.BottomPt;return e.Pt.Y>n.Pt.Y?r:e.Pt.Y<n.Pt.Y?t:e.Pt.X<n.Pt.X?r:e.Pt.X>n.Pt.X||e.Next==e?t:n.Next==n||this.FirstIsBottomPt(e,n)?r:t};C.Clipper.prototype.Param1RightOfParam2=function(r,t){do if(r=r.FirstLeft,r==t)return!0;while(r!==null);return!1};C.Clipper.prototype.GetOutRec=function(r){for(var t=this.m_PolyOuts[r];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};C.Clipper.prototype.AppendPolygon=function(r,t){var e=this.m_PolyOuts[r.OutIdx],n=this.m_PolyOuts[t.OutIdx],i;this.Param1RightOfParam2(e,n)?i=n:this.Param1RightOfParam2(n,e)?i=e:i=this.GetLowermostRec(e,n);var a=e.Pts,u=a.Prev,h=n.Pts,d=h.Prev,m;r.Side==C.EdgeSide.esLeft?(t.Side==C.EdgeSide.esLeft?(this.ReversePolyPtLinks(h),h.Next=a,a.Prev=h,u.Next=d,d.Prev=u,e.Pts=d):(d.Next=a,a.Prev=d,h.Prev=u,u.Next=h,e.Pts=h),m=C.EdgeSide.esLeft):(t.Side==C.EdgeSide.esRight?(this.ReversePolyPtLinks(h),u.Next=d,d.Prev=u,h.Next=a,a.Prev=h):(u.Next=h,h.Prev=u,a.Prev=d,d.Next=a),m=C.EdgeSide.esRight),e.BottomPt=null,i==n&&(n.FirstLeft!=e&&(e.FirstLeft=n.FirstLeft),e.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=e;var v=r.OutIdx,x=t.OutIdx;r.OutIdx=-1,t.OutIdx=-1;for(var S=this.m_ActiveEdges;S!==null;){if(S.OutIdx==x){S.OutIdx=v,S.Side=m;break}S=S.NextInAEL}n.Idx=e.Idx};C.Clipper.prototype.ReversePolyPtLinks=function(r){if(r!==null){var t,e;t=r;do e=t.Next,t.Next=t.Prev,t.Prev=e,t=e;while(t!=r)}};C.Clipper.SwapSides=function(r,t){var e=r.Side;r.Side=t.Side,t.Side=e};C.Clipper.SwapPolyIndexes=function(r,t){var e=r.OutIdx;r.OutIdx=t.OutIdx,t.OutIdx=e};C.Clipper.prototype.IntersectEdges=function(r,t,e,n){var i=!n&&r.NextInLML===null&&r.Top.X==e.X&&r.Top.Y==e.Y,a=!n&&t.NextInLML===null&&t.Top.X==e.X&&t.Top.Y==e.Y,u=r.OutIdx>=0,h=t.OutIdx>=0;if(CO&&(r.WindDelta===0||t.WindDelta===0)){r.WindDelta===0&&t.WindDelta===0?(i||a)&&u&&h&&this.AddLocalMaxPoly(r,t,e):r.PolyTyp==t.PolyTyp&&r.WindDelta!=t.WindDelta&&this.m_ClipType==C.ClipType.ctUnion?r.WindDelta===0?h&&(this.AddOutPt(r,e),u&&(r.OutIdx=-1)):u&&(this.AddOutPt(t,e),h&&(t.OutIdx=-1)):r.PolyTyp!=t.PolyTyp&&(r.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=C.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(r,e),u&&(r.OutIdx=-1)):t.WindDelta===0&&Math.abs(r.WindCnt)==1&&(this.m_ClipType!=C.ClipType.ctUnion||r.WindCnt2===0)&&(this.AddOutPt(t,e),h&&(t.OutIdx=-1))),i&&(r.OutIdx<0?this.DeleteFromAEL(r):C.Error("Error intersecting polylines")),a&&(t.OutIdx<0?this.DeleteFromAEL(t):C.Error("Error intersecting polylines"));return}if(r.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(r)){var d=r.WindCnt;r.WindCnt=t.WindCnt,t.WindCnt=d}else r.WindCnt+t.WindDelta===0?r.WindCnt=-r.WindCnt:r.WindCnt+=t.WindDelta,t.WindCnt-r.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=r.WindDelta;else this.IsEvenOddFillType(t)?r.WindCnt2=r.WindCnt2===0?1:0:r.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(r)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=r.WindDelta;var m,v,x,S;r.PolyTyp==C.PolyType.ptSubject?(m=this.m_SubjFillType,x=this.m_ClipFillType):(m=this.m_ClipFillType,x=this.m_SubjFillType),t.PolyTyp==C.PolyType.ptSubject?(v=this.m_SubjFillType,S=this.m_ClipFillType):(v=this.m_ClipFillType,S=this.m_SubjFillType);var I,w;switch(m){case C.PolyFillType.pftPositive:I=r.WindCnt;break;case C.PolyFillType.pftNegative:I=-r.WindCnt;break;default:I=Math.abs(r.WindCnt);break}switch(v){case C.PolyFillType.pftPositive:w=t.WindCnt;break;case C.PolyFillType.pftNegative:w=-t.WindCnt;break;default:w=Math.abs(t.WindCnt);break}if(u&&h)i||a||I!==0&&I!=1||w!==0&&w!=1||r.PolyTyp!=t.PolyTyp&&this.m_ClipType!=C.ClipType.ctXor?this.AddLocalMaxPoly(r,t,e):(this.AddOutPt(r,e),this.AddOutPt(t,e),C.Clipper.SwapSides(r,t),C.Clipper.SwapPolyIndexes(r,t));else if(u)(w===0||w==1)&&(this.AddOutPt(r,e),C.Clipper.SwapSides(r,t),C.Clipper.SwapPolyIndexes(r,t));else if(h)(I===0||I==1)&&(this.AddOutPt(t,e),C.Clipper.SwapSides(r,t),C.Clipper.SwapPolyIndexes(r,t));else if((I===0||I==1)&&(w===0||w==1)&&!i&&!a){var E,T;switch(x){case C.PolyFillType.pftPositive:E=r.WindCnt2;break;case C.PolyFillType.pftNegative:E=-r.WindCnt2;break;default:E=Math.abs(r.WindCnt2);break}switch(S){case C.PolyFillType.pftPositive:T=t.WindCnt2;break;case C.PolyFillType.pftNegative:T=-t.WindCnt2;break;default:T=Math.abs(t.WindCnt2);break}if(r.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(r,t,e);else if(I==1&&w==1)switch(this.m_ClipType){case C.ClipType.ctIntersection:E>0&&T>0&&this.AddLocalMinPoly(r,t,e);break;case C.ClipType.ctUnion:E<=0&&T<=0&&this.AddLocalMinPoly(r,t,e);break;case C.ClipType.ctDifference:(r.PolyTyp==C.PolyType.ptClip&&E>0&&T>0||r.PolyTyp==C.PolyType.ptSubject&&E<=0&&T<=0)&&this.AddLocalMinPoly(r,t,e);break;case C.ClipType.ctXor:this.AddLocalMinPoly(r,t,e);break}else C.Clipper.SwapSides(r,t)}i!=a&&(i&&r.OutIdx>=0||a&&t.OutIdx>=0)&&(C.Clipper.SwapSides(r,t),C.Clipper.SwapPolyIndexes(r,t)),i&&this.DeleteFromAEL(r),a&&this.DeleteFromAEL(t)};C.Clipper.prototype.DeleteFromAEL=function(r){var t=r.PrevInAEL,e=r.NextInAEL;t===null&&e===null&&r!=this.m_ActiveEdges||(t!==null?t.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=t),r.NextInAEL=null,r.PrevInAEL=null)};C.Clipper.prototype.DeleteFromSEL=function(r){var t=r.PrevInSEL,e=r.NextInSEL;t===null&&e===null&&r!=this.m_SortedEdges||(t!==null?t.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=t),r.NextInSEL=null,r.PrevInSEL=null)};C.Clipper.prototype.UpdateEdgeIntoAEL=function(r){r.NextInLML===null&&C.Error("UpdateEdgeIntoAEL: invalid call");var t=r.PrevInAEL,e=r.NextInAEL;return r.NextInLML.OutIdx=r.OutIdx,t!==null?t.NextInAEL=r.NextInLML:this.m_ActiveEdges=r.NextInLML,e!==null&&(e.PrevInAEL=r.NextInLML),r.NextInLML.Side=r.Side,r.NextInLML.WindDelta=r.WindDelta,r.NextInLML.WindCnt=r.WindCnt,r.NextInLML.WindCnt2=r.WindCnt2,r=r.NextInLML,r.Curr.X=r.Bot.X,r.Curr.Y=r.Bot.Y,r.PrevInAEL=t,r.NextInAEL=e,C.ClipperBase.IsHorizontal(r)||this.InsertScanbeam(r.Top.Y),r};C.Clipper.prototype.ProcessHorizontals=function(r){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,r),t=this.m_SortedEdges};C.Clipper.prototype.GetHorzDirection=function(r,t){r.Bot.X<r.Top.X?(t.Left=r.Bot.X,t.Right=r.Top.X,t.Dir=C.Direction.dLeftToRight):(t.Left=r.Top.X,t.Right=r.Bot.X,t.Dir=C.Direction.dRightToLeft)};C.Clipper.prototype.PrepareHorzJoins=function(r,t){var e=this.m_PolyOuts[r.OutIdx].Pts;r.Side!=C.EdgeSide.esLeft&&(e=e.Prev),t&&(C.IntPoint.op_Equality(e.Pt,r.Top)?this.AddGhostJoin(e,r.Bot):this.AddGhostJoin(e,r.Top))};C.Clipper.prototype.ProcessHorizontal=function(r,t){var e={Dir:null,Left:null,Right:null};this.GetHorzDirection(r,e);for(var n=e.Dir,i=e.Left,a=e.Right,u=r,h=null;u.NextInLML!==null&&C.ClipperBase.IsHorizontal(u.NextInLML);)u=u.NextInLML;for(u.NextInLML===null&&(h=this.GetMaximaPair(u));;){for(var d=r==u,m=this.GetNextInAEL(r,n);m!==null&&!(m.Curr.X==r.Top.X&&r.NextInLML!==null&&m.Dx<r.NextInLML.Dx);){var v=this.GetNextInAEL(m,n);if(n==C.Direction.dLeftToRight&&m.Curr.X<=a||n==C.Direction.dRightToLeft&&m.Curr.X>=i){if(r.OutIdx>=0&&r.WindDelta!=0&&this.PrepareHorzJoins(r,t),m==h&&d){n==C.Direction.dLeftToRight?this.IntersectEdges(r,m,m.Top,!1):this.IntersectEdges(m,r,m.Top,!1),h.OutIdx>=0&&C.Error("ProcessHorizontal error");return}else if(n==C.Direction.dLeftToRight){var x=new C.IntPoint(m.Curr.X,r.Curr.Y);this.IntersectEdges(r,m,x,!0)}else{var x=new C.IntPoint(m.Curr.X,r.Curr.Y);this.IntersectEdges(m,r,x,!0)}this.SwapPositionsInAEL(r,m)}else if(n==C.Direction.dLeftToRight&&m.Curr.X>=a||n==C.Direction.dRightToLeft&&m.Curr.X<=i)break;m=v}if(r.OutIdx>=0&&r.WindDelta!==0&&this.PrepareHorzJoins(r,t),r.NextInLML!==null&&C.ClipperBase.IsHorizontal(r.NextInLML)){r=this.UpdateEdgeIntoAEL(r),r.OutIdx>=0&&this.AddOutPt(r,r.Bot);var e={Dir:n,Left:i,Right:a};this.GetHorzDirection(r,e),n=e.Dir,i=e.Left,a=e.Right}else break}if(r.NextInLML!==null)if(r.OutIdx>=0){var S=this.AddOutPt(r,r.Top);if(r=this.UpdateEdgeIntoAEL(r),r.WindDelta===0)return;var I=r.PrevInAEL,v=r.NextInAEL;if(I!==null&&I.Curr.X==r.Bot.X&&I.Curr.Y==r.Bot.Y&&I.WindDelta!==0&&I.OutIdx>=0&&I.Curr.Y>I.Top.Y&&C.ClipperBase.SlopesEqual(r,I,this.m_UseFullRange)){var w=this.AddOutPt(I,r.Bot);this.AddJoin(S,w,r.Top)}else if(v!==null&&v.Curr.X==r.Bot.X&&v.Curr.Y==r.Bot.Y&&v.WindDelta!==0&&v.OutIdx>=0&&v.Curr.Y>v.Top.Y&&C.ClipperBase.SlopesEqual(r,v,this.m_UseFullRange)){var w=this.AddOutPt(v,r.Bot);this.AddJoin(S,w,r.Top)}}else r=this.UpdateEdgeIntoAEL(r);else h!==null?h.OutIdx>=0?(n==C.Direction.dLeftToRight?this.IntersectEdges(r,h,r.Top,!1):this.IntersectEdges(h,r,r.Top,!1),h.OutIdx>=0&&C.Error("ProcessHorizontal error")):(this.DeleteFromAEL(r),this.DeleteFromAEL(h)):(r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r))};C.Clipper.prototype.GetNextInAEL=function(r,t){return t==C.Direction.dLeftToRight?r.NextInAEL:r.PrevInAEL};C.Clipper.prototype.IsMinima=function(r){return r!==null&&r.Prev.NextInLML!=r&&r.Next.NextInLML!=r};C.Clipper.prototype.IsMaxima=function(r,t){return r!==null&&r.Top.Y==t&&r.NextInLML===null};C.Clipper.prototype.IsIntermediate=function(r,t){return r.Top.Y==t&&r.NextInLML!==null};C.Clipper.prototype.GetMaximaPair=function(r){var t=null;return C.IntPoint.op_Equality(r.Next.Top,r.Top)&&r.Next.NextInLML===null?t=r.Next:C.IntPoint.op_Equality(r.Prev.Top,r.Top)&&r.Prev.NextInLML===null&&(t=r.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!C.ClipperBase.IsHorizontal(t))?null:t};C.Clipper.prototype.ProcessIntersections=function(r,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(r,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(e){this.m_SortedEdges=null,this.m_IntersectList.length=0,C.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};C.Clipper.prototype.BuildIntersectList=function(r,t){if(this.m_ActiveEdges!==null){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e.Curr.X=C.Clipper.TopX(e,t),e=e.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,e=this.m_SortedEdges;e.NextInSEL!==null;){var i=e.NextInSEL,a=new C.IntPoint;if(e.Curr.X>i.Curr.X){!this.IntersectPoint(e,i,a)&&e.Curr.X>i.Curr.X+1&&C.Error("Intersection error"),a.Y>r&&(a.Y=r,Math.abs(e.Dx)>Math.abs(i.Dx)?a.X=C.Clipper.TopX(i,r):a.X=C.Clipper.TopX(e,r));var u=new C.IntersectNode;u.Edge1=e,u.Edge2=i,u.Pt.X=a.X,u.Pt.Y=a.Y,this.m_IntersectList.push(u),this.SwapPositionsInSEL(e,i),n=!0}else e=i}if(e.PrevInSEL!==null)e.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};C.Clipper.prototype.EdgesAdjacent=function(r){return r.Edge1.NextInSEL==r.Edge2||r.Edge1.PrevInSEL==r.Edge2};C.Clipper.IntersectNodeSort=function(r,t){return t.Pt.Y-r.Pt.Y};C.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var r=this.m_IntersectList.length,t=0;t<r;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var e=t+1;e<r&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e==r)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[e],this.m_IntersectList[e]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};C.Clipper.prototype.ProcessIntersectList=function(){for(var r=0,t=this.m_IntersectList.length;r<t;r++){var e=this.m_IntersectList[r];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt,!0),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var Sq=l(function(r){return r<0?Math.ceil(r-.5):Math.round(r)},"R1"),Iq=l(function(r){return r<0?Math.ceil(r-.5):Math.floor(r+.5)},"R2"),Mq=l(function(r){return r<0?-Math.round(Math.abs(r)):Math.round(r)},"R3"),Tq=l(function(r){return r<0?(r-=.5,r<-2147483648?Math.ceil(r):r|0):(r+=.5,r>2147483647?Math.floor(r):r|0)},"R4");dr.msie?C.Clipper.Round=Sq:dr.chromium?C.Clipper.Round=Mq:dr.safari?C.Clipper.Round=Tq:C.Clipper.Round=Iq;C.Clipper.TopX=function(r,t){return t==r.Top.Y?r.Top.X:r.Bot.X+C.Clipper.Round(r.Dx*(t-r.Bot.Y))};C.Clipper.prototype.IntersectPoint=function(r,t,e){e.X=0,e.Y=0;var n,i;if(C.ClipperBase.SlopesEqual(r,t,this.m_UseFullRange)||r.Dx==t.Dx)return t.Bot.Y>r.Bot.Y?(e.X=t.Bot.X,e.Y=t.Bot.Y):(e.X=r.Bot.X,e.Y=r.Bot.Y),!1;if(r.Delta.X===0)e.X=r.Bot.X,C.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(i=t.Bot.Y-t.Bot.X/t.Dx,e.Y=C.Clipper.Round(e.X/t.Dx+i));else if(t.Delta.X===0)e.X=t.Bot.X,C.ClipperBase.IsHorizontal(r)?e.Y=r.Bot.Y:(n=r.Bot.Y-r.Bot.X/r.Dx,e.Y=C.Clipper.Round(e.X/r.Dx+n));else{n=r.Bot.X-r.Bot.Y*r.Dx,i=t.Bot.X-t.Bot.Y*t.Dx;var a=(i-n)/(r.Dx-t.Dx);e.Y=C.Clipper.Round(a),Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=C.Clipper.Round(r.Dx*a+n):e.X=C.Clipper.Round(t.Dx*a+i)}if(e.Y<r.Top.Y||e.Y<t.Top.Y){if(r.Top.Y>t.Top.Y)return e.Y=r.Top.Y,e.X=C.Clipper.TopX(t,r.Top.Y),e.X<r.Top.X;e.Y=t.Top.Y,Math.abs(r.Dx)<Math.abs(t.Dx)?e.X=C.Clipper.TopX(r,e.Y):e.X=C.Clipper.TopX(t,e.Y)}return!0};C.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(r){for(var t=this.m_ActiveEdges;t!==null;){var e=this.IsMaxima(t,r);if(e){var n=this.GetMaximaPair(t);e=n===null||!C.ClipperBase.IsHorizontal(n)}if(e){var i=t.PrevInAEL;this.DoMaxima(t),i===null?t=this.m_ActiveEdges:t=i.NextInAEL}else{if(this.IsIntermediate(t,r)&&C.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=C.Clipper.TopX(t,r),t.Curr.Y=r),this.StrictlySimple){var i=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&i!==null&&i.OutIdx>=0&&i.Curr.X==t.Curr.X&&i.WindDelta!==0){var a=this.AddOutPt(i,t.Curr),u=this.AddOutPt(t,t.Curr);this.AddJoin(a,u,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,r)){var a=null;t.OutIdx>=0&&(a=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var i=t.PrevInAEL,h=t.NextInAEL;if(i!==null&&i.Curr.X==t.Bot.X&&i.Curr.Y==t.Bot.Y&&a!==null&&i.OutIdx>=0&&i.Curr.Y>i.Top.Y&&C.ClipperBase.SlopesEqual(t,i,this.m_UseFullRange)&&t.WindDelta!==0&&i.WindDelta!==0){var u=this.AddOutPt(i,t.Bot);this.AddJoin(a,u,t.Top)}else if(h!==null&&h.Curr.X==t.Bot.X&&h.Curr.Y==t.Bot.Y&&a!==null&&h.OutIdx>=0&&h.Curr.Y>h.Top.Y&&C.ClipperBase.SlopesEqual(t,h,this.m_UseFullRange)&&t.WindDelta!==0&&h.WindDelta!==0){var u=this.AddOutPt(h,t.Bot);this.AddJoin(a,u,t.Top)}}t=t.NextInAEL}};C.Clipper.prototype.DoMaxima=function(r){var t=this.GetMaximaPair(r);if(t===null){r.OutIdx>=0&&this.AddOutPt(r,r.Top),this.DeleteFromAEL(r);return}for(var e=r.NextInAEL,n=!0;e!==null&&e!=t;)this.IntersectEdges(r,e,r.Top,!0),this.SwapPositionsInAEL(r,e),e=r.NextInAEL;r.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(r),this.DeleteFromAEL(t)):r.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(r,t,r.Top,!1):n&&r.WindDelta===0?(r.OutIdx>=0&&(this.AddOutPt(r,r.Top),r.OutIdx=-1),this.DeleteFromAEL(r),t.OutIdx>=0&&(this.AddOutPt(t,r.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):C.Error("DoMaxima error")};C.Clipper.ReversePaths=function(r){for(var t=0,e=r.length;t<e;t++)r[t].reverse()};C.Clipper.Orientation=function(r){return C.Clipper.Area(r)>=0};C.Clipper.prototype.PointCount=function(r){if(r===null)return 0;var t=0,e=r;do t++,e=e.Next;while(e!=r);return t};C.Clipper.prototype.BuildResult=function(r){C.Clear(r);for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var i=n.Pts.Prev,a=this.PointCount(i);if(!(a<2)){for(var u=new Array(a),h=0;h<a;h++)u[h]=i.Pt,i=i.Prev;r.push(u)}}}};C.Clipper.prototype.BuildResult2=function(r){r.Clear();for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var n=this.m_PolyOuts[t],i=this.PointCount(n.Pts);if(!(n.IsOpen&&i<2||!n.IsOpen&&i<3)){this.FixHoleLinkage(n);var a=new C.PolyNode;r.m_AllPolys.push(a),n.PolyNode=a,a.m_polygon.length=i;for(var u=n.Pts.Prev,h=0;h<i;h++)a.m_polygon[h]=u.Pt,u=u.Prev}}for(var t=0,e=this.m_PolyOuts.length;t<e;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,r.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):r.AddChild(n.PolyNode))}};C.Clipper.prototype.FixupOutPolygon=function(r){var t=null;r.BottomPt=null;for(var e=r.Pts;;){if(e.Prev==e||e.Prev==e.Next){this.DisposeOutPts(e),r.Pts=null;return}if(C.IntPoint.op_Equality(e.Pt,e.Next.Pt)||C.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||C.ClipperBase.SlopesEqual(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt))){t=null;var n=e;e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev,n=null}else{if(e==t)break;t===null&&(t=e),e=e.Next}}r.Pts=e};C.Clipper.prototype.DupOutPt=function(r,t){var e=new C.OutPt;return e.Pt.X=r.Pt.X,e.Pt.Y=r.Pt.Y,e.Idx=r.Idx,t?(e.Next=r.Next,e.Prev=r,r.Next.Prev=e,r.Next=e):(e.Prev=r.Prev,e.Next=r,r.Prev.Next=e,r.Prev=e),e};C.Clipper.prototype.GetOverlap=function(r,t,e,n,i){return r<t?e<n?(i.Left=Math.max(r,e),i.Right=Math.min(t,n)):(i.Left=Math.max(r,n),i.Right=Math.min(t,e)):e<n?(i.Left=Math.max(t,e),i.Right=Math.min(r,n)):(i.Left=Math.max(t,n),i.Right=Math.min(r,e)),i.Left<i.Right};C.Clipper.prototype.JoinHorz=function(r,t,e,n,i,a){var u=r.Pt.X>t.Pt.X?C.Direction.dRightToLeft:C.Direction.dLeftToRight,h=e.Pt.X>n.Pt.X?C.Direction.dRightToLeft:C.Direction.dLeftToRight;if(u==h)return!1;if(u==C.Direction.dLeftToRight){for(;r.Next.Pt.X<=i.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;a&&r.Pt.X!=i.X&&(r=r.Next),t=this.DupOutPt(r,!a),C.IntPoint.op_Inequality(t.Pt,i)&&(r=t,r.Pt.X=i.X,r.Pt.Y=i.Y,t=this.DupOutPt(r,!a))}else{for(;r.Next.Pt.X>=i.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;!a&&r.Pt.X!=i.X&&(r=r.Next),t=this.DupOutPt(r,a),C.IntPoint.op_Inequality(t.Pt,i)&&(r=t,r.Pt.X=i.X,r.Pt.Y=i.Y,t=this.DupOutPt(r,a))}if(h==C.Direction.dLeftToRight){for(;e.Next.Pt.X<=i.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;a&&e.Pt.X!=i.X&&(e=e.Next),n=this.DupOutPt(e,!a),C.IntPoint.op_Inequality(n.Pt,i)&&(e=n,e.Pt.X=i.X,e.Pt.Y=i.Y,n=this.DupOutPt(e,!a))}else{for(;e.Next.Pt.X>=i.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;!a&&e.Pt.X!=i.X&&(e=e.Next),n=this.DupOutPt(e,a),C.IntPoint.op_Inequality(n.Pt,i)&&(e=n,e.Pt.X=i.X,e.Pt.Y=i.Y,n=this.DupOutPt(e,a))}return u==C.Direction.dLeftToRight==a?(r.Prev=e,e.Next=r,t.Next=n,n.Prev=t):(r.Next=e,e.Prev=r,t.Prev=n,n.Next=t),!0};C.Clipper.prototype.JoinPoints=function(r,t,e){var n=r.OutPt1,i=new C.OutPt,a=r.OutPt2,u=new C.OutPt,h=r.OutPt1.Pt.Y==r.OffPt.Y;if(h&&C.IntPoint.op_Equality(r.OffPt,r.OutPt1.Pt)&&C.IntPoint.op_Equality(r.OffPt,r.OutPt2.Pt)){for(i=r.OutPt1.Next;i!=n&&C.IntPoint.op_Equality(i.Pt,r.OffPt);)i=i.Next;var d=i.Pt.Y>r.OffPt.Y;for(u=r.OutPt2.Next;u!=a&&C.IntPoint.op_Equality(u.Pt,r.OffPt);)u=u.Next;var m=u.Pt.Y>r.OffPt.Y;return d==m?!1:d?(i=this.DupOutPt(n,!1),u=this.DupOutPt(a,!0),n.Prev=a,a.Next=n,i.Next=u,u.Prev=i,r.OutPt1=n,r.OutPt2=i,!0):(i=this.DupOutPt(n,!0),u=this.DupOutPt(a,!1),n.Next=a,a.Prev=n,i.Prev=u,u.Next=i,r.OutPt1=n,r.OutPt2=i,!0)}else if(h){for(i=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=i&&n.Prev!=a;)n=n.Prev;for(;i.Next.Pt.Y==i.Pt.Y&&i.Next!=n&&i.Next!=a;)i=i.Next;if(i.Next==n||i.Next==a)return!1;for(u=a;a.Prev.Pt.Y==a.Pt.Y&&a.Prev!=u&&a.Prev!=i;)a=a.Prev;for(;u.Next.Pt.Y==u.Pt.Y&&u.Next!=a&&u.Next!=n;)u=u.Next;if(u.Next==a||u.Next==n)return!1;var v={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,a.Pt.X,u.Pt.X,v))return!1;var x=v.Left,S=v.Right,I=new C.IntPoint,w;return n.Pt.X>=x&&n.Pt.X<=S?(I.X=n.Pt.X,I.Y=n.Pt.Y,w=n.Pt.X>i.Pt.X):a.Pt.X>=x&&a.Pt.X<=S?(I.X=a.Pt.X,I.Y=a.Pt.Y,w=a.Pt.X>u.Pt.X):i.Pt.X>=x&&i.Pt.X<=S?(I.X=i.Pt.X,I.Y=i.Pt.Y,w=i.Pt.X>n.Pt.X):(I.X=u.Pt.X,I.Y=u.Pt.Y,w=u.Pt.X>a.Pt.X),r.OutPt1=n,r.OutPt2=a,this.JoinHorz(n,i,a,u,I,w)}else{for(i=n.Next;C.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var E=i.Pt.Y>n.Pt.Y||!C.ClipperBase.SlopesEqual(n.Pt,i.Pt,r.OffPt,this.m_UseFullRange);if(E){for(i=n.Prev;C.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Prev;if(i.Pt.Y>n.Pt.Y||!C.ClipperBase.SlopesEqual(n.Pt,i.Pt,r.OffPt,this.m_UseFullRange))return!1}for(u=a.Next;C.IntPoint.op_Equality(u.Pt,a.Pt)&&u!=a;)u=u.Next;var T=u.Pt.Y>a.Pt.Y||!C.ClipperBase.SlopesEqual(a.Pt,u.Pt,r.OffPt,this.m_UseFullRange);if(T){for(u=a.Prev;C.IntPoint.op_Equality(u.Pt,a.Pt)&&u!=a;)u=u.Prev;if(u.Pt.Y>a.Pt.Y||!C.ClipperBase.SlopesEqual(a.Pt,u.Pt,r.OffPt,this.m_UseFullRange))return!1}return i==n||u==a||i==u||t==e&&E==T?!1:E?(i=this.DupOutPt(n,!1),u=this.DupOutPt(a,!0),n.Prev=a,a.Next=n,i.Next=u,u.Prev=i,r.OutPt1=n,r.OutPt2=i,!0):(i=this.DupOutPt(n,!0),u=this.DupOutPt(a,!1),n.Next=a,a.Prev=n,i.Prev=u,u.Next=i,r.OutPt1=n,r.OutPt2=i,!0)}};C.Clipper.GetBounds=function(r){for(var t=0,e=r.length;t<e&&r[t].length==0;)t++;if(t==e)return new C.IntRect(0,0,0,0);var n=new C.IntRect;for(n.left=r[t][0].X,n.right=n.left,n.top=r[t][0].Y,n.bottom=n.top;t<e;t++)for(var i=0,a=r[t].length;i<a;i++)r[t][i].X<n.left?n.left=r[t][i].X:r[t][i].X>n.right&&(n.right=r[t][i].X),r[t][i].Y<n.top?n.top=r[t][i].Y:r[t][i].Y>n.bottom&&(n.bottom=r[t][i].Y);return n};C.Clipper.prototype.GetBounds2=function(r){var t=r,e=new C.IntRect;for(e.left=r.Pt.X,e.right=r.Pt.X,e.top=r.Pt.Y,e.bottom=r.Pt.Y,r=r.Next;r!=t;)r.Pt.X<e.left&&(e.left=r.Pt.X),r.Pt.X>e.right&&(e.right=r.Pt.X),r.Pt.Y<e.top&&(e.top=r.Pt.Y),r.Pt.Y>e.bottom&&(e.bottom=r.Pt.Y),r=r.Next;return e};C.Clipper.PointInPolygon=function(r,t){var e=0,n=t.length;if(n<3)return 0;for(var i=t[0],a=1;a<=n;++a){var u=a==n?t[0]:t[a];if(u.Y==r.Y&&(u.X==r.X||i.Y==r.Y&&u.X>r.X==i.X<r.X))return-1;if(i.Y<r.Y!=u.Y<r.Y){if(i.X>=r.X)if(u.X>r.X)e=1-e;else{var h=(i.X-r.X)*(u.Y-r.Y)-(u.X-r.X)*(i.Y-r.Y);if(h==0)return-1;h>0==u.Y>i.Y&&(e=1-e)}else if(u.X>r.X){var h=(i.X-r.X)*(u.Y-r.Y)-(u.X-r.X)*(i.Y-r.Y);if(h==0)return-1;h>0==u.Y>i.Y&&(e=1-e)}}i=u}return e};C.Clipper.prototype.PointInPolygon=function(r,t){for(var e=0,n=t;;){var i=t.Pt.X,a=t.Pt.Y,u=t.Next.Pt.X,h=t.Next.Pt.Y;if(h==r.Y&&(u==r.X||a==r.Y&&u>r.X==i<r.X))return-1;if(a<r.Y!=h<r.Y){if(i>=r.X)if(u>r.X)e=1-e;else{var d=(i-r.X)*(h-r.Y)-(u-r.X)*(a-r.Y);if(d==0)return-1;d>0==h>a&&(e=1-e)}else if(u>r.X){var d=(i-r.X)*(h-r.Y)-(u-r.X)*(a-r.Y);if(d==0)return-1;d>0==h>a&&(e=1-e)}}if(t=t.Next,n==t)break}return e};C.Clipper.prototype.Poly2ContainsPoly1=function(r,t){var e=r;do{var n=this.PointInPolygon(e.Pt,t);if(n>=0)return n!=0;e=e.Next}while(e!=r);return!0};C.Clipper.prototype.FixupFirstLefts1=function(r,t){for(var e=0,n=this.m_PolyOuts.length;e<n;e++){var i=this.m_PolyOuts[e];i.Pts!==null&&i.FirstLeft==r&&this.Poly2ContainsPoly1(i.Pts,t.Pts)&&(i.FirstLeft=t)}};C.Clipper.prototype.FixupFirstLefts2=function(r,t){for(var e=0,n=this.m_PolyOuts,i=n.length,a=n[e];e<i;e++,a=n[e])a.FirstLeft==r&&(a.FirstLeft=t)};C.Clipper.ParseFirstLeft=function(r){for(;r!=null&&r.Pts==null;)r=r.FirstLeft;return r};C.Clipper.prototype.JoinCommonEdges=function(){for(var r=0,t=this.m_Joins.length;r<t;r++){var e=this.m_Joins[r],n=this.GetOutRec(e.OutPt1.Idx),i=this.GetOutRec(e.OutPt2.Idx);if(!(n.Pts==null||i.Pts==null)){var a;if(n==i?a=n:this.Param1RightOfParam2(n,i)?a=i:this.Param1RightOfParam2(i,n)?a=n:a=this.GetLowermostRec(n,i),!!this.JoinPoints(e,n,i))if(n==i){if(n.Pts=e.OutPt1,n.BottomPt=null,i=this.CreateOutRec(),i.Pts=e.OutPt2,this.UpdateOutPtIdxs(i),this.m_UsingPolyTree)for(var u=0,h=this.m_PolyOuts.length;u<h-1;u++){var d=this.m_PolyOuts[u];d.Pts==null||C.Clipper.ParseFirstLeft(d.FirstLeft)!=n||d.IsHole==n.IsHole||this.Poly2ContainsPoly1(d.Pts,e.OutPt2)&&(d.FirstLeft=i)}this.Poly2ContainsPoly1(i.Pts,n.Pts)?(i.IsHole=!n.IsHole,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):this.Poly2ContainsPoly1(n.Pts,i.Pts)?(i.IsHole=n.IsHole,n.IsHole=!i.IsHole,i.FirstLeft=n.FirstLeft,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):(i.IsHole=n.IsHole,i.FirstLeft=n.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(n,i))}else i.Pts=null,i.BottomPt=null,i.Idx=n.Idx,n.IsHole=a.IsHole,a==i&&(n.FirstLeft=i.FirstLeft),i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n)}}};C.Clipper.prototype.UpdateOutPtIdxs=function(r){var t=r.Pts;do t.Idx=r.Idx,t=t.Prev;while(t!=r.Pts)};C.Clipper.prototype.DoSimplePolygons=function(){for(var r=0;r<this.m_PolyOuts.length;){var t=this.m_PolyOuts[r++],e=t.Pts;if(e!==null)do{for(var n=e.Next;n!=t.Pts;){if(C.IntPoint.op_Equality(e.Pt,n.Pt)&&n.Next!=e&&n.Prev!=e){var i=e.Prev,a=n.Prev;e.Prev=a,a.Next=e,n.Prev=i,i.Next=n,t.Pts=e;var u=this.CreateOutRec();u.Pts=n,this.UpdateOutPtIdxs(u),this.Poly2ContainsPoly1(u.Pts,t.Pts)?(u.IsHole=!t.IsHole,u.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,u.Pts)?(u.IsHole=t.IsHole,t.IsHole=!u.IsHole,u.FirstLeft=t.FirstLeft,t.FirstLeft=u):(u.IsHole=t.IsHole,u.FirstLeft=t.FirstLeft),n=e}n=n.Next}e=e.Next}while(e!=t.Pts)}};C.Clipper.Area=function(r){var t=r.length;if(t<3)return 0;for(var e=0,n=0,i=t-1;n<t;++n)e+=(r[i].X+r[n].X)*(r[i].Y-r[n].Y),i=n;return-e*.5};C.Clipper.prototype.Area=function(r){var t=r.Pts;if(t==null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=r.Pts);return e*.5};SO&&(C.Clipper.OffsetPaths=function(r,t,e,n,i){var a=new C.Paths,u=new C.ClipperOffset(i,i);return u.AddPaths(r,e,n),u.Execute(a,t),a});C.Clipper.SimplifyPolygon=function(r,t){var e=new Array,n=new C.Clipper(0);return n.StrictlySimple=!0,n.AddPath(r,C.PolyType.ptSubject,!0),n.Execute(C.ClipType.ctUnion,e,t,t),e};C.Clipper.SimplifyPolygons=function(r,t){typeof t>"u"&&(t=C.PolyFillType.pftEvenOdd);var e=new Array,n=new C.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(r,C.PolyType.ptSubject,!0),n.Execute(C.ClipType.ctUnion,e,t,t),e};C.Clipper.DistanceSqrd=function(r,t){var e=r.X-t.X,n=r.Y-t.Y;return e*e+n*n};C.Clipper.DistanceFromLineSqrd=function(r,t,e){var n=t.Y-e.Y,i=e.X-t.X,a=n*t.X+i*t.Y;return a=n*r.X+i*r.Y-a,a*a/(n*n+i*i)};C.Clipper.SlopesNearCollinear=function(r,t,e,n){return C.Clipper.DistanceFromLineSqrd(t,r,e)<n};C.Clipper.PointsAreClose=function(r,t,e){var n=r.X-t.X,i=r.Y-t.Y;return n*n+i*i<=e};C.Clipper.ExcludeOp=function(r){var t=r.Prev;return t.Next=r.Next,r.Next.Prev=t,t.Idx=0,t};C.Clipper.CleanPolygon=function(r,t){typeof t>"u"&&(t=1.415);var e=r.length;if(e==0)return new Array;for(var n=new Array(e),i=0;i<e;++i)n[i]=new C.OutPt;for(var i=0;i<e;++i)n[i].Pt=r[i],n[i].Next=n[(i+1)%e],n[i].Next.Prev=n[i],n[i].Idx=0;for(var a=t*t,u=n[0];u.Idx==0&&u.Next!=u.Prev;)C.Clipper.PointsAreClose(u.Pt,u.Prev.Pt,a)?(u=C.Clipper.ExcludeOp(u),e--):C.Clipper.PointsAreClose(u.Prev.Pt,u.Next.Pt,a)?(C.Clipper.ExcludeOp(u.Next),u=C.Clipper.ExcludeOp(u),e-=2):C.Clipper.SlopesNearCollinear(u.Prev.Pt,u.Pt,u.Next.Pt,a)?(u=C.Clipper.ExcludeOp(u),e--):(u.Idx=1,u=u.Next);e<3&&(e=0);for(var h=new Array(e),i=0;i<e;++i)h[i]=new C.IntPoint(u.Pt),u=u.Next;return n=null,h};C.Clipper.CleanPolygons=function(r,t){for(var e=new Array(r.length),n=0,i=r.length;n<i;n++)e[n]=C.Clipper.CleanPolygon(r[n],t);return e};C.Clipper.Minkowski=function(r,t,e,n){var i=n?1:0,a=r.length,u=t.length,h=new Array;if(e)for(var d=0;d<u;d++){for(var m=new Array(a),v=0,x=r.length,S=r[v];v<x;v++,S=r[v])m[v]=new C.IntPoint(t[d].X+S.X,t[d].Y+S.Y);h.push(m)}else for(var d=0;d<u;d++){for(var m=new Array(a),v=0,x=r.length,S=r[v];v<x;v++,S=r[v])m[v]=new C.IntPoint(t[d].X-S.X,t[d].Y-S.Y);h.push(m)}for(var I=new Array,d=0;d<u-1+i;d++)for(var v=0;v<a;v++){var w=new Array;w.push(h[d%u][v%a]),w.push(h[(d+1)%u][v%a]),w.push(h[(d+1)%u][(v+1)%a]),w.push(h[d%u][(v+1)%a]),C.Clipper.Orientation(w)||w.reverse(),I.push(w)}var E=new C.Clipper(0);return E.AddPaths(I,C.PolyType.ptSubject,!0),E.Execute(C.ClipType.ctUnion,h,C.PolyFillType.pftNonZero,C.PolyFillType.pftNonZero),h};C.Clipper.MinkowskiSum=function(){var r=arguments,t=r.length;if(t==3){var e=r[0],n=r[1],i=r[2];return C.Clipper.Minkowski(e,n,!0,i)}else if(t==4){for(var e=r[0],a=r[1],u=r[2],i=r[3],h=new C.Clipper,d,m=0,v=a.length;m<v;++m){var d=C.Clipper.Minkowski(e,a[m],!0,i);h.AddPaths(d,C.PolyType.ptSubject,!0)}i&&h.AddPaths(a,C.PolyType.ptClip,!0);var x=new C.Paths;return h.Execute(C.ClipType.ctUnion,x,u,u),x}};C.Clipper.MinkowskiDiff=function(r,t,e){return C.Clipper.Minkowski(r,t,!1,e)};C.Clipper.PolyTreeToPaths=function(r){var t=new Array;return C.Clipper.AddPolyNodeToPaths(r,C.Clipper.NodeType.ntAny,t),t};C.Clipper.AddPolyNodeToPaths=function(r,t,e){var n=!0;switch(t){case C.Clipper.NodeType.ntOpen:return;case C.Clipper.NodeType.ntClosed:n=!r.IsOpen;break;default:break}r.m_polygon.length>0&&n&&e.push(r.m_polygon);for(var i=0,a=r.Childs(),u=a.length,h=a[i];i<u;i++,h=a[i])C.Clipper.AddPolyNodeToPaths(h,t,e)};C.Clipper.OpenPathsFromPolyTree=function(r){for(var t=new C.Paths,e=0,n=r.ChildCount();e<n;e++)r.Childs()[e].IsOpen&&t.push(r.Childs()[e].m_polygon);return t};C.Clipper.ClosedPathsFromPolyTree=function(r){var t=new C.Paths;return C.Clipper.AddPolyNodeToPaths(r,C.Clipper.NodeType.ntClosed,t),t};lx(C.Clipper,C.ClipperBase);C.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};C.ClipperOffset=function(r,t){typeof r>"u"&&(r=2),typeof t>"u"&&(t=C.ClipperOffset.def_arc_tolerance),this.m_destPolys=new C.Paths,this.m_srcPoly=new C.Path,this.m_destPoly=new C.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new C.IntPoint,this.m_polyNodes=new C.PolyNode,this.MiterLimit=r,this.ArcTolerance=t,this.m_lowest.X=-1};C.ClipperOffset.two_pi=6.28318530717959;C.ClipperOffset.def_arc_tolerance=.25;C.ClipperOffset.prototype.Clear=function(){C.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};C.ClipperOffset.Round=C.Clipper.Round;C.ClipperOffset.prototype.AddPath=function(r,t,e){var n=r.length-1;if(!(n<0)){var i=new C.PolyNode;if(i.m_jointype=t,i.m_endtype=e,e==C.EndType.etClosedLine||e==C.EndType.etClosedPolygon)for(;n>0&&C.IntPoint.op_Equality(r[0],r[n]);)n--;i.m_polygon.push(r[0]);for(var a=0,u=0,h=1;h<=n;h++)C.IntPoint.op_Inequality(i.m_polygon[a],r[h])&&(a++,i.m_polygon.push(r[h]),(r[h].Y>i.m_polygon[u].Y||r[h].Y==i.m_polygon[u].Y&&r[h].X<i.m_polygon[u].X)&&(u=a));if(!(e==C.EndType.etClosedPolygon&&a<2||e!=C.EndType.etClosedPolygon&&a<0)&&(this.m_polyNodes.AddChild(i),e==C.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new C.IntPoint(0,u);else{var d=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[u].Y>d.Y||i.m_polygon[u].Y==d.Y&&i.m_polygon[u].X<d.X)&&(this.m_lowest=new C.IntPoint(this.m_polyNodes.ChildCount()-1,u))}}};C.ClipperOffset.prototype.AddPaths=function(r,t,e){for(var n=0,i=r.length;n<i;n++)this.AddPath(r[n],t,e)};C.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!C.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];(t.m_endtype==C.EndType.etClosedPolygon||t.m_endtype==C.EndType.etClosedLine&&C.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var r=0;r<this.m_polyNodes.ChildCount();r++){var t=this.m_polyNodes.Childs()[r];t.m_endtype==C.EndType.etClosedLine&&!C.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};C.ClipperOffset.GetUnitNormal=function(r,t){var e=t.X-r.X,n=t.Y-r.Y;if(e==0&&n==0)return new C.DoublePoint(0,0);var i=1/Math.sqrt(e*e+n*n);return e*=i,n*=i,new C.DoublePoint(n,-e)};C.ClipperOffset.prototype.DoOffset=function(r){if(this.m_destPolys=new Array,this.m_delta=r,C.ClipperBase.near_zero(r)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];e.m_endtype==C.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=C.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(r)*C.ClipperOffset.def_arc_tolerance?n=Math.abs(r)*C.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var i=3.14159265358979/Math.acos(1-n/Math.abs(r));this.m_sin=Math.sin(C.ClipperOffset.two_pi/i),this.m_cos=Math.cos(C.ClipperOffset.two_pi/i),this.m_StepsPerRad=i/C.ClipperOffset.two_pi,r<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var e=this.m_polyNodes.Childs()[t];this.m_srcPoly=e.m_polygon;var a=this.m_srcPoly.length;if(!(a==0||r<=0&&(a<3||e.m_endtype!=C.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,a==1){if(e.m_jointype==C.JoinType.jtRound)for(var u=1,h=0,d=1;d<=i;d++){this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[0].X+u*r),C.ClipperOffset.Round(this.m_srcPoly[0].Y+h*r)));var m=u;u=u*this.m_cos-this.m_sin*h,h=m*this.m_sin+h*this.m_cos}else for(var u=-1,h=-1,d=0;d<4;++d)this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[0].X+u*r),C.ClipperOffset.Round(this.m_srcPoly[0].Y+h*r))),u<0?u=1:h<0?h=1:u=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var d=0;d<a-1;d++)this.m_normals.push(C.ClipperOffset.GetUnitNormal(this.m_srcPoly[d],this.m_srcPoly[d+1]));if(e.m_endtype==C.EndType.etClosedLine||e.m_endtype==C.EndType.etClosedPolygon?this.m_normals.push(C.ClipperOffset.GetUnitNormal(this.m_srcPoly[a-1],this.m_srcPoly[0])):this.m_normals.push(new C.DoublePoint(this.m_normals[a-2])),e.m_endtype==C.EndType.etClosedPolygon){for(var v=a-1,d=0;d<a;d++)v=this.OffsetPoint(d,v,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype==C.EndType.etClosedLine){for(var v=a-1,d=0;d<a;d++)v=this.OffsetPoint(d,v,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var x=this.m_normals[a-1],d=a-1;d>0;d--)this.m_normals[d]=new C.DoublePoint(-this.m_normals[d-1].X,-this.m_normals[d-1].Y);this.m_normals[0]=new C.DoublePoint(-x.X,-x.Y),v=0;for(var d=a-1;d>=0;d--)v=this.OffsetPoint(d,v,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var v=0,d=1;d<a-1;++d)v=this.OffsetPoint(d,v,e.m_jointype);var S;if(e.m_endtype==C.EndType.etOpenButt){var d=a-1;S=new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[d].X+this.m_normals[d].X*r),C.ClipperOffset.Round(this.m_srcPoly[d].Y+this.m_normals[d].Y*r)),this.m_destPoly.push(S),S=new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[d].X-this.m_normals[d].X*r),C.ClipperOffset.Round(this.m_srcPoly[d].Y-this.m_normals[d].Y*r)),this.m_destPoly.push(S)}else{var d=a-1;v=a-2,this.m_sinA=0,this.m_normals[d]=new C.DoublePoint(-this.m_normals[d].X,-this.m_normals[d].Y),e.m_endtype==C.EndType.etOpenSquare?this.DoSquare(d,v):this.DoRound(d,v)}for(var d=a-1;d>0;d--)this.m_normals[d]=new C.DoublePoint(-this.m_normals[d-1].X,-this.m_normals[d-1].Y);this.m_normals[0]=new C.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),v=a-1;for(var d=v-1;d>0;--d)v=this.OffsetPoint(d,v,e.m_jointype);e.m_endtype==C.EndType.etOpenButt?(S=new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*r),C.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*r)),this.m_destPoly.push(S),S=new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*r),C.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*r)),this.m_destPoly.push(S)):(v=1,this.m_sinA=0,e.m_endtype==C.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};C.ClipperOffset.prototype.Execute=function(){var r=arguments,t=r[0]instanceof C.PolyTree;if(t){var e=r[0],n=r[1];e.Clear(),this.FixOrientations(),this.DoOffset(n);var i=new C.Clipper(0);if(i.AddPaths(this.m_destPolys,C.PolyType.ptSubject,!0),n>0)i.Execute(C.ClipType.ctUnion,e,C.PolyFillType.pftPositive,C.PolyFillType.pftPositive);else{var a=C.Clipper.GetBounds(this.m_destPolys),u=new C.Path;if(u.push(new C.IntPoint(a.left-10,a.bottom+10)),u.push(new C.IntPoint(a.right+10,a.bottom+10)),u.push(new C.IntPoint(a.right+10,a.top-10)),u.push(new C.IntPoint(a.left-10,a.top-10)),i.AddPath(u,C.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(C.ClipType.ctUnion,e,C.PolyFillType.pftNegative,C.PolyFillType.pftNegative),e.ChildCount()==1&&e.Childs()[0].ChildCount()>0){var h=e.Childs()[0];e.Childs()[0]=h.Childs()[0];for(var d=1;d<h.ChildCount();d++)e.AddChild(h.Childs()[d])}else e.Clear()}}else{var e=r[0],n=r[1];C.Clear(e),this.FixOrientations(),this.DoOffset(n);var i=new C.Clipper(0);if(i.AddPaths(this.m_destPolys,C.PolyType.ptSubject,!0),n>0)i.Execute(C.ClipType.ctUnion,e,C.PolyFillType.pftPositive,C.PolyFillType.pftPositive);else{var a=C.Clipper.GetBounds(this.m_destPolys),u=new C.Path;u.push(new C.IntPoint(a.left-10,a.bottom+10)),u.push(new C.IntPoint(a.right+10,a.bottom+10)),u.push(new C.IntPoint(a.right+10,a.top-10)),u.push(new C.IntPoint(a.left-10,a.top-10)),i.AddPath(u,C.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(C.ClipType.ctUnion,e,C.PolyFillType.pftNegative,C.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}};C.ClipperOffset.prototype.OffsetPoint=function(r,t,e){if(this.m_sinA=this.m_normals[t].X*this.m_normals[r].Y-this.m_normals[r].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[t].X*this.m_delta),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new C.IntPoint(this.m_srcPoly[r])),this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)));else switch(e){case C.JoinType.jtMiter:{var n=1+(this.m_normals[r].X*this.m_normals[t].X+this.m_normals[r].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(r,t,n):this.DoSquare(r,t);break}case C.JoinType.jtSquare:this.DoSquare(r,t);break;case C.JoinType.jtRound:this.DoRound(r,t);break}return t=r,t};C.ClipperOffset.prototype.DoSquare=function(r,t){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y)/4);this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*e)),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*e)))),this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_delta*(this.m_normals[r].X+this.m_normals[r].Y*e)),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_delta*(this.m_normals[r].Y-this.m_normals[r].X*e))))};C.ClipperOffset.prototype.DoMiter=function(r,t,e){var n=this.m_delta/e;this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+(this.m_normals[t].X+this.m_normals[r].X)*n),C.ClipperOffset.Round(this.m_srcPoly[r].Y+(this.m_normals[t].Y+this.m_normals[r].Y)*n)))};C.ClipperOffset.prototype.DoRound=function(r,t){for(var e=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[r].X+this.m_normals[t].Y*this.m_normals[r].Y),n=C.Cast_Int32(C.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),i=this.m_normals[t].X,a=this.m_normals[t].Y,u,h=0;h<n;++h)this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+i*this.m_delta),C.ClipperOffset.Round(this.m_srcPoly[r].Y+a*this.m_delta))),u=i,i=i*this.m_cos-this.m_sin*a,a=u*this.m_sin+a*this.m_cos;this.m_destPoly.push(new C.IntPoint(C.ClipperOffset.Round(this.m_srcPoly[r].X+this.m_normals[r].X*this.m_delta),C.ClipperOffset.Round(this.m_srcPoly[r].Y+this.m_normals[r].Y*this.m_delta)))};C.Error=function(r){try{throw new Error(r)}catch(t){alert(t.message)}};C.JS={};C.JS.AreaOfPolygon=function(r,t){return t||(t=1),C.Clipper.Area(r)/(t*t)};C.JS.AreaOfPolygons=function(r,t){t||(t=1);for(var e=0,n=0;n<r.length;n++)e+=C.Clipper.Area(r[n]);return e/(t*t)};C.JS.BoundsOfPath=function(r,t){return C.JS.BoundsOfPaths([r],t)};C.JS.BoundsOfPaths=function(r,t){t||(t=1);var e=C.Clipper.GetBounds(r);return e.left/=t,e.bottom/=t,e.right/=t,e.top/=t,e};C.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var e=n[0]instanceof Array,n=C.JS.Clone(n);if(typeof t!="number"||t===null)return C.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;e||(n=[n]);for(var i=n.length,a,u,h,d,m,v,x,S=[],I=0;I<i;I++)if(u=n[I],a=u.length,a!==0){if(a<3){h=u,S.push(h);continue}for(h=u,d=t*t,m=u[0],v=1,x=1;x<a;x++)(u[x].X-m.X)*(u[x].X-m.X)+(u[x].Y-m.Y)*(u[x].Y-m.Y)<=d||(h[v]=u[x],m=u[x],v++);m=u[v-1],(u[0].X-m.X)*(u[0].X-m.X)+(u[0].Y-m.Y)*(u[0].Y-m.Y)<=d&&v--,v<a&&h.splice(v,a-v),h.length&&S.push(h)}return!e&&S.length?S=S[0]:!e&&S.length===0?S=[]:e&&S.length===0&&(S=[[]]),S};C.JS.Clone=function(r){if(!(r instanceof Array))return[];if(r.length===0)return[];if(r.length==1&&r[0].length===0)return[[]];var t=r[0]instanceof Array;t||(r=[r]);var e=r.length,n,i,a,u,h=new Array(e);for(i=0;i<e;i++){for(n=r[i].length,u=new Array(n),a=0;a<n;a++)u[a]={X:r[i][a].X,Y:r[i][a].Y};h[i]=u}return t||(h=h[0]),h};C.JS.Lighten=function(r,t){if(!(r instanceof Array))return[];if(typeof t!="number"||t===null)return C.Error("Tolerance is not a number in Lighten()."),C.JS.Clone(r);if(r.length===0||r.length==1&&r[0].length===0||t<0)return C.JS.Clone(r);r[0]instanceof Array||(r=[r]);var e,n,i,a,u,h,d,m,v,x,S,I,w,E,T,D,A,L=r.length,B=t*t,j=[];for(e=0;e<L;e++)if(i=r[e],h=i.length,h!=0){for(a=0;a<1e6;a++){for(u=[],h=i.length,i[h-1].X!=i[0].X||i[h-1].Y!=i[0].Y?(I=1,i.push({X:i[0].X,Y:i[0].Y}),h=i.length):I=0,S=[],n=0;n<h-2;n++)d=i[n],v=i[n+1],m=i[n+2],D=d.X,A=d.Y,w=m.X-D,E=m.Y-A,(w!==0||E!==0)&&(T=((v.X-D)*w+(v.Y-A)*E)/(w*w+E*E),T>1?(D=m.X,A=m.Y):T>0&&(D+=w*T,A+=E*T)),w=v.X-D,E=v.Y-A,x=w*w+E*E,x<=B&&(S[n+1]=1,n++);for(u.push({X:i[0].X,Y:i[0].Y}),n=1;n<h-1;n++)S[n]||u.push({X:i[n].X,Y:i[n].Y});if(u.push({X:i[h-1].X,Y:i[h-1].Y}),I&&i.pop(),S.length)i=u;else break}h=u.length,u[h-1].X==u[0].X&&u[h-1].Y==u[0].Y&&u.pop(),u.length>2&&j.push(u)}return!r[0]instanceof Array&&(j=j[0]),typeof j>"u"&&(j=[[]]),j};C.JS.PerimeterOfPath=function(r,t,e){if(typeof r>"u")return 0;var n=Math.sqrt,i=0,a,u,h=0,d=0,m=0,v=0,x=r.length;if(x<2)return 0;for(t&&(r[x]=r[0],x++);--x;)a=r[x],h=a.X,d=a.Y,u=r[x-1],m=u.X,v=u.Y,i+=n((h-m)*(h-m)+(d-v)*(d-v));return t&&r.pop(),i/e};C.JS.PerimeterOfPaths=function(r,t,e){e||(e=1);for(var n=0,i=0;i<r.length;i++)n+=C.JS.PerimeterOfPath(r[i],t,e);return n};C.JS.ScaleDownPath=function(r,t){var e,n;for(t||(t=1),e=r.length;e--;)n=r[e],n.X=n.X/t,n.Y=n.Y/t};C.JS.ScaleDownPaths=function(r,t){var e,n,i,a=Math.round;for(t||(t=1),e=r.length;e--;)for(n=r[e].length;n--;)i=r[e][n],i.X=i.X/t,i.Y=i.Y/t};C.JS.ScaleUpPath=function(r,t){var e,n,i=Math.round;for(t||(t=1),e=r.length;e--;)n=r[e],n.X=i(n.X*t),n.Y=i(n.Y*t)};C.JS.ScaleUpPaths=function(r,t){var e,n,i,a=Math.round;for(t||(t=1),e=r.length;e--;)for(n=r[e].length;n--;)i=r[e][n],i.X=a(i.X*t),i.Y=a(i.Y*t)};C.ExPolygons=function(){return[]};C.ExPolygon=function(){this.outer=null,this.holes=null};C.JS.AddOuterPolyNodeToExPolygons=function(r,t){var e=new C.ExPolygon;e.outer=r.Contour();var n=r.Childs(),i=n.length;e.holes=new Array(i);var a,u,h,d,m,v;for(h=0;h<i;h++)for(a=n[h],e.holes[h]=a.Contour(),d=0,m=a.Childs(),v=m.length;d<v;d++)u=m[d],C.JS.AddOuterPolyNodeToExPolygons(u,t);t.push(e)};C.JS.ExPolygonsToPaths=function(r){var t,e,n,i,a=new C.Paths;for(t=0,n=r.length;t<n;t++)for(a.push(r[t].outer),e=0,i=r[t].holes.length;e<i;e++)a.push(r[t].holes[e]);return a};C.JS.PolyTreeToExPolygons=function(r){var t=new C.ExPolygons,e,n,i,a;for(n=0,i=r.Childs(),a=i.length;n<a;n++)e=i[n],C.JS.AddOuterPolyNodeToExPolygons(e,t);return t};jy.exports=C});var oL=Lt((BVt,x2)=>{y();(function(){"use strict";function r(u,h){var d=u.x-h.x,m=u.y-h.y;return d*d+m*m}l(r,"getSqDist");function t(u,h,d){var m=h.x,v=h.y,x=d.x-m,S=d.y-v;if(x!==0||S!==0){var I=((u.x-m)*x+(u.y-v)*S)/(x*x+S*S);I>1?(m=d.x,v=d.y):I>0&&(m+=x*I,v+=S*I)}return x=u.x-m,S=u.y-v,x*x+S*S}l(t,"getSqSegDist");function e(u,h){for(var d=u[0],m=[d],v,x=1,S=u.length;x<S;x++)v=u[x],r(v,d)>h&&(m.push(v),d=v);return d!==v&&m.push(v),m}l(e,"simplifyRadialDist");function n(u,h,d,m,v){for(var x=m,S,I=h+1;I<d;I++){var w=t(u[I],u[h],u[d]);w>x&&(S=I,x=w)}x>m&&(S-h>1&&n(u,h,S,m,v),v.push(u[S]),d-S>1&&n(u,S,d,m,v))}l(n,"simplifyDPStep");function i(u,h){var d=u.length-1,m=[u[0]];return n(u,0,d,h,m),m.push(u[d]),m}l(i,"simplifyDouglasPeucker");function a(u,h,d){if(u.length<=2)return u;var m=h!==void 0?h*h:1;return u=d?u:e(u,m),u=i(u,m),u}l(a,"simplify"),typeof define=="function"&&define.amd?define(function(){return a}):typeof x2<"u"?(x2.exports=a,x2.exports.default=a):typeof self<"u"?self.simplify=a:window.simplify=a})()});y();y();var d_=class d_{constructor(t){b(this,"id");this.id=t}};l(d_,"BaseMetaData");var si=d_;y();y();var vp=class vp{constructor(t,e,n){b(this,"__type",vp.__type);b(this,"id",Mr());b(this,"latitude");b(this,"longitude");b(this,"floorId");b(this,"verticalOffset");var i;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(i=t.verticalOffset)!=null?i:0;else{if(e==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=e,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===vp.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{__type:vp.__type,latitude:this.latitude,longitude:this.longitude,floorId:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};l(vp,"Coordinate"),b(vp,"__type","coordinate");var m_=vp,ve=m_;y();y();y();function Mn(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}l(Mn,"getCoord");function Hr(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}l(Hr,"getCoords");function g_(r,t,e){if(!r)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+r.geometry.type)}l(g_,"featureOf");function Qn(r){return r.type==="Feature"?r.geometry:r}l(Qn,"getGeom");function os(r,t){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}l(os,"getType");var cA=$r(nv(),1);y();var xA=$r(BP(),1);y();y();function cn(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=Mn(r),i=Qn(t),a=i.type,u=t.bbox,h=i.coordinates;if(u&&_A(n,u)===!1)return!1;a==="Polygon"&&(h=[h]);for(var d=!1,m=0;m<h.length&&!d;m++)if(GP(n,h[m][0],e.ignoreBoundary)){for(var v=!1,x=1;x<h[m].length&&!v;)GP(n,h[m][x],!e.ignoreBoundary)&&(v=!0),x++;v||(d=!0)}return d}l(cn,"booleanPointInPolygon");function GP(r,t,e){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,a=t.length-1;i<t.length;a=i++){var u=t[i][0],h=t[i][1],d=t[a][0],m=t[a][1],v=r[1]*(u-d)+h*(d-r[0])+m*(r[0]-u)===0&&(u-r[0])*(d-r[0])<=0&&(h-r[1])*(m-r[1])<=0;if(v)return!e;var x=h>r[1]!=m>r[1]&&r[0]<(d-u)*(r[1]-h)/(m-h)+u;x&&(n=!n)}return n}l(GP,"inRing");function _A(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}l(_A,"inBBox");y();y();function CA(r,t,e){e===void 0&&(e={});var n=Mn(r),i=Mn(t),a=Si(i[1]-n[1]),u=Si(i[0]-n[0]),h=Si(n[1]),d=Si(i[1]),m=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(h)*Math.cos(d);return q0(2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m)),e.units)}l(CA,"distance");var bn=CA;y();var q$=function(){function r(t,e,n){this.a=t,this.b=e,this.c=n;var i=e.x-t.x,a=e.y-t.y,u=n.x-t.x,h=n.y-t.y,d=i*(t.x+e.x)+a*(t.y+e.y),m=u*(t.x+n.x)+h*(t.y+n.y),v=2*(i*(n.y-e.y)-a*(n.x-e.x)),x,S;this.x=(h*d-a*m)/v,this.y=(i*m-u*d)/v,x=this.x-t.x,S=this.y-t.y,this.r=x*x+S*S}return l(r,"Triangle"),r}();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();y();var jP=new ArrayBuffer(16),kK=new Float64Array(jP),RK=new Uint32Array(jP);y();y();y();y();y();y();var FA=$r(O_(),1);y();y();y();y();y();var Xtt=function(){function r(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var n=this.points[e],i=this.points[e+1];this.centers.push({x:(n.x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var a=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,u=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+a),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+u),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+a),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+u),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return l(r,"Spline"),r.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var i=0;i<this.duration;i+=10){var a=this.pos(i),u=Math.sqrt((a.x-n.x)*(a.x-n.x)+(a.y-n.y)*(a.y-n.y)+(a.z-n.z)*(a.z-n.z));u>t&&(e.push(i),n=a)}return e},r.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},r.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*n),a=(this.length-1)*n-i;return BA(a,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},r}();function BA(r,t,e,n,i){var a=GA(r),u={x:i.x*a[0]+n.x*a[1]+e.x*a[2]+t.x*a[3],y:i.y*a[0]+n.y*a[1]+e.y*a[2]+t.y*a[3],z:i.z*a[0]+n.z*a[1]+e.z*a[2]+t.z*a[3]};return u}l(BA,"bezier");function GA(r){var t=r*r,e=t*r;return[e,3*t*(1-r),3*r*(1-r)*(1-r),(1-r)*(1-r)*(1-r)]}l(GA,"B");y();y();y();y();function vg(r,t){t===void 0&&(t={});var e=Number(r[0]),n=Number(r[1]),i=Number(r[2]),a=Number(r[3]);if(r.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var u=[e,n],h=[e,a],d=[i,a],m=[i,n];return zr([[u,m,d,h,u]],t.properties,{bbox:r,id:t.id})}l(vg,"bboxPolygon");function VA(r){return vg(Kn(r))}l(VA,"envelope");var D_=VA;y();y();y();function ss(r,t,e,n){n===void 0&&(n={});var i=Mn(r),a=Si(i[0]),u=Si(i[1]),h=Si(e),d=W0(t,n.units),m=Math.asin(Math.sin(u)*Math.cos(d)+Math.cos(u)*Math.sin(d)*Math.cos(h)),v=a+Math.atan2(Math.sin(h)*Math.sin(d)*Math.cos(u),Math.cos(d)-Math.sin(u)*Math.sin(m)),x=mp(v),S=mp(m);return kr([x,S],n.properties)}l(ss,"destination");y();y();function Yl(r,t,e){if(e===void 0&&(e={}),e.final===!0)return jA(r,t);var n=Mn(r),i=Mn(t),a=Si(n[0]),u=Si(i[0]),h=Si(n[1]),d=Si(i[1]),m=Math.sin(u-a)*Math.cos(d),v=Math.cos(h)*Math.sin(d)-Math.sin(h)*Math.cos(d)*Math.cos(u-a);return mp(Math.atan2(m,v))}l(Yl,"bearing");function jA(r,t){var e=Yl(t,r);return e=(e+180)%360,e}l(jA,"calculateFinalBearing");y();function UA(r,t){t===void 0&&(t={});var e=Kn(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return kr([n,i],t.properties,t)}l(UA,"center");var qa=UA;y();y();y();y();y();var HA=$r(iA(),1);y();y();y();y();function XA(r){if(!r)throw new Error("geojson is required");var t=[];return oi(r,function(e){YA(e,t)}),we(t)}l(XA,"lineSegment");function YA(r,t){var e=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":e=Hr(n);break;case"LineString":e=[Hr(n)]}e.forEach(function(i){var a=qA(i,r.properties);a.forEach(function(u){u.id=t.length,t.push(u)})})}}l(YA,"lineSegmentFeature");function qA(r,t){var e=[];return r.reduce(function(n,i){var a=Dn([n,i],t);return a.bbox=WA(n,i),e.push(a),i}),e}l(qA,"createSegments");function WA(r,t){var e=r[0],n=r[1],i=t[0],a=t[1],u=e<i?e:i,h=n<a?n:a,d=e>i?e:i,m=n>a?n:a;return[u,h,d,m]}l(WA,"bbox");var xp=XA;var lE=$r(mv(),1);function _N(r,t){var e={},n=[];if(r.type==="LineString"&&(r=Xa(r)),t.type==="LineString"&&(t=Xa(t)),r.type==="Feature"&&t.type==="Feature"&&r.geometry!==null&&t.geometry!==null&&r.geometry.type==="LineString"&&t.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var i=aE(r,t);return i&&n.push(i),we(n)}var a=(0,lE.default)();return a.load(xp(t)),nn(xp(r),function(u){nn(a.search(u),function(h){var d=aE(u,h);if(d){var m=Hr(d).join(",");e[m]||(e[m]=!0,n.push(d))}})}),we(n)}l(_N,"lineIntersect");function aE(r,t){var e=Hr(r),n=Hr(t);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=e[0][0],a=e[0][1],u=e[1][0],h=e[1][1],d=n[0][0],m=n[0][1],v=n[1][0],x=n[1][1],S=(x-m)*(u-i)-(v-d)*(h-a),I=(v-d)*(a-m)-(x-m)*(i-d),w=(u-i)*(a-m)-(h-a)*(i-d);if(S===0)return null;var E=I/S,T=w/S;if(E>=0&&E<=1&&T>=0&&T<=1){var D=i+E*(u-i),A=a+E*(h-a);return kr([D,A])}return null}l(aE,"intersects");var Za=_N;function CN(r,t,e){e===void 0&&(e={});var n=kr([1/0,1/0],{dist:1/0}),i=0;return oi(r,function(a){for(var u=Hr(a),h=0;h<u.length-1;h++){var d=kr(u[h]);d.properties.dist=bn(t,d,e);var m=kr(u[h+1]);m.properties.dist=bn(t,m,e);var v=bn(d,m,e),x=Math.max(d.properties.dist,m.properties.dist),S=Yl(d,m),I=ss(t,x,S+90,e),w=ss(t,x,S-90,e),E=Za(Dn([I.geometry.coordinates,w.geometry.coordinates]),Dn([d.geometry.coordinates,m.geometry.coordinates])),T=null;E.features.length>0&&(T=E.features[0],T.properties.dist=bn(t,T,e),T.properties.location=i+bn(d,T,e)),d.properties.dist<n.properties.dist&&(n=d,n.properties.index=h,n.properties.location=i),m.properties.dist<n.properties.dist&&(n=m,n.properties.index=h+1,n.properties.location=i+v),T&&T.properties.dist<n.properties.dist&&(n=T,n.properties.index=h),i+=v}}),n}l(CN,"nearestPointOnLine");var ql=CN;y();y();y();var IN=$r(nv(),1);y();y();y();y();y();y();function _p(r,t){return t===void 0&&(t={}),rP(r,function(e,n){var i=n.geometry.coordinates;return e+bn(i[0],i[1],t)},0)}l(_p,"length");y();function MN(r,t,e){var n=Hr(e);if(os(e)!=="LineString")throw new Error("line must be a LineString");var i=ql(e,r),a=ql(e,t),u;i.properties.index<=a.properties.index?u=[i,a]:u=[a,i];for(var h=[u[0].geometry.coordinates],d=u[0].properties.index+1;d<u[1].properties.index+1;d++)h.push(n[d]);return h.push(u[1].geometry.coordinates),Dn(h,e.properties)}l(MN,"lineSlice");var yv=MN;y();y();y();y();function TN(r,t,e){e===void 0&&(e={});for(var n=Mn(r),i=Hr(t),a=0;a<i.length-1;a++){var u=!1;if(e.ignoreEndVertices&&(a===0&&(u="start"),a===i.length-2&&(u="end"),a===0&&a+1===i.length-1&&(u="both")),wN(i[a],i[a+1],n,u,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}l(TN,"booleanPointOnLine");function wN(r,t,e,n,i){var a=e[0],u=e[1],h=r[0],d=r[1],m=t[0],v=t[1],x=e[0]-h,S=e[1]-d,I=m-h,w=v-d,E=x*w-S*I;if(i!==null){if(Math.abs(E)>i)return!1}else if(E!==0)return!1;if(n){if(n==="start")return Math.abs(I)>=Math.abs(w)?I>0?h<a&&a<=m:m<=a&&a<h:w>0?d<u&&u<=v:v<=u&&u<d;if(n==="end")return Math.abs(I)>=Math.abs(w)?I>0?h<=a&&a<m:m<a&&a<=h:w>0?d<=u&&u<v:v<u&&u<=d;if(n==="both")return Math.abs(I)>=Math.abs(w)?I>0?h<a&&a<m:m<a&&a<h:w>0?d<u&&u<v:v<u&&u<d}else return Math.abs(I)>=Math.abs(w)?I>0?h<=a&&a<=m:m<=a&&a<=h:w>0?d<=u&&u<=v:v<=u&&u<=d;return!1}l(wN,"isPointOnLineSegment");var ed=TN;y();y();y();y();var ON=$r(O_(),1);y();var hE=Math.PI/180,fE=180/Math.PI,xg=l(function(r,t){this.lon=r,this.lat=t,this.x=hE*r,this.y=hE*t},"Coord");xg.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};xg.prototype.antipode=function(){var r=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new xg(t,r)};var dE=l(function(){this.coords=[],this.length=0},"LineString");dE.prototype.move_to=function(r){this.length++,this.coords.push(r)};var X_=l(function(r){this.properties=r||{},this.geometries=[]},"Arc");X_.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var r=[],t=0;t<this.geometries.length;t++)r.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:r},type:"Feature",properties:this.properties}};X_.prototype.wkt=function(){for(var r="",t="LINESTRING(",e=l(function(a){t+=a[0]+" "+a[1]+","},"collect"),n=0;n<this.geometries.length;n++){if(this.geometries[n].coords.length===0)return"LINESTRING(empty)";var i=this.geometries[n].coords;i.forEach(e),r+=t.substring(0,t.length-1)+")"}return r};var mE=l(function(r,t,e){if(!r||r.x===void 0||r.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new xg(r.x,r.y),this.end=new xg(t.x,t.y),this.properties=e||{};var n=this.start.x-this.end.x,i=this.start.y-this.end.y,a=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(n/2),2);if(this.g=2*Math.asin(Math.sqrt(a)),this.g===Math.PI)throw new Error("it appears "+r.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+r+" and "+t)},"GreatCircle");mE.prototype.interpolate=function(r){var t=Math.sin((1-r)*this.g)/Math.sin(this.g),e=Math.sin(r*this.g)/Math.sin(this.g),n=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),i=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),a=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),u=fE*Math.atan2(a,Math.sqrt(Math.pow(n,2)+Math.pow(i,2))),h=fE*Math.atan2(i,n);return[h,u]};mE.prototype.Arc=function(r,t){var e=[];if(!r||r<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var n=1/(r-1),i=0;i<r;++i){var a=n*i,u=this.interpolate(a);e.push(u)}for(var h=!1,d=0,m=t&&t.offset?t.offset:10,v=180-m,x=-180+m,S=360-m,I=1;I<e.length;++I){var w=e[I-1][0],E=e[I][0],T=Math.abs(E-w);T>S&&(E>v&&w<x||w>v&&E<x)?h=!0:T>d&&(d=T)}var D=[];if(h&&d<m){var A=[];D.push(A);for(var L=0;L<e.length;++L){var B=parseFloat(e[L][0]);if(L>0&&Math.abs(B-e[L-1][0])>S){var j=parseFloat(e[L-1][0]),W=parseFloat(e[L-1][1]),$=parseFloat(e[L][0]),F=parseFloat(e[L][1]);if(j>-180&&j<x&&$===180&&L+1<e.length&&e[L-1][0]>-180&&e[L-1][0]<x){A.push([-180,e[L][1]]),L++,A.push([e[L][0],e[L][1]]);continue}else if(j>v&&j<180&&$===-180&&L+1<e.length&&e[L-1][0]>v&&e[L-1][0]<180){A.push([180,e[L][1]]),L++,A.push([e[L][0],e[L][1]]);continue}if(j<x&&$>v){var J=j;j=$,$=J;var ot=W;W=F,F=ot}if(j>v&&$<x&&($+=360),j<=180&&$>=180&&j<$){var K=(180-j)/($-j),H=K*F+(1-K)*W;A.push([e[L-1][0]>v?180:-180,H]),A=[],A.push([e[L-1][0]>v?-180:180,H]),D.push(A)}else A=[],D.push(A);A.push([B,e[L][1]])}else A.push([e[L][0],e[L][1]])}}else{var _t=[];D.push(_t);for(var ct=0;ct<e.length;++ct)_t.push([e[ct][0],e[ct][1]])}for(var ft=new X_(this.properties),mt=0;mt<D.length;++mt){var St=new dE;ft.geometries.push(St);for(var dt=D[mt],xt=0;xt<dt.length;++xt)St.move_to(dt[xt])}return ft};y();var AN=$r(mv(),1);y();y();function Cp(r,t){t===void 0&&(t={});var e=Qn(r);switch(!t.properties&&r.type==="Feature"&&(t.properties=r.properties),e.type){case"Polygon":return yE(e,t);case"MultiPolygon":return NN(e,t);default:throw new Error("invalid poly")}}l(Cp,"default");function yE(r,t){t===void 0&&(t={});var e=Qn(r),n=e.coordinates,i=t.properties?t.properties:r.type==="Feature"?r.properties:{};return vE(n,i)}l(yE,"polygonToLine");function NN(r,t){t===void 0&&(t={});var e=Qn(r),n=e.coordinates,i=t.properties?t.properties:r.type==="Feature"?r.properties:{},a=[];return n.forEach(function(u){a.push(vE(u,i))}),we(a)}l(NN,"multiPolygonToLine");function vE(r,t){return r.length>1?zf(r,t):Dn(r[0],t)}l(vE,"coordsToLine");y();y();y();y();var AR=$r(mv(),1);var NR=$r(bC(),1);y();y();y();y();y();y();y();var FR=$r(nv(),1);var Pe=[],Ee=[],Oe=[],De=[],Le=[],Ae=[],Ne=[],ke=[],Re=[],Fe=[],Be=[],Ge=[],Ve=[],je=[],Ue=[],ze=[],He=[],Xe=[],Ye=[],qe=[],We=[],Ze=[],$e=[],Je=[];Ne[85]=Fe[85]=-1;ke[85]=Be[85]=0;Re[85]=Ge[85]=1;Ye[85]=Ze[85]=1;qe[85]=$e[85]=0;We[85]=Je[85]=1;Pe[85]=De[85]=0;Ee[85]=Le[85]=-1;Oe[85]=Ue[85]=0;ze[85]=Ve[85]=0;He[85]=je[85]=1;Ae[85]=Xe[85]=1;Ze[1]=Ze[169]=0;$e[1]=$e[169]=-1;Je[1]=Je[169]=0;Ve[1]=Ve[169]=-1;je[1]=je[169]=0;Ue[1]=Ue[169]=0;Fe[4]=Fe[166]=0;Be[4]=Be[166]=-1;Ge[4]=Ge[166]=1;ze[4]=ze[166]=1;He[4]=He[166]=0;Xe[4]=Xe[166]=0;Ne[16]=Ne[154]=0;ke[16]=ke[154]=1;Re[16]=Re[154]=1;De[16]=De[154]=1;Le[16]=Le[154]=0;Ae[16]=Ae[154]=1;Ye[64]=Ye[106]=0;qe[64]=qe[106]=1;We[64]=We[106]=0;Pe[64]=Pe[106]=-1;Ee[64]=Ee[106]=0;Oe[64]=Oe[106]=1;Ye[2]=Ye[168]=0;qe[2]=qe[168]=-1;We[2]=We[168]=1;Ze[2]=Ze[168]=0;$e[2]=$e[168]=-1;Je[2]=Je[168]=0;Ve[2]=Ve[168]=-1;je[2]=je[168]=0;Ue[2]=Ue[168]=0;ze[2]=ze[168]=-1;He[2]=He[168]=0;Xe[2]=Xe[168]=1;Ne[8]=Ne[162]=0;ke[8]=ke[162]=-1;Re[8]=Re[162]=0;Fe[8]=Fe[162]=0;Be[8]=Be[162]=-1;Ge[8]=Ge[162]=1;Ve[8]=Ve[162]=1;je[8]=je[162]=0;Ue[8]=Ue[162]=1;ze[8]=ze[162]=1;He[8]=He[162]=0;Xe[8]=Xe[162]=0;Ne[32]=Ne[138]=0;ke[32]=ke[138]=1;Re[32]=Re[138]=1;Fe[32]=Fe[138]=0;Be[32]=Be[138]=1;Ge[32]=Ge[138]=0;Pe[32]=Pe[138]=1;Ee[32]=Ee[138]=0;Oe[32]=Oe[138]=0;De[32]=De[138]=1;Le[32]=Le[138]=0;Ae[32]=Ae[138]=1;Ze[128]=Ze[42]=0;$e[128]=$e[42]=1;Je[128]=Je[42]=1;Ye[128]=Ye[42]=0;qe[128]=qe[42]=1;We[128]=We[42]=0;Pe[128]=Pe[42]=-1;Ee[128]=Ee[42]=0;Oe[128]=Oe[42]=1;De[128]=De[42]=-1;Le[128]=Le[42]=0;Ae[128]=Ae[42]=0;Fe[5]=Fe[165]=-1;Be[5]=Be[165]=0;Ge[5]=Ge[165]=0;Ze[5]=Ze[165]=1;$e[5]=$e[165]=0;Je[5]=Je[165]=0;ze[20]=ze[150]=0;He[20]=He[150]=1;Xe[20]=Xe[150]=1;De[20]=De[150]=0;Le[20]=Le[150]=-1;Ae[20]=Ae[150]=1;Ne[80]=Ne[90]=-1;ke[80]=ke[90]=0;Re[80]=Re[90]=1;Ye[80]=Ye[90]=1;qe[80]=qe[90]=0;We[80]=We[90]=1;Ve[65]=Ve[105]=0;je[65]=je[105]=1;Ue[65]=Ue[105]=0;Pe[65]=Pe[105]=0;Ee[65]=Ee[105]=-1;Oe[65]=Oe[105]=0;Ne[160]=Ne[10]=-1;ke[160]=ke[10]=0;Re[160]=Re[10]=1;Fe[160]=Fe[10]=-1;Be[160]=Be[10]=0;Ge[160]=Ge[10]=0;Ze[160]=Ze[10]=1;$e[160]=$e[10]=0;Je[160]=Je[10]=0;Ye[160]=Ye[10]=1;qe[160]=qe[10]=0;We[160]=We[10]=1;ze[130]=ze[40]=0;He[130]=He[40]=1;Xe[130]=Xe[40]=1;Ve[130]=Ve[40]=0;je[130]=je[40]=1;Ue[130]=Ue[40]=0;Pe[130]=Pe[40]=0;Ee[130]=Ee[40]=-1;Oe[130]=Oe[40]=0;De[130]=De[40]=0;Le[130]=Le[40]=-1;Ae[130]=Ae[40]=1;Fe[37]=Fe[133]=0;Be[37]=Be[133]=1;Ge[37]=Ge[133]=1;Ze[37]=Ze[133]=0;$e[37]=$e[133]=1;Je[37]=Je[133]=0;Pe[37]=Pe[133]=-1;Ee[37]=Ee[133]=0;Oe[37]=Oe[133]=0;De[37]=De[133]=1;Le[37]=Le[133]=0;Ae[37]=Ae[133]=0;ze[148]=ze[22]=-1;He[148]=He[22]=0;Xe[148]=Xe[22]=0;Ze[148]=Ze[22]=0;$e[148]=$e[22]=-1;Je[148]=Je[22]=1;Ye[148]=Ye[22]=0;qe[148]=qe[22]=1;We[148]=We[22]=1;De[148]=De[22]=-1;Le[148]=Le[22]=0;Ae[148]=Ae[22]=1;Ne[82]=Ne[88]=0;ke[82]=ke[88]=-1;Re[82]=Re[88]=1;ze[82]=ze[88]=1;He[82]=He[88]=0;Xe[82]=Xe[88]=1;Ve[82]=Ve[88]=-1;je[82]=je[88]=0;Ue[82]=Ue[88]=1;Ye[82]=Ye[88]=0;qe[82]=qe[88]=-1;We[82]=We[88]=0;Ne[73]=Ne[97]=0;ke[73]=ke[97]=1;Re[73]=Re[97]=0;Fe[73]=Fe[97]=0;Be[73]=Be[97]=-1;Ge[73]=Ge[97]=0;Ve[73]=Ve[97]=1;je[73]=je[97]=0;Ue[73]=Ue[97]=0;Pe[73]=Pe[97]=1;Ee[73]=Ee[97]=0;Oe[73]=Oe[97]=1;Ne[145]=Ne[25]=0;ke[145]=ke[25]=-1;Re[145]=Re[25]=0;Ve[145]=Ve[25]=1;je[145]=je[25]=0;Ue[145]=Ue[25]=1;Ze[145]=Ze[25]=0;$e[145]=$e[25]=1;Je[145]=Je[25]=1;De[145]=De[25]=-1;Le[145]=Le[25]=0;Ae[145]=Ae[25]=0;Fe[70]=Fe[100]=0;Be[70]=Be[100]=1;Ge[70]=Ge[100]=0;ze[70]=ze[100]=-1;He[70]=He[100]=0;Xe[70]=Xe[100]=1;Ye[70]=Ye[100]=0;qe[70]=qe[100]=-1;We[70]=We[100]=1;Pe[70]=Pe[100]=1;Ee[70]=Ee[100]=0;Oe[70]=Oe[100]=0;Fe[101]=Fe[69]=0;Be[101]=Be[69]=1;Ge[101]=Ge[69]=0;Pe[101]=Pe[69]=1;Ee[101]=Ee[69]=0;Oe[101]=Oe[69]=0;Ze[149]=Ze[21]=0;$e[149]=$e[21]=1;Je[149]=Je[21]=1;De[149]=De[21]=-1;Le[149]=Le[21]=0;Ae[149]=Ae[21]=0;ze[86]=ze[84]=-1;He[86]=He[84]=0;Xe[86]=Xe[84]=1;Ye[86]=Ye[84]=0;qe[86]=qe[84]=-1;We[86]=We[84]=1;Ne[89]=Ne[81]=0;ke[89]=ke[81]=-1;Re[89]=Re[81]=0;Ve[89]=Ve[81]=1;je[89]=je[81]=0;Ue[89]=Ue[81]=1;Ne[96]=Ne[74]=0;ke[96]=ke[74]=1;Re[96]=Re[74]=0;Fe[96]=Fe[74]=-1;Be[96]=Be[74]=0;Ge[96]=Ge[74]=1;Ye[96]=Ye[74]=1;qe[96]=qe[74]=0;We[96]=We[74]=0;Pe[96]=Pe[74]=1;Ee[96]=Ee[74]=0;Oe[96]=Oe[74]=1;Ne[24]=Ne[146]=0;ke[24]=ke[146]=-1;Re[24]=Re[146]=1;ze[24]=ze[146]=1;He[24]=He[146]=0;Xe[24]=Xe[146]=1;Ve[24]=Ve[146]=0;je[24]=je[146]=1;Ue[24]=Ue[146]=1;De[24]=De[146]=0;Le[24]=Le[146]=-1;Ae[24]=Ae[146]=0;Fe[6]=Fe[164]=-1;Be[6]=Be[164]=0;Ge[6]=Ge[164]=1;ze[6]=ze[164]=-1;He[6]=He[164]=0;Xe[6]=Xe[164]=0;Ze[6]=Ze[164]=0;$e[6]=$e[164]=-1;Je[6]=Je[164]=1;Ye[6]=Ye[164]=1;qe[6]=qe[164]=0;We[6]=We[164]=0;Ve[129]=Ve[41]=0;je[129]=je[41]=1;Ue[129]=Ue[41]=1;Ze[129]=Ze[41]=0;$e[129]=$e[41]=1;Je[129]=Je[41]=0;Pe[129]=Pe[41]=-1;Ee[129]=Ee[41]=0;Oe[129]=Oe[41]=0;De[129]=De[41]=0;Le[129]=Le[41]=-1;Ae[129]=Ae[41]=0;ze[66]=ze[104]=0;He[66]=He[104]=1;Xe[66]=Xe[104]=0;Ve[66]=Ve[104]=-1;je[66]=je[104]=0;Ue[66]=Ue[104]=1;Ye[66]=Ye[104]=0;qe[66]=qe[104]=-1;We[66]=We[104]=0;Pe[66]=Pe[104]=0;Ee[66]=Ee[104]=-1;Oe[66]=Oe[104]=1;Ne[144]=Ne[26]=-1;ke[144]=ke[26]=0;Re[144]=Re[26]=0;Ze[144]=Ze[26]=1;$e[144]=$e[26]=0;Je[144]=Je[26]=1;Ye[144]=Ye[26]=0;qe[144]=qe[26]=1;We[144]=We[26]=1;De[144]=De[26]=-1;Le[144]=Le[26]=0;Ae[144]=Ae[26]=1;Fe[36]=Fe[134]=0;Be[36]=Be[134]=1;Ge[36]=Ge[134]=1;ze[36]=ze[134]=0;He[36]=He[134]=1;Xe[36]=Xe[134]=0;Pe[36]=Pe[134]=0;Ee[36]=Ee[134]=-1;Oe[36]=Oe[134]=1;De[36]=De[134]=1;Le[36]=Le[134]=0;Ae[36]=Ae[134]=0;Ne[9]=Ne[161]=-1;ke[9]=ke[161]=0;Re[9]=Re[161]=0;Fe[9]=Fe[161]=0;Be[9]=Be[161]=-1;Ge[9]=Ge[161]=0;Ve[9]=Ve[161]=1;je[9]=je[161]=0;Ue[9]=Ue[161]=0;Ze[9]=Ze[161]=1;$e[9]=$e[161]=0;Je[9]=Je[161]=1;Ne[136]=0;ke[136]=1;Re[136]=1;Fe[136]=0;Be[136]=1;Ge[136]=0;ze[136]=-1;He[136]=0;Xe[136]=1;Ve[136]=-1;je[136]=0;Ue[136]=0;Ze[136]=0;$e[136]=-1;Je[136]=0;Ye[136]=0;qe[136]=-1;We[136]=1;Pe[136]=1;Ee[136]=0;Oe[136]=0;De[136]=1;Le[136]=0;Ae[136]=1;Ne[34]=0;ke[34]=-1;Re[34]=0;Fe[34]=0;Be[34]=-1;Ge[34]=1;ze[34]=1;He[34]=0;Xe[34]=0;Ve[34]=1;je[34]=0;Ue[34]=1;Ze[34]=0;$e[34]=1;Je[34]=1;Ye[34]=0;qe[34]=1;We[34]=0;Pe[34]=-1;Ee[34]=0;Oe[34]=1;De[34]=-1;Le[34]=0;Ae[34]=0;Ne[35]=0;ke[35]=1;Re[35]=1;Fe[35]=0;Be[35]=-1;Ge[35]=1;ze[35]=1;He[35]=0;Xe[35]=0;Ve[35]=-1;je[35]=0;Ue[35]=0;Ze[35]=0;$e[35]=-1;Je[35]=0;Ye[35]=0;qe[35]=1;We[35]=0;Pe[35]=-1;Ee[35]=0;Oe[35]=1;De[35]=1;Le[35]=0;Ae[35]=1;Ne[153]=0;ke[153]=1;Re[153]=1;Ve[153]=-1;je[153]=0;Ue[153]=0;Ze[153]=0;$e[153]=-1;Je[153]=0;De[153]=1;Le[153]=0;Ae[153]=1;Fe[102]=0;Be[102]=-1;Ge[102]=1;ze[102]=1;He[102]=0;Xe[102]=0;Ye[102]=0;qe[102]=1;We[102]=0;Pe[102]=-1;Ee[102]=0;Oe[102]=1;Ne[155]=0;ke[155]=-1;Re[155]=0;Ve[155]=1;je[155]=0;Ue[155]=1;Ze[155]=0;$e[155]=1;Je[155]=1;De[155]=-1;Le[155]=0;Ae[155]=0;Fe[103]=0;Be[103]=1;Ge[103]=0;ze[103]=-1;He[103]=0;Xe[103]=1;Ye[103]=0;qe[103]=-1;We[103]=1;Pe[103]=1;Ee[103]=0;Oe[103]=0;Ne[152]=0;ke[152]=1;Re[152]=1;ze[152]=-1;He[152]=0;Xe[152]=1;Ve[152]=-1;je[152]=0;Ue[152]=0;Ze[152]=0;$e[152]=-1;Je[152]=0;Ye[152]=0;qe[152]=-1;We[152]=1;De[152]=1;Le[152]=0;Ae[152]=1;Ne[156]=0;ke[156]=-1;Re[156]=1;ze[156]=1;He[156]=0;Xe[156]=1;Ve[156]=-1;je[156]=0;Ue[156]=0;Ze[156]=0;$e[156]=-1;Je[156]=0;Ye[156]=0;qe[156]=1;We[156]=1;De[156]=-1;Le[156]=0;Ae[156]=1;Ne[137]=0;ke[137]=1;Re[137]=1;Fe[137]=0;Be[137]=1;Ge[137]=0;Ve[137]=-1;je[137]=0;Ue[137]=0;Ze[137]=0;$e[137]=-1;Je[137]=0;Pe[137]=1;Ee[137]=0;Oe[137]=0;De[137]=1;Le[137]=0;Ae[137]=1;Ne[139]=0;ke[139]=1;Re[139]=1;Fe[139]=0;Be[139]=-1;Ge[139]=0;Ve[139]=1;je[139]=0;Ue[139]=0;Ze[139]=0;$e[139]=1;Je[139]=0;Pe[139]=-1;Ee[139]=0;Oe[139]=0;De[139]=1;Le[139]=0;Ae[139]=1;Ne[98]=0;ke[98]=-1;Re[98]=0;Fe[98]=0;Be[98]=-1;Ge[98]=1;ze[98]=1;He[98]=0;Xe[98]=0;Ve[98]=1;je[98]=0;Ue[98]=1;Ye[98]=0;qe[98]=1;We[98]=0;Pe[98]=-1;Ee[98]=0;Oe[98]=1;Ne[99]=0;ke[99]=1;Re[99]=0;Fe[99]=0;Be[99]=-1;Ge[99]=1;ze[99]=1;He[99]=0;Xe[99]=0;Ve[99]=-1;je[99]=0;Ue[99]=1;Ye[99]=0;qe[99]=-1;We[99]=0;Pe[99]=1;Ee[99]=0;Oe[99]=1;Fe[38]=0;Be[38]=-1;Ge[38]=1;ze[38]=1;He[38]=0;Xe[38]=0;Ze[38]=0;$e[38]=1;Je[38]=1;Ye[38]=0;qe[38]=1;We[38]=0;Pe[38]=-1;Ee[38]=0;Oe[38]=1;De[38]=-1;Le[38]=0;Ae[38]=0;Fe[39]=0;Be[39]=1;Ge[39]=1;ze[39]=-1;He[39]=0;Xe[39]=0;Ze[39]=0;$e[39]=-1;Je[39]=1;Ye[39]=0;qe[39]=1;We[39]=0;Pe[39]=-1;Ee[39]=0;Oe[39]=1;De[39]=1;Le[39]=0;Ae[39]=0;var xC=l(function(r){return[[r.bottomleft,0],[0,0],[0,r.leftbottom]]},"p00"),_C=l(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0]]},"p01"),CC=l(function(r){return[[r.topright,1],[1,1],[1,r.righttop]]},"p02"),SC=l(function(r){return[[0,r.lefttop],[0,1],[r.topleft,1]]},"p03"),IC=l(function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop]]},"p04"),MC=l(function(r){return[[r.bottomright,0],[r.bottomleft,0],[1,r.righttop],[1,r.rightbottom]]},"p05"),TC=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.topleft,1],[r.topright,1]]},"p06"),wC=l(function(r){return[[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},"p07"),BR=l(function(r){return[[0,0],[0,r.leftbottom],[1,r.rightbottom],[1,0]]},"p08"),GR=l(function(r){return[[1,0],[r.bottomright,0],[r.topright,1],[1,1]]},"p09"),VR=l(function(r){return[[1,1],[1,r.righttop],[0,r.lefttop],[0,1]]},"p10"),jR=l(function(r){return[[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},"p11"),UR=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.leftbottom],[0,r.lefttop]]},"p12"),zR=l(function(r){return[[r.topleft,1],[r.topright,1],[r.bottomright,0],[r.bottomleft,0]]},"p13"),HR=l(function(){return[[0,0],[0,1],[1,1],[1,0]]},"p14"),XR=l(function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,1],[r.topleft,1]]},"p15"),YR=l(function(r){return[[r.topright,1],[1,1],[1,0],[0,0],[0,r.leftbottom]]},"p16"),qR=l(function(r){return[[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[1,1]]},"p17"),WR=l(function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,1]]},"p18"),ZR=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[0,r.lefttop],[0,1],[r.topleft,1]]},"p19"),$R=l(function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[r.topright,1]]},"p20"),JR=l(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop]]},"p21"),KR=l(function(r){return[[r.topright,1],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1]]},"p22"),QR=l(function(r){return[[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p23"),tF=l(function(r){return[[1,1],[1,r.righttop],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},"p24"),eF=l(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[r.topleft,1],[r.topright,1]]},"p25"),rF=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom]]},"p26"),nF=l(function(r){return[[1,r.rightbottom],[1,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},"p27"),iF=l(function(r){return[[1,1],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},"p28"),oF=l(function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1]]},"p29"),sF=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,1],[r.topleft,1]]},"p30"),aF=l(function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},"p31"),lF=l(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p32"),uF=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},"p33"),cF=l(function(r){return[[1,1],[1,r.righttop],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topright,1]]},"p34"),pF=l(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p35"),hF=l(function(r){return[[1,1],[1,r.righttop],[r.bottomright,0],[r.bottomleft,0],[0,r.leftbottom],[0,r.lefttop],[r.topright,1]]},"p36"),fF=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomleft,0],[0,0],[0,r.leftbottom],[r.topleft,1],[r.topright,1]]},"p37"),dF=l(function(r){return[[1,r.righttop],[1,r.rightbottom],[r.bottomright,0],[r.bottomleft,0],[0,r.lefttop],[0,1],[r.topleft,1]]},"p38"),mF=l(function(r){return[[1,r.rightbottom],[1,0],[r.bottomright,0],[0,r.leftbottom],[0,r.lefttop],[r.topleft,1],[r.topright,1]]},"p39"),or=[],sr=[],ar=[],lr=[],ur=[],cr=[],pr=[],hr=[];lr[1]=ur[1]=18;lr[169]=ur[169]=18;ar[4]=sr[4]=12;ar[166]=sr[166]=12;or[16]=hr[16]=4;or[154]=hr[154]=4;cr[64]=pr[64]=22;cr[106]=pr[106]=22;ar[2]=cr[2]=17;lr[2]=ur[2]=18;ar[168]=cr[168]=17;lr[168]=ur[168]=18;or[8]=lr[8]=9;sr[8]=ar[8]=12;or[162]=lr[162]=9;sr[162]=ar[162]=12;or[32]=hr[32]=4;sr[32]=pr[32]=1;or[138]=hr[138]=4;sr[138]=pr[138]=1;ur[128]=hr[128]=21;cr[128]=pr[128]=22;ur[42]=hr[42]=21;cr[42]=pr[42]=22;sr[5]=ur[5]=14;sr[165]=ur[165]=14;ar[20]=hr[20]=6;ar[150]=hr[150]=6;or[80]=cr[80]=11;or[90]=cr[90]=11;lr[65]=pr[65]=3;lr[105]=pr[105]=3;or[160]=cr[160]=11;sr[160]=ur[160]=14;or[10]=cr[10]=11;sr[10]=ur[10]=14;ar[130]=hr[130]=6;lr[130]=pr[130]=3;ar[40]=hr[40]=6;lr[40]=pr[40]=3;sr[101]=pr[101]=1;sr[69]=pr[69]=1;ur[149]=hr[149]=21;ur[21]=hr[21]=21;ar[86]=cr[86]=17;ar[84]=cr[84]=17;or[89]=lr[89]=9;or[81]=lr[81]=9;or[96]=pr[96]=0;sr[96]=cr[96]=15;or[74]=pr[74]=0;sr[74]=cr[74]=15;or[24]=ar[24]=8;lr[24]=hr[24]=7;or[146]=ar[146]=8;lr[146]=hr[146]=7;sr[6]=cr[6]=15;ar[6]=ur[6]=16;sr[164]=cr[164]=15;ar[164]=ur[164]=16;lr[129]=hr[129]=7;ur[129]=pr[129]=20;lr[41]=hr[41]=7;ur[41]=pr[41]=20;ar[66]=pr[66]=2;lr[66]=cr[66]=19;ar[104]=pr[104]=2;lr[104]=cr[104]=19;or[144]=ur[144]=10;cr[144]=hr[144]=23;or[26]=ur[26]=10;cr[26]=hr[26]=23;sr[36]=hr[36]=5;ar[36]=pr[36]=2;sr[134]=hr[134]=5;ar[134]=pr[134]=2;or[9]=ur[9]=10;sr[9]=lr[9]=13;or[161]=ur[161]=10;sr[161]=lr[161]=13;sr[37]=hr[37]=5;ur[37]=pr[37]=20;sr[133]=hr[133]=5;ur[133]=pr[133]=20;ar[148]=ur[148]=16;cr[148]=hr[148]=23;ar[22]=ur[22]=16;cr[22]=hr[22]=23;or[82]=ar[82]=8;lr[82]=cr[82]=19;or[88]=ar[88]=8;lr[88]=cr[88]=19;or[73]=pr[73]=0;sr[73]=lr[73]=13;or[97]=pr[97]=0;sr[97]=lr[97]=13;or[145]=lr[145]=9;ur[145]=hr[145]=21;or[25]=lr[25]=9;ur[25]=hr[25]=21;sr[70]=pr[70]=1;ar[70]=cr[70]=17;sr[100]=pr[100]=1;ar[100]=cr[100]=17;or[34]=lr[34]=9;sr[34]=ar[34]=12;ur[34]=hr[34]=21;cr[34]=pr[34]=22;or[136]=hr[136]=4;sr[136]=pr[136]=1;ar[136]=cr[136]=17;lr[136]=ur[136]=18;or[35]=hr[35]=4;sr[35]=ar[35]=12;lr[35]=ur[35]=18;cr[35]=pr[35]=22;or[153]=hr[153]=4;lr[153]=ur[153]=18;sr[102]=ar[102]=12;cr[102]=pr[102]=22;or[155]=lr[155]=9;ur[155]=hr[155]=23;sr[103]=pr[103]=1;ar[103]=cr[103]=17;or[152]=hr[152]=4;ar[152]=cr[152]=17;lr[152]=ur[152]=18;or[156]=ar[156]=8;lr[156]=ur[156]=18;cr[156]=hr[156]=23;or[137]=hr[137]=4;sr[137]=pr[137]=1;lr[137]=ur[137]=18;or[139]=hr[139]=4;sr[139]=lr[139]=13;ur[139]=pr[139]=20;or[98]=lr[98]=9;sr[98]=ar[98]=12;cr[98]=pr[98]=22;or[99]=pr[99]=0;sr[99]=ar[99]=12;lr[99]=cr[99]=19;sr[38]=ar[38]=12;ur[38]=hr[38]=21;cr[38]=pr[38]=22;sr[39]=hr[39]=5;ar[39]=ur[39]=16;cr[39]=pr[39]=22;var kt=[];kt[1]=kt[169]=xC;kt[4]=kt[166]=_C;kt[16]=kt[154]=CC;kt[64]=kt[106]=SC;kt[168]=kt[2]=IC;kt[162]=kt[8]=MC;kt[138]=kt[32]=TC;kt[42]=kt[128]=wC;kt[5]=kt[165]=BR;kt[20]=kt[150]=GR;kt[80]=kt[90]=VR;kt[65]=kt[105]=jR;kt[160]=kt[10]=UR;kt[130]=kt[40]=zR;kt[85]=HR;kt[101]=kt[69]=XR;kt[149]=kt[21]=YR;kt[86]=kt[84]=qR;kt[89]=kt[81]=WR;kt[96]=kt[74]=ZR;kt[24]=kt[146]=$R;kt[6]=kt[164]=JR;kt[129]=kt[41]=KR;kt[66]=kt[104]=QR;kt[144]=kt[26]=tF;kt[36]=kt[134]=eF;kt[9]=kt[161]=rF;kt[37]=kt[133]=nF;kt[148]=kt[22]=iF;kt[82]=kt[88]=oF;kt[73]=kt[97]=sF;kt[145]=kt[25]=aF;kt[70]=kt[100]=lF;kt[34]=function(r){return[wC(r),MC(r)]};kt[35]=uF;kt[136]=function(r){return[TC(r),IC(r)]};kt[153]=function(r){return[CC(r),xC(r)]};kt[102]=function(r){return[_C(r),SC(r)]};kt[155]=cF;kt[103]=pF;kt[152]=function(r){return[CC(r),IC(r)]};kt[156]=hF;kt[137]=function(r){return[TC(r),xC(r)]};kt[139]=fF;kt[98]=function(r){return[MC(r),SC(r)]};kt[99]=dF;kt[38]=function(r){return[_C(r),wC(r)]};kt[39]=mF;y();y();y();y();y();y();y();y();function yF(r){return(r>0)-(r<0)||+r}l(yF,"mathSign");function ud(r,t,e){var n=t[0]-r[0],i=t[1]-r[1],a=e[0]-t[0],u=e[1]-t[1];return yF(n*u-a*i)}l(ud,"orientationIndex");function i6(r,t){var e=r.geometry.coordinates[0].map(function(u){return u[0]}),n=r.geometry.coordinates[0].map(function(u){return u[1]}),i=t.geometry.coordinates[0].map(function(u){return u[0]}),a=t.geometry.coordinates[0].map(function(u){return u[1]});return Math.max.apply(null,e)===Math.max.apply(null,i)&&Math.max.apply(null,n)===Math.max.apply(null,a)&&Math.min.apply(null,e)===Math.min.apply(null,i)&&Math.min.apply(null,n)===Math.min.apply(null,a)}l(i6,"envelopeIsEqual");function PC(r,t){return t.geometry.coordinates[0].every(function(e){return cn(kr(e),r)})}l(PC,"envelopeContains");function o6(r,t){return r[0]===t[0]&&r[1]===t[1]}l(o6,"coordinatesEqual");var vF=function(){function r(t){this.id=r.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return l(r,"Node"),r.buildId=function(t){return t.join(",")},r.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},r.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},r.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},r.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var i=e.to,a=n.to;if(i.coordinates[0]-t.coordinates[0]>=0&&a.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&a.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]===0&&a.coordinates[0]-t.coordinates[0]===0)return i.coordinates[1]-t.coordinates[1]>=0||a.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-a.coordinates[1]:a.coordinates[1]-i.coordinates[1];var u=ud(t.coordinates,i.coordinates,a.coordinates);if(u<0)return 1;if(u>0)return-1;var h=Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2),d=Math.pow(a.coordinates[0]-t.coordinates[0],2)+Math.pow(a.coordinates[1]-t.coordinates[1],2);return h-d}),this.outerEdgesSorted=!0)},r.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},r.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},r.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},r}(),EC=vF;y();var bF=function(){function r(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return l(r,"Edge"),r.prototype.getSymetric=function(){return this.symetric||(this.symetric=new r(this.to,this.from),this.symetric.symetric=this),this.symetric},r.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},r.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},r.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},r.prototype.toLineString=function(){return Dn([this.from.coordinates,this.to.coordinates])},r.prototype.compareTo=function(t){return ud(t.from.coordinates,t.to.coordinates,this.to.coordinates)},r}(),s6=bF;y();var xF=function(){function r(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return l(r,"EdgeRing"),r.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},r.prototype.get=function(t){return this.edges[t]},Object.defineProperty(r.prototype,"length",{get:l(function(){return this.edges.length},"get"),enumerable:!0,configurable:!0}),r.prototype.forEach=function(t){this.edges.forEach(t)},r.prototype.map=function(t){return this.edges.map(t)},r.prototype.some=function(t){return this.edges.some(t)},r.prototype.isValid=function(){return!0},r.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(u,h,d){return h.from.coordinates[1]>t.edges[u].from.coordinates[1]&&(u=d),u},0),n=(e===0?this.length:e)-1,i=(e+1)%this.length,a=ud(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[i].from.coordinates);return a===0?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:a>0},r.prototype.toMultiPoint=function(){return o_(this.edges.map(function(t){return t.from.coordinates}))},r.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=zr([t])},r.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=D_(this.toPolygon())},r.findEdgeRingContaining=function(t,e){var n=t.getEnvelope(),i,a;return e.forEach(function(u){var h=u.getEnvelope();if(a&&(i=a.getEnvelope()),!i6(h,n)&&PC(h,n)){for(var d=t.map(function(w){return w.from.coordinates}),m=void 0,v=l(function(w){u.some(function(E){return o6(w,E.from.coordinates)})||(m=w)},"_loop_1"),x=0,S=d;x<S.length;x++){var I=S[x];v(I)}m&&u.inside(kr(m))&&(!a||PC(i,h))&&(a=u)}}),a},r.prototype.inside=function(t){return cn(t,this.toPolygon())},r}(),OC=xF;function _F(r){if(!r)throw new Error("No geojson passed");if(r.type!=="FeatureCollection"&&r.type!=="GeometryCollection"&&r.type!=="MultiLineString"&&r.type!=="LineString"&&r.type!=="Feature")throw new Error("Invalid input type '"+r.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}l(_F,"validateGeoJson");var spt=function(){function r(){this.edges=[],this.nodes={}}return l(r,"Graph"),r.fromGeoJson=function(t){_F(t);var e=new r;return oi(t,function(n){g_(n,"LineString","Graph::fromGeoJson"),eP(n,function(i,a){if(i){var u=e.getNode(i),h=e.getNode(a);e.addEdge(u,h)}return a})}),e},r.prototype.getNode=function(t){var e=EC.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new EC(t)),n},r.prototype.addEdge=function(t,e){var n=new s6(t,e),i=n.getSymetric();this.edges.push(n),this.edges.push(i)},r.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},r.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(i){return i.to});this.removeNode(t),n.forEach(function(i){return e._removeIfDangle(i)})}},r.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},r.prototype._computeNextCWEdges=function(t){var e=this;typeof t>"u"?Object.keys(this.nodes).forEach(function(n){return e._computeNextCWEdges(e.nodes[n])}):t.getOuterEdges().forEach(function(n,i){t.getOuterEdge((i===0?t.getOuterEdges().length:i)-1).symetric.next=n})},r.prototype._computeNextCCWEdges=function(t,e){for(var n=t.getOuterEdges(),i,a,u=n.length-1;u>=0;--u){var h=n[u],d=h.symetric,m=void 0,v=void 0;h.label===e&&(m=h),d.label===e&&(v=d),!(!m||!v)&&(v&&(a=v),m&&(a&&(a.next=m,a=void 0),i||(i=m)))}a&&(a.next=i)},r.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var i=n;do i.label=e,i=i.next;while(!n.isEqual(i));e++}}),t},r.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(n){n.label=void 0}),this._findLabeledEdgeRings().forEach(function(n){t._findIntersectionNodes(n).forEach(function(i){t._computeNextCCWEdges(i,n.label)})});var e=[];return this.edges.forEach(function(n){n.ring||e.push(t._findEdgeRing(n))}),e},r.prototype._findIntersectionNodes=function(t){var e=[],n=t,i=l(function(){var a=0;n.from.getOuterEdges().forEach(function(u){u.label===t.label&&++a}),a>1&&e.push(n.from),n=n.next},"_loop_1");do i();while(!t.isEqual(n));return e},r.prototype._findEdgeRing=function(t){var e=t,n=new OC;do n.push(e),e.ring=n,e=e.next;while(!t.isEqual(e));return n},r.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(n){return e.removeEdge(n)}),t.innerEdges.forEach(function(n){return e.removeEdge(n)}),delete this.nodes[t.id]},r.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},r}();y();function CF(r,t){var e=!0;return oi(r,function(n){oi(t,function(i){if(e===!1)return!1;e=SF(n.geometry,i.geometry)})}),e}l(CF,"booleanDisjoint");function SF(r,t){switch(r.type){case"Point":switch(t.type){case"Point":return!wF(r.coordinates,t.coordinates);case"LineString":return!a6(t,r);case"Polygon":return!cn(r,t)}break;case"LineString":switch(t.type){case"Point":return!a6(r,t);case"LineString":return!IF(r,t);case"Polygon":return!l6(t,r)}break;case"Polygon":switch(t.type){case"Point":return!cn(t,r);case"LineString":return!l6(r,t);case"Polygon":return!MF(t,r)}}return!1}l(SF,"disjoint");function a6(r,t){for(var e=0;e<r.coordinates.length-1;e++)if(TF(r.coordinates[e],r.coordinates[e+1],t.coordinates))return!0;return!1}l(a6,"isPointOnLine");function IF(r,t){var e=Za(r,t);return e.features.length>0}l(IF,"isLineOnLine");function l6(r,t){for(var e=0,n=t.coordinates;e<n.length;e++){var i=n[e];if(cn(i,r))return!0}var a=Za(t,Cp(r));return a.features.length>0}l(l6,"isLineInPoly");function MF(r,t){for(var e=0,n=r.coordinates[0];e<n.length;e++){var i=n[e];if(cn(i,t))return!0}for(var a=0,u=t.coordinates[0];a<u.length;a++){var h=u[a];if(cn(h,r))return!0}var d=Za(Cp(r),Cp(t));return d.features.length>0}l(MF,"isPolyInPoly");function TF(r,t,e){var n=e[0]-r[0],i=e[1]-r[1],a=t[0]-r[0],u=t[1]-r[1],h=n*u-i*a;return h!==0?!1:Math.abs(a)>=Math.abs(u)?a>0?r[0]<=e[0]&&e[0]<=t[0]:t[0]<=e[0]&&e[0]<=r[0]:u>0?r[1]<=e[1]&&e[1]<=t[1]:t[1]<=e[1]&&e[1]<=r[1]}l(TF,"isPointOnLineSegment");function wF(r,t){return r[0]===t[0]&&r[1]===t[1]}l(wF,"compareCoords");var DC=CF;y();y();y();var DF=$r(LC(),1);y();var LF=$r(LC(),1);y();function Eg(r,t){var e=!1;return oi(r,function(n){oi(t,function(i){if(e===!0)return!0;e=!DC(n.geometry,i.geometry)})}),e}l(Eg,"booleanIntersects");y();var AF=$r(g6(),1);y();var VF=$r(T6(),1);y();y();function P6(r){for(var t=r,e=[];t.parent;)e.unshift(t),t=t.parent;return e}l(P6,"pathTo");function UF(){return new E6(function(r){return r.f})}l(UF,"getHeap");var RC={search:l(function(r,t,e,n){r.cleanDirty(),n=n||{};var i=n.heuristic||RC.heuristics.manhattan,a=n.closest||!1,u=UF(),h=t;for(t.h=i(t,e),u.push(t);u.size()>0;){var d=u.pop();if(d===e)return P6(d);d.closed=!0;for(var m=r.neighbors(d),v=0,x=m.length;v<x;++v){var S=m[v];if(!(S.closed||S.isWall())){var I=d.g+S.getCost(d),w=S.visited;(!w||I<S.g)&&(S.visited=!0,S.parent=d,S.h=S.h||i(S,e),S.g=I,S.f=S.g+S.h,r.markDirty(S),a&&(S.h<h.h||S.h===h.h&&S.g<h.g)&&(h=S),w?u.rescoreElement(S):u.push(S))}}}return a?P6(h):[]},"search"),heuristics:{manhattan:l(function(r,t){var e=Math.abs(t.x-r.x),n=Math.abs(t.y-r.y);return e+n},"manhattan"),diagonal:l(function(r,t){var e=1,n=Math.sqrt(2),i=Math.abs(t.x-r.x),a=Math.abs(t.y-r.y);return e*(i+a)+(n-2*e)*Math.min(i,a)},"diagonal")},cleanNode:l(function(r){r.f=0,r.g=0,r.h=0,r.visited=!1,r.closed=!1,r.parent=null},"cleanNode")};function Og(r,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<r.length;e++){this.grid[e]=[];for(var n=0,i=r[e];n<i.length;n++){var a=new Vv(e,n,i[n]);this.grid[e][n]=a,this.nodes.push(a)}}this.init()}l(Og,"Graph");Og.prototype.init=function(){this.dirtyNodes=[];for(var r=0;r<this.nodes.length;r++)RC.cleanNode(this.nodes[r])};Og.prototype.cleanDirty=function(){for(var r=0;r<this.dirtyNodes.length;r++)RC.cleanNode(this.dirtyNodes[r]);this.dirtyNodes=[]};Og.prototype.markDirty=function(r){this.dirtyNodes.push(r)};Og.prototype.neighbors=function(r){var t=[],e=r.x,n=r.y,i=this.grid;return i[e-1]&&i[e-1][n]&&t.push(i[e-1][n]),i[e+1]&&i[e+1][n]&&t.push(i[e+1][n]),i[e]&&i[e][n-1]&&t.push(i[e][n-1]),i[e]&&i[e][n+1]&&t.push(i[e][n+1]),this.diagonal&&(i[e-1]&&i[e-1][n-1]&&t.push(i[e-1][n-1]),i[e+1]&&i[e+1][n-1]&&t.push(i[e+1][n-1]),i[e-1]&&i[e-1][n+1]&&t.push(i[e-1][n+1]),i[e+1]&&i[e+1][n+1]&&t.push(i[e+1][n+1])),t};Og.prototype.toString=function(){for(var r=[],t=this.grid,e,n,i,a,u=0,h=t.length;u<h;u++){for(e=[],n=t[u],i=0,a=n.length;i<a;i++)e.push(n[i].weight);r.push(e.join(" "))}return r.join("\n")};function Vv(r,t,e){this.x=r,this.y=t,this.weight=e}l(Vv,"GridNode");Vv.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Vv.prototype.getCost=function(r){return r&&r.x!==this.x&&r.y!==this.y?this.weight*1.41421:this.weight};Vv.prototype.isWall=function(){return this.weight===0};function E6(r){this.content=[],this.scoreFunction=r}l(E6,"BinaryHeap");E6.prototype={push:l(function(r){this.content.push(r),this.sinkDown(this.content.length-1)},"push"),pop:l(function(){var r=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),r},"pop"),remove:l(function(r){var t=this.content.indexOf(r),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(r)?this.sinkDown(t):this.bubbleUp(t))},"remove"),size:l(function(){return this.content.length},"size"),rescoreElement:l(function(r){this.sinkDown(this.content.indexOf(r))},"rescoreElement"),sinkDown:l(function(r){for(var t=this.content[r];r>0;){var e=(r+1>>1)-1,n=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(n))this.content[e]=t,this.content[r]=n,r=e;else break}},"sinkDown"),bubbleUp:l(function(r){for(var t=this.content.length,e=this.content[r],n=this.scoreFunction(e);;){var i=r+1<<1,a=i-1,u=null,h;if(a<t){var d=this.content[a];h=this.scoreFunction(d),h<n&&(u=a)}if(i<t){var m=this.content[i],v=this.scoreFunction(m);v<(u===null?n:h)&&(u=i)}if(u!==null)this.content[r]=this.content[u],this.content[u]=e,r=u;else break}},"bubbleUp")};y();y();y();y();y();y();y();y();function FC(){this._=null}l(FC,"RedBlackTree");function pd(r){r.U=r.C=r.L=r.R=r.P=r.N=null}l(pd,"RedBlackNode");FC.prototype={constructor:FC,insert:l(function(r,t){var e,n,i;if(r){if(t.P=r,t.N=r.N,r.N&&(r.N.P=t),r.N=t,r.R){for(r=r.R;r.L;)r=r.L;r.L=t}else r.R=t;e=r}else this._?(r=O6(this._),t.P=null,t.N=r,r.P=r.L=t,e=r):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,r=t;e&&e.C;)n=e.U,e===n.L?(i=n.R,i&&i.C?(e.C=i.C=!1,n.C=!0,r=n):(r===e.R&&(Dg(this,e),r=e,e=r.U),e.C=!1,n.C=!0,Lg(this,n))):(i=n.L,i&&i.C?(e.C=i.C=!1,n.C=!0,r=n):(r===e.L&&(Lg(this,e),r=e,e=r.U),e.C=!1,n.C=!0,Dg(this,n))),e=r.U;this._.C=!1},"insert"),remove:l(function(r){r.N&&(r.N.P=r.P),r.P&&(r.P.N=r.N),r.N=r.P=null;var t=r.U,e,n=r.L,i=r.R,a,u;if(n?i?a=O6(i):a=n:a=i,t?t.L===r?t.L=a:t.R=a:this._=a,n&&i?(u=a.C,a.C=r.C,a.L=n,n.U=a,a!==i?(t=a.U,a.U=r.U,r=a.R,t.L=r,a.R=i,i.U=a):(a.U=t,t=a,r=a.R)):(u=r.C,r=a),r&&(r.U=t),!u){if(r&&r.C){r.C=!1;return}do{if(r===this._)break;if(r===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Dg(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Lg(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Dg(this,t),r=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Lg(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Dg(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Lg(this,t),r=this._;break}e.C=!0,r=t,t=t.U}while(!r.C);r&&(r.C=!1)}},"remove")};function Dg(r,t){var e=t,n=t.R,i=e.U;i?i.L===e?i.L=n:i.R=n:r._=n,n.U=i,e.U=n,e.R=n.L,e.R&&(e.R.U=e),n.L=e}l(Dg,"RedBlackRotateLeft");function Lg(r,t){var e=t,n=t.L,i=e.U;i?i.L===e?i.L=n:i.R=n:r._=n,n.U=i,e.U=n,e.L=n.R,e.L&&(e.L.U=e),n.R=e}l(Lg,"RedBlackRotateRight");function O6(r){for(;r.L;)r=r.L;return r}l(O6,"RedBlackFirst");var BC=FC;y();y();function hd(r,t,e,n){var i=[null,null],a=Mi.push(i)-1;return i.left=r,i.right=t,e&&Ag(i,r,t,e),n&&Ag(i,t,r,n),xo[r.index].halfedges.push(a),xo[t.index].halfedges.push(a),i}l(hd,"createEdge");function fd(r,t,e){var n=[t,e];return n.left=r,n}l(fd,"createBorderEdge");function Ag(r,t,e,n){!r[0]&&!r[1]?(r[0]=n,r.left=t,r.right=e):r.left===e?r[1]=n:r[0]=n}l(Ag,"setEdgeEnd");function zF(r,t,e,n,i){var a=r[0],u=r[1],h=a[0],d=a[1],m=u[0],v=u[1],x=0,S=1,I=m-h,w=v-d,E;if(E=t-h,!(!I&&E>0)){if(E/=I,I<0){if(E<x)return;E<S&&(S=E)}else if(I>0){if(E>S)return;E>x&&(x=E)}if(E=n-h,!(!I&&E<0)){if(E/=I,I<0){if(E>S)return;E>x&&(x=E)}else if(I>0){if(E<x)return;E<S&&(S=E)}if(E=e-d,!(!w&&E>0)){if(E/=w,w<0){if(E<x)return;E<S&&(S=E)}else if(w>0){if(E>S)return;E>x&&(x=E)}if(E=i-d,!(!w&&E<0)){if(E/=w,w<0){if(E>S)return;E>x&&(x=E)}else if(w>0){if(E<x)return;E<S&&(S=E)}return!(x>0)&&!(S<1)||(x>0&&(r[0]=[h+x*I,d+x*w]),S<1&&(r[1]=[h+S*I,d+S*w])),!0}}}}}l(zF,"clipEdge");function HF(r,t,e,n,i){var a=r[1];if(a)return!0;var u=r[0],h=r.left,d=r.right,m=h[0],v=h[1],x=d[0],S=d[1],I=(m+x)/2,w=(v+S)/2,E,T;if(S===v){if(I<t||I>=n)return;if(m>x){if(!u)u=[I,e];else if(u[1]>=i)return;a=[I,i]}else{if(!u)u=[I,i];else if(u[1]<e)return;a=[I,e]}}else if(E=(m-x)/(S-v),T=w-E*I,E<-1||E>1)if(m>x){if(!u)u=[(e-T)/E,e];else if(u[1]>=i)return;a=[(i-T)/E,i]}else{if(!u)u=[(i-T)/E,i];else if(u[1]<e)return;a=[(e-T)/E,e]}else if(v<S){if(!u)u=[t,E*t+T];else if(u[0]>=n)return;a=[n,E*n+T]}else{if(!u)u=[n,E*n+T];else if(u[0]<t)return;a=[t,E*t+T]}return r[0]=u,r[1]=a,!0}l(HF,"connectEdge");function D6(r,t,e,n){for(var i=Mi.length,a;i--;)(!HF(a=Mi[i],r,t,e,n)||!zF(a,r,t,e,n)||!(Math.abs(a[0][0]-a[1][0])>Xr||Math.abs(a[0][1]-a[1][1])>Xr))&&delete Mi[i]}l(D6,"clipEdges");function L6(r){return xo[r.index]={site:r,halfedges:[]}}l(L6,"createCell");function XF(r,t){var e=r.site,n=t.left,i=t.right;return e===i&&(i=n,n=e),i?Math.atan2(i[1]-n[1],i[0]-n[0]):(e===n?(n=t[1],i=t[0]):(n=t[0],i=t[1]),Math.atan2(n[0]-i[0],i[1]-n[1]))}l(XF,"cellHalfedgeAngle");function GC(r,t){return t[+(t.left!==r.site)]}l(GC,"cellHalfedgeStart");function YF(r,t){return t[+(t.left===r.site)]}l(YF,"cellHalfedgeEnd");function A6(){for(var r=0,t=xo.length,e,n,i,a;r<t;++r)if((e=xo[r])&&(a=(n=e.halfedges).length)){var u=new Array(a),h=new Array(a);for(i=0;i<a;++i)u[i]=i,h[i]=XF(e,Mi[n[i]]);for(u.sort(function(d,m){return h[m]-h[d]}),i=0;i<a;++i)h[i]=n[u[i]];for(i=0;i<a;++i)n[i]=h[i]}}l(A6,"sortCellHalfedges");function N6(r,t,e,n){var i=xo.length,a,u,h,d,m,v,x,S,I,w,E,T,D=!0;for(a=0;a<i;++a)if(u=xo[a]){for(h=u.site,m=u.halfedges,d=m.length;d--;)Mi[m[d]]||m.splice(d,1);for(d=0,v=m.length;d<v;)w=YF(u,Mi[m[d]]),E=w[0],T=w[1],x=GC(u,Mi[m[++d%v]]),S=x[0],I=x[1],(Math.abs(E-S)>Xr||Math.abs(T-I)>Xr)&&(m.splice(d,0,Mi.push(fd(h,w,Math.abs(E-r)<Xr&&n-T>Xr?[r,Math.abs(S-r)<Xr?I:n]:Math.abs(T-n)<Xr&&e-E>Xr?[Math.abs(I-n)<Xr?S:e,n]:Math.abs(E-e)<Xr&&T-t>Xr?[e,Math.abs(S-e)<Xr?I:t]:Math.abs(T-t)<Xr&&E-r>Xr?[Math.abs(I-t)<Xr?S:r,t]:null))-1),++v);v&&(D=!1)}if(D){var A,L,B,j=1/0;for(a=0,D=null;a<i;++a)(u=xo[a])&&(h=u.site,A=h[0]-r,L=h[1]-t,B=A*A+L*L,B<j&&(j=B,D=u));if(D){var W=[r,t],$=[r,n],F=[e,n],J=[e,t];D.halfedges.push(Mi.push(fd(h=D.site,W,$))-1,Mi.push(fd(h,$,F))-1,Mi.push(fd(h,F,J))-1,Mi.push(fd(h,J,W))-1)}}for(a=0;a<i;++a)(u=xo[a])&&(u.halfedges.length||delete xo[a])}l(N6,"clipCells");y();var k6=[],jv;function qF(){pd(this),this.x=this.y=this.arc=this.site=this.cy=null}l(qF,"Circle");function Tp(r){var t=r.P,e=r.N;if(!(!t||!e)){var n=t.site,i=r.site,a=e.site;if(n!==a){var u=i[0],h=i[1],d=n[0]-u,m=n[1]-h,v=a[0]-u,x=a[1]-h,S=2*(d*x-m*v);if(!(S>=-R6)){var I=d*d+m*m,w=v*v+x*x,E=(x*I-m*w)/S,T=(d*w-v*I)/S,D=k6.pop()||new qF;D.arc=r,D.site=i,D.x=E+u,D.y=(D.cy=T+h)+Math.sqrt(E*E+T*T),r.circle=D;for(var A=null,L=dd._;L;)if(D.y<L.y||D.y===L.y&&D.x<=L.x)if(L.L)L=L.L;else{A=L.P;break}else if(L.R)L=L.R;else{A=L;break}dd.insert(A,D),A||(jv=D)}}}}l(Tp,"attachCircle");function wp(r){var t=r.circle;t&&(t.P||(jv=t.N),dd.remove(t),k6.push(t),pd(t),r.circle=null)}l(wp,"detachCircle");var B6=[];function WF(){pd(this),this.edge=this.site=this.circle=null}l(WF,"Beach");function F6(r){var t=B6.pop()||new WF;return t.site=r,t}l(F6,"createBeach");function VC(r){wp(r),Pp.remove(r),B6.push(r),pd(r)}l(VC,"detachBeach");function G6(r){var t=r.circle,e=t.x,n=t.cy,i=[e,n],a=r.P,u=r.N,h=[r];VC(r);for(var d=a;d.circle&&Math.abs(e-d.circle.x)<Xr&&Math.abs(n-d.circle.cy)<Xr;)a=d.P,h.unshift(d),VC(d),d=a;h.unshift(d),wp(d);for(var m=u;m.circle&&Math.abs(e-m.circle.x)<Xr&&Math.abs(n-m.circle.cy)<Xr;)u=m.N,h.push(m),VC(m),m=u;h.push(m),wp(m);var v=h.length,x;for(x=1;x<v;++x)m=h[x],d=h[x-1],Ag(m.edge,d.site,m.site,i);d=h[0],m=h[v-1],m.edge=hd(d.site,m.site,null,i),Tp(d),Tp(m)}l(G6,"removeBeach");function V6(r){for(var t=r[0],e=r[1],n,i,a,u,h=Pp._;h;)if(a=j6(h,e)-t,a>Xr)h=h.L;else if(u=t-ZF(h,e),u>Xr){if(!h.R){n=h;break}h=h.R}else{a>-Xr?(n=h.P,i=h):u>-Xr?(n=h,i=h.N):n=i=h;break}L6(r);var d=F6(r);if(Pp.insert(n,d),!(!n&&!i)){if(n===i){wp(n),i=F6(n.site),Pp.insert(d,i),d.edge=i.edge=hd(n.site,d.site),Tp(n),Tp(i);return}if(!i){d.edge=hd(n.site,d.site);return}wp(n),wp(i);var m=n.site,v=m[0],x=m[1],S=r[0]-v,I=r[1]-x,w=i.site,E=w[0]-v,T=w[1]-x,D=2*(S*T-I*E),A=S*S+I*I,L=E*E+T*T,B=[(T*A-I*L)/D+v,(S*L-E*A)/D+x];Ag(i.edge,m,w,B),d.edge=hd(m,r,null,B),i.edge=hd(r,w,null,B),Tp(n),Tp(i)}}l(V6,"addBeach");function j6(r,t){var e=r.site,n=e[0],i=e[1],a=i-t;if(!a)return n;var u=r.P;if(!u)return-1/0;e=u.site;var h=e[0],d=e[1],m=d-t;if(!m)return h;var v=h-n,x=1/a-1/m,S=v/m;return x?(-S+Math.sqrt(S*S-2*x*(v*v/(-2*m)-d+m/2+i-a/2)))/x+n:(n+h)/2}l(j6,"leftBreakPoint");function ZF(r,t){var e=r.N;if(e)return j6(e,t);var n=r.site;return n[1]===t?n[0]:1/0}l(ZF,"rightBreakPoint");var Xr=1e-6,R6=1e-12,Pp,xo,dd,Mi;function $F(r,t,e){return(r[0]-e[0])*(t[1]-r[1])-(r[0]-t[0])*(e[1]-r[1])}l($F,"triangleArea");function JF(r,t){return t[1]-r[1]||t[0]-r[0]}l(JF,"lexicographic");function Uv(r,t){var e=r.sort(JF).pop(),n,i,a;for(Mi=[],xo=new Array(r.length),Pp=new BC,dd=new BC;;)if(a=jv,e&&(!a||e[1]<a.y||e[1]===a.y&&e[0]<a.x))(e[0]!==n||e[1]!==i)&&(V6(e),n=e[0],i=e[1]),e=r.pop();else if(a)G6(a.arc);else break;if(A6(),t){var u=+t[0][0],h=+t[0][1],d=+t[1][0],m=+t[1][1];D6(u,h,d,m),N6(u,h,d,m)}this.edges=Mi,this.cells=xo,Pp=dd=Mi=xo=null}l(Uv,"Diagram");Uv.prototype={constructor:Uv,polygons:l(function(){var r=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(n){return GC(t,r[n])});return e.data=t.site.data,e})},"polygons"),triangles:l(function(){var r=[],t=this.edges;return this.cells.forEach(function(e,n){if(h=(a=e.halfedges).length)for(var i=e.site,a,u=-1,h,d,m=t[a[h-1]],v=m.left===i?m.right:m.left;++u<h;)d=v,m=t[a[u]],v=m.left===i?m.right:m.left,d&&v&&n<d.index&&n<v.index&&$F(i,d,v)<0&&r.push([i.data,d.data,v.data])}),r},"triangles"),links:l(function(){return this.edges.filter(function(r){return r.right}).map(function(r){return{source:r.left.data,target:r.right.data}})},"links"),find:l(function(r,t,e){for(var n=this,i,a=n._found||0,u=n.cells.length,h;!(h=n.cells[a]);)if(++a>=u)return null;var d=r-h.site[0],m=t-h.site[1],v=d*d+m*m;do h=n.cells[i=a],a=null,h.halfedges.forEach(function(x){var S=n.edges[x],I=S.left;if(!((I===h.site||!I)&&!(I=S.right))){var w=r-I[0],E=t-I[1],T=w*w+E*E;T<v&&(v=T,a=I.index)}});while(a!==null);return n._found=i,e==null||v<=e*e?h.site:null},"find")};y();y();y();y();y();y();y();y();y();y();y();y();var oB=$r(md(),1);y();var ZC=$r(X6(),1);y();y();y();function _o(){return new Xv}l(_o,"default");function Xv(){this.reset()}l(Xv,"Adder");Xv.prototype={constructor:Xv,reset:l(function(){this.s=this.t=0},"reset"),add:l(function(r){Y6(Hv,r,this.t),Y6(this,Hv.s,this.s),this.s?this.t+=Hv.t:this.s=Hv.t},"add"),valueOf:l(function(){return this.s},"valueOf")};var Hv=new Xv;function Y6(r,t,e){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}l(Y6,"add");y();var Pr=1e-6;var Br=Math.PI,li=Br/2,Yv=Br/4,Ka=Br*2,Ep=180/Br,Bo=Br/180,An=Math.abs,sa=Math.atan,Go=Math.atan2,gr=Math.cos;var qv=Math.exp;var Ng=Math.log;var Me=Math.sin;var zi=Math.sqrt,kg=Math.tan;function zC(r){return r>1?0:r<-1?Br:Math.acos(r)}l(zC,"acos");function Co(r){return r>1?li:r<-1?-li:Math.asin(r)}l(Co,"asin");y();function aa(){}l(aa,"noop");y();var sB=_o(),zmt=_o();y();y();function Op(r){var t=r[0],e=r[1],n=gr(e);return[n*gr(t),n*Me(t),Me(e)]}l(Op,"cartesian");function Rg(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}l(Rg,"cartesianCross");function Fg(r){var t=zi(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}l(Fg,"cartesianNormalizeInPlace");var ngt=_o();y();y();y();y();y();function W6(r,t){return[r>Br?r-Ka:r<-Br?r+Ka:r,t]}l(W6,"rotationIdentity");W6.invert=W6;y();y();function Wv(){var r=[],t;return{point:l(function(e,n){t.push([e,n])},"point"),lineStart:l(function(){r.push(t=[])},"lineStart"),lineEnd:aa,rejoin:l(function(){r.length>1&&r.push(r.pop().concat(r.shift()))},"rejoin"),result:l(function(){var e=r;return r=[],t=null,e},"result")}}l(Wv,"default");y();y();y();function Zv(r,t){return An(r[0]-t[0])<Pr&&An(r[1]-t[1])<Pr}l(Zv,"default");function $v(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}l($v,"Intersection");function Jv(r,t,e,n,i){var a=[],u=[],h,d;if(r.forEach(function(w){if(!((E=w.length-1)<=0)){var E,T=w[0],D=w[E],A;if(Zv(T,D)){for(i.lineStart(),h=0;h<E;++h)i.point((T=w[h])[0],T[1]);i.lineEnd();return}a.push(A=new $v(T,w,null,!0)),u.push(A.o=new $v(T,null,A,!1)),a.push(A=new $v(D,w,null,!1)),u.push(A.o=new $v(D,null,A,!0))}}),!!a.length){for(u.sort(t),Z6(a),Z6(u),h=0,d=u.length;h<d;++h)u[h].e=e=!e;for(var m=a[0],v,x;;){for(var S=m,I=!0;S.v;)if((S=S.n)===m)return;v=S.z,i.lineStart();do{if(S.v=S.o.v=!0,S.e){if(I)for(h=0,d=v.length;h<d;++h)i.point((x=v[h])[0],x[1]);else n(S.x,S.n.x,1,i);S=S.n}else{if(I)for(v=S.p.z,h=v.length-1;h>=0;--h)i.point((x=v[h])[0],x[1]);else n(S.x,S.p.x,-1,i);S=S.p}S=S.o,v=S.z,I=!I}while(!S.v);i.lineEnd()}}}l(Jv,"default");function Z6(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}l(Z6,"link");y();y();y();function Zl(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}l(Zl,"default");y();function Kv(r){return r.length===1&&(r=uB(r)),{left:l(function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var a=n+i>>>1;r(t[a],e)<0?n=a+1:i=a}return n},"left"),right:l(function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var a=n+i>>>1;r(t[a],e)>0?i=a:n=a+1}return n},"right")}}l(Kv,"default");function uB(r){return function(t,e){return Zl(r(t),e)}}l(uB,"ascendingComparator");var $6=Kv(Zl),cB=$6.right,pB=$6.left;y();y();y();y();y();y();y();y();y();var J6=Array.prototype,fB=J6.slice,dB=J6.map;y();y();y();y();var jyt=Math.sqrt(50),Uyt=Math.sqrt(10),zyt=Math.sqrt(2);y();y();y();y();y();y();y();y();function Bg(r){for(var t=r.length,e,n=-1,i=0,a,u;++n<t;)i+=r[n].length;for(a=new Array(i);--t>=0;)for(u=r[t],e=u.length;--e>=0;)a[--i]=u[e];return a}l(Bg,"default");y();y();y();y();y();y();y();var CB=1e9,avt=-CB;y();y();var HC=_o();function tb(r,t){var e=t[0],n=t[1],i=[Me(e),-gr(e),0],a=0,u=0;HC.reset();for(var h=0,d=r.length;h<d;++h)if(v=(m=r[h]).length)for(var m,v,x=m[v-1],S=x[0],I=x[1]/2+Yv,w=Me(I),E=gr(I),T=0;T<v;++T,S=A,w=B,E=j,x=D){var D=m[T],A=D[0],L=D[1]/2+Yv,B=Me(L),j=gr(L),W=A-S,$=W>=0?1:-1,F=$*W,J=F>Br,ot=w*B;if(HC.add(Go(ot*$*Me(F),E*j+ot*gr(F))),a+=J?W+$*Ka:W,J^S>=e^A>=e){var K=Rg(Op(x),Op(D));Fg(K);var H=Rg(i,K);Fg(H);var _t=(J^W>=0?-1:1)*Co(H[2]);(n>_t||n===_t&&(K[0]||K[1]))&&(u+=J^W>=0?1:-1)}}return(a<-Pr||a<Pr&&HC<-Pr)^u&1}l(tb,"default");y();y();var _vt=_o();y();y();y();y();y();var Kvt=_o(),Qvt=_o();y();var MB=1/0;var ibt=-MB;y();y();function XC(r){this._context=r}l(XC,"PathContext");XC.prototype={_radius:4.5,pointRadius:l(function(r){return this._radius=r,this},"pointRadius"),polygonStart:l(function(){this._line=0},"polygonStart"),polygonEnd:l(function(){this._line=NaN},"polygonEnd"),lineStart:l(function(){this._point=0},"lineStart"),lineEnd:l(function(){this._line===0&&this._context.closePath(),this._point=NaN},"lineEnd"),point:l(function(r,t){switch(this._point){case 0:{this._context.moveTo(r,t),this._point=1;break}case 1:{this._context.lineTo(r,t);break}default:{this._context.moveTo(r+this._radius,t),this._context.arc(r,t,this._radius,0,Ka);break}}},"point"),result:aa};y();var xbt=_o();y();function YC(){this._string=[]}l(YC,"PathString");YC.prototype={_radius:4.5,_circle:t7(4.5),pointRadius:l(function(r){return(r=+r)!==this._radius&&(this._radius=r,this._circle=null),this},"pointRadius"),polygonStart:l(function(){this._line=0},"polygonStart"),polygonEnd:l(function(){this._line=NaN},"polygonEnd"),lineStart:l(function(){this._point=0},"lineStart"),lineEnd:l(function(){this._line===0&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:l(function(r,t){switch(this._point){case 0:{this._string.push("M",r,",",t),this._point=1;break}case 1:{this._string.push("L",r,",",t);break}default:{this._circle==null&&(this._circle=t7(this._radius)),this._string.push("M",r,",",t,this._circle);break}}},"point"),result:l(function(){if(this._string.length){var r=this._string.join("");return this._string=[],r}else return null},"result")};function t7(r){return"m0,"+r+"a"+r+","+r+" 0 1,1 0,"+-2*r+"a"+r+","+r+" 0 1,1 0,"+2*r+"z"}l(t7,"circle");y();y();y();y();y();y();function eb(r,t,e,n){return function(i,a){var u=t(a),h=i.invert(n[0],n[1]),d=Wv(),m=t(d),v=!1,x,S,I,w={point:E,lineStart:D,lineEnd:A,polygonStart:l(function(){w.point=L,w.lineStart=B,w.lineEnd=j,S=[],x=[]},"polygonStart"),polygonEnd:l(function(){w.point=E,w.lineStart=D,w.lineEnd=A,S=Bg(S);var W=tb(x,h);S.length?(v||(a.polygonStart(),v=!0),Jv(S,PB,W,e,a)):W&&(v||(a.polygonStart(),v=!0),a.lineStart(),e(null,null,1,a),a.lineEnd()),v&&(a.polygonEnd(),v=!1),S=x=null},"polygonEnd"),sphere:l(function(){a.polygonStart(),a.lineStart(),e(null,null,1,a),a.lineEnd(),a.polygonEnd()},"sphere")};function E(W,$){var F=i(W,$);r(W=F[0],$=F[1])&&a.point(W,$)}l(E,"point");function T(W,$){var F=i(W,$);u.point(F[0],F[1])}l(T,"pointLine");function D(){w.point=T,u.lineStart()}l(D,"lineStart");function A(){w.point=E,u.lineEnd()}l(A,"lineEnd");function L(W,$){I.push([W,$]);var F=i(W,$);m.point(F[0],F[1])}l(L,"pointRing");function B(){m.lineStart(),I=[]}l(B,"ringStart");function j(){L(I[0][0],I[0][1]),m.lineEnd();var W=m.clean(),$=d.result(),F,J=$.length,ot,K,H;if(I.pop(),x.push(I),I=null,!!J){if(W&1){if(K=$[0],(ot=K.length-1)>0){for(v||(a.polygonStart(),v=!0),a.lineStart(),F=0;F<ot;++F)a.point((H=K[F])[0],H[1]);a.lineEnd()}return}J>1&&W&2&&$.push($.pop().concat($.shift())),S.push($.filter(wB))}}return l(j,"ringEnd"),w}}l(eb,"default");function wB(r){return r.length>1}l(wB,"validSegment");function PB(r,t){return((r=r.x)[0]<0?r[1]-li-Pr:li-r[1])-((t=t.x)[0]<0?t[1]-li-Pr:li-t[1])}l(PB,"compareIntersection");var EB=eb(function(){return!0},OB,LB,[-Br,-li]);function OB(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:l(function(){r.lineStart(),i=1},"lineStart"),point:l(function(a,u){var h=a>0?Br:-Br,d=An(a-t);An(d-Br)<Pr?(r.point(t,e=(e+u)/2>0?li:-li),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(h,e),r.point(a,e),i=0):n!==h&&d>=Br&&(An(t-n)<Pr&&(t-=n*Pr),An(a-h)<Pr&&(a-=h*Pr),e=DB(t,e,a,u),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(h,e),i=0),r.point(t=a,e=u),n=h},"point"),lineEnd:l(function(){r.lineEnd(),t=e=NaN},"lineEnd"),clean:l(function(){return 2-i},"clean")}}l(OB,"clipAntimeridianLine");function DB(r,t,e,n){var i,a,u=Me(r-e);return An(u)>Pr?sa((Me(t)*(a=gr(n))*Me(e)-Me(n)*(i=gr(t))*Me(r))/(i*a*u)):(t+n)/2}l(DB,"clipAntimeridianIntersect");function LB(r,t,e,n){var i;if(r==null)i=e*li,n.point(-Br,i),n.point(0,i),n.point(Br,i),n.point(Br,0),n.point(Br,-i),n.point(0,-i),n.point(-Br,-i),n.point(-Br,0),n.point(-Br,i);else if(An(r[0]-t[0])>Pr){var a=r[0]<t[0]?Br:-Br;i=e*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(t[0],t[1])}l(LB,"clipAntimeridianInterpolate");y();y();function rb(r){return function(t){var e=new qC;for(var n in r)e[n]=r[n];return e.stream=t,e}}l(rb,"transformer");function qC(){}l(qC,"TransformStream");qC.prototype={constructor:qC,point:l(function(r,t){this.stream.point(r,t)},"point"),sphere:l(function(){this.stream.sphere()},"sphere"),lineStart:l(function(){this.stream.lineStart()},"lineStart"),lineEnd:l(function(){this.stream.lineEnd()},"lineEnd"),polygonStart:l(function(){this.stream.polygonStart()},"polygonStart"),polygonEnd:l(function(){this.stream.polygonEnd()},"polygonEnd")};y();y();var Sxt=gr(30*Bo);var Gxt=rb({point:l(function(r,t){this.stream.point(r*Bo,t*Bo)},"point")});y();y();y();y();function nb(r){return function(t,e){var n=gr(t),i=gr(e),a=r(n*i);return[a*i*Me(t),a*Me(e)]}}l(nb,"azimuthalRaw");function Qa(r){return function(t,e){var n=zi(t*t+e*e),i=r(n),a=Me(i),u=gr(i);return[Go(t*a,n*u),Co(n&&e*a/n)]}}l(Qa,"azimuthalInvert");var a7=nb(function(r){return zi(2/(1+r))});a7.invert=Qa(function(r){return 2*Co(r/2)});y();var l7=nb(function(r){return(r=zC(r))&&r/Me(r)});l7.invert=Qa(function(r){return r});y();y();function WC(r,t){return[r,Ng(kg((li+t)/2))]}l(WC,"mercatorRaw");WC.invert=function(r,t){return[r,2*sa(qv(t))-li]};y();y();function ib(r,t){return[r,t]}l(ib,"equirectangularRaw");ib.invert=ib;y();function u7(r,t){var e=gr(t),n=gr(r)*e;return[e*Me(r)/n,Me(t)/n]}l(u7,"gnomonicRaw");u7.invert=Qa(sa);y();y();function c7(r,t){var e=t*t,n=e*e;return[r*(.8707-.131979*e+n*(-.013791+n*(.003971*e-.001529*n))),t*(1.007226+e*(.015085+n*(-.044475+.028874*e-.005916*n)))]}l(c7,"naturalEarth1Raw");c7.invert=function(r,t){var e=t,n=25,i;do{var a=e*e,u=a*a;e-=i=(e*(1.007226+a*(.015085+u*(-.044475+.028874*a-.005916*u)))-t)/(1.007226+a*(.015085*3+u*(-.044475*7+.028874*9*a-.005916*11*u)))}while(An(i)>Pr&&--n>0);return[r/(.8707+(a=e*e)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),e]};y();function p7(r,t){return[gr(t)*Me(r),Me(t)]}l(p7,"orthographicRaw");p7.invert=Qa(Co);y();function h7(r,t){var e=gr(t),n=1+gr(r)*e;return[e*Me(r)/n,Me(t)/n]}l(h7,"stereographicRaw");h7.invert=Qa(function(r){return 2*sa(r)});y();function f7(r,t){return[Ng(kg((li+t)/2)),-r]}l(f7,"transverseMercatorRaw");f7.invert=function(r,t){return[-t,2*sa(qv(r))-li]};y();var BB=$r(md(),1);y();var GB=$r(md(),1);y();var jB=$r(md(),1);y();y();var UB=$r(md(),1);y();y();y();y();function $C(r){var i,a,u,h,d,m;let t=((a=(i=r.enterprise)==null?void 0:i.locations)==null?void 0:a.reduce((v,x)=>(v[x.id]=x,v),{}))||{};for(let v of((u=r.enterprise)==null?void 0:u.locationInstances)||[])t[v.id]=v;let e={};for(let v of r["floorstack.json"]||[])e[v.id]=v;let n={};for(let v of((h=r["floor.geojson"])==null?void 0:h.features)||[])v.properties&&v.properties.id&&(n[v.properties.id]=v.properties);return{type:"downloaded",data:r,optimized:{"enterprise-location":t,"enterprise-category":((m=(d=r.enterprise)==null?void 0:d.categories)==null?void 0:m.reduce((v,x)=>(v[x.id]=x,v),{}))||{},"floor-stack":e,floor:n}}}l($C,"parseLocalePackToLanguagePack");function m7(r){return/^https?:\/\/cdn\.mappedin\.com/.test(r)}l(m7,"isMappedinCdnUrl");function g7(r){let t=r.split("?")[1];return!!(t!=null&&t.includes("sv="))}l(g7,"hasSasToken");function Ti(r,t){var n;let e=((n=r==null?void 0:r.properties)==null?void 0:n.id)||"unknown";if(r.geometry==null)return tt.error('Cannot get the center coordinate for "'.concat(e,'" because it has no geometry.')),new ve({latitude:0,longitude:0,floorId:t});try{if(r.geometry.type==="LineString"){let[[i,a],[u,h]]=r.geometry.coordinates,d=(i+u)/2,m=(a+h)/2;return new ve({latitude:m,longitude:d,floorId:t})}else if(r.geometry.type==="Point"){let[i,a]=r.geometry.coordinates;return new ve({latitude:a,longitude:i,floorId:t})}else if(r.geometry.type==="Polygon"){let i=r;if(i.properties.center!=null){let[a,u]=i.properties.center;return new ve({latitude:u,longitude:a,floorId:t})}}}catch(i){}try{let[i,a]=qa(r).geometry.coordinates;return new ve({latitude:a,longitude:i,floorId:t})}catch(i){return tt.error('Failed to get center coordinate for "'.concat(e,'" ').concat(i instanceof Error?i.stack:"")),new ve({latitude:0,longitude:0,floorId:t})}}l(Ti,"getCenterCoordinate");var tl,So,Lp,pc,Dp=class Dp extends si{constructor(e,n){super(n.mvfData.properties.id);b(this,"__type",Dp.__type);R(this,tl);R(this,So,{});R(this,Lp);R(this,pc);V(this,tl,e),V(this,Lp,n.floorId),V(this,pc,n.mvfData)}static is(e){return e.__type===Dp.__type}get locations(){return p(this,So).locations?p(this,So).locations:(p(this,So).locations=(p(this,tl).locationIdsByNodeId[this.id]||[]).map(e=>p(this,tl).getById("enterprise-location",e)).filter(Boolean),p(this,So).locations)}get space(){var e;return p(this,tl).getById("space",(e=p(this,tl).spaceIdsByNodeId[this.id])==null?void 0:e[0])}get floor(){let e=p(this,tl).getById("floor",p(this,Lp));if(e==null)throw new Error("Floor ".concat(p(this,Lp)," not found!"));return e}get coordinate(){return p(this,So).coordinate==null&&(p(this,So).coordinate=Ti(p(this,pc),p(this,Lp))),p(this,So).coordinate}get externalId(){var e;return(e=p(this,pc).properties.externalId)!=null?e:""}get neighbors(){if(p(this,So).neighbours==null){let e=p(this,pc).properties.neighbors.map(n=>{let i=p(this,tl).getById("node",n.id);if(i==null)throw new Error("Node ".concat(n.id," not found!"));return i});p(this,So).neighbours=e}return p(this,So).neighbours}get geoJSON(){return rt(U({},p(this,pc)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Dp.__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(p(this,So)))delete p(this,So)[e]}};tl=new WeakMap,So=new WeakMap,Lp=new WeakMap,pc=new WeakMap,l(Dp,"Node"),b(Dp,"__type","node");var JC=Dp,$l=JC;y();y();var Ap,KC=class KC{constructor(t,e){b(this,"id");R(this,Ap);this.id=t}get geoJSONBoundingBox(){return p(this,Ap)?p(this,Ap):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(V(this,Ap,Kn(this.geoJSON)),p(this,Ap))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};Ap=new WeakMap,l(KC,"BaseMapData");var la=KC;var hc,Ts,ua,yd,Gg,tS,Np=class Np extends la{constructor(e,n){super(n.mvfData.id,e);R(this,Gg);b(this,"__type",Np.__type);R(this,hc);R(this,Ts,{});R(this,ua);R(this,yd);V(this,hc,e),V(this,ua,n.mvfData),V(this,yd,n.facadeId)}static is(e){return e.__type===Np.__type}get type(){return p(this,ua).type}get name(){var e;return(e=yt(this,Gg,tS).call(this,"name"))!=null?e:""}get shortName(){var e;return(e=yt(this,Gg,tS).call(this,"shortName"))!=null?e:""}get externalId(){var e;return(e=p(this,ua).externalId)!=null?e:""}get floors(){var e,n;if(p(this,Ts).floors==null){let i=((n=(e=p(this,ua).floors)!=null?e:p(this,ua).maps)!=null?n:[]).reduce((a,u)=>{let h=p(this,hc).floorsById[u];return h&&a.push(h),a},[]);i.length===0&&tt.error("Floor stack ".concat(this.id," has no floors")),p(this,Ts).floors=i.sort((a,u)=>a.elevation-u.elevation)}return p(this,Ts).floors}get defaultFloor(){if(p(this,Ts).defaultFloor!=null)return p(this,Ts).defaultFloor;let e=p(this,ua).defaultFloor?p(this,hc).getById("floor",p(this,ua).defaultFloor):void 0;return p(this,Ts).defaultFloor=e||this.floors.reduce((n,i)=>Math.abs(i.elevation)<Math.abs(n.elevation)?i:n),p(this,Ts).defaultFloor}get facade(){return p(this,yd)?p(this,hc).facadesById[p(this,yd)]:void 0}toJSON(){return{__type:Np.__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(p(this,Ts)))delete p(this,Ts)[e]}};hc=new WeakMap,Ts=new WeakMap,ua=new WeakMap,yd=new WeakMap,Gg=new WeakSet,tS=l(function(e){return p(this,hc).getPropTranslation(this.__type,e,this.id,p(this,ua)[e])},"#translate"),l(Np,"FloorStack"),b(Np,"__type","floor-stack");var QC=Np,Vg=QC;y();y();y();y();y();y();var jg,Jl,kp=class kp extends si{constructor(e){super(String(Mr()));b(this,"__type",kp.__type);R(this,jg,{});R(this,Jl);V(this,Jl,e.mvfData)}static is(e){return e.__type===kp.__type}get url(){return p(this,Jl).url}get name(){if("displayName"in p(this,Jl))return p(this,Jl).displayName;if("label"in p(this,Jl))return p(this,Jl).label}toJSON(){return{__type:kp.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(p(this,jg)))delete p(this,jg)[e]}};jg=new WeakMap,Jl=new WeakMap,l(kp,"Hyperlink"),b(kp,"__type","hyperlink");var eS=kp,fc=eS;y();y();function Ug(r){return typeof r=="string"?r:r.id}l(Ug,"getId");function nS(r){return Array.isArray(r)&&Number.isFinite(r[0])&&Number.isFinite(r[1])}l(nS,"isPosition");var rS=8,el=l(r=>typeof r=="number"?r.toFixed(rS):nS(r)?r[1].toFixed(rS)+"-"+r[0].toFixed(rS):r.map(t=>el(t)).join("-"),"serializeCoords"),$B=l(r=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,e=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(r)||e.test(r)},"isPrivateCdnAsset"),ob=l(r=>{if(!$B(r))return null;let t="";r.startsWith("https://")?(t="https://",r=r.slice(8)):r.startsWith("http://")&&(t="http://",r=r.slice(7));let[e,n,i]=r.split("/");return{origin:t+e,mapId:n,fileName:i}},"parseCdnAssetUrl");var zg,dc,Fp,Rp=class Rp extends si{constructor(e){super(String(Mr()));b(this,"__type",Rp.__type);R(this,zg,{});R(this,dc);R(this,Fp);V(this,dc,e.mvfData),V(this,Fp,e.mapData)}static is(e){return e.__type===Rp.__type}get url(){let e=p(this,dc).url;if(p(this,Fp).tokenManager==null)return e;let n=ob(p(this,dc).url);if(n==null)return e;let i=n.mapId;try{if(p(this,Fp).tokenManager.isEnterpriseMode())return e;let a=p(this,Fp).tokenManager.getSasToken(i).token;if(a==null||a==="")throw new Error("SAS token empty!");return"".concat(e,"?").concat(a)}catch(a){return tt.error("Error getting SAS token for image",{error:a,url:e}),e}}get name(){return p(this,dc).altText}get altText(){return p(this,dc).altText}toJSON(){return{__type:Rp.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let e of globalThis.Object.keys(p(this,zg)))delete p(this,zg)[e]}};zg=new WeakMap,dc=new WeakMap,Fp=new WeakMap,l(Rp,"ImageMetaData"),b(Rp,"__type","image");var iS=Rp,mc=iS;var vd,Kl,Ql,oS=class oS extends la{constructor(e,n){super(n.properties.id,e);R(this,vd);R(this,Kl);R(this,Ql,{});V(this,vd,e),V(this,Kl,n)}get externalId(){var e;return(e=p(this,Kl).properties.externalId)!=null?e:""}get name(){var n,i,a,u;let e=(i=(n=p(this,Kl).properties.details)==null?void 0:n.name)!=null?i:"";return e===""&&(e=(u=(a=this.locationProfiles.find(h=>h.name&&h.name.length>0))==null?void 0:a.name)!=null?u:""),e}get description(){var n,i,a,u;let e=(i=(n=p(this,Kl).properties.details)==null?void 0:n.description)!=null?i:"";return e===""&&(e=(u=(a=this.locationProfiles.find(h=>h.description&&h.description.length>0))==null?void 0:a.description)!=null?u:""),e}get images(){var n,i,a,u,h;if(p(this,Ql).images!=null)return p(this,Ql).images;let e=(a=(i=(n=p(this,Kl).properties.details)==null?void 0:n.images)==null?void 0:i.map(d=>new mc({mvfData:d,mapData:p(this,vd)})))!=null?a:[];return(e==null||e.length===0)&&(e=(h=(u=this.locationProfiles.find(d=>d.images.length>0))==null?void 0:u.images)!=null?h:[]),p(this,Ql).images=e,e}get links(){var n,i,a,u,h;if(p(this,Ql).links!=null)return p(this,Ql).links;let e=(a=(i=(n=p(this,Kl).properties.details)==null?void 0:n.links)==null?void 0:i.map(d=>new fc({mvfData:d})))!=null?a:[];return(e==null||e.length===0)&&(e=(h=(u=this.locationProfiles.find(d=>d.links.length>0))==null?void 0:u.links)!=null?h:[]),p(this,Ql).links=e,e}get locationProfiles(){var e;return(e=p(this,vd).locationProfilesByAttachedFeatureId[this.id])!=null?e:[]}};vd=new WeakMap,Kl=new WeakMap,Ql=new WeakMap,l(oS,"DetailedMapData");var Hi=oS;var Hg,Gp,bd,xd,Bp=class Bp extends Hi{constructor(e,n){super(e,n.mvfData);b(this,"__type",Bp.__type);R(this,Hg);R(this,Gp);R(this,bd,{});R(this,xd);V(this,Hg,e),V(this,Gp,n.floorId),V(this,xd,n.mvfData)}static is(e){return e.__type===Bp.__type}get center(){return p(this,bd).center==null&&(p(this,bd).center=Ti(p(this,xd),p(this,Gp))),p(this,bd).center}get floor(){let e=p(this,Hg).getById("floor",p(this,Gp));if(e==null)throw new Error("Floor ".concat(p(this,Gp)," not found!"));return e}get geoJSON(){return rt(U({},p(this,xd)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:Bp.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Hg=new WeakMap,Gp=new WeakMap,bd=new WeakMap,xd=new WeakMap,l(Bp,"Area"),b(Bp,"__type","area");var sS=Bp,tu=sS;y();var jp,eu,Up,_d,Vp=class Vp extends Hi{constructor(e,n){super(e,n.mvfData);b(this,"__type",Vp.__type);R(this,jp);R(this,eu);R(this,Up);R(this,_d);V(this,eu,{}),V(this,_d,n.mvfData),V(this,jp,e),V(this,Up,n.floorId)}static is(e){return e.__type===Vp.__type}get floor(){let e=p(this,jp).getById("floor",p(this,Up));if(e==null)throw new Error("Floor ".concat(p(this,Up)," not found!"));return e}get center(){return p(this,eu).center==null&&(p(this,eu).center=Ti(p(this,_d),p(this,Up))),p(this,eu).center}get isExterior(){var i;let e=p(this,jp).obstructionIdByEntranceId[this.id],n=p(this,jp).getMVFFeatureById("obstruction",e);return(i=n==null?void 0:n.properties.footprintComponent)!=null?i:!1}get geoJSON(){return rt(U({},p(this,_d)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Vp.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let e of Object.keys(p(this,eu)))delete p(this,eu)[e]}};jp=new WeakMap,eu=new WeakMap,Up=new WeakMap,_d=new WeakMap,l(Vp,"Door"),b(Vp,"__type","door");var aS=Vp,ca=aS;y();var gc,Hp,as,rl,zp=class zp extends Hi{constructor(e,n){super(e,n.mvfData);b(this,"__type",zp.__type);R(this,gc);R(this,Hp);R(this,as,{});R(this,rl);V(this,gc,e),V(this,Hp,n.floorId),V(this,rl,n.mvfData)}getMvfData(){return p(this,rl)}static is(e){return e.__type===zp.__type}get type(){return KB(p(this,rl).properties.kind)}get locations(){if(p(this,as).locations)return p(this,as).locations;p(this,as).locations=[];let e=p(this,gc).mvfLocationsBySpaceId[p(this,rl).properties.id];if((e==null?void 0:e.length)>0)for(let n of e){let i=p(this,gc).getById("enterprise-location",n.id);i&&p(this,as).locations.push(i)}return p(this,as).locations}get floor(){let e=p(this,gc).getById("floor",p(this,Hp));if(e==null)throw new Error("Floor ".concat(p(this,Hp)," not found!"));return e}get doors(){return p(this,rl).properties.destinationNodes.reduce((e,n)=>{let i=p(this,gc).doorsByNodeId[n];return i&&e.push(i),e},[])}get center(){return p(this,as).center==null&&(p(this,as).center=Ti(p(this,rl),p(this,Hp))),p(this,as).center}get geoJSON(){return rt(U({},p(this,rl)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:zp.__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(p(this,as)))delete p(this,as)[e]}};gc=new WeakMap,Hp=new WeakMap,as=new WeakMap,rl=new WeakMap,l(zp,"Space"),b(zp,"__type","space");var lS=zp,JB=["room","hallway","exterior","void","gate","connection.stairs","connection.elevator","poi"];function KB(r){if(r==null||r==="default")return"room";let t=r.toLowerCase();return JB.includes(t)?t:"room"}l(KB,"validateSpaceType");var ui=lS;y();var ws,Gr,ls,Cd,sb,Xp=class Xp extends la{constructor(e,n){super(n.mvfData.properties.id,e);R(this,Cd);b(this,"__type",Xp.__type);R(this,ws);R(this,Gr,{});R(this,ls);V(this,ws,e),V(this,ls,n.mvfData)}static is(e){return e.__type===Xp.__type}get focusTarget(){return this}get name(){var e,n;return"name"in p(this,ls).properties?(n=yt(this,Cd,sb).call(this,"name"))!=null?n:"":(e=p(this,ls).properties.externalId)!=null?e:""}get shortName(){var e,n;return"shortName"in p(this,ls).properties?(n=yt(this,Cd,sb).call(this,"shortName"))!=null?n:"":(e=p(this,ls).properties.externalId)!=null?e:""}get subtitle(){var e;return(e=yt(this,Cd,sb).call(this,"subtitle"))!=null?e:""}get externalId(){var e;return(e=p(this,ls).properties.externalId)!=null?e:""}get elevation(){return p(this,ls).properties.elevation}get spaces(){if(p(this,Gr).spaces==null){let e=p(this,ws).spaces.filter(n=>n.floor.id===this.id);p(this,Gr).spaces=e}return p(this,Gr).spaces}get geoJSON(){var e;return{type:"Feature",properties:null,geometry:(e=p(this,ls).geometry)!=null?e:{type:"Polygon",coordinates:[]}}}get objects(){if(p(this,Gr).objects==null){let e=p(this,ws).objects.filter(n=>n.floor.id===this.id);p(this,Gr).objects=e}return p(this,Gr).objects}get connections(){if(p(this,Gr).connections==null){let e=p(this,ws).connections.filter(n=>n.floors.includes(this));p(this,Gr).connections=e}return p(this,Gr).connections}get doors(){if(p(this,Gr).doors==null){let e=p(this,ws).doors.filter(n=>n.floor.id===this.id);p(this,Gr).doors=e}return p(this,Gr).doors}get annotations(){if(p(this,Gr).annotations==null){let e=p(this,ws).annotations.filter(n=>n.floor.id===this.id);p(this,Gr).annotations=e}return p(this,Gr).annotations}get pois(){if(p(this,Gr).pois==null){let e=p(this,ws).pointsOfInterest.filter(n=>n.floor.id===this.id);p(this,Gr).pois=e}return p(this,Gr).pois}get floorStack(){if(p(this,Gr).floorStack==null){let e=p(this,ws).floorStacks.find(n=>n.floors.includes(this));p(this,Gr).floorStack=e}return p(this,Gr).floorStack}get center(){return p(this,Gr).center==null&&(p(this,Gr).center=Ti(p(this,ls),this.id)),p(this,Gr).center}toJSON(){return{__type:Xp.__type,id:this.id,name:this.name,shortName:this.shortName,subtitle:this.subtitle,elevation:this.elevation,spaces:this.spaces.map(e=>e.id),objects:this.objects.map(e=>e.id),connections:this.connections.map(e=>e.id),doors:this.doors.map(e=>e.id),annotations:this.annotations.map(e=>e.id),pois:this.pois.map(e=>e.id)}}destroy(){for(let e of globalThis.Object.keys(p(this,Gr)))delete p(this,Gr)[e]}};ws=new WeakMap,Gr=new WeakMap,ls=new WeakMap,Cd=new WeakSet,sb=l(function(e){let n=p(this,ls).properties[e];return p(this,ws).getPropTranslation(this.__type,e,this.id,n)},"#translate"),l(Xp,"Floor"),b(Xp,"__type","floor");var uS=Xp,Io=uS;y();y();y();var Xg=l(r=>r!=null,"notNull");y();function Yg(r){let t;if(ui.is(r)||ca.is(r)||Vo.is(r)||tu.is(r)||Ps.is(r))t=r.center;else if(ru.is(r)||nu.is(r))t=r.coordinate;else if(ve.is(r))t=r;else if($l.is(r))t=r.coordinate;else if(nl.is(r))t=r.coordinates[0];else return;return t}l(Yg,"getCoordinateFromStuffs");y();y();var Yp={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},il="ExteriorWalls",yc="Walls",y7=0,Sd="InteriorDoors",Id="ExteriorDoors",Gn="GeometryLayer",iu="LabelsLayer",ol="MarkersLayer",qg="FootprintLayer",qp="OcclusionLayer",sl="ImagesLayer",Wp="FacadesLayer";var v7=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],b7={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};var QB=new Set(["outdoorView","bearing","pitch","zoomLevel","screenOffsets","debug","initialFloor","shadingAndOutlines","wallTopColor","style","multiFloorView","occlusion","imagePlacementOptions","flipImagesToFaceCamera","injectStyles","useStandaloneCamera","preloadFloors","hideImagesNotOnCurrentFloor"]),tG=new Set(["style","enabled","layersHiddenByGeometry","lowDpi"]);function cS(r){var t,e;(t=r.outdoorView)!=null&&t.enabled&&!((e=r.outdoorView)!=null&&e.token)&&tt.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}l(cS,"validateOptions");function pS(r,t){var i,a,u,h,d,m;let e=((i=r==null?void 0:r.outdoorView)==null?void 0:i.token)||t.outdoorViewToken,n=rt(U(U({},Yp),r),{outdoorView:U({enabled:((a=r==null?void 0:r.outdoorView)==null?void 0:a.enabled)===void 0?!!e:(u=r==null?void 0:r.outdoorView)==null?void 0:u.enabled,layersHiddenByGeometry:(h=Yp.outdoorView)==null?void 0:h.layersHiddenByGeometry},r==null?void 0:r.outdoorView),bearing:(m=(d=r==null?void 0:r.bearing)!=null?d:t.naturalBearing)!=null?m:0,imagePlacementOptions:U(U({},Yp.imagePlacementOptions),r==null?void 0:r.imagePlacementOptions),multiFloorView:U(U({},Yp.multiFloorView),r==null?void 0:r.multiFloorView)});return e&&n.outdoorView&&(n.outdoorView.token=e),n}l(pS,"handleShow3DMapOptionDefault");function x7(r){let t={remove_watermark:!1};if(r)try{let e=z0(r);Object.assign(t,e.capabilities)}catch(e){tt.error("Error decoding capabilities from token",e)}return t}l(x7,"handleTokenCapabilities");function _7(r){let t=Object.fromEntries(Object.entries(r).filter(([e])=>QB.has(e)));return t.outdoorView&&(t.outdoorView=Object.fromEntries(Object.entries(t.outdoorView).filter(([e])=>tG.has(e)))),t}l(_7,"getPublicOptions");var vc,Es,ou,Zp=class Zp extends Hi{constructor(e,n){let i=Object.values(n.mvfDataByFloorId)[0];super(e,i);b(this,"__type",Zp.__type);R(this,vc);R(this,Es);R(this,ou);V(this,Es,{}),V(this,vc,e),V(this,ou,n.mvfDataByFloorId)}static is(e){return e.__type===Zp.__type}get accessible(){var e;return(e=Object.values(p(this,ou))[0].properties.accessible)!=null?e:!1}get type(){var e,n;return(n=(e=Object.values(p(this,ou))[0].properties.kind)==null?void 0:e.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(p(this,ou))[0].properties.extra}get coordinates(){return p(this,Es).coordinates==null&&(p(this,Es).coordinates=Object.entries(p(this,ou)).map(([e,n])=>Ti(n,e))),p(this,Es).coordinates}get nodes(){return Object.values(p(this,ou))[0].properties.nodes.map(e=>p(this,vc).getById("node",e))}get floors(){return this.coordinates.map(e=>e.floorId?p(this,vc).getById("floor",e.floorId):void 0).filter(Xg)}get locationProfiles(){var n,i,a,u,h;if(p(this,Es).locationProfiles!=null)return p(this,Es).locationProfiles;let e=super.locationProfiles;if(e==null||e.length===0){let d=[(i=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?i:0,(u=(a=this.coordinates[0])==null?void 0:a.latitude)!=null?u:0],m=el(d),v=(h=p(this,vc).mvfConnectionIdsByLatLon[m])!=null?h:[];for(let x of v){let S=p(this,vc).locationProfilesByAttachedFeatureId[x];if(S!=null){e=S;break}}}return p(this,Es).locationProfiles=e!=null?e:[],e}get focusTarget(){return this.coordinates}toJSON(){return{__type:Zp.__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(p(this,Es)))delete p(this,Es)[e]}};vc=new WeakMap,Es=new WeakMap,ou=new WeakMap,l(Zp,"Connection"),b(Zp,"__type","connection");var hS=Zp,bc=hS;y();var Wg,Jp,xc,Kp,$p=class $p extends Hi{constructor(e,n){super(e,n.mvfData);b(this,"__type",$p.__type);R(this,Wg);R(this,Jp);R(this,xc,{});R(this,Kp);V(this,Wg,e),V(this,Jp,n.floorId),V(this,Kp,n.mvfData)}static is(e){return e.__type===$p.__type}get type(){let e=p(this,Kp).properties.kind;return e==null&&(e="object"),e==="Desks"&&(e="desk"),e.toLowerCase()}get floor(){let e=p(this,Wg).getById("floor",p(this,Jp));if(e==null)throw new Error("Floor ".concat(p(this,Jp)," not found!"));return e}get center(){return p(this,xc).center==null&&(p(this,xc).center=Ti(p(this,Kp),p(this,Jp))),p(this,xc).center}get geoJSON(){return rt(U({},p(this,Kp)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:$p.__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(p(this,xc)))p(this,xc)[e]=null}};Wg=new WeakMap,Jp=new WeakMap,xc=new WeakMap,Kp=new WeakMap,l($p,"MapObject"),b($p,"__type","object");var fS=$p,Vo=fS;y();var Zg,th,_c,Md,Qp=class Qp extends Hi{constructor(e,n){super(e,n.mvfData);b(this,"__type",Qp.__type);R(this,Zg);R(this,th);R(this,_c,{});R(this,Md);V(this,Zg,e),V(this,Md,n.mvfData),V(this,th,n.floorId)}static is(e){return e.__type===Qp.__type}get floor(){let e=p(this,Zg).getById("floor",p(this,th));if(e==null)throw new Error("Floor ".concat(p(this,th)," not found!"));return e}get coordinate(){return p(this,_c).coordinate==null&&(p(this,_c).coordinate=Ti(p(this,Md),p(this,th))),p(this,_c).coordinate}get geoJSON(){return rt(U({},p(this,Md)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Qp.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let e in p(this,_c))p(this,_c)[e]=null}};Zg=new WeakMap,th=new WeakMap,_c=new WeakMap,Md=new WeakMap,l(Qp,"PointOfInterest"),b(Qp,"__type","point-of-interest");var dS=Qp,ru=dS;y();var $g,rh,Cc,nh,Jg,gS,eh=class eh extends Hi{constructor(e,n){super(e,n.mvfData);R(this,Jg);b(this,"__type",eh.__type);R(this,$g);R(this,rh);R(this,Cc,{});R(this,nh);V(this,$g,e),V(this,rh,n.floorId),V(this,nh,n.mvfData)}static is(e){return e.__type===eh.__type}get group(){return yt(this,Jg,gS).call(this).group}get type(){return yt(this,Jg,gS).call(this).type}get coordinate(){return p(this,Cc).coordinate==null&&(p(this,Cc).coordinate=Ti(p(this,nh),p(this,rh))),p(this,Cc).coordinate}get floor(){let e=p(this,$g).getById("floor",p(this,rh));if(e==null)throw new Error("Floor ".concat(p(this,rh)," not found!"));return e}get geoJSON(){return rt(U({},p(this,nh)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:eh.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let e of Object.keys(p(this,Cc)))delete p(this,Cc)[e]}};$g=new WeakMap,rh=new WeakMap,Cc=new WeakMap,nh=new WeakMap,Jg=new WeakSet,gS=l(function(){let[e,n]=p(this,nh).properties.symbolId.split("--");return{group:e,type:n}},"#getGroupAndTypeFromSymbolId"),l(eh,"Annotation"),b(eh,"__type","annotation");var mS=eh,nu=mS;y();var eG=new Set(["wall","area"]),rG=new Set(["void","desk-entrance"]),nG=l((r,t)=>{var d,m,v,x,S,I,w,E,T,D,A;let e={},n={},i={},a={},u={},h={};for(let L of r["location.json"]||[]){let B=new ih(t,{mvfData:L});if(e[L.id]=B,L.externalId&&(a[L.externalId]==null&&(a[L.externalId]=[]),a[L.externalId].push(B)),L.categories)for(let W of L.categories)u[W]==null&&(u[W]=[]),u[W].push(B);let j=[...(m=(d=L.obstructions)==null?void 0:d.map(W=>W.id))!=null?m:[],...(x=(v=L.spaces)==null?void 0:v.map(W=>W.id))!=null?x:[],...(I=(S=L.annotations)==null?void 0:S.map(W=>W.id))!=null?I:[],...(w=L.connections)!=null?w:[],...(T=(E=L.entrances)==null?void 0:E.map(W=>W.id))!=null?T:[],...(A=(D=L.areas)==null?void 0:D.map(W=>W.id))!=null?A:[]];for(let W of j)W&&(h[W]==null&&(h[W]=[]),h[W].push(B))}for(let L of r["category.json"]||[]){let B=new Qg(t,{mvfData:L});n[L.id]=B,L.parent&&(i[L.parent]==null&&(i[L.parent]=[]),i[L.parent].push(B))}return{locationCategoriesByParentId:i,locationProfilesById:e,locationCategoriesById:n,locationProfilesByExternalId:a,locationProfilesByCategoryId:u,locationProfilesByAttachedFeatureId:h}},"processMVFLocationProfilesAndCategories"),iG=l((r,t,e)=>{var E,T;let n={},i={},a={},u={},h={},d={},m={},v={},x={},S={},I={},w=globalThis.Object.keys(r.space);for(let D of w){let A=r.space[D];if(A!=null){for(let L of A.features)if(I[L.properties.id]=D,d[L.properties.id]=L,L.properties.kind==="desk-entrance"&&(h[L.properties.externalId]==null&&(h[L.properties.externalId]=[]),h[L.properties.externalId].push(...L.properties.destinationNodes)),!rG.has((E=L.properties.kind)!=null?E:"")){if((T=L.properties.kind)!=null&&T.includes("connection")){let B=el(L.geometry.coordinates);x[B]==null&&(x[B]=[]),x[B].push(L.properties.id);continue}if(L.properties.kind==="poi"){let B=new ru(e,{floorId:D,mvfData:L});a[L.properties.id]=B,v[D]||(v[D]=[]),v[D].push(L),L.properties.externalId&&(u[L.properties.externalId]==null&&(u[L.properties.externalId]=[]),u[L.properties.externalId].push(B))}else{let B=new ui(e,{floorId:D,mvfData:L});n[L.properties.id]=B,L.properties.externalId&&(i[L.properties.externalId]==null&&(i[L.properties.externalId]=[]),i[L.properties.externalId].push(B)),m[D]||(m[D]=[]),m[D].push(L)}}}}for(let D in x){let A=x[D],L={};for(let j of A){let W=I[j],$=d[j],F=t==null?void 0:t["n_"+$.properties.id.split("s_")[1]];L[W]=rt(U({},$),{properties:rt(U({},$.properties),{accessible:(F==null?void 0:F.accessible)===!0})})}let B=new bc(e,{mvfDataByFloorId:L});S[B.id]=B}return{spacesById:n,spacesByExternalId:i,poisById:a,poisByExternalId:u,connectionsById:S,objectEntranceNodeIdsByObstructionId:h,mvfSpacesById:d,connectionIdsByLatLon:x,mvfSpacesByFloorId:m,mvfPoisByFloorId:v}},"processMVFSpaces"),oG=l((r,t)=>{var u,h;let e={},n={},i={},a={};for(let d of r["node.geojson"].features){i[d.properties.id]=d;let m=new $l(t,{mvfData:d,floorId:(u=d.properties.floor)!=null?u:d.properties.map});e[d.properties.id]=m,d.properties.externalId&&(n[d.properties.externalId]==null&&(n[d.properties.externalId]=[]),n[d.properties.externalId].push(m));let v=(h=d.properties.floor)!=null?h:d.properties.map;a[v]||(a[v]=[]),a[v].push(d)}return{nodesById:e,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}},"processMVFNodes"),sG=l((r,t)=>{var h,d;let e={},n={},i={},a={},u=globalThis.Object.keys(r.obstruction);for(let m of u){let v=r.obstruction[m];if(v!=null)for(let x of v.features){i[x.properties.id]=x;for(let I of x.properties.entrances)a[I]=x.properties.id;if(eG.has((d=(h=x.properties.kind)==null?void 0:h.toLowerCase())!=null?d:""))continue;let S=new Vo(t,{floorId:m,mvfData:x});e[x.properties.id]=S,x.properties.externalId&&(n[x.properties.externalId]==null&&(n[x.properties.externalId]=[]),n[x.properties.externalId].push(S))}}return{objectsById:e,objectsByExternalId:n,mvfObstructionById:i,obstructionIdByEntranceId:a}},"processMVFObstructions"),aG=l((r,t)=>{let e={},n={},i={};if("floor.geojson"in r&&r["floor.geojson"]!=null)for(let a of r["floor.geojson"].features){i[a.properties.id]=a.properties;let u=new Io(t,{mvfData:a});e[a.properties.id]=u,a.properties.externalId&&(n[a.properties.externalId]==null&&(n[a.properties.externalId]=[]),n[a.properties.externalId].push(u))}else for(let a of r["map.geojson"]){i[a.id]=a;let u=new Io(t,{mvfData:{properties:a}});e[a.id]=u}return{floorsById:e,floorsByExternalId:n,mvfFloorsById:i}},"processMVFFloors"),lG=l((r,t)=>{var d;let e={},n={},i={},a={},u={},h=r["floorstack.json"]||r["mapstack.json"]||r["mapstack.geojson"];if(h!=null)for(let m of h){let v=(d=r.facade)==null?void 0:d[m.id],x=new Vg(t,{mvfData:m,facadeId:v==null?void 0:v.id});if(e[m.id]=x,m.externalId&&(n[m.externalId]==null&&(n[m.externalId]=[]),n[m.externalId].push(x)),i[m.id]=m,v){let S=new Ps(t,{mvfData:v,floorStackId:m.id});a[v.id]=S;for(let I of v.spaces)u[I.spaceId]=S}}return{floorStacksById:e,floorStacksByExternalId:n,mvfFloorStacksById:i,facadesById:a,facadesBySpaceId:u}},"processMVFFloorStacks"),uG=l((r,t)=>{let e={},n={},i=r["connection.json"].reduce((a,u)=>{u.nodes.forEach(d=>a[d]=u),e[u.id]=u;let h=t==null?void 0:t[u.nodes[0]];if(h!=null){let d=el(h.geometry.coordinates);n[d]==null&&(n[d]=[]),n[d].push(u.id)}return a},{});return{mvfConnectionsById:e,mvfConnectionsByNodeId:i,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),cG=l((r,t)=>{let e={},n={},i={},a={},u={},h=globalThis.Object.keys(r.entrance);for(let d of h){let m=r.entrance[d];if(m!=null)for(let v of m.features){a[v.properties.id]=v;let x=new ca(t,{floorId:d,mvfData:v});v.properties.node&&(i[v.properties.node]=x),e[v.properties.id]=x,v.properties.externalId&&(n[v.properties.externalId]==null&&(n[v.properties.externalId]=[]),n[v.properties.externalId].push(x)),u[d]||(u[d]=[]),u[d].push(v)}}return{doorsById:e,doorsByExternalId:n,doorsByNodeId:i,mvfEntrancesById:a,mvfEntrancesByFloorId:u}},"processMVFEntrances"),pG=l((r,t,e)=>{var n;if(r.textAreas!=null)for(let i in r.textAreas){let a=(n=r.textAreas[i])==null?void 0:n.features;if(a!=null){for(let u of a)if("anchorId"in u.properties){let h=u==null?void 0:u.properties,d=t[h.anchorId]||e[h.anchorId];if(d!=null&&h!=null){let m=d.properties;m.textArea=h,m.textArea&&(m.textArea.position=u.geometry.coordinates)}}}}},"processMVFTextAreas"),hG=l((r,t,e)=>{var n;if(r.floorImages!=null)for(let i in r.floorImages){let a=(n=r.floorImages[i])==null?void 0:n.features;if(a!=null){for(let u of a)if("anchorId"in u.properties){let h=u==null?void 0:u.properties,d=t[h.anchorId]||e[h.anchorId];if(d!=null&&h!=null){let m=d.properties;m.image=h,m.image&&(m.image.position=u.geometry.coordinates)}}}}},"processMVFPolygonImages"),fG=l((r,t)=>{var n,i;if(((n=r.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let e=(i=r.enterprise)==null?void 0:i.enterpriseStyles;for(let a in e){let u=e[a];u.geometryAnchors.forEach(h=>{let d=t[h.geometryId];if(d!=null){let m=d.properties;m.style={styleId:a,edgeOffset:u.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),dG=l((r,t,e)=>{if(!(r.enterprise==null||r.enterprise.textures==null))for(let n of r.enterprise.textures)for(let i of n.geometryAnchors){let a=t[i.geometryId]||e[i.geometryId];if(a!=null){let u=a.properties;u.textures==null&&(u.textures=[]),u.textures.push(n)}}},"processMVFEnterpriseTextures"),mG=l((r,t)=>{let e={},n={},i={};if(r.annotation==null)return{annotationsById:e,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i};let a=globalThis.Object.keys(r.annotation);for(let u of a){let h=r.annotation[u];if(h!=null)for(let d of h.features){n[d.properties.id]=d;let m=new nu(t,{floorId:u,mvfData:d});e[d.properties.id]=m,i[u]||(i[u]=[]),i[u].push(d)}}return{annotationsById:e,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i}},"processMVFAnnotations"),gG=l((r,t)=>{let e={},n={},i={};if(r.area==null)return{areasById:e,areasByExternalId:n,mvfAreasById:i};let a=globalThis.Object.keys(r.area);for(let u of a){let h=r.area[u];if(h!=null)for(let d of h.features){i[d.properties.id]=d;let m=new tu(t,{floorId:u,mvfData:d});e[d.properties.id]=m,d.properties.externalId&&(n[d.properties.externalId]==null&&(n[d.properties.externalId]=[]),n[d.properties.externalId].push(m))}}return{areasById:e,areasByExternalId:n,mvfAreasById:i}},"processMVFAreas"),C7=l((r,t)=>{var A,L,B,j,W,$,F,J,ot,K,H,_t,ct;let e={},n={},i={},a={},u=((L=(A=r.enterprise)==null?void 0:A.locations)!=null?L:[]).reduce((ft,mt)=>(ft[mt.id]=mt,ft),{}),h={},d={},m={},v={},x={},S={},I=((B=r.enterprise)==null?void 0:B.venue)||{},w={},E={},T={};for(let ft of(W=(j=r.enterprise)==null?void 0:j.categories)!=null?W:[]){let mt=new Kg(t,{mvfData:ft});h[ft.id]=mt,ft.externalId&&(d[ft.externalId]==null&&(d[ft.externalId]=[]),d[ft.externalId].push(mt)),m[ft.id]=ft,ft.locations.forEach(St=>{x[St]==null&&(x[St]=[]),x[St].push(ft.id)})}let D={};for(let ft of(F=($=r.enterprise)==null?void 0:$.locationInstances)!=null?F:[]){let mt=u[ft.parent],St=Object.keys(mt),dt={};for(let q of St)dt[q]=void 0;let xt=U(rt(U({},dt),{polygons:[],nodes:[]}),ft);D[xt.parent]==null&&(D[xt.parent]=[]),D[xt.parent].push(new nl(t,{mvfData:xt,categoryIds:((ot=(J=r.enterprise)==null?void 0:J.categoryPriorities)==null?void 0:ot[xt.id])||x[xt.id],parentId:ft.parent})),w[xt.id]=ft}for(let ft in r.space){let mt=r.space[ft];if(mt!=null)for(let St of mt.features){for(let dt of St.properties.destinationNodes)E[dt]==null&&(E[dt]=[]),E[dt].push(St.properties.id);T[St.properties.id]=St.properties.destinationNodes}}for(let ft of(H=(K=r.enterprise)==null?void 0:K.locations)!=null?H:[]){let mt=new nl(t,{mvfData:ft,categoryIds:((ct=(_t=r.enterprise)==null?void 0:_t.categoryPriorities)==null?void 0:ct[ft.id])||x[ft.id],locationInstances:D[ft.id]});i[ft.id]=mt,ft.externalId&&(a[ft.externalId]==null&&(a[ft.externalId]=[]),a[ft.externalId].push(mt)),ft.nodes.forEach(St=>{S[St.id]==null&&(S[St.id]=[]),S[St.id].push(ft.id)});for(let St of ft.polygons)v[St.id]==null&&(v[St.id]=[]),v[St.id].push(ft)}if(t.enterpriseMode===!0){for(let ft in t.mvfConnectionsById){let mt={},St=t.mvfConnectionsById[ft];for(let dt of t.mvfConnectionsById[ft].nodes){let xt=t.nodesById[dt];xt!=null&&(mt[xt.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[xt.coordinate.longitude,xt.coordinate.latitude]},properties:{id:ft,externalId:St.externalId,kind:"enterprise."+St.type,destinationNodes:[],flags:"",type:St.type,nodes:St.nodes,accessible:St.accessible,extra:St.extra,details:St.details}})}Object.keys(mt).length>0&&(e[ft]=new bc(t,{mvfDataByFloorId:mt}),St.externalId&&(n[St.externalId]==null&&(n[St.externalId]=[]),n[St.externalId].push(e[ft])))}t.connectionsById=e}return{spaceIdsByNodeId:E,connectionsByExternalId:n,locationIdsByNodeId:S,mvfLocationsBySpaceId:v,mvfLocationsById:u,mvfCategoriesById:m,locationsById:i,locationsByExternalId:a,locationInstancesById:w,categoriesById:h,categoriesByExternalId:d,destinationNodesIdsBySpaceId:T,venue:I}},"createEnterpriseDataFromMVF"),S7=l((r,t)=>{let{nodesById:e,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:a}=oG(r,t),{mvfConnectionsById:u,mvfConnectionsByNodeId:h,mvfConnectionIdsByLatLon:d}=uG(r,i),{spacesById:m,spacesByExternalId:v,poisById:x,poisByExternalId:S,mvfSpacesById:I,objectEntranceNodeIdsByObstructionId:w,connectionsById:E,connectionIdsByLatLon:T,mvfSpacesByFloorId:D,mvfPoisByFloorId:A}=iG(r,h,t),{objectsById:L,objectsByExternalId:B,mvfObstructionById:j,obstructionIdByEntranceId:W}=sG(r,t),{floorsById:$,floorsByExternalId:F,mvfFloorsById:J}=aG(r,t),{floorStacksById:ot,floorStacksByExternalId:K,mvfFloorStacksById:H,facadesById:_t,facadesBySpaceId:ct}=lG(r,t),{doorsById:ft,doorsByExternalId:mt,doorsByNodeId:St,mvfEntrancesById:dt,mvfEntrancesByFloorId:xt}=cG(r,t),{annotationsById:q,mvfAnnotationsById:ee,mvfAnnotationsByFloorId:Gt}=mG(r,t),{areasById:Kt,areasByExternalId:It,mvfAreasById:ie}=gG(r,t);hG(r,I,j),pG(r,I,j),fG(r,I),dG(r,I,j);let{locationCategoriesByParentId:vr,locationProfilesById:Qe,locationCategoriesById:Nt,locationProfilesByExternalId:At,locationProfilesByCategoryId:Ct,locationProfilesByAttachedFeatureId:_e}=nG(r,t);return{spacesById:m,spacesByExternalId:v,nodesById:e,nodesByExternalId:n,objectsById:L,objectsByExternalId:B,floorsById:$,floorsByExternalId:F,floorStacksById:ot,floorStacksByExternalId:K,facadesById:_t,facadesBySpaceId:ct,connectionsById:E,doorsById:ft,doorsByExternalId:mt,doorsByNodeId:St,poisById:x,poisByExternalId:S,annotationsById:q,areasById:Kt,areasByExternalId:It,objectEntranceNodeIdsByObstructionId:w,obstructionIdByEntranceId:W,connectionIdsByLatLon:T,locationProfilesById:Qe,locationCategoriesById:Nt,locationProfilesByExternalId:At,locationProfilesByCategoryId:Ct,locationCategoriesByParentId:vr,mvfSpacesById:I,mvfNodesById:i,mvfObstructionById:j,mvfFloorsById:J,mvfFloorStacksById:H,mvfConnectionsById:u,mvfConnectionsByNodeId:h,mvfEntrancesById:dt,mvfAnnotationsById:ee,mvfNodesByFloorId:a,mvfSpacesByFloorId:D,mvfPoisByFloorId:A,mvfAreasById:ie,mvfEntrancesByFloorId:xt,mvfAnnotationsByFloorId:Gt,locationProfilesByAttachedFeatureId:_e,mvfConnectionIdsByLatLon:d}},"createDataFromMVF");y();y();y();var yG=l(function(){let t=globalThis.fetch;return{fetch(...e){if(!Xg(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...e)},setFetch(e){t=e}}},"createFetchControl")(),I7=yG.fetch;var E7=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],M7=E7[0],O7="https://api-gateway.mappedin.com/track-analytics/a/",D7="deny-watchposition",L7="load-mapview",A7="load-mapdata",N7="change-language",k7="query-directions";var al,Os,su,vS,ab,bS=class bS{constructor(){R(this,su);R(this,al,Object.freeze({}));R(this,Os);b(this,"oneTimeEventsSent",new Set);b(this,"sendGetDirectionsEvent",n_((t,e)=>this.sendAnalyticEvent(k7,{start:t,end:e,type:"location_to_location"}),2500));V(this,Os,yt(this,su,ab).call(this,p(this,al)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){V(this,al,{}),V(this,Os,yt(this,su,ab).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return V(this,al,Object.freeze(Object.assign({},p(this,al),t))),V(this,Os,yt(this,su,ab).call(this,t)),yt(this,su,vS).call(this,p(this,Os)),p(this,Os)}updateState(t){let e=U({},t);e.mapId&&(e.analyticsBaseUrl=yS(rt(U({},p(this,Os)),{mapId:e.mapId}))),e.context&&(e.context=P7(e.context)),e.baseUri&&(e.analyticsBaseUrl=yS({baseUri:e.baseUri,mapId:p(this,Os).mapId})),Object.assign(p(this,Os),e),this.handleStateUpdate(t),yt(this,su,vS).call(this,e)}handleStateUpdate(t){var e;(e=t.userPosition)!=null&&e.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:e,accessToken:n}=this.getState();return!!(t&&e)||!!n}getState(){return p(this,Os)}getContext(){return this.getState().context||p(this,al).context||M7}getSessionId(){return this.getState().sessionId||p(this,al).sessionId||w7()}getDeviceId(){return this.getState().deviceId||p(this,al).deviceId||T7()}sendAnalyticEvent(t,e={}){let n=this.getState(),i=vG(n.analyticsBaseUrl,t),a={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(n.logEvents&&tt.log("Analytics.track",i,a),!n.sendEvents)return Promise.resolve();if(!this.authReady)return tt.warn("Auth needs to be ready to send analytics.");let u=rt(U({},e),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(u,n.userPosition),a["Content-Type"]="application/json",n.accessToken?a.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(a["x-mappedin-key"]=btoa(n.key),a["x-mappedin-secret"]=btoa(n.secret)),I7(i,{method:"POST",mode:"cors",headers:a,body:JSON.stringify(u)})}capture(t,e){if(xG.includes(t))return tt.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=bG.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,e)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(A7,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(N7,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(D7)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:e,collisionWorkerDisabled:n,outdoorsWorkerDisabled:i}){return this.sendAnalyticEvent(L7,{type:"3d",firstRenderDuration:t,width:e.width,height:e.height,devicePixelRatio:globalThis.devicePixelRatio||1,collisionWorkerDisabled:n,outdoorsWorkerDisabled:i})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};al=new WeakMap,Os=new WeakMap,su=new WeakSet,vS=l(function(t){t.sessionId&&Xl.getInstance().saveSessionData("id",t.sessionId),t.deviceId&&Xl.getInstance().saveLocalData("deviceId",t.deviceId)},"#saveStateToStorage"),ab=l(function(t){var n,i,a,u;let e=(n=t.baseUri)!=null?n:O7;return{baseUri:e,analyticsBaseUrl:yS(rt(U({},t),{baseUri:e})),version:((i=P==null?void 0:P.env)==null?void 0:i.npm_package_version)||"v6",deviceId:t.deviceId||T7(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||w7(),platformString:t.platformString||"",context:P7(t.context)||M7,geolocationMode:!1,sendEvents:(a=t.sendEvents)!=null?a:!0,logEvents:(u=t.logEvents)!=null?u:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),l(bS,"AnalyticsInternal");var Td=bS;function yS({mapId:r,baseUri:t=O7}){return"".concat(t).concat(r,"/")}l(yS,"getBaseUrl");function T7(){return Xl.getInstance().loadLocalData("deviceId")}l(T7,"getDeviceIDFromStorage");function w7(){return Xl.getInstance().loadSessionData("id")}l(w7,"getSessionIDFromStorage");function vG(r,t){return r+t}l(vG,"buildUrl");function P7(r){return E7.find(t=>t===r)}l(P7,"getValidContext");var bG=["$select-location","$select-category","$query-suggest","$query-search"],xG=[L7,A7,k7,D7,N7],rPt=new Td,Ds,xS=class xS{constructor(t){R(this,Ds);b(this,"capture");b(this,"updateState");V(this,Ds,t),this.capture=p(this,Ds).capture.bind(p(this,Ds)),this.updateState=p(this,Ds).updateState.bind(p(this,Ds))}getState(){let i=p(this,Ds).getState(),{sessionId:t,deviceId:e}=i;return ea(i,["sessionId","deviceId"])}getContext(){return p(this,Ds).getContext()}getSessionId(){return p(this,Ds).getSessionId()}getDeviceId(){return p(this,Ds).getDeviceId()}};Ds=new WeakMap,l(xS,"Analytics");var ty=xS;y();var _G=new Set(["polygons"]),pa,xn,jo,ey,oh=class oh extends si{constructor(e,n){super(n.mvfData.externalId);b(this,"__type",oh.__type);b(this,"description");b(this,"name","");b(this,"amenity");b(this,"externalId","");b(this,"extra");b(this,"gallery");b(this,"instances");b(this,"logo");b(this,"operationHours");b(this,"phone");b(this,"picture");b(this,"shortName");b(this,"showFloatingLabelWhenImagePresent");b(this,"showLogo");b(this,"siblingGroups");b(this,"social");b(this,"sortOrder",-1);b(this,"states");b(this,"tags");b(this,"type","");b(this,"hidden",!1);R(this,pa);R(this,xn,{});R(this,jo);R(this,ey);V(this,pa,e),V(this,jo,n.mvfData),V(this,ey,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let i in n.mvfData)!_G.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{enumerable:!0,get(){if(n.parentId){let a=p(this,pa).locationsById[n.parentId];return p(this,jo)[i]!=null?p(this,pa).getPropTranslation(this.__type,i,p(this,jo).id,p(this,jo)[i]):p(this,pa).getPropTranslation(this.__type,i,p(this,jo).id,a[i])}return p(this,pa).getPropTranslation(this.__type,i,p(this,jo).id,p(this,jo)[i])}})}static is(e){return e.__type===oh.__type}get focusTarget(){return this.spaces}get categories(){return p(this,xn).categories?p(this,xn).categories:(p(this,xn).categories=(p(this,ey).map(e=>p(this,pa).getById("enterprise-category",e))||[]).filter(Boolean),p(this,xn).categories)}get coordinates(){if(p(this,xn).coordinates)return p(this,xn).coordinates;p(this,xn).coordinates=[];for(let e=0;e<this.nodes.length;e++)p(this,xn).coordinates.push(this.nodes[e].coordinate);return p(this,xn).coordinates}get nodes(){if(p(this,xn).nodes)return p(this,xn).nodes;p(this,xn).nodes=[];for(let e=0;e<p(this,jo).nodes.length;e++){let n=p(this,pa).getById("node",p(this,jo).nodes[e].id);n&&p(this,xn).nodes.push(n)}return p(this,xn).nodes}get spaces(){if(p(this,xn).spaces)return p(this,xn).spaces;p(this,xn).spaces=[];for(let e=0;e<p(this,jo).polygons.length;e++){let n=p(this,pa).getById("space",p(this,jo).polygons[e].id);n&&p(this,xn).spaces.push(n)}return p(this,xn).spaces}toJSON(){return{__type:oh.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(p(this,xn)))delete p(this,xn)[e]}};pa=new WeakMap,xn=new WeakMap,jo=new WeakMap,ey=new WeakMap,l(oh,"EnterpriseLocation"),b(oh,"__type","enterprise-location");var _S=oh,nl=_S;y();var CG=new Set,ah,Mo,ll,sh=class sh extends si{constructor(e,n){super(n.mvfData.externalId);b(this,"__type",sh.__type);b(this,"name","");b(this,"color");b(this,"externalId","");b(this,"extra");b(this,"icon");b(this,"iconFromDefaultList");b(this,"sortOrder",-1);b(this,"picture");R(this,ah);R(this,Mo,{});R(this,ll);V(this,ah,e),V(this,ll,n.mvfData);for(let i in n.mvfData)!CG.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{get(){return p(this,ah).getPropTranslation(this.__type,i,p(this,ll).id,p(this,ll)[i])}})}static is(e){return e.__type===sh.__type}get children(){if(p(this,Mo).children)return p(this,Mo).children;p(this,Mo).children=[];for(let e=0;e<p(this,ll).children.length;e++){let n=p(this,ah).getById("enterprise-category",p(this,ll).children[e]);n&&p(this,Mo).children.push(n)}return p(this,Mo).children}get locations(){if(p(this,Mo).locations)return p(this,Mo).locations;p(this,Mo).locations=[];for(let e=0;e<p(this,ll).locations.length;e++){let n=p(this,ah).getById("enterprise-location",p(this,ll).locations[e]);n&&p(this,Mo).locations.push(n)}return p(this,Mo).locations}toJSON(){return{__type:sh.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(p(this,Mo)))delete p(this,Mo)[e]}};ah=new WeakMap,Mo=new WeakMap,ll=new WeakMap,l(sh,"EnterpriseCategory"),b(sh,"__type","enterprise-category");var CS=sh,Kg=CS;y();var SG=new Set,ry,ny,lh=class lh extends si{constructor(e,n){super(n.mvfData.externalId);b(this,"__type",lh.__type);b(this,"countrycode");b(this,"externalId","");b(this,"defaultLanguage",{code:"en",name:"English"});b(this,"defaultMap");b(this,"extra");b(this,"icon");b(this,"languages",[]);b(this,"links",[]);b(this,"logo");b(this,"mappedinWebUrl");b(this,"slug","");b(this,"topLocations");b(this,"tzid");R(this,ry,{});R(this,ny);V(this,ny,n.mvfData);for(let i in n.mvfData)!SG.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&(this[i]=n.mvfData[i])}static is(e){return e.__type===lh.__type}get name(){var e;return(e=p(this,ny).name)!=null?e:""}toJSON(){return{__type:lh.__type,id:this.id,name:this.name}}destroy(){for(let e of Object.keys(p(this,ry)))delete p(this,ry)[e]}};ry=new WeakMap,ny=new WeakMap,l(lh,"EnterpriseVenue"),b(lh,"__type","enterprise-venue");var SS=lh,lb=SS;y();y();function wd(r){return r.endsWith("/")?r:"".concat(r,"/")}l(wd,"normalizeUrl");y();var Pd="https://app.mappedin.com/",R7="https://auth.mappedin.com/";y();y();var IG=l(r=>{let t=Date.now();return r-t},"fromNow"),ub=l((r,t)=>IG(r)<=t*60*1e3,"shouldRefreshToken");var B7=60,G7=B7*60*1e3,F7="accessTokens";async function iy(r,t=!1){let e="".concat(r.key),n=Xl.getInstance(),i=(n==null?void 0:n.loadSessionData(F7))||{},a=Math.floor(Date.now()/1e3);if(i[e]&&!ub(i[e].expiresTimestamp*1e3,B7))return i[e];let u=t?await MG(r,a):await TG(r,a),h=rt(U({},i),{[e]:u});return n==null||n.saveSessionData(F7,h),u}l(iy,"getAccessToken");async function MG(r,t){var a;let e="".concat((a=r.baseAuthUri)!=null?a:R7,"oauth2/token"),n=await ha()(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:r.key,client_secret:r.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}l(MG,"fetchAccessTokenEnterprise");async function TG(r,t){let e="".concat(r.baseAuthUri?wd(r.baseAuthUri):Pd,"api/api-key/token"),n=await ha()(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:r.key,secret:r.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}l(TG,"fetchAccessToken");y();var j7=60,U7=j7*60*1e3,V7="miSasTokens";async function IS(r,t){let e="".concat(t,"__").concat(r.mapId),n=Xl.getInstance(),i=(n==null?void 0:n.loadSessionData(V7))||{};if(i[e]&&!ub(i[e].expires,j7))return i[e];let a=await wG(r,t),u=rt(U({},i),{[e]:{token:a.token,expires:new Date(a.expires).getTime()}});return n==null||n.saveSessionData(V7,u),a}l(IS,"getSasToken");async function wG(r,t){let e="".concat(r.baseUri?wd(r.baseUri):Pd,"api/v1/venue/").concat(r.mapId,"/sas-token"),n=await ha()(e,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{token:i.token,expires:new Date(i.expires).getTime()}}l(wG,"fetchSasToken");var z7=globalThis.fetch,Y7,PG=(Y7=P==null?void 0:P.env)==null?void 0:Y7.npm_package_version;function ha(){if(z7==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return z7}l(ha,"isomorphicFetch");var MS={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function q7(r){var e;let t=U(U({},MS),r);return t.headers=rt(U({},t.headers),{"mappedin-sdk-version":PG}),t.things=[],"platformString"in r&&(t.headers=rt(U({},t.headers),{"mappedin-platform-version":r.platformString})),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(e=t.language)==null?void 0:e.toLowerCase(),t}l(q7,"parseOptions");function EG(r,t,e=!1){let n={language:r.language,clientId:r.clientId,clientSecret:r.clientSecret};e&&delete n.language;let{headers:i}=r;i["Content-Type"]=i["Content-Type"]||"text/json",r.accessToken?i.Authorization="Bearer ".concat(r.accessToken):r.noAuth||r.clientId&&r.clientSecret&&(i["x-mappedin-key"]=btoa(r.clientId),i["x-mappedin-secret"]=btoa(r.clientSecret));let a={method:"GET",headers:i};return r.secure&&(t+="&withcdntoken"),{req:a,url:t}}l(EG,"constructParamsForRequest");async function OG(r,t,e=!1){let n=EG(r,t,e),i=await ha()(n.url,n.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}l(OG,"generateAPIRequest");var DG=l(r=>{let t=r!=null&&typeof r=="object"&&"perspectives"in r&&r.perspectives!=null&&typeof r.perspectives=="object"?r.perspectives:null;if(t==null||Object.keys(t).length===0)return tt.warn("No perspectives available in response!"),null;let e={};for(let[n,i]of Object.entries(t)){let a="url"in i&&typeof i.url=="string"?i.url:null,u="locale_packs"in i&&typeof i.locale_packs=="object"?i.locale_packs:null;if(a==null||u==null){tt.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}e[n]={url:a,locale_packs:u}}return e},"getPerspectivesFromResponse");async function LG(r,t="exports/mvf/1/bundle"){var m,v;let e=q7(U(U({baseUri:"https://api-gateway.mappedin.com/"},MS),r)),n="".concat(e.baseUri+t,"?venue=").concat(e.venue,"&version=").concat((m=e.version)!=null?m:"2.0.0");e.headers["Content-Type"]="application/zip";let i=await OG(e,n),a=i.url,u=i.locale_packs,h=(v=e.perspective)!=null?v:MS.perspective,d=DG(i);if(h!=null&&h!==""&&d!=null){let x=d[h];x==null?tt.warn("Perspective ".concat(h," not found in response! Loading default perspective instead.")):(tt.log('Loading perspective "'.concat(h,'"')),a=x.url,u=x.locale_packs)}return{url:a,localePacks:u,updated_at:i.updated_at}}l(LG,"getVenueMVFURL");var Ed=function(){let r;return()=>(r||(r=new TextDecoder),r)}();async function TS(r,{signal:t}){let e=await(await ha()(r,{signal:t})).arrayBuffer();return new Uint8Array(e)}l(TS,"getLanguagePackUnitArray");async function Od(r){let e=(await import("./browser-6HMQAV4T.js")).unzipSync(r),n={};if(e["enterprise/"]!=null){n.enterprise={};let i=e["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(Ed().decode(i)));let a=e["enterprise/locationInstances.json"];a&&(n.enterprise.locationInstances=JSON.parse(Ed().decode(a)));let u=e["enterprise/categories.json"];u&&(n.enterprise.categories=JSON.parse(Ed().decode(u)))}return e["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(Ed().decode(e["floorstack.json"]))),e["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(Ed().decode(e["floor.geojson"]))),e["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(Ed().decode(e["manifest.json"]))),n}l(Od,"parseLanguagePack");async function W7(r,{signal:t}){try{let e=await(await ha()(r,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(e);return await Od(n)}catch(e){let n=new Error("downloadLanguagePack failed");throw n.cause=e,n}}l(W7,"downloadLanguagePack");async function wS(r){return new Promise(async(t,e)=>{try{let n=r.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:i,localePacks:a}=await LG(r,n),u=await ha()(i).then(d=>d.arrayBuffer()),h=new Uint8Array(u);t({compressed:h,localePacks:a})}catch(n){e(n)}})}l(wS,"downloadVenueBundleMVFAPIGateway");async function PS(r,t){return new Promise(async(e,n)=>{try{let{url:i}=await AG(r,t),a=await ha()(i).then(h=>h.arrayBuffer()),u=new Uint8Array(a);e(u)}catch(i){n(i)}})}l(PS,"downloadMVF");async function AG(r,t){let e=new URL("".concat(r.baseUri?wd(r.baseUri):Pd,"api/venue/").concat(r.mapId,"/mvf"));r.viewId&&e.searchParams.set("configId",r.viewId),r.mvfVersion&&e.searchParams.set("version",r.mvfVersion);let n=await ha()(e.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}l(AG,"getMakerBundleURL");function pb(r){var n,i,a,u,h,d,m,v,x,S,I,w,E,T,D,A,L,B;let t=new TextDecoder,e=t.decode.bind(t);try{let j={"connection.json":JSON.parse(e(r["connection.json"])),"manifest.geojson":JSON.parse(e(r["manifest.geojson"])),"map.geojson":r["map.geojson"]?JSON.parse(e(r["map.geojson"])):void 0,"mapstack.geojson":r["mapstack.geojson"]?JSON.parse(e(r["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(e(r["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":r["tileset.json"]?JSON.parse(e(r["tileset.json"])):void 0};if(r.enterprise!=null&&(j.enterprise={},(n=r.enterprise)!=null&&n["locations.json"]&&(j.enterprise.locations=JSON.parse(e((i=r.enterprise)==null?void 0:i["locations.json"]))),(a=r.enterprise)!=null&&a["categories.json"]&&(j.enterprise.categories=JSON.parse(e((u=r.enterprise)==null?void 0:u["categories.json"]))),(h=r.enterprise)!=null&&h["venue.json"]&&(j.enterprise.venue=JSON.parse(e((d=r.enterprise)==null?void 0:d["venue.json"]))),(m=r.enterprise)!=null&&m["layers.json"]&&(j.enterprise.layers=JSON.parse(e((v=r.enterprise)==null?void 0:v["layers.json"]))),(x=r.enterprise)!=null&&x["locationInstances.json"]&&(j.enterprise.locationInstances=JSON.parse(e((S=r.enterprise)==null?void 0:S["locationInstances.json"]))),(I=r.enterprise)!=null&&I["enterpriseStyles.json"]&&(j.enterprise.enterpriseStyles=JSON.parse(e((w=r.enterprise)==null?void 0:w["enterpriseStyles.json"]))),(E=r.enterprise)!=null&&E["textures.json"]&&(j.enterprise.textures=JSON.parse(e((T=r.enterprise)==null?void 0:T["textures.json"]))),(D=r.enterprise)!=null&&D["floorText.json"]&&(j.enterprise.floorText=JSON.parse(e((A=r.enterprise)==null?void 0:A["floorText.json"]))),(L=r.enterprise)!=null&&L["categoryPriorities.json"]&&(j.enterprise.categoryPriorities=JSON.parse(e((B=r.enterprise)==null?void 0:B["categoryPriorities.json"])))),r["floorstack.json"]!=null?j["floorstack.json"]=JSON.parse(e(r["floorstack.json"])):r["mapstack.json"]!=null&&(j["mapstack.json"]=JSON.parse(e(r["mapstack.json"]))),j["floorstack.json"]==null&&j["mapstack.json"]==null&&j["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(r["floor.geojson"]&&(j["floor.geojson"]=JSON.parse(e(r["floor.geojson"]))),j["floor.geojson"]==null&&j["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in r&&(j["styles.json"]=JSON.parse(e(r["styles.json"]))),"shapes.json"in r&&(j["shapes.json"]=JSON.parse(e(r["shapes.json"]))),"location.json"in r&&(j["location.json"]=JSON.parse(e(r["location.json"]))),"category.json"in r&&(j["category.json"]=JSON.parse(e(r["category.json"]))),r.annotation!=null){j.annotation={};let $=Object.keys(r.annotation);for(let F of $){let J=F.replace(/\.json|\.geojson/g,"");j.annotation[J]=JSON.parse(e(r.annotation[F]))}}let W=Object.keys(r.space);for(let $ of W){let F=$.replace(/\.json|\.geojson/g,"");j.space[F]=JSON.parse(e(r.space[$]))}if(r.obstruction!=null){let $=Object.keys(r.obstruction);for(let F of $){let J=F.replace(/\.json|\.geojson/g,"");j.obstruction[J]=JSON.parse(e(r.obstruction[F]))}}else j.obstruction={};if(r.entrance!=null){let $=Object.keys(r.entrance);for(let F of $){let J=F.replace(/\.json|\.geojson/g,"");j.entrance[J]=JSON.parse(e(r.entrance[F]))}}else j.entrance={};if("floorImages"in r&&r.floorImages!=null){j.floorImages={};for(let $ of Object.keys(r.floorImages)){let F=$.replace(/\.json|\.geojson/g,"");j.floorImages[F]=JSON.parse(e(r.floorImages[$]))}}if("textAreas"in r&&r.textAreas!=null){j.textAreas={};for(let $ of Object.keys(r.textAreas)){let F=$.replace(/\.json|\.geojson/g,"");j.textAreas[F]=JSON.parse(e(r.textAreas[$]))}}if("facade"in r&&r.facade!=null){j.facade={};for(let $ of Object.keys(r.facade)){let F=$.replace(/\.json|\.geojson/g,"");j.facade[F]=JSON.parse(e(r.facade[$]))}}if("area"in r&&r.area!=null){j.area={};for(let $ of Object.keys(r.area)){let F=$.replace(/\.json|\.geojson/g,"");j.area[F]=JSON.parse(e(r.area[$]))}}return j}catch(j){throw tt.error(j),new Error("MVF parsing failed! Probably encountered a bad file.")}}l(pb,"parseMVF");function NG(r){if(r==null||typeof r!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in r?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in r?"floorstack.json":"mapstack.json"in r?"mapstack.json":"mapstack.geojson"];"styles.json"in r&&t.push("styles.json"),"shapes.json"in r&&t.push("shapes.json");for(let e of t)if(r[e]==null||r[e][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}l(NG,"validateStaticMVFFiles");async function hb(r){return new Promise(async(t,e)=>{try{if(r==null||typeof r!="object")throw new Error("Error parsing data! Unzipping failed.");if(r[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let i=(await import("./browser-6HMQAV4T.js")).unzipSync(r);if(!NG(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let a={},u=Object.keys(i);for(let h of u){if(i[h].length===0)continue;let d=h.split("/");if(d.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(d.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(d.length===1){a[d[0]]=i[h];continue}if(d[0]==="image"){tt.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else a[d[0]]==null&&(a[d[0]]={}),a[d[0]][d[1]]=i[h]}t(a)}catch(n){e(n)}})}l(hb,"unzipMVF");function Sc(){let r="us",t={};function e(){return BG(VG(r),t)}return l(e,"getState"),{updateByUserOption(n){var i,a;n.environment&&(r=n.environment),n.baseUri&&(t.baseUri=n.baseUri),n.baseAuthUri&&(t.baseAuthUri=n.baseAuthUri),(i=n.analytics)!=null&&i.baseUri&&(t.analyticsBaseUri=(a=n.analytics)==null?void 0:a.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){r=n},getBaseUri(n){return r==="us"&&n?H7.baseUri:e().baseUri},getBaseAuthUri(n=!1){return r==="us"&&n?H7.baseAuthUri:e().baseAuthUri},getAnalyticsBaseUri(){return e().analyticsBaseUri},getTileServerUri(){return e().tileServerUri},reset(){r="us",t={}},__getState:e}}l(Sc,"createEnvControl");var Z7=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"}),H7=Object.freeze(rt(U({},Z7),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),kG=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"}),RG=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"});function BG(r,t){return U(U({},r),t)}l(BG,"getAuthStateByEnvironment");var GG={eu:kG,us:Z7,"us-staging-enterprise":RG,"us-staging-self-serve":FG};function VG(r){return GG[r]}l(VG,"getEnvironmentAuthState");var fb=l(r=>{var e,n;let t=Object.values((n=(e=r["floorstack.json"])!=null?e:r["mapstack.json"])!=null?n:{});return t.length===1?[]:t.filter(i=>i.type!=="Outdoor").map(i=>i.id.replace("fs_","").replace("ms_",""))},"getBuildingIds"),cb;async function jG(){return cb||(cb=(await import("./dist-NFOUUHU5.js")).extractAndConvertMVFv3,cb)}l(jG,"getExtractAndConvertMvfV3");var X7=l(async r=>{let t=performance.now(),e=await(await jG())(r);return tt.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),e.inspectErr(n=>{throw tt.error(n),new Error("MVFv3 parsing failed!")}),e.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function oy(r,t="2.0.0"){switch(t){case"2.0.0":try{let e=await hb(r);return pb(e)}catch(e){return X7(r)}case"3.0.0":return X7(r);default:throw new Error("Unsupported MVF version: ".concat(t))}}l(oy,"unzipAndParseMVFv2");y();y();y();y();var FZ={};K2(FZ,{ACTION_TYPE:()=>AM,Annotation:()=>nu,Area:()=>tu,BEARING_TYPE:()=>f2,CONNECTION_TYPE:()=>NM,Connection:()=>bc,Coordinate:()=>ve,DOORS:()=>I1,Directions:()=>ju,Door:()=>ca,E_SDK_LOG_LEVEL:()=>Mw,EnterpriseCategory:()=>Kg,EnterpriseLocation:()=>nl,EnterpriseVenue:()=>lb,Facade:()=>Ps,Floor:()=>Io,FloorStack:()=>Vg,Hyperlink:()=>fc,ImageMetaData:()=>mc,LocationCategory:()=>Qg,LocationProfile:()=>ih,MAPPEDIN_COLORS:()=>b7,MapObject:()=>Vo,Node:()=>$l,PointOfInterest:()=>ru,Space:()=>ui,WALLS:()=>S1,__setWatermarkOnClickFn:()=>DZ,checkWorkerUrls:()=>LL,createMapLibreOverlay:()=>kZ,disableText3DWorker:()=>cL,enableTestMode:()=>NS,findPreferredLanguageInVenue:()=>L2,getMapData:()=>DL,getMapDataEnterprise:()=>NZ,hydrateMapData:()=>_L,hydrateMapDataFromMVF:()=>LZ,parseMVF:()=>pb,preloadFont:()=>$3,setLoggerLevel:()=>Tw,setUseEnterpriseAPI:()=>AZ,setWorkersUrl:()=>gL,show3dMap:()=>AL,show3dMapGeojson:()=>RZ,unzipAndParseMVFv2:()=>oy,unzipMVF:()=>hb});y();y();y();y();var ay,ly,uy,ES=class ES{constructor(t,e,{enabled:n=!1}={}){R(this,ay);b(this,"searchInstance");R(this,ly);R(this,uy);b(this,"enabled",!1);V(this,ay,t),V(this,ly,e),V(this,uy,()=>{var i;(i=this.searchInstance)==null||i.then(a=>a.populate())}),n&&this.enable()}async query(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return tt.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,e)}catch(n){return tt.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,e={}){if(this.enabled||await this.enable(),!this.searchInstance)return tt.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,e)}catch(n){return tt.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-A2RG32A3.js").then(({InternalSearch:t})=>new t(p(this,ay)))),p(this,ly).on("language-change",p(this,uy)),await this.searchInstance)}};ay=new WeakMap,ly=new WeakMap,uy=new WeakMap,l(ES,"Search");var sy=ES;var $7=new WeakMap,uh,Tn,DS=class DS{constructor(t,{search:e}={}){R(this,uh);R(this,Tn);b(this,"Analytics");b(this,"Search");b(this,"Query");b(this,"internal");b(this,"on",l((t,e)=>{p(this,uh).on(t,e)},"on"));b(this,"off",l((t,e)=>{p(this,uh).off(t,e)},"off"));b(this,"getDirections",l((t,e,n)=>p(this,Tn).getDirections(t,e,n),"getDirections"));b(this,"getDirectionsMultiDestination",l((t,e,n)=>p(this,Tn).getDirectionsMultiDestination(t,e,n),"getDirectionsMultiDestination"));V(this,uh,new le),V(this,Tn,t),$7.set(this,t),this.Analytics=new ty(t.Analytics),this.Query=t.Query,this.internal=t,this.Search=new sy(this,t,{enabled:e==null?void 0:e.enabled}),p(this,Tn).on("language-change",n=>{p(this,uh).publish("language-change",n)})}getEnv(){return p(this,Tn).getEnv()}getAccessToken(){var t;return(t=p(this,Tn).tokenManager)==null?void 0:t.getAccessToken().token}get mapName(){return p(this,Tn).mapName}get mapId(){var t;return(t=p(this,Tn).getMapDataOptions)==null?void 0:t.mapId}get mapCenter(){return p(this,Tn).mapCenter}get organizationId(){return p(this,Tn).organizationId}get outdoorViewToken(){return p(this,Tn).outdoorViewToken}getByType(t){return p(this,Tn).getByType(t)}getById(t,e){return p(this,Tn).getById(t,e)}getByExternalId(t,e){return p(this,Tn).getByExternalId(t,e)}getGeoJSON(t){return t.geoJSON}async changeLanguage(t){return p(this,Tn).changeLanguage(t)}get currentLanguage(){return p(this,Tn).currentLanguage}get naturalBearing(){var t;return(t=p(this,Tn).naturalBearing)!=null?t:0}getDistance(t,e){return p(this,Tn).getDistance(t,e)}toBinaryBundle({downloadLanguagePacks:t=!0}={}){return p(this,Tn).toBinaryBundle({downloadLanguagePacks:t})}toJSONBundle({downloadLanguagePacks:t=!0}={}){return p(this,Tn).toJSONBundle({downloadLanguagePacks:t})}};uh=new WeakMap,Tn=new WeakMap,l(DS,"MapData");var OS=DS,cy=OS;function py(r){let t=$7.get(r);if(!t)throw new Error("MapDataInternal not found");return t}l(py,"getMapDataInternal");y();y();y();y();var UG=1e-7;function LS(r){return{type:"Point",coordinates:r}}l(LS,"point");function zG(r,t){let{coordinates:e}=t.geometry,{coordinates:n}=r.geometry,i=e.map(a=>ql(r,LS(a)));return n.reduce((a,u)=>{let h=yv(LS(u),i[0],r),d=yv(LS(u),i[1],r),m=_p(h)<_p(d)?h:d;return m.properties=rt(U({},r.properties),{entrances:[]}),a.concat([m])},[])}l(zG,"splitObstructionByEntrance");function AS(r,t){return t.reduce((e,n)=>{let i={epsilon:UG},a=e.obstructions.findIndex(h=>ed(qa(n),h,i)),u=e.obstructions[a];if(u){let[h,d]=zG(u,n);e.entrances.push(n),e.obstructions.splice(a,1,h,d)}return e},{obstructions:[r],entrances:[]})}l(AS,"findAndSplitObstructionByAllEntrances");y();y();y();y();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:l(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var J7="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wgARCAIABAADAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAP3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAIAAAJAFAAAAAAAAAAAAAAAAAAAAAAAAABAgAAEgCgAAAAAAAAAAAAAAAAAAAABERLSM1zM4zXMzjMoUIqCCSSS8XNC9mpoaVomharWTQAAAAAAAAAAAAAAAAEREtIoZrnGZkucUKFStQQSTFixdNDStF0TWrmiWqbJoAAAAAAAAAAAAAIgiWkZy4HNLzHLXKcxzpzmFYmRkUKFSCCSSxcuampsbR0HSdK9R1R1HTZvWll0mlAAAAAAAAAAAIiKLnLjHNLynLXKcycxzmNYmJmUKFSCAWLFy5qamxvHQvSdJ0nVHUdFm1aparWKAjNWSKAAAAARBEtYzlyXnjmOSuM4U4q4jjOM5a5k5zAyMjOqFCCCCSSS5c0jU1NzoOk6pew7TtjuO1e0646jezWr2WSaUAAAAAECIqtZco55eY464zhTirhOI5Dks5jAwMTIzqhUqQASWLFzSNTY3Og6V646zsO2O47V7DrjqNzWy9nlZ1c0LlrLEk0EQQVipRczIyMU5q5F4U8+vOPOrgThOOuU5jAxMjMzKpUggigJiSSxY0XQ1Njc6TqjtO49CX0D0T0Y7l7E6JdzU1NEvViSalBAWIqVKLSMjIxOauM4U86vPPOrz04TjrkOYwMTIzKJQqQQCKmBJJYutzQ1Njc6TrOyO475fRPRPQjuXsToXWPn6kkkEkhCkEAgggqVMjlrzzzDy7PMPPrhOQ5jBMqoVIIIAAIAJAAJJJLFzWN16TsO49CPTPUl9Q9A6o1LFiSSSSQpCwQQCCCpVMjlrzzyzy7PMPPrhOM5kwM6zKlQQAAQASAASCxY0NI3XpOw7j0I9M9SX0z0DqjU+UqpQqVIBFgEyixJYuWLFDkrzE8o8yvOONOasipBAAAAAAAAAAABJJY2OiO1fQPUj1T0pewuVKlCCqQsBIUSSSSWLlyTM5K808pPLrzziTnrEqQQAAAAAAAAAAASSWNjojtX0D1I9VfSOuND4uzMzqhQqVIALEli5c1jUuQc1vnp5pwJzVmQQAAAAAAAAAAAAAASSaHTHevpHoHTFjMyM6zKlSpABJJcsaGkamhU5q88804E5qzIIAAAAAAAAAAAAAAJJNDpjvX0j0Dqix8dVDMolSpAqCYElixc0XU0IMjlTlrIqAAAAAAAAAAAAAAAAAWNTqjqXYGZkZpUoQQRSFIsSXLroaGhBkcqctZFQAAAAAAAAAAAAAAAACxqdUdS7EngWQCAAQASACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYFSCCAACCQACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAJABAAAAAAAAAJBILEli5Y0LlzQ0Lly5csWLAkgFSChUoUMyhmUMyhQqVKkEEAEAAAAAAAAAkEgsSWLljQuXNDQuXLlyxYsCSAVIKFShQzKGZQzKFCpUqQe+ZmZkUKFCpUEEAAkksWLFzQ0NTU2NzY3Og3NzoNzc2NjU1NS5csSAQVKmZmZGRiYmBgYHOYGBgYGBiZGRkUMypUqQCAASSWLFi5oaGpqbG5sbnQbm50G5ubGxqampcuWJAIIKGZmZGRiYmBgYHOYGBgYGR+jmBzmBzmJiZGZQoQQSSWLmhqbGxudB0nSdJ1HSdR1HSdJ0G5qamhcsWJJJBIIIBUqVKFDIyMDA5jmOU5TlOY5TmOc5znMTEyMyhQggFixc0NTY2NzoOk6TpOo6TqOo6TpOg3NTU0LlixJJIJBAIKkFChQyMjAwOY5jlOU5jnP00yMTnOc5zAwMjMoVIJJLmhqbmx0HQdBubmxqXLkkgAAAAAAAAAAAAAEEFTMzMTEwOc5znMDAyMyhUgkkuaGpsbnQdB0G5ubGpcuSSAAAAAAAAAAAAAAQQVKGZ1gAEEEEFSCACSSxJJJIAAAAAAAAAAAAAAAAAAAAAAABBBBBUggAkkksSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSSSSAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSWBIAAKFiQAAAAAAAAACCpUoUMzIyMzMzMyhQoVKkEEAgkEkklixYuXNDQ0NTQ1NC5cuWJAAAAAAAAAAIKlShQzMjIzMzMzKFChUqQQQCCQSSSWLFyxoXNDQ1NDU0LljUkkAAAAAAAAAAggggEEAgAAAAAAAAAAAAAEkgkkkkkAAAAAAAAAAgggggEAgAAAAAEgEAAAAAAEkgkkuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyyCCCCCCCCAQASCSQWJJJJLEkkkkkgkkEgkAEgAAEAAgEAggEEEEEEEFSCCCCCCAQASCSQWJJJJLEkkkkkgkkEgEgEgAAEAAgEAggEEEEEH5AQQQQVBBAIAAJBIJJJLEkkkkliSSSSSQSSCQSAAAQAQQCCCCCCCCCpBBBBBUEEEAgAAkEgkkksSSSSSWJJJJJJBJIJBIAABABBAIIIIIIIIKg/LCAQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQAQQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQfPgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/xAApEAAABQUBAQACAwACAwAAAAABAgQFFQMGERQWEhNAUAAgMGCAkKCw/9oACAEBAAECAP8AwTZznOf3mc5/YZE41xVivFyM6i7C8C8C8zMzMzMyDyDyDyDwV4K7ldSuZV5VgVwqZ/SCca4qxXmcjOouwvAvEzMzMzMzMyDyDyDwV4K7ldSuRVwKgrgf88TDWMrO4VHOo61Hao7ndzvB3k7yZ5M8i8i8zMzMzMyDyDyDyV5K8keSPJHmm8U3em70nam603Mi8qotUDfk5GqZUdfUc6jrUdqjvUeDvB3kzyZ5M8i8i8zMzMzMzMg8g8leSvJHkjyR5pvFN4pu9N2pOtNzIvKqLWA39PX+/saplJlh1tRfVcKrlVdKrrVdqrvVdzu53Y7sZ2M6mdRdRdBdJSUk5SUB0B0B1K6kdSOxHam7Unek70nei7UXWi6UXKk40l9NaRWWuB8/75E41zKjraq+q41nOq6VXas7VXeq71Hc7ud2O7GdRdRdZQXSUlJSUlAdCugOpXUjqR2I7U3em70nek70nai60XSk5UnGkvItIrKoCsC0FwLgXAuBbube3ubm7uiuFcZcZaZYdZUWVl1dwruVdzrulZ0qulVzqOR3EzgZeZcZcK0Vm3t7W1tbW1tgrBYC0q0q4q8jgRxpuVJzoulB0oOlBzoOVBworqa0iwi0i0q4FwLQWAr2trZ2trb3RWiuFcZaZadbUW1l1ZwruVd0rulZ0qulVzqOR3E7gZeZeK4VorNzb29ra2tsFe2CwFpVxVxV5HAjjTcqTnRdKDpQdKDnQcqDhRXU1pFhVm/ISUnKSkrLSsrKyspJyUhvitOtrLq69Q4qHGu41nGqvqLjrDKhUDW+nv1nP+Oc+vYVArFUEVEWUl1FfQcU7imckzinX0VxFoLgXyMlJykrLS0tLS0rKSclI74rjraq6uvUuKhxruNdxqr6i46wysVA1vp79Zz/AI5z6A4VArFUEVkWUl1FfQcU7imcUzinX0VxFoLZKTlJWVlpaXl5eWlpWUB0BzBxkDr669SvUr666stqqz1xqes/j5AxahFFJXRWp1yZemX0F5HCQkpOUlZaWlpeXl5aWB2lQdAcwcZE7hWcFLgpXqF1ZbVVnUDU9Z/HyBi1CV6SuitTrky9MvoLyL5AXEXEXIXIXKSkpKSkpIHIHIHIrkVxK4yJnCsvrra6uqpPVE354GJVpKaCtOtoryuEiZxM5C5C5C5SUnJSclJSQOQORXIrkVxBxM4VV9dbXV1VJ6om/PAxKtFTQVp1tFeRwkRWitFYKvb2tra2draBUCsFgLCrSrQWitOsqqT1RN+jAxKtJTTWFWitMtMtFYKzb29ra2tnaBUCsFZVhVpVoLRWnWVFJ6om/RgYlWkpprAW73v36zn++c+gOFQKv1GoJv04GCp9Rq/T36zn++c+gOFT7fUagm/TgYKn1+3/AKEeMefHjx8/n8vl8vn8/Hjx5xj9bjHnx48fP5/L5fL5/Px48ecY/wAvOPxceQIFIKIJgSAiBAVuK2FaitINAM4MwMwMsJCQkJCQkJCwosws4tAtItQtgtot4oRSCm+Hy8ecfi48gQKQUQTAkBECArcVsK1FaQaAZwZgZgZYSEhISEhISFhRZhZxaBaRahbBbRbxQikFN8BpfMWgWozWLaLcKAUWpq62vr/DX19YEoJARAhBvK2laytRGgjORlIyEYiMJLfJbxLdJbhLbJbRLaJbJbZLbAWxzHMcxzHMcxzHMDbBrYNbJraNbRrbPbh7dPbx7fOwHYjsZ2UzMZoM0maxbRbhQCi1NXW19fX19fW1QSAiBCDeVtK1laiNBGYjKRkIxEYSW+S3iW6S3CW2S2iW0S2S2yW2AtgLY5jmOY5jmOY5gbYNbJrZNbRraPbZ7cPbp7ePb52A7EdjOymZjW4e3D26e3j2+ZgMwmYhYxY4SEhISEBjKxlYiMJGAjAS3iW9TtynblO26dtUrap2zTtmnbNO2SW2S3isRWYGkG0EAItTW1/h8Phr6+rp6AtwtQs5mI9vntw9tHtk9s1LZqWzUto9tnts9uHt09vHt8zAZhMxCxixwkJCQkIDGVjKxEYSMBGAlvEt6nblO3Kdt0rap21TtmnbNO2SWyS2yW8ViKzA1A2ggBFqa2v8Ph8NfW1dPRFuFqMzGYjW+e3D20e2T2zUtk9tHto1tCzHYj2+e3T24e3D24a3DW4Nuc5znOc4FuBbhbcLbhLcJblO3CW4S3iMRGcrYVECcKYB+cJBoCjM2maDsZ7fPbp7cPbh7cNbhrcG3Oc5znOcC3C24W3C24S3CW5TtwluEt4jERnK2FRAnCmAfnCQaAoxb/7ePl8NbU09PT1NYKHy8Y/ZePl8NbU09PT1NYKHy8Y/4Z6+g1tjb3d+Rk5SVlZWVlZSTkd8Fu3s/b6es/pvX0Gtsbe7vyMnKSkrKysrKSciC8Fu3s/YKnrP9gqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqoqsqsqoFIVwqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqkqsqsqsFIV/Hn8XHj5/H4a+traurq6mpqampqampqampqampqampqampqamrq62tr/D4/Lx5/Fx4+fx+Gvra2rq6upqampqampqamrq6upqampqampqamrq6utra/w+Py/wCgEzNTc5OTs7PT09PT8/Pz09PT07Ozk3Ng9TMxLy0rKSclJSMhIb+9vbu9u7u7u7u7u729vb2/vyEjJSUnKSstLzEzNTc5OTs7Oz09PT8/Pz09PT07Ozk5NzUzMS8tKyknJSUjISG/v727vbu7u7u7u7u9u729v78hIyUlJykrLS8x0nR9H0fR9H0XRdF0XRdD0PQ9F0XRdF0XRdF0fR9H0nSdJ0vS9L0vTdN03TdP0/T9P0/T9P0/T9P0/T9R0/T9P0/T9P0/TdN03S9L0vS9J0nSdJ0fR9H0XRdF0PRdD0PQ9D0PRdF0XRdF0XR9H0fSdJ0nS9L0vS9N03TdN0/T9P0/T9P0/T9P0/T9P1HT9P0/T9P0/T9N03TdL0vS9L0vSS8tLy0tLS0rKysrKysrKysrKystLS0vLS8vLy8vMTExMTExMzMzMTMzMzM1NTUzMzMzMzMzMzExMTExMS8vLy8vLy8tKy0tKysrKysrKysrKysrLS0tLy0vLy8vLzExMTExMTMzMzEzMzMzNTU1MzMzMzMzMzMxMTExMTEvLy8vnOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5znOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5z/9YD//xAArEAEAAgIDAQABBAICAQUAAAAAAVICYgNRYQRBEEBQUzFCIDARYICQoLD/2gAIAQEAAz8A/wDgmhCEI/nYQj+RhjH5ccflxw44YMe0dtmzZs2bNmzZs2bIsjtiwlxy45/Ljn8se0fwuPbjj8uOPy44YQxR2izZs2bNmzZs2bNkWR2xYS45cc/lhP5Y9/wEQwj8sIRD1s2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNmyLMZYZMZ/KJ/dRDCPywhjCI/LZs2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNkWYywlhP5RP/ABj9hDGGMIh69bNmzZs2bNmzZsmybJsmybJsmybJsmybJsmybJs2bNmzZs2bNmzZ7+mMsZYyj9hDGGMIj9NmzZs2bNmzZs2bJsmybJsmybJs2TZNk2TZNk2bJs2bNmzZs2bNmzZ6iWMsXr16hiwYMGDBgwYo/T169/T162bNmzZs2TZNk2T2ntPae09pSlKUpSlPae09p7T2mybJsmzZs2bNmz17+nr16hiwYOPtx9uPtx9sO2DBih69evXr1s2bNmzZsmybJsmye09p7T2lKUpSlKU9p7T2ntNk2TZNmzZs2bNmz17+vr1s2bNmzZs2bNmzZs2evXr169bNmye09p7SlKUp/wC6UpSlKe09p7etmzZs9evWzZs2bNmzZs2bNmzZs2bPXr1s9bNmye09p7SlKUp/7pSlKUp7T29bPWz169evWzZs2bNmzZs2bNmzZs2bNmzZs2evU9plM/vJhMJ7T29bNnrZ62bNmzZs2bNmzZs2bNmzZs2bNnr39J7TKZ/eTCYT3+nr162bNnrZs2bJsntNk2TZPabNmzZs2etnr39JlM/wUwmP09etmzZs2bNk2TZNk2TZNk2bNmzZs2bNnv6TKZ/gphMfp69etk9p7T2ntKUpSlKUp7T2nt69e/pMpn+GmH/j9PXr1Pae09pSySlklKU9p7T29evf0mUz/DTCY/T16lP/AHSlKU/xUpSlP/dKUpT/ABUpT/8AQllKWTJl0y6ZdMumXTLpl0y6ZJSn+QlKWTJl0y6ZdMumXTLpl0y6ZJSn/sn9xKWXTLpn0z6Z9M+mXTLplVlVlVlVlVlVlVlVlVlVlRlVlVlRlVlVlVlVlVlVlVl0z6Z9M4/DPpn0z6ZdMkp/byll0y6Z9M+mfTPpn0y6ZVZVZVZVZVZVZVZVZUZVZUZVZVZVZVZVZVZVZVZVZVZdM+mfTOPwz6Z9M+mTJlVlVlVl0yZ9M2fTPpn0z6Z9M+mbPpn0z6Z9M2fTPpl0yqyqyqyqyqyomiaJomiaJomiaJomjRo0aNGjRo0aNGjRNE0TRNE0TRNE0TRNE0ZVZVZVZVZVZVZM+mbPpn0z6Z9M+mfTNn0z6Z9M+mfTPpl0y6ZVZVZVTVlVlRNE0TRlRNE0TRNE0TRo0aNGjRo0aNGjRomiaJomiaJomiaJomqaJqyq0TRNE0TRNE0TVNE1TVNU1TRNE1TVNU0TRNE0TRNGjRo0aNGjRhWHFHTgh88Pmj8Pnj/V89HBRwf1w4f64cNMXFSHFTFxUxcVIcP9cOGkOCkPno+ej55/D55cEuKemHUIo0aNGjRo0TRNE0TRNE0TVNE0TVNE1TVNE1TRNU0TRNE0TRNGjRo0aNGjRhWHFHThh88Pnj8Pnq+ejgo4P64cP9cOKkOKkOKmLipi4aYuH+uHBSHBSHz0fPR88/h88uCXFNWHUIo0aNGjRo4ZcU9MOoRRFGjRo0aNGjRo0aNGjRo0RRhVxR04IcGP4cGP+jij/GEMI/xjCP3+M/5xhxT/AJwhwT/o4Mv9XBk4p6YdQiiKNGjRo0aNGjRo0aNGjRoijGsOKOnBi4Mfw4I/0cUf4whhH+MYR+/xn/OMOKf84Q4J/wBHBP8Ar/zxrDCsOKkOKjhq4auGrhq4auGjipDjpDGsI/k8awwrDipDio4aOGrhq4auGrho4qQ46QxrCP8A0bHcMLQ47w4rw4buCzgs4O3A4HA4XA4HA4HA4O3BZwWcN3Fdx3hhaGNoR/Dx3DC0OO8OK8OG7gs4LODtwOBwOFwOBwOBwODtwWcFnDdxXcd4YWhjaEf88UftoQh4y6ZuRyuVzOZzeudz+uf1z+uf1z+uf1z+uf1zuf1z+uf1z+uf1z+udzR25nM5o7c3rlcrlZsniOkSj9tCEPGXTNyuVy+uZzOb1z+uf1z+uf1z+uf1z+uf1z+udz+uf1z+uf1z+uf1z+ueO3O5nM5vXK5XKzZPEdMUftoYsemHTDpx9OPpxVcVXDVw1cNXDVw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDVw1cNXFVxVcVXFVx9OPph0w6Yo/bQxY9MOnH04+nH04quKrhq4auGrhq4aOGjho4aOGjho4aOGkOGkOGkOGjho4aOGjho4aOGjhq4auGriq4quKriq4+nH0w6Ydf+wHgcLhcLicTjYdww7hh3DDuGPcMe4Y9ww7hh3DDuGHcONxuJxOFwuBwOB8753z2fPZ89nz3fNd893zXfPd893z3fP/Y+e757uC75/wCyHz/2Q+f+yHBd893z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDgcLhcLicTjYdww7hh3DDuGHcMe4Ydww7hh3DDuGHcONxuJxOFwuBwPnfO+d89nz2fPZ893zXfPd813z3fPd893z/2Pnu+e7gu+f8Ash8/9kPn/shwXcF3z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDdu3bt03bt26bpum6bpum6bt27du3bt26bt26bpum6bpum6bpum6bt03TdN26bpum6bpum7dN03TdN03TdN03TdN03Tdum7dum7dN27dum6bpum6bpum6bpum7du3bt03bpu3bpum6bpum6bpum6bpu3TdN03bpum6bpum6bt03TdN03TdN03TdN03TdN03TduysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysmzKzKzKybMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrJT+2lKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpSn9tKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpT/wDrA//EAB0RAAMBAAMBAQEAAAAAAAAAAAABERIwQFAgkMD/2gAIAQIBAT8A/COlKioqKioqKi+zSoqKioqL59Ro0aKyvpVlZWaNFXiVGkaNFZWV9CsrNGjRpFXepo0V8c69Zo0u1pGilfVnJWaNF+NFXNUaNFfmU0aReamkaNPzNM19VlZWaKysrK/XrKzTNGjRWaKyv+u0/8QAHREBAQACAQUAAAAAAAAAAAAAEQBAUCAQITCQwP/aAAgBAwEBPwD1NkRER07eYiIiNMRERGARERGgIiNAREZRERoCIjiYBERqiIwiI1REcCIiIiIjbkREREREfXZ//9k=";y();y();var K7=!1;function NS(){K7=!0}l(NS,"enableTestMode");function Q7(){return K7}l(Q7,"isTestMode");var kS=class kS{constructor(t){b(this,"backgroundAlpha",1);b(this,"backgroundColor",new rn);b(this,"width",0);b(this,"height",0);b(this,"options",{});b(this,"renderer");b(this,"enabledLayers",new Set([0,1]));b(this,"handleWebGLContextCreationError",l(t=>{var e,n;(n=(e=this.options).onWebGLContextCreationError)==null||n.call(e,t)},"handleWebGLContextCreationError"));b(this,"handleWebGLContextLost",l(t=>{var e,n;(n=(e=this.options).onWebGLContextLost)==null||n.call(e,t)},"handleWebGLContextLost"));b(this,"handleWebGLContextRestored",l(t=>{var e,n;(n=(e=this.options).onWebGLContextRestored)==null||n.call(e,t)},"handleWebGLContextRestored"));var e,n,i,a,u;try{this.options=t,Q7()?(this.renderer={setSize:l(()=>{},"setSize"),state:{reset:l(()=>{},"reset")},properties:{get:l(()=>{},"get")},getSize:l(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:l(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:l(()=>1,"getClearAlpha"),getClearColor:l(()=>new rn,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:l(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:l(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:l(()=>{},"setRenderTarget"),setClearColor:l(()=>{},"setClearColor"),clear:l(()=>{},"clear"),render:l(()=>{},"render"),clearStencil:l(()=>{},"clearStencil"),clearDepth:l(()=>{},"clearDepth"),domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new Ww({canvas:t.canvas,alpha:t.alpha||!1,stencil:!0,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new rn((e=t.backgroundColor)!=null?e:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(h){tt.error(h),t.onWebGLRendererError&&t.onWebGLRendererError(h)}(i=this.domElement())==null||i.addEventListener("webglcontextlost",this.handleWebGLContextLost),(a=this.domElement())==null||a.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(u=this.domElement())==null||u.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,e,n,i,a;this.renderer&&((e=(t=this.renderer).dispose)==null||e.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(a=this.domElement())==null||a.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,e){if(this.renderer){this.renderer.state.reset(),e.layers.disableAll();for(let n of this.enabledLayers.values())e.layers.enable(n);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,e),this.renderer.clearDepth(),e.layers.disableAll(),e.layers.enable(J0.ALWAYS_ON_TOP),this.renderer.render(t,e),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,e){P.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=e,this.renderer.setSize(t,e,!1))}setBackgroundColor(t,e){this.backgroundColor=t,this.backgroundAlpha=e}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};l(kS,"Renderer");var db=kS;y();y();var t9='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';y();y();y();y();y();function e9(r,t){return t.x+t.w<r.x+r.w&&t.x>r.x&&t.y>r.y&&t.y+t.h<r.y+r.h}l(e9,"contains");y();function r9(r,t){let[e,n]=t;return e>=r.x&&e<=r.x+r.w&&n>=r.y&&n<=r.y+r.h}l(r9,"intersectPoint");y();function n9(r,t){let e=t.x,n=t.y,i=t.x+t.w,a=t.y+t.h,u=r.x,h=r.y,d=r.x+r.w,m=r.y+r.h;return e<d&&u<i&&n<m&&h<a}l(n9,"intersects");y();function au(r,t){for(let e=0;e<t.length;e++)r.push(t[e])}l(au,"appendItems");y();var RS=class RS{constructor(t,e,n,i,a){b(this,"x");b(this,"y");b(this,"w");b(this,"h");b(this,"userData");this.userData=typeof a>"u"?null:a,this.x=t,this.y=e,this.w=n,this.h=i}contains(t){return t===this?!1:e9(this,t)}intersects(t){return n9(this,t)}intersectsPoint(t){return r9(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};l(RS,"Rectangle");var Nr=RS;var ch=class ch{constructor(t,e){b(this,"topLeft");b(this,"topRight");b(this,"bottomLeft");b(this,"bottomRight");b(this,"divided",!1);b(this,"boundary");b(this,"capacity",16);b(this,"objects",[]);b(this,"parent");this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:n,h:i}=this.boundary;this.topLeft=new ch(new Nr(t,e,n/2,i/2),this),this.topRight=new ch(new Nr(t+n/2,e,n/2,i/2),this),this.bottomLeft=new ch(new Nr(t,e+i/2,n/2,i/2),this),this.bottomRight=new ch(new Nr(t+n/2,e+i/2,n/2,i/2),this),this.divided=!0}queryRect(t){let e=[];if(this.boundary.intersects(t))e.push(...this.objects);else return[];return this.divided&&(au(e,this.topLeft.queryRect(t)),au(e,this.topRight.queryRect(t)),au(e,this.bottomLeft.queryRect(t)),au(e,this.bottomRight.queryRect(t))),e}queryPoint(t){let e=[];if(this.boundary.intersectsPoint(t))e.push(...this.objects);else return[];return this.divided&&(au(e,this.topLeft.queryPoint(t)),au(e,this.topRight.queryPoint(t)),au(e,this.bottomLeft.queryPoint(t)),au(e,this.bottomRight.queryPoint(t))),e}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(e=>e.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};l(ch,"QuadTree");var Ls=ch;y();y();var i9=["","","low","medium","high","always-visible"];function o9(r){return Math.min(5,Math.max(2,r))}l(o9,"clampTierNumber");function Dd(r){if(typeof r=="number")return o9(r);let t=i9.indexOf(r);return t===-1?3:t}l(Dd,"convertCollisionRankingTierToNumber");function hy(r){let t=o9(r);return i9[t]}l(hy,"convertNumberToCollisionRankingTier");function s9(r,t,e){let n,i,a,u=null,h=0;e||(e={});let d=l(function(){h=e.leading===!1?0:Date.now(),u=null,a=r.apply(n,i),u||(n=i=null)},"later");return function(){let m=Date.now();!h&&e.leading===!1&&(h=m);let v=t-(m-h);return n=globalThis,i=arguments,v<=0||v>t?(u&&(clearTimeout(u),u=null),h=m,a=r.apply(n,i),u||(n=i=null)):!u&&e.trailing!==!1&&(u=setTimeout(d,v)),a}}l(s9,"throttle");function a9(r){let t=r[0].map(e=>{let n=e[0].map(i=>({index:i[4],boundingBox:[i[0],i[1],i[2],i[3]]}));return{enabledAndVisible:e[1]===1,rank:e[2]===1?5:0,x:e[3],y:e[4],shouldCollideWithScreenEdges:e[5]===1,bboxes:n,lockedToStrategyIndex:e[6]}});return{msgId:"-1",totalWidth:r[3],totalHeight:r[2],watermarkWidth:r[4],watermarkHeight:r[5],watermarkPosition:r[6],colliders:t,devicePixelRatio:r[1]}}l(a9,"unpackMessage");y();y();var Ic=200,mb=10;function l9(r,t,e,n,i,a,u="-1"){let h=1/0,d=1/0,m=-1/0,v=-1/0,x=new Nr(-mb,0,5,e),S=new Nr(-mb,0,t,5),I=new Nr(t-5,0,t+mb,e),w=new Nr(0,e-5,t,e+mb),E=XG(t,e,n,i,a),T=[x,S,I,w],D=new Nr(-Ic,-Ic,t+Ic*2,e+Ic*2);for(let j of r){let W,$;for(let F=0;F<j.bboxes.length;F++){if(j.bboxes[F]==null||(W=j.bboxes[F].boundingBox,$=j.bboxes[F].index,j.lockedToStrategyIndex!==-1&&$!==j.lockedToStrategyIndex))continue;let[J,ot,K,H]=W,[_t,ct,ft,mt]=[j.y-J,j.y+ot,j.x-K,j.x+H],St=ft,dt=_t,xt=mt-ft,q=ct-_t;h=Math.min(h,St)-Ic,d=Math.min(d,dt)-Ic,m=Math.max(m,St+xt)+Ic,v=Math.max(v,dt+q)+Ic,j.bboxes[F].boundingRect=new Nr(St,dt,xt,q)}}let A={msgId:u,colliders:new Array(r.length),debug:[]},L=new Ls(new Nr(h,d,m-h,v-d)),B;for(let j=0;j<r.length;j++)if(B=r[j],A.colliders[j]=[-1,0],B.enabledAndVisible){let[W,$,F]=[1/0,-1,void 0];for(let{index:J,boundingRect:ot}of B.bboxes){if(ot==null)continue;let K=[];if(K=L.queryRect(ot).filter(_t=>ot.intersects(_t)),B.shouldCollideWithScreenEdges&&T.forEach(_t=>{ot.intersects(_t)&&K.push(_t)}),ot.intersects(E)){A.colliders[j]=[-1,0,ot];break}if(K.length<=W&&(F=ot,$=J,W=K.length),K.length===0){L.insert(ot),A.colliders[j]=[J,D.contains(ot)?0:1,ot];break}}B.rank===5&&F!=null&&(L.insert(F),A.colliders[j]=[$,D.contains(F)?0:1,F])}else A.colliders[j]=[-1,0];return A}l(l9,"processColliders");function XG(r,t,e,n,i){switch(i){case"top-right":return new Nr(r-e,0,e,n);case"bottom-left":return new Nr(0,t-n,e,n);case"bottom-right":return new Nr(r-e,t-n,e,n);case"top-left":return new Nr(0,0,e,n)}}l(XG,"getWatermarkBoundary");var FS=class FS{constructor(){b(this,"onmessage",l(()=>{},"onmessage"));b(this,"postMessage",l(t=>{let e=a9(t);this.onmessage({data:l9(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId)})},"postMessage"));b(this,"terminate",l(()=>{},"terminate"))}};l(FS,"SyncWorker");var gb=FS;var ph=!1,YG=150,BS=class BS extends le{constructor(e,n,i=!0){super();b(this,"worker");b(this,"debugContext");b(this,"debugCanvas");b(this,"collidersDirty",!0);b(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);b(this,"visibleCollidersQTree",new Ls(new Nr(0,0,0,0)));b(this,"interactiveCollidersQTree",new Ls(new Nr(0,0,0,0)));b(this,"coreState");b(this,"postMessage");b(this,"showCollisionBoxes",l(()=>{ph=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));b(this,"hideCollisionBoxes",l(()=>{ph=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));b(this,"currentMsgId","");b(this,"working",!1);b(this,"_postMessage",l(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));b(this,"componentArray",[]);b(this,"update",l((e,n,i="bottom-left",a=!1)=>{let u=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let h;for(let d of this.coreState.geometry2DIdsInScene){let m=this.coreState.geometry2DMap.get(d);m&&(h=m.components[0],this.componentArray.push(h))}this.resize(e,n,i),this.collidersDirty=!1,u=!0}else u=this.componentArray.some(h=>h.collisionDirty===!0);u&&this.componentArray.sort((h,d)=>d.rank-h.rank);for(let h=0;h<this.componentArray.length;h++)if(this.packedMessage){let d=this.componentArray[h].toPackedMessage(a&&!u);this.packedMessage[0][h]==null&&(this.packedMessage[0][h]=[]),this.packedMessage[0][h][0]==null&&(this.packedMessage[0][h][0]=[]),this.packedMessage[0][h][0]=d.bboxes,this.packedMessage[0][h][1]=d.enabled&&this.componentArray[h].visible&&!this.componentArray[h].isOccluded?1:0,this.packedMessage[0][h][2]=d.rank===5?1:0,this.packedMessage[0][h][3]=d.x,this.packedMessage[0][h][4]=d.y,this.packedMessage[0][h][5]=d.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][h][6]=d.lockedToStrategyIndex}this.working||this.postMessage()},"update"));b(this,"resolve",l(e=>{if(this.working=!1,this.collidersDirty||!e.data)return;let n=e.data.colliders,i=-1,a,u,h;ph&&(this.visibleCollidersQTree=new Ls(new Nr(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new Ls(new Nr(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let d=0;d<this.componentArray.length;d++){let m=this.componentArray[d];n[d]!=null&&(i=n[d][0],a=n[d][2],m.offscreen=n[d][1]===1,i!==-1&&a!=null?(h=new Nr(a.x,a.y,a.w,a.h,{entityId:m.id}),ph&&this.visibleCollidersQTree.insert(h),u=this.coreState.geometry2DMap.get(m.id),(u==null?void 0:u.components[1])!=null&&this.interactiveCollidersQTree.insert(new Nr(a.x,a.y,a.w,a.h,{entityId:m.id})),(m.canShow===!1||m.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in m&&(m.visibilityNeedsUpdate="show"),i!==-1&&i!==m.currentStrategyIndex&&(m.activeBoundingBox=h,m.onStrategySelected(i))):((m.canShow===!0||m.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in m&&(m.visibilityNeedsUpdate="hide"),i!==-1&&i!==m.currentStrategyIndex&&m.onStrategySelected(i)))}ph&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));b(this,"drawDebug",l(()=>{ph&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));b(this,"destroy",l(()=>{this.worker.terminate()},"destroy"));this.worker=i===!1?new gb:hh!==""?new Worker(hh):new Worker(URL.createObjectURL(new Blob([t9],{type:"text/javascript"}))),this.coreState=n,this.debugCanvas=e,this.debugContext=e.getContext("2d"),this.worker.onmessage=a=>this.resolve(a),this.postMessage=s9(this._postMessage,YG,!1),ph?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(e,n,i){this.packedMessage[6]=i,this.packedMessage[5]=n,this.packedMessage[4]=e,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};l(BS,"CollisionSystem");var yb=BS;y();y();y();y();var VS=class VS{constructor(t){b(this,"type");b(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};l(VS,"Tap");var vb=VS,jS=class jS{constructor(){b(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,e;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((e=this.taps[1])==null?void 0:e.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(e=>t-e.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};l(jS,"TapsController");var bb=jS;y();function US(r){let t=new Set;for(let e of r){let n=e.object;for(;n.visible&&n.parent&&n.parent.visible===!0&&!t.has(n.parent);)n=n.parent,n instanceof Er&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}l(US,"getUniqueIntersectedGroupContainers");var Ld,zS=class zS extends le{constructor(e,n,i,a,u){super();b(this,"raycaster",new Ua);b(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});b(this,"coreState");b(this,"camera");b(this,"worldPlane");b(this,"_quadtree",new Ls(new Nr(0,0,0,0)));b(this,"_container");b(this,"lastPointerEvent");b(this,"cursor","grab");b(this,"touchesCount",0);b(this,"isUserInteracting");b(this,"hasTouched",!1);R(this,Ld);b(this,"onPointerMoveRaf",l(e=>{this.lastPointerEvent=e,p(this,Ld)&&cancelAnimationFrame(p(this,Ld)),V(this,Ld,requestAnimationFrame(()=>{this.onPointerMove(e)}))},"onPointerMoveRaf"));b(this,"onPointerMove",l(e=>{e.preventDefault(),this.updateInteractionStateIfPanning(e),(e.pointerType!=="touch"||e.pointerType===void 0&&this.hasTouched)&&this.handleHover(e),this.handleCursor()},"onPointerMove"));b(this,"tapsControl",new bb);b(this,"onPointerDown",l(e=>{e.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:e.timeStamp,clientX:e.clientX,clientY:e.clientY},this.lastPointerEvent=e,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),e.pointerType==="touch"&&(this.tapsControl.add(new vb(e)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));b(this,"clickTimeout");b(this,"onPointerUp",l(e=>{this.tapsControl.discardOutsideOfWaitWindow(e.timeStamp),this.lastPointerEvent=e,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(e);let{mouseDownStart:n}=this.state.interaction;!n||this.state.interaction.distanceFromMouseDown==null||(Date.now()<n.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(e.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",e),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(e),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",e),this.flush()):this.handleClick(e)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));b(this,"dirty3D",!0);b(this,"cachedHitBoxes",{entities:[]});b(this,"ndcPoint",new ne);b(this,"debugPanel");this.isUserInteracting=u,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=i,this._container=e,this.coreState=n,this.worldPlane=a,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(e){this._quadtree=e}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let e=this.state.hovered3DEntity.components[2];e&&(e.dirty=!0)}}getThreeDIntersectsFromXY(e){this.raycaster.setFromCamera(e,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.entities,!0).filter(a=>{var u,h;return((u=a.object)==null?void 0:u.name)==="worldPlane"||((h=a.object)==null?void 0:h.visible)}),i=n.findIndex(a=>{var u;return((u=a.object)==null?void 0:u.name)==="worldPlane"});return i!==-1&&n.push(n.splice(i,1)[0]),n}getGroupContainerIntersectsFromXY(e){let n=this.getThreeDIntersectsFromXY(e),i;return n!=null&&n.length>0&&(i=US(n)),i}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(e){let n=e||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:i,entity2D:a,position:u,groupContainers:h}=this.intersect(n);(this.detect3DEntityHover(i)||this.detect2DEntityHover(a)||this.detect3DContainerHover(h))&&(this.state.hovered3DEntity=i,this.state.lastHover=i,this.state.hovered2DEntity=a,this.state.hovered3DContainers=h,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:u,groupContainers:h})),this.handleCursor()}handleCursor(){var u;let e=!!(this.state.hovered3DEntity&&((u=this.state.hovered3DEntity)!=null&&u.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,i=this.state.interaction.isPanning,a=$G(e,i,n);this.cursor!==a&&(this.cursor=a,a==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(e){return this.state.hovered2DEntity!==e}handleClick(e){let n=this.intersect(e);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:e.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[];let e;for(let n of this.coreState.geometry3DIdsInScene)e=this.coreState.geometry3DMap.get(n),((e==null?void 0:e.type)==="geometry"||(e==null?void 0:e.type)==="model"||(e==null?void 0:e.type)==="path"||(e==null?void 0:e.type)==="custom-geometry")&&e.components[0].mesh&&!this.cachedHitBoxes.entities.includes(e.components[0].mesh)&&this.cachedHitBoxes.entities.push(e.components[0].mesh);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(e){var D,A,L,B,j;let n=[e.offsetX,e.offsetY],i=this._quadtree.queryPoint(n),[a]=i.filter(W=>W.intersectsPoint(n)),u=this.coreState.containerOffset[0],h=this.coreState.containerOffset[1];this.ndcPoint.x=(e.clientX-h)/this._container.clientWidth*2-1,this.ndcPoint.y=-((e.clientY-u)/this._container.clientHeight)*2+1;let d=this.getThreeDIntersectsFromXY(this.ndcPoint),m=(D=d[0])==null?void 0:D.point,v=[],x=[],S=d.filter(W=>W.object.name!=="worldPlane");for(let W of S)W.object instanceof ue&&W.object.material.depthTest===!1?v.push(W):x.push(W);let I=(L=(A=v[0])!=null?A:x[0])!=null?L:void 0,w,E;if(I!=null){if(w=KG(I.object,this.coreState.geometry3DMap),!w){let W=(B=I==null?void 0:I.instanceId)!=null?B:I==null?void 0:I.batchId;w=W!=null&&(I!=null&&I.object.userData.entities)?this.coreState.geometry3DMap.get(I==null?void 0:I.object.userData.entities[W]):this.coreState.geometry3DMap.get(I==null?void 0:I.object.userData.entityId)}w!=null&&w.components[2]&&(E=w)}let T=US(S);return{entity2D:((j=a==null?void 0:a.userData)==null?void 0:j.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(a==null?void 0:a.userData.entityId),entity3D:E,position:m,groupContainers:T.length>0?T:void 0}}detect3DEntityHover(e){return this.state.lastHover!==e&&(this.state.lastHover&&c9(this.state.lastHover,!1,this.coreState),e&&c9(e,!0,this.coreState)),this.state.hovered3DEntity!==e}detect3DContainerHover(e){return!Y0(this.state.hovered3DContainers,e)}updateInteractionStateIfPanning(e){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(e.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(e.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.right="0",e.style.backgroundColor="white",e.style.padding="10px",document.body.append(e),e.id="interaction-debug-panel",this.debugPanel=e,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",n=>{var i,a,u;this.queueDebugMessage("CLICK \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((a=n.entity2D)==null?void 0:a.id," \nPos: ").concat((u=n.position)==null?void 0:u.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var i,a,u;this.queueDebugMessage("HOVER \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((a=n.entity2D)==null?void 0:a.id," \nPos: ").concat((u=n.position)==null?void 0:u.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(e,n){var a;let i=document.createElement("pre");i.style.maxWidth="300px",i.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",i.style.backgroundColor=n,i.textContent=e,(a=this.debugPanel)==null||a.prepend(i),setTimeout(()=>{i.style.opacity="0",setTimeout(()=>{i.remove()},500)},2500)}getCursor(){return this.cursor}};Ld=new WeakMap,l(zS,"InteractionSystem");var dy=zS;function c9(r,t,e){var u;let n=r.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let i=(u=r.components[0].textMesh)==null?void 0:u.userData.entityId;if(!i)return;let a=e.geometry3DMap.get(i);(a==null?void 0:a.type)==="text3d"&&(a.components[1].hoverByPolygon=t,a.components[1].dirty=!0)}l(c9,"updateHover");function $G(r,t,e){return t?"grabbing":r?"pointer":e?"grabbing":"grab"}l($G,"processCursor");function JG(r){let t=r;for(;t!=null&&t.parent;){if(t instanceof ic)return;if(t.userData.isSingleModel)return t;t=t.parent}}l(JG,"findModelParent");function KG(r,t){let e=JG(r);return e?t.get(e.userData.entityId):void 0}l(KG,"findModelParentEntity");y();y();y();var Q={};K2(Q,{BRAND:()=>IV,DIRTY:()=>fh,EMPTY_PATH:()=>rV,INVALID:()=>ae,NEVER:()=>lj,OK:()=>ao,ParseStatus:()=>Xi,Schema:()=>Ce,ZodAny:()=>wc,ZodArray:()=>pu,ZodBigInt:()=>gh,ZodBoolean:()=>yh,ZodBranded:()=>_y,ZodCatch:()=>Ph,ZodDate:()=>vh,ZodDefault:()=>wh,ZodDiscriminatedUnion:()=>Mb,ZodEffects:()=>ks,ZodEnum:()=>Mh,ZodError:()=>Uo,ZodFirstPartyTypeKind:()=>ce,ZodFunction:()=>wb,ZodIntersection:()=>Ch,ZodIssueCode:()=>Pt,ZodLazy:()=>Sh,ZodLiteral:()=>Ih,ZodMap:()=>Vd,ZodNaN:()=>Ud,ZodNativeEnum:()=>Th,ZodNever:()=>fa,ZodNull:()=>xh,ZodNullable:()=>hl,ZodNumber:()=>mh,ZodObject:()=>zo,ZodOptional:()=>As,ZodParsedType:()=>Vt,ZodPipeline:()=>Cy,ZodPromise:()=>Pc,ZodReadonly:()=>Eh,ZodRecord:()=>Tb,ZodSchema:()=>Ce,ZodSet:()=>jd,ZodString:()=>Tc,ZodSymbol:()=>Bd,ZodTransformer:()=>ks,ZodTuple:()=>pl,ZodType:()=>Ce,ZodUndefined:()=>bh,ZodUnion:()=>_h,ZodUnknown:()=>cu,ZodVoid:()=>Gd,addIssueToContext:()=>Ft,any:()=>AV,array:()=>FV,bigint:()=>PV,boolean:()=>_9,coerce:()=>aj,custom:()=>v9,date:()=>EV,datetimeRegex:()=>g9,defaultErrorMap:()=>lu,discriminatedUnion:()=>jV,effect:()=>QV,enum:()=>$V,function:()=>qV,getErrorMap:()=>Ad,getParsedType:()=>cl,instanceof:()=>TV,intersection:()=>UV,isAborted:()=>Sb,isAsync:()=>Nd,isDirty:()=>Ib,isValid:()=>Mc,late:()=>MV,lazy:()=>WV,literal:()=>ZV,makeIssue:()=>my,map:()=>XV,nan:()=>wV,nativeEnum:()=>JV,never:()=>kV,null:()=>LV,nullable:()=>ej,number:()=>x9,object:()=>BV,objectUtil:()=>HS,oboolean:()=>sj,onumber:()=>oj,optional:()=>tj,ostring:()=>ij,pipeline:()=>nj,preprocess:()=>rj,promise:()=>KV,quotelessJson:()=>QG,record:()=>HV,set:()=>YV,setErrorMap:()=>eV,strictObject:()=>GV,string:()=>b9,symbol:()=>OV,transformer:()=>QV,tuple:()=>zV,undefined:()=>DV,union:()=>VV,unknown:()=>NV,util:()=>fr,void:()=>RV});y();y();y();y();y();var fr;(function(r){r.assertEqual=i=>{};function t(i){}l(t,"assertIs"),r.assertIs=t;function e(i){throw new Error}l(e,"assertNever"),r.assertNever=e,r.arrayToEnum=i=>{let a={};for(let u of i)a[u]=u;return a},r.getValidEnumValues=i=>{let a=r.objectKeys(i).filter(h=>typeof i[i[h]]!="number"),u={};for(let h of a)u[h]=i[h];return r.objectValues(u)},r.objectValues=i=>r.objectKeys(i).map(function(a){return i[a]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let u in i)Object.prototype.hasOwnProperty.call(i,u)&&a.push(u);return a},r.find=(i,a)=>{for(let u of i)if(a(u))return u},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(u=>typeof u=="string"?"'".concat(u,"'"):u).join(a)}l(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(fr||(fr={}));var HS;(function(r){r.mergeShapes=(t,e)=>U(U({},t),e)})(HS||(HS={}));var Vt=fr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cl=l(r=>{switch(typeof r){case"undefined":return Vt.undefined;case"string":return Vt.string;case"number":return Number.isNaN(r)?Vt.nan:Vt.number;case"boolean":return Vt.boolean;case"function":return Vt.function;case"bigint":return Vt.bigint;case"symbol":return Vt.symbol;case"object":return Array.isArray(r)?Vt.array:r===null?Vt.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?Vt.promise:typeof Map<"u"&&r instanceof Map?Vt.map:typeof Set<"u"&&r instanceof Set?Vt.set:typeof Date<"u"&&r instanceof Date?Vt.date:Vt.object;default:return Vt.unknown}},"getParsedType");var Pt=fr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),QG=l(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),_b=class _b extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=t}format(t){let e=t||function(a){return a.message},n={_errors:[]},i=l(a=>{for(let u of a.issues)if(u.code==="invalid_union")u.unionErrors.map(i);else if(u.code==="invalid_return_type")i(u.returnTypeError);else if(u.code==="invalid_arguments")i(u.argumentsError);else if(u.path.length===0)n._errors.push(e(u));else{let h=n,d=0;for(;d<u.path.length;){let m=u.path[d];d===u.path.length-1?(h[m]=h[m]||{_errors:[]},h[m]._errors.push(e(u))):h[m]=h[m]||{_errors:[]},h=h[m],d++}}},"processError");return i(this),n}static assert(t){if(!(t instanceof _b))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,fr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=e=>e.message){let e={},n=[];for(let i of this.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:e}}get formErrors(){return this.flatten()}};l(_b,"ZodError");var Uo=_b;Uo.create=r=>new Uo(r);var tV=l((r,t)=>{let e;switch(r.code){case Pt.invalid_type:r.received===Vt.undefined?e="Required":e="Expected ".concat(r.expected,", received ").concat(r.received);break;case Pt.invalid_literal:e="Invalid literal value, expected ".concat(JSON.stringify(r.expected,fr.jsonStringifyReplacer));break;case Pt.unrecognized_keys:e="Unrecognized key(s) in object: ".concat(fr.joinValues(r.keys,", "));break;case Pt.invalid_union:e="Invalid input";break;case Pt.invalid_union_discriminator:e="Invalid discriminator value. Expected ".concat(fr.joinValues(r.options));break;case Pt.invalid_enum_value:e="Invalid enum value. Expected ".concat(fr.joinValues(r.options),", received '").concat(r.received,"'");break;case Pt.invalid_arguments:e="Invalid function arguments";break;case Pt.invalid_return_type:e="Invalid function return type";break;case Pt.invalid_date:e="Invalid date";break;case Pt.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(e='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(e="".concat(e," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?e='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?e='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):fr.assertNever(r.validation):r.validation!=="regex"?e="Invalid ".concat(r.validation):e="Invalid";break;case Pt.too_small:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):e="Invalid input";break;case Pt.too_big:r.type==="array"?e="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?e="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?e="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?e="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?e="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):e="Invalid input";break;case Pt.custom:e="Invalid input";break;case Pt.invalid_intersection_types:e="Intersection results could not be merged";break;case Pt.not_multiple_of:e="Number must be a multiple of ".concat(r.multipleOf);break;case Pt.not_finite:e="Number must be finite";break;default:e=t.defaultError,fr.assertNever(r)}return{message:e}},"errorMap"),lu=tV;var p9=lu;function eV(r){p9=r}l(eV,"setErrorMap");function Ad(){return p9}l(Ad,"getErrorMap");y();var my=l(r=>{let{data:t,path:e,errorMaps:n,issueData:i}=r,a=[...e,...i.path||[]],u=rt(U({},i),{path:a});if(i.message!==void 0)return rt(U({},i),{path:a,message:i.message});let h="",d=n.filter(m=>!!m).slice().reverse();for(let m of d)h=m(u,{data:t,defaultError:h}).message;return rt(U({},i),{path:a,message:h})},"makeIssue"),rV=[];function Ft(r,t){let e=Ad(),n=my({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e,e===lu?void 0:lu].filter(i=>!!i)});r.common.issues.push(n)}l(Ft,"addIssueToContext");var Cb=class Cb{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,e){let n=[];for(let i of e){if(i.status==="aborted")return ae;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,e){let n=[];for(let i of e){let a=await i.key,u=await i.value;n.push({key:a,value:u})}return Cb.mergeObjectSync(t,n)}static mergeObjectSync(t,e){let n={};for(let i of e){let{key:a,value:u}=i;if(a.status==="aborted"||u.status==="aborted")return ae;a.status==="dirty"&&t.dirty(),u.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof u.value<"u"||i.alwaysSet)&&(n[a.value]=u.value)}return{status:t.value,value:n}}};l(Cb,"ParseStatus");var Xi=Cb,ae=Object.freeze({status:"aborted"}),fh=l(r=>({status:"dirty",value:r}),"DIRTY"),ao=l(r=>({status:"valid",value:r}),"OK"),Sb=l(r=>r.status==="aborted","isAborted"),Ib=l(r=>r.status==="dirty","isDirty"),Mc=l(r=>r.status==="valid","isValid"),Nd=l(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");y();y();y();var Zt;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Zt||(Zt={}));var qS=class qS{constructor(t,e,n,i){this._cachedPath=[],this.parent=t,this.data=e,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};l(qS,"ParseInputLazyPath");var Ns=qS,h9=l((r,t)=>{if(Mc(t))return{success:!0,data:t.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let e=new Uo(r.common.issues);return this._error=e,this._error}}},"handleResult");function be(r){if(!r)return{};let{errorMap:t,invalid_type_error:e,required_error:n,description:i}=r;if(t&&(e||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:l((u,h)=>{var m,v;let{message:d}=r;return u.code==="invalid_enum_value"?{message:d!=null?d:h.defaultError}:typeof h.data>"u"?{message:(m=d!=null?d:n)!=null?m:h.defaultError}:u.code!=="invalid_type"?{message:h.defaultError}:{message:(v=d!=null?d:e)!=null?v:h.defaultError}},"customMap"),description:i}}l(be,"processCreateParams");var WS=class WS{get description(){return this._def.description}_getType(t){return cl(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:cl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Xi,ctx:{common:t.parent.common,data:t.data,parsedType:cl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Nd(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let n=this.safeParse(t,e);if(n.success)return n.data;throw n.error}safeParse(t,e){var a;let n={common:{issues:[],async:(a=e==null?void 0:e.async)!=null?a:!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cl(t)},i=this._parseSync({data:t,path:n.path,parent:n});return h9(n,i)}"~validate"(t){var n,i;let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cl(t)};if(!this["~standard"].async)try{let a=this._parseSync({data:t,path:[],parent:e});return Mc(a)?{value:a.value}:{issues:e.common.issues}}catch(a){(i=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(a=>Mc(a)?{value:a.value}:{issues:e.common.issues})}async parseAsync(t,e){let n=await this.safeParseAsync(t,e);if(n.success)return n.data;throw n.error}async safeParseAsync(t,e){let n={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cl(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(Nd(i)?i:Promise.resolve(i));return h9(n,a)}refine(t,e){let n=l(i=>typeof e=="string"||typeof e>"u"?{message:e}:typeof e=="function"?e(i):e,"getIssueProperties");return this._refinement((i,a)=>{let u=t(i),h=l(()=>a.addIssue(U({code:Pt.custom},n(i))),"setError");return typeof Promise<"u"&&u instanceof Promise?u.then(d=>d?!0:(h(),!1)):u?!0:(h(),!1)})}refinement(t,e){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof e=="function"?e(n,i):e),!1))}_refinement(t){return new ks({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:l(e=>this["~validate"](e),"validate")}}optional(){return As.create(this,this._def)}nullable(){return hl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pu.create(this)}promise(){return Pc.create(this,this._def)}or(t){return _h.create([this,t],this._def)}and(t){return Ch.create(this,t,this._def)}transform(t){return new ks(rt(U({},be(this._def)),{schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let e=typeof t=="function"?t:()=>t;return new wh(rt(U({},be(this._def)),{innerType:this,defaultValue:e,typeName:ce.ZodDefault}))}brand(){return new _y(U({typeName:ce.ZodBranded,type:this},be(this._def)))}catch(t){let e=typeof t=="function"?t:()=>t;return new Ph(rt(U({},be(this._def)),{innerType:this,catchValue:e,typeName:ce.ZodCatch}))}describe(t){let e=this.constructor;return new e(rt(U({},this._def),{description:t}))}pipe(t){return Cy.create(this,t)}readonly(){return Eh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l(WS,"ZodType");var Ce=WS,nV=/^c[^\s-]{8,}$/i,iV=/^[0-9a-z]+$/,oV=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sV=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,aV=/^[a-z0-9_-]{21}$/i,lV=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uV=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cV=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",XS,hV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,dV=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,mV=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gV=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yV=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,d9="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vV=new RegExp("^".concat(d9,"$"));function m9(r){let t="[0-5]\\d";r.precision?t="".concat(t,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(t="".concat(t,"(\\.\\d+)?"));let e=r.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(e)}l(m9,"timeRegexSource");function bV(r){return new RegExp("^".concat(m9(r),"$"))}l(bV,"timeRegex");function g9(r){let t="".concat(d9,"T").concat(m9(r)),e=[];return e.push(r.local?"Z?":"Z"),r.offset&&e.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(e.join("|"),")"),new RegExp("^".concat(t,"$"))}l(g9,"datetimeRegex");function xV(r,t){return!!((t==="v4"||!t)&&hV.test(r)||(t==="v6"||!t)&&dV.test(r))}l(xV,"isValidIP");function _V(r,t){if(!lV.test(r))return!1;try{let[e]=r.split("."),n=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch(e){return!1}}l(_V,"isValidJWT");function CV(r,t){return!!((t==="v4"||!t)&&fV.test(r)||(t==="v6"||!t)&&mV.test(r))}l(CV,"isValidCidr");var dh=class dh extends Ce{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Vt.string){let a=this._getOrReturnCtx(t);return Ft(a,{code:Pt.invalid_type,expected:Vt.string,received:a.parsedType}),ae}let n=new Xi,i;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let u=t.data.length>a.value,h=t.data.length<a.value;(u||h)&&(i=this._getOrReturnCtx(t,i),u?Ft(i,{code:Pt.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):h&&Ft(i,{code:Pt.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")cV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"email",code:Pt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")XS||(XS=new RegExp(pV,"u")),XS.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"emoji",code:Pt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")sV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"uuid",code:Pt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")aV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"nanoid",code:Pt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")nV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"cuid",code:Pt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")iV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"cuid2",code:Pt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")oV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"ulid",code:Pt.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch(u){i=this._getOrReturnCtx(t,i),Ft(i,{validation:"url",code:Pt.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"regex",code:Pt.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?g9(a).test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?vV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?bV(a).test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?uV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"duration",code:Pt.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?xV(t.data,a.version)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"ip",code:Pt.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?_V(t.data,a.alg)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"jwt",code:Pt.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?CV(t.data,a.version)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"cidr",code:Pt.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?gV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"base64",code:Pt.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?yV.test(t.data)||(i=this._getOrReturnCtx(t,i),Ft(i,{validation:"base64url",code:Pt.invalid_string,message:a.message}),n.dirty()):fr.assertNever(a);return{status:n.value,value:t.data}}_regex(t,e,n){return this.refinement(i=>t.test(i),U({validation:e,code:Pt.invalid_string},Zt.errToObj(n)))}_addCheck(t){return new dh(rt(U({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(U({kind:"email"},Zt.errToObj(t)))}url(t){return this._addCheck(U({kind:"url"},Zt.errToObj(t)))}emoji(t){return this._addCheck(U({kind:"emoji"},Zt.errToObj(t)))}uuid(t){return this._addCheck(U({kind:"uuid"},Zt.errToObj(t)))}nanoid(t){return this._addCheck(U({kind:"nanoid"},Zt.errToObj(t)))}cuid(t){return this._addCheck(U({kind:"cuid"},Zt.errToObj(t)))}cuid2(t){return this._addCheck(U({kind:"cuid2"},Zt.errToObj(t)))}ulid(t){return this._addCheck(U({kind:"ulid"},Zt.errToObj(t)))}base64(t){return this._addCheck(U({kind:"base64"},Zt.errToObj(t)))}base64url(t){return this._addCheck(U({kind:"base64url"},Zt.errToObj(t)))}jwt(t){return this._addCheck(U({kind:"jwt"},Zt.errToObj(t)))}ip(t){return this._addCheck(U({kind:"ip"},Zt.errToObj(t)))}cidr(t){return this._addCheck(U({kind:"cidr"},Zt.errToObj(t)))}datetime(t){var e,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(U({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(e=t==null?void 0:t.offset)!=null?e:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},Zt.errToObj(t==null?void 0:t.message)))}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(U({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},Zt.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(U({kind:"duration"},Zt.errToObj(t)))}regex(t,e){return this._addCheck(U({kind:"regex",regex:t},Zt.errToObj(e)))}includes(t,e){return this._addCheck(U({kind:"includes",value:t,position:e==null?void 0:e.position},Zt.errToObj(e==null?void 0:e.message)))}startsWith(t,e){return this._addCheck(U({kind:"startsWith",value:t},Zt.errToObj(e)))}endsWith(t,e){return this._addCheck(U({kind:"endsWith",value:t},Zt.errToObj(e)))}min(t,e){return this._addCheck(U({kind:"min",value:t},Zt.errToObj(e)))}max(t,e){return this._addCheck(U({kind:"max",value:t},Zt.errToObj(e)))}length(t,e){return this._addCheck(U({kind:"length",value:t},Zt.errToObj(e)))}nonempty(t){return this.min(1,Zt.errToObj(t))}trim(){return new dh(rt(U({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new dh(rt(U({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new dh(rt(U({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxLength(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};l(dh,"ZodString");var Tc=dh;Tc.create=r=>{var t;return new Tc(U({checks:[],typeName:ce.ZodString,coerce:(t=r==null?void 0:r.coerce)!=null?t:!1},be(r)))};function SV(r,t){let e=(r.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=e>n?e:n,a=Number.parseInt(r.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return a%u/10**i}l(SV,"floatSafeRemainder");var gy=class gy extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Vt.number){let a=this._getOrReturnCtx(t);return Ft(a,{code:Pt.invalid_type,expected:Vt.number,received:a.parsedType}),ae}let n,i=new Xi;for(let a of this._def.checks)a.kind==="int"?fr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?SV(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.not_finite,message:a.message}),i.dirty()):fr.assertNever(a);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,Zt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,Zt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,Zt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,Zt.toString(e))}setLimit(t,e,n,i){return new gy(rt(U({},this._def),{checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:Zt.toString(i)}]}))}_addCheck(t){return new gy(rt(U({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:Zt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:Zt.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:Zt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zt.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&fr.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(e===null||n.value>e)&&(e=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(e)&&Number.isFinite(t)}};l(gy,"ZodNumber");var mh=gy;mh.create=r=>new mh(U({checks:[],typeName:ce.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},be(r)));var yy=class yy extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(a){return this._getInvalidInput(t)}if(this._getType(t)!==Vt.bigint)return this._getInvalidInput(t);let n,i=new Xi;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Ft(n,{code:Pt.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):fr.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){let e=this._getOrReturnCtx(t);return Ft(e,{code:Pt.invalid_type,expected:Vt.bigint,received:e.parsedType}),ae}gte(t,e){return this.setLimit("min",t,!0,Zt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,Zt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,Zt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,Zt.toString(e))}setLimit(t,e,n,i){return new yy(rt(U({},this._def),{checks:[...this._def.checks,{kind:t,value:e,inclusive:n,message:Zt.toString(i)}]}))}_addCheck(t){return new yy(rt(U({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Zt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:Zt.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t}get maxValue(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t}};l(yy,"ZodBigInt");var gh=yy;gh.create=r=>{var t;return new gh(U({checks:[],typeName:ce.ZodBigInt,coerce:(t=r==null?void 0:r.coerce)!=null?t:!1},be(r)))};var ZS=class ZS extends Ce{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Vt.boolean){let n=this._getOrReturnCtx(t);return Ft(n,{code:Pt.invalid_type,expected:Vt.boolean,received:n.parsedType}),ae}return ao(t.data)}};l(ZS,"ZodBoolean");var yh=ZS;yh.create=r=>new yh(U({typeName:ce.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},be(r)));var Pb=class Pb extends Ce{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Vt.date){let a=this._getOrReturnCtx(t);return Ft(a,{code:Pt.invalid_type,expected:Vt.date,received:a.parsedType}),ae}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return Ft(a,{code:Pt.invalid_date}),ae}let n=new Xi,i;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),Ft(i,{code:Pt.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):fr.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Pb(rt(U({},this._def),{checks:[...this._def.checks,t]}))}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:Zt.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:Zt.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)e.kind==="min"&&(t===null||e.value>t)&&(t=e.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)e.kind==="max"&&(t===null||e.value<t)&&(t=e.value);return t!=null?new Date(t):null}};l(Pb,"ZodDate");var vh=Pb;vh.create=r=>new vh(U({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:ce.ZodDate},be(r)));var $S=class $S extends Ce{_parse(t){if(this._getType(t)!==Vt.symbol){let n=this._getOrReturnCtx(t);return Ft(n,{code:Pt.invalid_type,expected:Vt.symbol,received:n.parsedType}),ae}return ao(t.data)}};l($S,"ZodSymbol");var Bd=$S;Bd.create=r=>new Bd(U({typeName:ce.ZodSymbol},be(r)));var JS=class JS extends Ce{_parse(t){if(this._getType(t)!==Vt.undefined){let n=this._getOrReturnCtx(t);return Ft(n,{code:Pt.invalid_type,expected:Vt.undefined,received:n.parsedType}),ae}return ao(t.data)}};l(JS,"ZodUndefined");var bh=JS;bh.create=r=>new bh(U({typeName:ce.ZodUndefined},be(r)));var KS=class KS extends Ce{_parse(t){if(this._getType(t)!==Vt.null){let n=this._getOrReturnCtx(t);return Ft(n,{code:Pt.invalid_type,expected:Vt.null,received:n.parsedType}),ae}return ao(t.data)}};l(KS,"ZodNull");var xh=KS;xh.create=r=>new xh(U({typeName:ce.ZodNull},be(r)));var QS=class QS extends Ce{constructor(){super(...arguments),this._any=!0}_parse(t){return ao(t.data)}};l(QS,"ZodAny");var wc=QS;wc.create=r=>new wc(U({typeName:ce.ZodAny},be(r)));var t3=class t3 extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ao(t.data)}};l(t3,"ZodUnknown");var cu=t3;cu.create=r=>new cu(U({typeName:ce.ZodUnknown},be(r)));var e3=class e3 extends Ce{_parse(t){let e=this._getOrReturnCtx(t);return Ft(e,{code:Pt.invalid_type,expected:Vt.never,received:e.parsedType}),ae}};l(e3,"ZodNever");var fa=e3;fa.create=r=>new fa(U({typeName:ce.ZodNever},be(r)));var r3=class r3 extends Ce{_parse(t){if(this._getType(t)!==Vt.undefined){let n=this._getOrReturnCtx(t);return Ft(n,{code:Pt.invalid_type,expected:Vt.void,received:n.parsedType}),ae}return ao(t.data)}};l(r3,"ZodVoid");var Gd=r3;Gd.create=r=>new Gd(U({typeName:ce.ZodVoid},be(r)));var Rd=class Rd extends Ce{_parse(t){let{ctx:e,status:n}=this._processInputParams(t),i=this._def;if(e.parsedType!==Vt.array)return Ft(e,{code:Pt.invalid_type,expected:Vt.array,received:e.parsedType}),ae;if(i.exactLength!==null){let u=e.data.length>i.exactLength.value,h=e.data.length<i.exactLength.value;(u||h)&&(Ft(e,{code:u?Pt.too_big:Pt.too_small,minimum:h?i.exactLength.value:void 0,maximum:u?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&e.data.length<i.minLength.value&&(Ft(e,{code:Pt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&e.data.length>i.maxLength.value&&(Ft(e,{code:Pt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),e.common.async)return Promise.all([...e.data].map((u,h)=>i.type._parseAsync(new Ns(e,u,e.path,h)))).then(u=>Xi.mergeArray(n,u));let a=[...e.data].map((u,h)=>i.type._parseSync(new Ns(e,u,e.path,h)));return Xi.mergeArray(n,a)}get element(){return this._def.type}min(t,e){return new Rd(rt(U({},this._def),{minLength:{value:t,message:Zt.toString(e)}}))}max(t,e){return new Rd(rt(U({},this._def),{maxLength:{value:t,message:Zt.toString(e)}}))}length(t,e){return new Rd(rt(U({},this._def),{exactLength:{value:t,message:Zt.toString(e)}}))}nonempty(t){return this.min(1,t)}};l(Rd,"ZodArray");var pu=Rd;pu.create=(r,t)=>new pu(U({type:r,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray},be(t)));function kd(r){if(r instanceof zo){let t={};for(let e in r.shape){let n=r.shape[e];t[e]=As.create(kd(n))}return new zo(rt(U({},r._def),{shape:l(()=>t,"shape")}))}else return r instanceof pu?new pu(rt(U({},r._def),{type:kd(r.element)})):r instanceof As?As.create(kd(r.unwrap())):r instanceof hl?hl.create(kd(r.unwrap())):r instanceof pl?pl.create(r.items.map(t=>kd(t))):r}l(kd,"deepPartialify");var us=class us extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=fr.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==Vt.object){let m=this._getOrReturnCtx(t);return Ft(m,{code:Pt.invalid_type,expected:Vt.object,received:m.parsedType}),ae}let{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:u}=this._getCached(),h=[];if(!(this._def.catchall instanceof fa&&this._def.unknownKeys==="strip"))for(let m in i.data)u.includes(m)||h.push(m);let d=[];for(let m of u){let v=a[m],x=i.data[m];d.push({key:{status:"valid",value:m},value:v._parse(new Ns(i,x,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof fa){let m=this._def.unknownKeys;if(m==="passthrough")for(let v of h)d.push({key:{status:"valid",value:v},value:{status:"valid",value:i.data[v]}});else if(m==="strict")h.length>0&&(Ft(i,{code:Pt.unrecognized_keys,keys:h}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let v of h){let x=i.data[v];d.push({key:{status:"valid",value:v},value:m._parse(new Ns(i,x,i.path,v)),alwaysSet:v in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let m=[];for(let v of d){let x=await v.key,S=await v.value;m.push({key:x,value:S,alwaysSet:v.alwaysSet})}return m}).then(m=>Xi.mergeObjectSync(n,m)):Xi.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(t){return Zt.errToObj,new us(U(rt(U({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:l((e,n)=>{var a,u,h,d;let i=(h=(u=(a=this._def).errorMap)==null?void 0:u.call(a,e,n).message)!=null?h:n.defaultError;return e.code==="unrecognized_keys"?{message:(d=Zt.errToObj(t).message)!=null?d:i}:{message:i}},"errorMap")}:{}))}strip(){return new us(rt(U({},this._def),{unknownKeys:"strip"}))}passthrough(){return new us(rt(U({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new us(rt(U({},this._def),{shape:l(()=>U(U({},this._def.shape()),t),"shape")}))}merge(t){return new us({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:l(()=>U(U({},this._def.shape()),t._def.shape()),"shape"),typeName:ce.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new us(rt(U({},this._def),{catchall:t}))}pick(t){let e={};for(let n of fr.objectKeys(t))t[n]&&this.shape[n]&&(e[n]=this.shape[n]);return new us(rt(U({},this._def),{shape:l(()=>e,"shape")}))}omit(t){let e={};for(let n of fr.objectKeys(this.shape))t[n]||(e[n]=this.shape[n]);return new us(rt(U({},this._def),{shape:l(()=>e,"shape")}))}deepPartial(){return kd(this)}partial(t){let e={};for(let n of fr.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?e[n]=i:e[n]=i.optional()}return new us(rt(U({},this._def),{shape:l(()=>e,"shape")}))}required(t){let e={};for(let n of fr.objectKeys(this.shape))if(t&&!t[n])e[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof As;)a=a._def.innerType;e[n]=a}return new us(rt(U({},this._def),{shape:l(()=>e,"shape")}))}keyof(){return y9(fr.objectKeys(this.shape))}};l(us,"ZodObject");var zo=us;zo.create=(r,t)=>new zo(U({shape:l(()=>r,"shape"),unknownKeys:"strip",catchall:fa.create(),typeName:ce.ZodObject},be(t)));zo.strictCreate=(r,t)=>new zo(U({shape:l(()=>r,"shape"),unknownKeys:"strict",catchall:fa.create(),typeName:ce.ZodObject},be(t)));zo.lazycreate=(r,t)=>new zo(U({shape:r,unknownKeys:"strip",catchall:fa.create(),typeName:ce.ZodObject},be(t)));var n3=class n3 extends Ce{_parse(t){let{ctx:e}=this._processInputParams(t),n=this._def.options;function i(a){for(let h of a)if(h.result.status==="valid")return h.result;for(let h of a)if(h.result.status==="dirty")return e.common.issues.push(...h.ctx.common.issues),h.result;let u=a.map(h=>new Uo(h.ctx.common.issues));return Ft(e,{code:Pt.invalid_union,unionErrors:u}),ae}if(l(i,"handleResults"),e.common.async)return Promise.all(n.map(async a=>{let u=rt(U({},e),{common:rt(U({},e.common),{issues:[]}),parent:null});return{result:await a._parseAsync({data:e.data,path:e.path,parent:u}),ctx:u}})).then(i);{let a,u=[];for(let d of n){let m=rt(U({},e),{common:rt(U({},e.common),{issues:[]}),parent:null}),v=d._parseSync({data:e.data,path:e.path,parent:m});if(v.status==="valid")return v;v.status==="dirty"&&!a&&(a={result:v,ctx:m}),m.common.issues.length&&u.push(m.common.issues)}if(a)return e.common.issues.push(...a.ctx.common.issues),a.result;let h=u.map(d=>new Uo(d));return Ft(e,{code:Pt.invalid_union,unionErrors:h}),ae}}get options(){return this._def.options}};l(n3,"ZodUnion");var _h=n3;_h.create=(r,t)=>new _h(U({options:r,typeName:ce.ZodUnion},be(t)));var uu=l(r=>r instanceof Sh?uu(r.schema):r instanceof ks?uu(r.innerType()):r instanceof Ih?[r.value]:r instanceof Mh?r.options:r instanceof Th?fr.objectValues(r.enum):r instanceof wh?uu(r._def.innerType):r instanceof bh?[void 0]:r instanceof xh?[null]:r instanceof As?[void 0,...uu(r.unwrap())]:r instanceof hl?[null,...uu(r.unwrap())]:r instanceof _y||r instanceof Eh?uu(r.unwrap()):r instanceof Ph?uu(r._def.innerType):[],"getDiscriminator"),Eb=class Eb extends Ce{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Vt.object)return Ft(e,{code:Pt.invalid_type,expected:Vt.object,received:e.parsedType}),ae;let n=this.discriminator,i=e.data[n],a=this.optionsMap.get(i);return a?e.common.async?a._parseAsync({data:e.data,path:e.path,parent:e}):a._parseSync({data:e.data,path:e.path,parent:e}):(Ft(e,{code:Pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,n){let i=new Map;for(let a of e){let u=uu(a.shape[t]);if(!u.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let h of u){if(i.has(h))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(h)));i.set(h,a)}}return new Eb(U({typeName:ce.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i},be(n)))}};l(Eb,"ZodDiscriminatedUnion");var Mb=Eb;function YS(r,t){let e=cl(r),n=cl(t);if(r===t)return{valid:!0,data:r};if(e===Vt.object&&n===Vt.object){let i=fr.objectKeys(t),a=fr.objectKeys(r).filter(h=>i.indexOf(h)!==-1),u=U(U({},r),t);for(let h of a){let d=YS(r[h],t[h]);if(!d.valid)return{valid:!1};u[h]=d.data}return{valid:!0,data:u}}else if(e===Vt.array&&n===Vt.array){if(r.length!==t.length)return{valid:!1};let i=[];for(let a=0;a<r.length;a++){let u=r[a],h=t[a],d=YS(u,h);if(!d.valid)return{valid:!1};i.push(d.data)}return{valid:!0,data:i}}else return e===Vt.date&&n===Vt.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}l(YS,"mergeValues");var i3=class i3 extends Ce{_parse(t){let{status:e,ctx:n}=this._processInputParams(t),i=l((a,u)=>{if(Sb(a)||Sb(u))return ae;let h=YS(a.value,u.value);return h.valid?((Ib(a)||Ib(u))&&e.dirty(),{status:e.value,value:h.data}):(Ft(n,{code:Pt.invalid_intersection_types}),ae)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,u])=>i(a,u)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};l(i3,"ZodIntersection");var Ch=i3;Ch.create=(r,t,e)=>new Ch(U({left:r,right:t,typeName:ce.ZodIntersection},be(e)));var Ob=class Ob extends Ce{_parse(t){let{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==Vt.array)return Ft(n,{code:Pt.invalid_type,expected:Vt.array,received:n.parsedType}),ae;if(n.data.length<this._def.items.length)return Ft(n,{code:Pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&n.data.length>this._def.items.length&&(Ft(n,{code:Pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());let a=[...n.data].map((u,h)=>{let d=this._def.items[h]||this._def.rest;return d?d._parse(new Ns(n,u,n.path,h)):null}).filter(u=>!!u);return n.common.async?Promise.all(a).then(u=>Xi.mergeArray(e,u)):Xi.mergeArray(e,a)}get items(){return this._def.items}rest(t){return new Ob(rt(U({},this._def),{rest:t}))}};l(Ob,"ZodTuple");var pl=Ob;pl.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pl(U({items:r,typeName:ce.ZodTuple,rest:null},be(t)))};var vy=class vy extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==Vt.object)return Ft(n,{code:Pt.invalid_type,expected:Vt.object,received:n.parsedType}),ae;let i=[],a=this._def.keyType,u=this._def.valueType;for(let h in n.data)i.push({key:a._parse(new Ns(n,h,n.path,h)),value:u._parse(new Ns(n,n.data[h],n.path,h)),alwaysSet:h in n.data});return n.common.async?Xi.mergeObjectAsync(e,i):Xi.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,n){return e instanceof Ce?new vy(U({keyType:t,valueType:e,typeName:ce.ZodRecord},be(n))):new vy(U({keyType:Tc.create(),valueType:t,typeName:ce.ZodRecord},be(e)))}};l(vy,"ZodRecord");var Tb=vy,o3=class o3 extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==Vt.map)return Ft(n,{code:Pt.invalid_type,expected:Vt.map,received:n.parsedType}),ae;let i=this._def.keyType,a=this._def.valueType,u=[...n.data.entries()].map(([h,d],m)=>({key:i._parse(new Ns(n,h,n.path,[m,"key"])),value:a._parse(new Ns(n,d,n.path,[m,"value"]))}));if(n.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let d of u){let m=await d.key,v=await d.value;if(m.status==="aborted"||v.status==="aborted")return ae;(m.status==="dirty"||v.status==="dirty")&&e.dirty(),h.set(m.value,v.value)}return{status:e.value,value:h}})}else{let h=new Map;for(let d of u){let m=d.key,v=d.value;if(m.status==="aborted"||v.status==="aborted")return ae;(m.status==="dirty"||v.status==="dirty")&&e.dirty(),h.set(m.value,v.value)}return{status:e.value,value:h}}}};l(o3,"ZodMap");var Vd=o3;Vd.create=(r,t,e)=>new Vd(U({valueType:t,keyType:r,typeName:ce.ZodMap},be(e)));var by=class by extends Ce{_parse(t){let{status:e,ctx:n}=this._processInputParams(t);if(n.parsedType!==Vt.set)return Ft(n,{code:Pt.invalid_type,expected:Vt.set,received:n.parsedType}),ae;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Ft(n,{code:Pt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),e.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Ft(n,{code:Pt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),e.dirty());let a=this._def.valueType;function u(d){let m=new Set;for(let v of d){if(v.status==="aborted")return ae;v.status==="dirty"&&e.dirty(),m.add(v.value)}return{status:e.value,value:m}}l(u,"finalizeSet");let h=[...n.data.values()].map((d,m)=>a._parse(new Ns(n,d,n.path,m)));return n.common.async?Promise.all(h).then(d=>u(d)):u(h)}min(t,e){return new by(rt(U({},this._def),{minSize:{value:t,message:Zt.toString(e)}}))}max(t,e){return new by(rt(U({},this._def),{maxSize:{value:t,message:Zt.toString(e)}}))}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}};l(by,"ZodSet");var jd=by;jd.create=(r,t)=>new jd(U({valueType:r,minSize:null,maxSize:null,typeName:ce.ZodSet},be(t)));var Fd=class Fd extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Vt.function)return Ft(e,{code:Pt.invalid_type,expected:Vt.function,received:e.parsedType}),ae;function n(h,d){return my({data:h,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ad(),lu].filter(m=>!!m),issueData:{code:Pt.invalid_arguments,argumentsError:d}})}l(n,"makeArgsIssue");function i(h,d){return my({data:h,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ad(),lu].filter(m=>!!m),issueData:{code:Pt.invalid_return_type,returnTypeError:d}})}l(i,"makeReturnsIssue");let a={errorMap:e.common.contextualErrorMap},u=e.data;if(this._def.returns instanceof Pc){let h=this;return ao(async function(...d){let m=new Uo([]),v=await h._def.args.parseAsync(d,a).catch(I=>{throw m.addIssue(n(d,I)),m}),x=await Reflect.apply(u,this,v);return await h._def.returns._def.type.parseAsync(x,a).catch(I=>{throw m.addIssue(i(x,I)),m})})}else{let h=this;return ao(function(...d){let m=h._def.args.safeParse(d,a);if(!m.success)throw new Uo([n(d,m.error)]);let v=Reflect.apply(u,this,m.data),x=h._def.returns.safeParse(v,a);if(!x.success)throw new Uo([i(v,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Fd(rt(U({},this._def),{args:pl.create(t).rest(cu.create())}))}returns(t){return new Fd(rt(U({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,n){return new Fd(U({args:t||pl.create([]).rest(cu.create()),returns:e||cu.create(),typeName:ce.ZodFunction},be(n)))}};l(Fd,"ZodFunction");var wb=Fd,s3=class s3 extends Ce{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};l(s3,"ZodLazy");var Sh=s3;Sh.create=(r,t)=>new Sh(U({getter:r,typeName:ce.ZodLazy},be(t)));var a3=class a3 extends Ce{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return Ft(e,{received:e.data,code:Pt.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:t.data}}get value(){return this._def.value}};l(a3,"ZodLiteral");var Ih=a3;Ih.create=(r,t)=>new Ih(U({value:r,typeName:ce.ZodLiteral},be(t)));function y9(r,t){return new Mh(U({values:r,typeName:ce.ZodEnum},be(t)))}l(y9,"createZodEnum");var xy=class xy extends Ce{_parse(t){if(typeof t.data!="string"){let e=this._getOrReturnCtx(t),n=this._def.values;return Ft(e,{expected:fr.joinValues(n),received:e.parsedType,code:Pt.invalid_type}),ae}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let e=this._getOrReturnCtx(t),n=this._def.values;return Ft(e,{received:e.data,code:Pt.invalid_enum_value,options:n}),ae}return ao(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return xy.create(t,U(U({},this._def),e))}exclude(t,e=this._def){return xy.create(this.options.filter(n=>!t.includes(n)),U(U({},this._def),e))}};l(xy,"ZodEnum");var Mh=xy;Mh.create=y9;var l3=class l3 extends Ce{_parse(t){let e=fr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Vt.string&&n.parsedType!==Vt.number){let i=fr.objectValues(e);return Ft(n,{expected:fr.joinValues(i),received:n.parsedType,code:Pt.invalid_type}),ae}if(this._cache||(this._cache=new Set(fr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=fr.objectValues(e);return Ft(n,{received:n.data,code:Pt.invalid_enum_value,options:i}),ae}return ao(t.data)}get enum(){return this._def.values}};l(l3,"ZodNativeEnum");var Th=l3;Th.create=(r,t)=>new Th(U({values:r,typeName:ce.ZodNativeEnum},be(t)));var u3=class u3 extends Ce{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==Vt.promise&&e.common.async===!1)return Ft(e,{code:Pt.invalid_type,expected:Vt.promise,received:e.parsedType}),ae;let n=e.parsedType===Vt.promise?e.data:Promise.resolve(e.data);return ao(n.then(i=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}};l(u3,"ZodPromise");var Pc=u3;Pc.create=(r,t)=>new Pc(U({type:r,typeName:ce.ZodPromise},be(t)));var c3=class c3 extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:l(u=>{Ft(n,u),u.fatal?e.abort():e.dirty()},"addIssue"),get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let u=i.transform(n.data,a);if(n.common.async)return Promise.resolve(u).then(async h=>{if(e.value==="aborted")return ae;let d=await this._def.schema._parseAsync({data:h,path:n.path,parent:n});return d.status==="aborted"?ae:d.status==="dirty"?fh(d.value):e.value==="dirty"?fh(d.value):d});{if(e.value==="aborted")return ae;let h=this._def.schema._parseSync({data:u,path:n.path,parent:n});return h.status==="aborted"?ae:h.status==="dirty"?fh(h.value):e.value==="dirty"?fh(h.value):h}}if(i.type==="refinement"){let u=l(h=>{let d=i.refinement(h,a);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h},"executeRefinement");if(n.common.async===!1){let h=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return h.status==="aborted"?ae:(h.status==="dirty"&&e.dirty(),u(h.value),{status:e.value,value:h.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(h=>h.status==="aborted"?ae:(h.status==="dirty"&&e.dirty(),u(h.value).then(()=>({status:e.value,value:h.value}))))}if(i.type==="transform")if(n.common.async===!1){let u=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Mc(u))return ae;let h=i.transform(u.value,a);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:h}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(u=>Mc(u)?Promise.resolve(i.transform(u.value,a)).then(h=>({status:e.value,value:h})):ae);fr.assertNever(i)}};l(c3,"ZodEffects");var ks=c3;ks.create=(r,t,e)=>new ks(U({schema:r,typeName:ce.ZodEffects,effect:t},be(e)));ks.createWithPreprocess=(r,t,e)=>new ks(U({schema:t,effect:{type:"preprocess",transform:r},typeName:ce.ZodEffects},be(e)));var p3=class p3 extends Ce{_parse(t){return this._getType(t)===Vt.undefined?ao(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};l(p3,"ZodOptional");var As=p3;As.create=(r,t)=>new As(U({innerType:r,typeName:ce.ZodOptional},be(t)));var h3=class h3 extends Ce{_parse(t){return this._getType(t)===Vt.null?ao(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};l(h3,"ZodNullable");var hl=h3;hl.create=(r,t)=>new hl(U({innerType:r,typeName:ce.ZodNullable},be(t)));var f3=class f3 extends Ce{_parse(t){let{ctx:e}=this._processInputParams(t),n=e.data;return e.parsedType===Vt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};l(f3,"ZodDefault");var wh=f3;wh.create=(r,t)=>new wh(U({innerType:r,typeName:ce.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},be(t)));var d3=class d3 extends Ce{_parse(t){let{ctx:e}=this._processInputParams(t),n=rt(U({},e),{common:rt(U({},e.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:U({},n)});return Nd(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Uo(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Uo(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};l(d3,"ZodCatch");var Ph=d3;Ph.create=(r,t)=>new Ph(U({innerType:r,typeName:ce.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},be(t)));var m3=class m3 extends Ce{_parse(t){if(this._getType(t)!==Vt.nan){let n=this._getOrReturnCtx(t);return Ft(n,{code:Pt.invalid_type,expected:Vt.nan,received:n.parsedType}),ae}return{status:"valid",value:t.data}}};l(m3,"ZodNaN");var Ud=m3;Ud.create=r=>new Ud(U({typeName:ce.ZodNaN},be(r)));var IV=Symbol("zod_brand"),g3=class g3 extends Ce{_parse(t){let{ctx:e}=this._processInputParams(t),n=e.data;return this._def.type._parse({data:n,path:e.path,parent:e})}unwrap(){return this._def.type}};l(g3,"ZodBranded");var _y=g3,Db=class Db extends Ce{_parse(t){let{status:e,ctx:n}=this._processInputParams(t);if(n.common.async)return l(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ae:a.status==="dirty"?(e.dirty(),fh(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ae:i.status==="dirty"?(e.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,e){return new Db({in:t,out:e,typeName:ce.ZodPipeline})}};l(Db,"ZodPipeline");var Cy=Db,y3=class y3 extends Ce{_parse(t){let e=this._def.innerType._parse(t),n=l(i=>(Mc(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return Nd(e)?e.then(i=>n(i)):n(e)}unwrap(){return this._def.innerType}};l(y3,"ZodReadonly");var Eh=y3;Eh.create=(r,t)=>new Eh(U({innerType:r,typeName:ce.ZodReadonly},be(t)));function f9(r,t){let e=typeof r=="function"?r(t):typeof r=="string"?{message:r}:r;return typeof e=="string"?{message:e}:e}l(f9,"cleanParams");function v9(r,t={},e){return r?wc.create().superRefine((n,i)=>{var u,h;let a=r(n);if(a instanceof Promise)return a.then(d=>{var m,v;if(!d){let x=f9(t,n),S=(v=(m=x.fatal)!=null?m:e)!=null?v:!0;i.addIssue(rt(U({code:"custom"},x),{fatal:S}))}});if(!a){let d=f9(t,n),m=(h=(u=d.fatal)!=null?u:e)!=null?h:!0;i.addIssue(rt(U({code:"custom"},d),{fatal:m}))}}):wc.create()}l(v9,"custom");var MV={object:zo.lazycreate},ce;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(ce||(ce={}));var TV=l((r,t={message:"Input not instance of ".concat(r.name)})=>v9(e=>e instanceof r,t),"instanceOfType"),b9=Tc.create,x9=mh.create,wV=Ud.create,PV=gh.create,_9=yh.create,EV=vh.create,OV=Bd.create,DV=bh.create,LV=xh.create,AV=wc.create,NV=cu.create,kV=fa.create,RV=Gd.create,FV=pu.create,BV=zo.create,GV=zo.strictCreate,VV=_h.create,jV=Mb.create,UV=Ch.create,zV=pl.create,HV=Tb.create,XV=Vd.create,YV=jd.create,qV=wb.create,WV=Sh.create,ZV=Ih.create,$V=Mh.create,JV=Th.create,KV=Pc.create,QV=ks.create,tj=As.create,ej=hl.create,rj=ks.createWithPreprocess,nj=Cy.create,ij=l(()=>b9().optional(),"ostring"),oj=l(()=>x9().optional(),"onumber"),sj=l(()=>_9().optional(),"oboolean"),aj={string:l(r=>Tc.create(rt(U({},r),{coerce:!0})),"string"),number:l(r=>mh.create(rt(U({},r),{coerce:!0})),"number"),boolean:l(r=>yh.create(rt(U({},r),{coerce:!0})),"boolean"),bigint:l(r=>gh.create(rt(U({},r),{coerce:!0})),"bigint"),date:l(r=>vh.create(rt(U({},r),{coerce:!0})),"date")};var lj=ae;var C9=Q;var Pi=C9;var K9=$r(P3());var Py=4,ez=8,rz="0.6",J9="low-priority-pin",E3=Q.object({rank:Q.union([Q.enum(["low","medium","high","always-visible"]),Q.number()]).optional(),interactive:Q.union([Q.boolean(),Q.literal("pointer-events-auto")]).optional(),id:Q.string().optional(),anchor:Q.union([Q.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),Q.array(Q.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:Q.boolean().optional(),zIndex:Q.number().optional(),lowPriorityPin:Q.object({enabled:Q.boolean().optional(),size:Q.number().positive().optional(),color:Q.string().optional()}).optional()});function Q9(r,t,e){Q.array(Q.number()).min(2).max(3).parse(r),Q.string().parse(t),E3.parse(e)}l(Q9,"validateMarker");var nz=Object.freeze({enabled:!0,size:ez,color:"#666"}),Ah=class Ah{constructor(t,e={}){b(this,"id");b(this,"type","marker");b(this,"rank",0);b(this,"initialRank",0);b(this,"activeAnchor","center");b(this,"pointerEvents","none");b(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:U({},nz)});b(this,"projection",new ne);b(this,"enabled",!0);b(this,"canShow",!1);b(this,"visible",!0);b(this,"isOccluded",!1);b(this,"offscreen",!1);b(this,"strategyIndex",-1);b(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});b(this,"dimensions",{width:0,height:0});b(this,"markerContainer");b(this,"containerEl");b(this,"contentEl",null);b(this,"contentHtml","");b(this,"style",{top:"0px",left:"0px"});b(this,"dirty",!1);b(this,"attachedDirty",!0);b(this,"collisionDirty",!0);b(this,"visibilityNeedsUpdate","show");b(this,"animation",null);b(this,"currentStrategyIndex",-1);b(this,"onStrategySelected",l((t,e=!1)=>{var i,a;if(this.currentStrategyIndex===t&&!e)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",J9);let u=this.options.lowPriorityPin,h=u.size,d=u.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(h,"px")),this.markerContainer.style.setProperty("--pin-color",d),this.markerContainer.style.opacity=rz,this.style.top=-h/2+"px",this.style.left=-h/2+"px"}else{this.activeAnchor=(a=(i=this.strategies[t])==null?void 0:i.name)!=null?a:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:u,height:h}=this.dimensions,d=-h/2+"px",m=-u/2+"px";switch(this.style.top=d,this.style.left=m,this.activeAnchor){case"top":{this.style.top=-h+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-u+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-h+"px",this.style.left=-u+"px";break}case"top-right":{this.style.top=-h+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-u+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=d,this.style.left=m}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));b(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,i,a;if(this.id=(e==null?void 0:e.id)||Mr(),this.options=(0,K9.default)(this.options,e),typeof e.rank=="string")this.rank=Dd(e.rank);else if(e.rank!=null&&e.rank>0)this.rank=e.rank;else{let u=Math.trunc(P.env.NODE_ENV==="test"?Ah.testId:Ah.testId*10)/10;Ah.testId+=.001,this.rank=u}typeof e.interactive=="string"&&(this.pointerEvents=e.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(a=(i=this.markerContainer.firstElementChild)==null?void 0:i.firstElementChild)!=null?a:null}updateDimensions(t,e){if(t!=null&&e!=null)this.dimensions={width:t,height:e};else{let{width:n,height:i}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var a;let{width:t,height:e}=this.dimensions;if(t===0||e===0)return[];let i=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(u=>({name:u,getBoundingBox:l(()=>{let h=e/2,d=e/2,m=t/2,v=t/2;switch(u){case"top":{h=e,d=0;break}case"bottom":{h=0,d=e;break}case"left":{m=t,v=0;break}case"right":{m=0,v=t;break}case"top-left":{h=e,m=t,d=0,v=0;break}case"top-right":{h=e,v=t,d=0,m=0;break}case"bottom-left":{d=e,m=t,h=0,v=0;break}case"bottom-right":{d=e,v=t,h=0,m=0;break}}return[h+Py,d+Py,m+Py,v+Py]},"getBoundingBox")}));if((a=this.options.lowPriorityPin)!=null&&a.enabled&&this.options.rank!=="always-visible"){let u={name:J9,getBoundingBox:l(()=>{let h=Math.max(2,Py/2);return[this.options.lowPriorityPin.size/2+h,this.options.lowPriorityPin.size/2+h,this.options.lowPriorityPin.size/2+h,this.options.lowPriorityPin.size/2+h]},"getBoundingBox")};i.push(u)}return i}toPackedMessage(t=!1){var n;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let e=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&e&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,e&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let i=this.packedMessage.bboxes.findIndex(a=>a[4]===this.currentStrategyIndex);if(i!==-1){let a=this.packedMessage.bboxes.splice(i,1)[0];this.packedMessage.bboxes.unshift(a)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let i=0;i<this.strategies.length;i++){let a=this.strategies[i];i===this.currentStrategyIndex&&e?this.packedMessage.bboxes.unshift([...a.getBoundingBox(),i]):this.packedMessage.bboxes.push([...a.getBoundingBox(),i])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return!((t=this.options.lowPriorityPin)!=null&&t.enabled)||this.options.rank==="always-visible"?-1:Array.isArray(this.options.anchor)?this.options.anchor.length:1}destroy(){}};l(Ah,"MarkerComponent"),b(Ah,"testId",0);var fl=Ah;y();y();y();y();y();var O3=class O3{constructor(){b(this,"hover",!1);b(this,"dirty",!1)}};l(O3,"InteractionComponent");var Yd=O3;y();y();function Vb(r){"@babel/helpers - typeof";return Vb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vb(r)}l(Vb,"_typeof");var iz=/^\s+/,oz=/\s+$/;function Xt(r,t){if(r=r||"",t=t||{},r instanceof Xt)return r;if(!(this instanceof Xt))return new Xt(r,t);var e=sz(r);this._originalInput=r,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||e.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}l(Xt,"tinycolor");Xt.prototype={isDark:l(function(){return this.getBrightness()<128},"isDark"),isLight:l(function(){return!this.isDark()},"isLight"),isValid:l(function(){return this._ok},"isValid"),getOriginalInput:l(function(){return this._originalInput},"getOriginalInput"),getFormat:l(function(){return this._format},"getFormat"),getAlpha:l(function(){return this._a},"getAlpha"),getBrightness:l(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:l(function(){var t=this.toRgb(),e,n,i,a,u,h;return e=t.r/255,n=t.g/255,i=t.b/255,e<=.03928?a=e/12.92:a=Math.pow((e+.055)/1.055,2.4),n<=.03928?u=n/12.92:u=Math.pow((n+.055)/1.055,2.4),i<=.03928?h=i/12.92:h=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*u+.0722*h},"getLuminance"),setAlpha:l(function(t){return this._a=s8(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:l(function(){var t=e8(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:l(function(){var t=e8(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+n+"%, "+i+"%)":"hsva("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:l(function(){var t=t8(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:l(function(){var t=t8(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+n+"%, "+i+"%)":"hsla("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:l(function(t){return r8(this._r,this._g,this._b,t)},"toHex"),toHexString:l(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:l(function(t){return cz(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:l(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:l(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:l(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:l(function(){return{r:Math.round(_n(this._r,255)*100)+"%",g:Math.round(_n(this._g,255)*100)+"%",b:Math.round(_n(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:l(function(){return this._a==1?"rgb("+Math.round(_n(this._r,255)*100)+"%, "+Math.round(_n(this._g,255)*100)+"%, "+Math.round(_n(this._b,255)*100)+"%)":"rgba("+Math.round(_n(this._r,255)*100)+"%, "+Math.round(_n(this._g,255)*100)+"%, "+Math.round(_n(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:l(function(){return this._a===0?"transparent":this._a<1?!1:Cz[r8(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:l(function(t){var e="#"+n8(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=Xt(t);n="#"+n8(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},"toFilter"),toString:l(function(t){var e=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!e&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:l(function(){return Xt(this.toString())},"clone"),_applyModification:l(function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:l(function(){return this._applyModification(dz,arguments)},"lighten"),brighten:l(function(){return this._applyModification(mz,arguments)},"brighten"),darken:l(function(){return this._applyModification(gz,arguments)},"darken"),desaturate:l(function(){return this._applyModification(pz,arguments)},"desaturate"),saturate:l(function(){return this._applyModification(hz,arguments)},"saturate"),greyscale:l(function(){return this._applyModification(fz,arguments)},"greyscale"),spin:l(function(){return this._applyModification(yz,arguments)},"spin"),_applyCombination:l(function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},"_applyCombination"),analogous:l(function(){return this._applyCombination(xz,arguments)},"analogous"),complement:l(function(){return this._applyCombination(vz,arguments)},"complement"),monochromatic:l(function(){return this._applyCombination(_z,arguments)},"monochromatic"),splitcomplement:l(function(){return this._applyCombination(bz,arguments)},"splitcomplement"),triad:l(function(){return this._applyCombination(i8,[3])},"triad"),tetrad:l(function(){return this._applyCombination(i8,[4])},"tetrad")};Xt.fromRatio=function(r,t){if(Vb(r)=="object"){var e={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?e[n]=r[n]:e[n]=Ey(r[n]));r=e}return Xt(r,t)};function sz(r){var t={r:0,g:0,b:0},e=1,n=null,i=null,a=null,u=!1,h=!1;return typeof r=="string"&&(r=Tz(r)),Vb(r)=="object"&&(du(r.r)&&du(r.g)&&du(r.b)?(t=az(r.r,r.g,r.b),u=!0,h=String(r.r).substr(-1)==="%"?"prgb":"rgb"):du(r.h)&&du(r.s)&&du(r.v)?(n=Ey(r.s),i=Ey(r.v),t=uz(r.h,n,i),u=!0,h="hsv"):du(r.h)&&du(r.s)&&du(r.l)&&(n=Ey(r.s),a=Ey(r.l),t=lz(r.h,n,a),u=!0,h="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=s8(e),{ok:u,format:r.format||h,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}l(sz,"inputToRGB");function az(r,t,e){return{r:_n(r,255)*255,g:_n(t,255)*255,b:_n(e,255)*255}}l(az,"rgbToRgb");function t8(r,t,e){r=_n(r,255),t=_n(t,255),e=_n(e,255);var n=Math.max(r,t,e),i=Math.min(r,t,e),a,u,h=(n+i)/2;if(n==i)a=u=0;else{var d=n-i;switch(u=h>.5?d/(2-n-i):d/(n+i),n){case r:a=(t-e)/d+(t<e?6:0);break;case t:a=(e-r)/d+2;break;case e:a=(r-t)/d+4;break}a/=6}return{h:a,s:u,l:h}}l(t8,"rgbToHsl");function lz(r,t,e){var n,i,a;r=_n(r,360),t=_n(t,100),e=_n(e,100);function u(m,v,x){return x<0&&(x+=1),x>1&&(x-=1),x<1/6?m+(v-m)*6*x:x<1/2?v:x<2/3?m+(v-m)*(2/3-x)*6:m}if(l(u,"hue2rgb"),t===0)n=i=a=e;else{var h=e<.5?e*(1+t):e+t-e*t,d=2*e-h;n=u(d,h,r+1/3),i=u(d,h,r),a=u(d,h,r-1/3)}return{r:n*255,g:i*255,b:a*255}}l(lz,"hslToRgb");function e8(r,t,e){r=_n(r,255),t=_n(t,255),e=_n(e,255);var n=Math.max(r,t,e),i=Math.min(r,t,e),a,u,h=n,d=n-i;if(u=n===0?0:d/n,n==i)a=0;else{switch(n){case r:a=(t-e)/d+(t<e?6:0);break;case t:a=(e-r)/d+2;break;case e:a=(r-t)/d+4;break}a/=6}return{h:a,s:u,v:h}}l(e8,"rgbToHsv");function uz(r,t,e){r=_n(r,360)*6,t=_n(t,100),e=_n(e,100);var n=Math.floor(r),i=r-n,a=e*(1-t),u=e*(1-i*t),h=e*(1-(1-i)*t),d=n%6,m=[e,u,a,a,h,e][d],v=[h,e,e,u,a,a][d],x=[a,a,h,e,e,u][d];return{r:m*255,g:v*255,b:x*255}}l(uz,"hsvToRgb");function r8(r,t,e,n){var i=[ma(Math.round(r).toString(16)),ma(Math.round(t).toString(16)),ma(Math.round(e).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}l(r8,"rgbToHex");function cz(r,t,e,n,i){var a=[ma(Math.round(r).toString(16)),ma(Math.round(t).toString(16)),ma(Math.round(e).toString(16)),ma(a8(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}l(cz,"rgbaToHex");function n8(r,t,e,n){var i=[ma(a8(n)),ma(Math.round(r).toString(16)),ma(Math.round(t).toString(16)),ma(Math.round(e).toString(16))];return i.join("")}l(n8,"rgbaToArgbHex");Xt.equals=function(r,t){return!r||!t?!1:Xt(r).toRgbString()==Xt(t).toRgbString()};Xt.random=function(){return Xt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function pz(r,t){t=t===0?0:t||10;var e=Xt(r).toHsl();return e.s-=t/100,e.s=jb(e.s),Xt(e)}l(pz,"_desaturate");function hz(r,t){t=t===0?0:t||10;var e=Xt(r).toHsl();return e.s+=t/100,e.s=jb(e.s),Xt(e)}l(hz,"_saturate");function fz(r){return Xt(r).desaturate(100)}l(fz,"_greyscale");function dz(r,t){t=t===0?0:t||10;var e=Xt(r).toHsl();return e.l+=t/100,e.l=jb(e.l),Xt(e)}l(dz,"_lighten");function mz(r,t){t=t===0?0:t||10;var e=Xt(r).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),Xt(e)}l(mz,"_brighten");function gz(r,t){t=t===0?0:t||10;var e=Xt(r).toHsl();return e.l-=t/100,e.l=jb(e.l),Xt(e)}l(gz,"_darken");function yz(r,t){var e=Xt(r).toHsl(),n=(e.h+t)%360;return e.h=n<0?360+n:n,Xt(e)}l(yz,"_spin");function vz(r){var t=Xt(r).toHsl();return t.h=(t.h+180)%360,Xt(t)}l(vz,"_complement");function i8(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=Xt(r).toHsl(),n=[Xt(r)],i=360/t,a=1;a<t;a++)n.push(Xt({h:(e.h+a*i)%360,s:e.s,l:e.l}));return n}l(i8,"polyad");function bz(r){var t=Xt(r).toHsl(),e=t.h;return[Xt(r),Xt({h:(e+72)%360,s:t.s,l:t.l}),Xt({h:(e+216)%360,s:t.s,l:t.l})]}l(bz,"_splitcomplement");function xz(r,t,e){t=t||6,e=e||30;var n=Xt(r).toHsl(),i=360/e,a=[Xt(r)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(Xt(n));return a}l(xz,"_analogous");function _z(r,t){t=t||6;for(var e=Xt(r).toHsv(),n=e.h,i=e.s,a=e.v,u=[],h=1/t;t--;)u.push(Xt({h:n,s:i,v:a})),a=(a+h)%1;return u}l(_z,"_monochromatic");Xt.mix=function(r,t,e){e=e===0?0:e||50;var n=Xt(r).toRgb(),i=Xt(t).toRgb(),a=e/100,u={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return Xt(u)};Xt.readability=function(r,t){var e=Xt(r),n=Xt(t);return(Math.max(e.getLuminance(),n.getLuminance())+.05)/(Math.min(e.getLuminance(),n.getLuminance())+.05)};Xt.isReadable=function(r,t,e){var n=Xt.readability(r,t),i,a;switch(a=!1,i=wz(e),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};Xt.mostReadable=function(r,t,e){var n=null,i=0,a,u,h,d;e=e||{},u=e.includeFallbackColors,h=e.level,d=e.size;for(var m=0;m<t.length;m++)a=Xt.readability(r,t[m]),a>i&&(i=a,n=Xt(t[m]));return Xt.isReadable(r,n,{level:h,size:d})||!u?n:(e.includeFallbackColors=!1,Xt.mostReadable(r,["#fff","#000"],e))};var D3=Xt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Cz=Xt.hexNames=Sz(D3);function Sz(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}l(Sz,"flip");function s8(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}l(s8,"boundAlpha");function _n(r,t){Iz(r)&&(r="100%");var e=Mz(r);return r=Math.min(t,Math.max(0,parseFloat(r))),e&&(r=parseInt(r*t,10)/100),Math.abs(r-t)<1e-6?1:r%t/parseFloat(t)}l(_n,"bound01");function jb(r){return Math.min(1,Math.max(0,r))}l(jb,"clamp01");function cs(r){return parseInt(r,16)}l(cs,"parseIntFromHex");function Iz(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}l(Iz,"isOnePointZero");function Mz(r){return typeof r=="string"&&r.indexOf("%")!=-1}l(Mz,"isPercentage");function ma(r){return r.length==1?"0"+r:""+r}l(ma,"pad2");function Ey(r){return r<=1&&(r=r*100+"%"),r}l(Ey,"convertToPercentage");function a8(r){return Math.round(parseFloat(r)*255).toString(16)}l(a8,"convertDecimalToHex");function o8(r){return cs(r)/255}l(o8,"convertHexToDecimal");var da=function(){var r="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",e="(?:"+t+")|(?:"+r+")",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",i="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function du(r){return!!da.CSS_UNIT.exec(r)}l(du,"isValidCSSUnit");function Tz(r){r=r.replace(iz,"").replace(oz,"").toLowerCase();var t=!1;if(D3[r])r=D3[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=da.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=da.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=da.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=da.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=da.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=da.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=da.hex8.exec(r))?{r:cs(e[1]),g:cs(e[2]),b:cs(e[3]),a:o8(e[4]),format:t?"name":"hex8"}:(e=da.hex6.exec(r))?{r:cs(e[1]),g:cs(e[2]),b:cs(e[3]),format:t?"name":"hex"}:(e=da.hex4.exec(r))?{r:cs(e[1]+""+e[1]),g:cs(e[2]+""+e[2]),b:cs(e[3]+""+e[3]),a:o8(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=da.hex3.exec(r))?{r:cs(e[1]+""+e[1]),g:cs(e[2]+""+e[2]),b:cs(e[3]+""+e[3]),format:t?"name":"hex"}:!1}l(Tz,"stringInputToObject");function wz(r){var t,e;return r=r||{level:"AA",size:"small"},t=(r.level||"AA").toUpperCase(),e=(r.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:t,size:e}}l(wz,"validateWCAG2Parms");var H3=$r(z3());y();var _X=Q.object({rank:Q.union([Q.enum(["low","medium","high","always-visible"]),Q.number()]).optional(),interactive:Q.boolean().optional(),appearance:Q.object({margin:Q.number().min(6).optional(),text:Q.object({numLines:Q.number().optional(),lineHeight:Q.number().optional(),size:Q.number().optional(),maxWidth:Q.number().optional(),foregroundColor:Q.string().optional(),backgroundColor:Q.string().optional()}).optional(),marker:Q.object({size:Q.number().optional(),foregroundColor:Q.object({active:Q.string().optional(),inactive:Q.string().optional()}).optional(),backgroundColor:Q.object({active:Q.string().optional(),inactive:Q.string().optional()}).optional(),iconScale:Q.union([Q.number(),Q.object({on:Q.literal("zoom-level").optional(),input:Q.array(Q.number()).nonempty(),output:Q.array(Q.number()).nonempty(),easing:Q.string().optional()})]).optional()}).optional()}).optional()}),q3=l(r=>{var t,e;if(_X.parse(r!=null?r:{}),typeof((e=(t=r.appearance)==null?void 0:t.marker)==null?void 0:e.iconScale)=="object"){let n=r.appearance.marker.iconScale;if(n.input.length!==n.output.length)throw new Error("iconScale.input and iconScale.output must have the same number of values for interpolation!");if(n.input.some((i,a)=>a>0&&i<n.input[a-1]))throw new Error("iconScale.input must be sorted in increasing order for interpolation!")}},"validateLabelOptions");function U8(r,t,e){Q.array(Q.number()).min(2).max(3).parse(r),Q.string().parse(t),q3(e)}l(U8,"validateLabel");var $d={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},CX={lightOnDark:rt(U({},$d),{text:rt(U({},$d.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:rt(U({},$d.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:rt(U({},$d),{text:rt(U({},$d.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:rt(U({},$d.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},SX="LOW_PRIORITY",B8=4,IX=6,MX=20,G8=2,TX="cover",wX=-1/0,V8=6.5,j8={heightAbovePolygon:0,appearance:CX.darkOnLight},z8=l((r,t)=>["numLines","lineHeight","size","maxWidth","foregroundColor","backgroundColor"].some(e=>{var n,i,a;return((n=t.text)==null?void 0:n[e])!=null&&((i=r.text)==null?void 0:i[e])!==((a=t.text)==null?void 0:a[e])}),"isOneOfTextDirtyOptions"),H8=l((r,t)=>["foregroundColor","backgroundColor","icon"].some(e=>{var n,i,a;return((n=t.marker)==null?void 0:n[e])!=null&&((i=r.marker)==null?void 0:i[e])!==((a=t.marker)==null?void 0:a[e])}),"isOneOfMarkerDirtyOptions"),Rh=class Rh{constructor(t,e,n){b(this,"lines",0);b(this,"id");b(this,"rank");b(this,"type","label");b(this,"initialRank");b(this,"contextConfigured",!1);b(this,"fillText");b(this,"newStyle",{});b(this,"opacity",0);b(this,"visibilityNeedsUpdate",!1);b(this,"text");b(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});b(this,"projection",new ne);b(this,"labelCacheId");b(this,"_cache",{});b(this,"appearance");b(this,"options");b(this,"visible",!0);b(this,"enabled",!0);b(this,"isOccluded",!1);b(this,"offscreen",!1);b(this,"canShow",!1);b(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});b(this,"dimensions",{width:0,height:0});b(this,"currentStrategyIndex",-1);b(this,"totalMarkerSize",0);b(this,"iconScale",1);b(this,"iconPadding");b(this,"dirty",!0);b(this,"textDirty",!0);b(this,"markerDirty",!0);b(this,"attachedDirty",!0);b(this,"collisionDirty",!0);b(this,"lastTextAlign");b(this,"imageHash");b(this,"markerSize",0);b(this,"iconVisible",!1);b(this,"dp");b(this,"animate",!0);b(this,"onStrategySelected",l(t=>{if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let e=this.strategies[this.currentStrategyIndex];if(e){e.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}},"onStrategySelected"));b(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var a,u;if(this.id=(a=e.id)!=null?a:Mr(),this.options=(0,H3.default)({},e,j8),this.text=t,this.dp=(h=1)=>h*n.pixelRatio,typeof e.rank=="string")this.rank=Dd(e.rank),this.initialRank=this.rank;else if(e.rank!=null&&e.rank>0)this.rank=e.rank,this.initialRank=e.rank;else{let h=Math.trunc(P.env.NODE_ENV==="test"?Rh.testId:Rh.testId*10)/10;Rh.testId+=.001,this.rank=h,this.initialRank=h}let i=(0,H3.default)({},this.options.appearance,j8.appearance);this.appearance={margin:i.margin,text:{lineHeight:i.text.lineHeight,numLines:i.text.numLines,size:i.text.size,maxWidth:i.text.maxWidth,foregroundColor:i.text.foregroundColor,backgroundColor:i.text.backgroundColor},marker:{foregroundColor:{active:i.marker.foregroundColor.active,inactive:i.marker.foregroundColor.inactive||Xt(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||Xt(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||MX,iconPadding:(u=i.marker.iconPadding)!=null?u:G8,iconFit:i.marker.iconFit||TX,iconOverflow:i.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:i.marker.iconVisibleAtZoomLevel==null?wX:i.marker.iconVisibleAtZoomLevel,iconScale:i.marker.iconScale}}}get scaledMarkerSize(){return this.totalMarkerSize*this.iconScale}get scaledIconPadding(){var t,e,n;return((n=(e=(t=this.appearance)==null?void 0:t.marker)==null?void 0:e.iconPadding)!=null?n:G8)*this.iconScale}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(V8),this.totalMarkerSize=Math.ceil((this.markerSize+2.5)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:e}=this.dimensions,{margin:n}=this.appearance,i=Math.max(IX,n),a=this.iconVisible?i/2:0,u=this.iconVisible?this.scaledMarkerSize:V8/2,h=[{name:"RIGHT",getBoundingBox:l(()=>{let d=Math.max(this.scaledMarkerSize,e);return[d/2+i,d/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+t+i]},"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=this.scaledMarkerSize/2+B8,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:l(()=>{let d=Math.max(this.scaledMarkerSize,e);return[d/2+i,d/2+i,this.scaledMarkerSize/2+t+i,this.scaledMarkerSize/2+i]},"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-e/2,this.newStyle.left=-t-this.scaledMarkerSize/2-B8,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:l(()=>{let d=this.dp();return[e+this.scaledMarkerSize/2/d+i,this.scaledMarkerSize/2+i,t/2+i,t/2+i]},"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-e-this.scaledMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:SX,getBoundingBox:l(()=>[u+a,u+a,u+a,u+a],"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:l(()=>[this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i,this.scaledMarkerSize/2+i],"getBoundingBox"),onStrategySelected:l(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:h}recomputeCurrentStrategy(t=this.iconScale){if(this.iconScale!==t||this.dirty){let e=this.strategies[this.currentStrategyIndex];if(this.iconScale=t,this.collisionDirty=!0,e){e.onStrategySelected(t);let n=this.style;this.style=this.newStyle,this.newStyle=n}this.dirty=!1}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var e;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((e=this.packedMessage.bboxes[0])==null?void 0:e[4])){let n=this.packedMessage.bboxes.findIndex(i=>i[4]===this.currentStrategyIndex);if(n!==-1){let i=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(i)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let i=this.strategies[n];n===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...i.getBoundingBox(),n]):this.packedMessage.bboxes.push([...i.getBoundingBox(),n])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};l(Rh,"LabelComponent"),b(Rh,"testId",0);var X3=Rh,dl=X3;y();y();var K3=class K3 extends le{constructor(e,n,i=!0){super();b(this,"rendererState");b(this,"convertTo3DMapPosition");b(this,"textSet",new Set);b(this,"batchedTextMap",new Map);b(this,"useWorker",!0);b(this,"debugTextAreaMesh",new Map);i===!1&&(this.useWorker=!1,Jb(!1)),this.rendererState=e,this.convertTo3DMapPosition=n}remove(e){this.textSet.delete(e)}update(e){var h,d,m;let n,i,a,u=[];for(let v of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(v),(n==null?void 0:n.type)==="text3d"){i=n.components[0],a=n.components[1];let x=(h=i.mesh)==null?void 0:h.parent;if(!x||!(x instanceof Er)||!(i instanceof Ec))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((m=(d=i.feature.properties)==null?void 0:d.textArea)==null?void 0:m.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(x)||this.batchedTextMap.set(x,Jd().then(({BatchedText:w})=>{let E=new w;return E.type="batchedtext",x.add(E),E}));let I=this.batchedTextMap.get(x);if(!I)throw new Error("batched text required");u.push(X8({entityId:v,textComponent:i,styleComponent:a,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:I,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(i.mesh!=null&&i.textMesh==null&&i.mesh.parent!=null){if(this.textSet.has(v.toString()))continue;this.textSet.add(v.toString()),this.batchedTextMap.has(x)||this.batchedTextMap.set(x,Jd().then(({BatchedText:w})=>{let E=new w;return E.type="batchedtext",x.add(E),E}));let I=this.batchedTextMap.get(x);if(!I)throw new Error("batched text required");u.push(X8({entityId:v,textComponent:i,styleComponent:a,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:I,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let S=this.batchedTextMap.get(x);i.textMesh&&S&&i.polygonEntityId!=null&&Promise.all([S,Promise.resolve({meshComponent:i,styleComponent:a})]).then(([I,{meshComponent:w,styleComponent:E}])=>{let{textMesh:T}=w;if(I&&T){let D=J3(I,T);w.visible&&!D?I.add(T):!w.visible&&D&&I.remove(T)}E.flipToFaceCamera&&this.flipIfNeeded(w,e)})}return Promise.all(u)}flipIfNeeded(e,n){let i=e.textMesh;if(!i)return!1;let a=i.rotation.z,u=p_(a+n);u>Math.PI/2&&u<3*Math.PI/2&&(i.rotation.z=p_(a+Math.PI))}showTextAreaMesh(){let e,n;for(let i of this.rendererState.geometry3DIdsInScene)if(e=this.rendererState.geometry3DMap.get(i),(e==null?void 0:e.type)==="text3d"&&(n=e.components[0],"textArea"in n.feature.properties)){let a=n.feature.properties.textArea;if(!a)continue;let u=new ra(a.maxWidth,a.maxHeight),h=new ue(u,new On({color:"pink"})),{textMesh:d}=n;if(!d)continue;let m=this.convertTo3DMapPosition(a.position,ky);h.position.copy(m),h.position.z=d.position.z-.1,h.rotation.z=d.rotation.z,W3.identity(),W3.makeRotationAxis(new zt(0,0,1),d.userData.rotationZ),ky.set(a.maxWidth/2,0,0),ky.applyMatrix4(W3),h.position.x-=ky.x,h.position.y-=ky.y,this.rendererState.entityScene.add(h),this.debugTextAreaMesh.set(i,h)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(e=>{this.rendererState.entityScene.remove(e)}),this.debugTextAreaMesh.clear(),this.publish("render")}};l(K3,"Text3DSystem");var $b=K3;function Jb(r){Jd().then(({configureTroikaTextBuilder:t})=>{t({useWorker:r})})}l(Jb,"configureWorker");var W3=new ns,ky=new zt,Z3;async function $3(r){let{preloadFont:t}=await Jd();return t(r)}l($3,"preloadFont");function Jd(){return Z3||(Z3=import("./text3d-ZRYODT3I.js").then(r=>r)),Z3}l(Jd,"getText3DService");async function X8({entityId:r,textComponent:t,styleComponent:e,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:a,type:u="text-area"}){return Promise.all([Jd(),Promise.resolve({entityId:r,meshComponent:t,styleComponent:e})]).then(([{createTroikaTextPoint:h,createTroikaTextArea:d},m])=>u==="text-area"?d(m.entityId,m.meshComponent,m.styleComponent,n):h(m.entityId,m.meshComponent,m.styleComponent,n)).catch(h=>{tt.warn("Trouble creating text: ",h)}).then(h=>{if(!(h!=null&&h.text))return;let d=[Promise.resolve(h.text),i,Promise.resolve()];if(t.polygonEntityId){let m=a.geometry3DMap.get(t.polygonEntityId);if((m==null?void 0:m.type)==="geometry"){let v=m.components[0],x=m.components[1];v.textMesh=h.text,v.mesh!=null&&(h.text.position.z=x.altitude+x.height+PX)}}else d[2]=Jd().then(({syncText:m})=>m(h.text));return Promise.all(d)}).then(h=>{if(!h)return;let[d,m]=h;m.add(d),t.batchedText||(t.batchedText=m)})}l(X8,"createText");function J3(r,t){return r._members.has(t)}l(J3,"doesBatchedTextContainsText");var PX=.5;var EX=Q.object({visible:Q.boolean(),color:Q.string(),flipToFaceCamera:Q.boolean(),font:Q.string().optional(),fontSize:Q.number(),margin:Q.union([Q.number(),Q.tuple([Q.number(),Q.number(),Q.number(),Q.number()])]),outlineColor:Q.string(),outlineOpacity:Q.number(),outlineBlur:Q.union([Q.number(),Q.string()]),outlineWidth:Q.number(),outlineOffsetX:Q.number(),outlineOffsetY:Q.number(),strokeWidth:Q.number(),maxWidth:Q.number().optional(),maxHeight:Q.number().optional(),strokeOpacity:Q.number(),strokeColor:Q.string(),fillOpacity:Q.number(),hoverColor:Q.string().optional(),id:Q.union([Q.string(),Q.number()]),type:Q.literal("text3d"),position:Q.tuple([Q.number(),Q.number(),Q.number()]),content:Q.string()}),Y8=EX.partial().omit({id:!0,type:!0}).strict(),q8=Y8.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),W8=Q.object({appearance:Y8.optional(),parentId:Q.string().optional()}).strict(),Q3=class Q3{constructor(t){b(this,"mesh",new oa);b(this,"textMesh");b(this,"type","text3d");b(this,"feature");b(this,"parent");b(this,"batchedText");b(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?J3(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};l(Q3,"Text3DComponent");var Ec=Q3;y();var tI=class tI{constructor(t){b(this,"color");b(this,"dirty",!0);b(this,"visible",!0);b(this,"edgeColors");b(this,"geometry");b(this,"ranges");b(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[this.ranges.start*4+3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[this.ranges.start*4],this.edgeColors.array[this.ranges.start*4+1],this.edgeColors.array[this.ranges.start*4+2]]:[0,0,0]}};l(tI,"OutlineComponent");var Kd=tI;y();y();y();var eI=class eI extends Gw{constructor(e){let n=e,i=3,a=i*4;super(new Uint8Array(e*a),i,e,k0,N0);b(this,"_width");b(this,"_height");b(this,"_propertiesLength");this._width=a,this._height=n,this._propertiesLength=i}setColor(e,n,i){let a=this.image.data,u=e*this._width;a[u]=Math.round(n.r*255),a[u+1]=Math.round(n.g*255),a[u+2]=Math.round(n.b*255),a[u+3]=0,a[u+4]=Math.round(i.r*255),a[u+5]=Math.round(i.g*255),a[u+6]=Math.round(i.b*255),a[u+7]=0,this.needsUpdate=!0}getColor(e){let n=this.image.data,i=e*this._width,a=new rn(n[i]/255,n[i+1]/255,n[i+2]/255),u=new rn(n[i+4]/255,n[i+5]/255,n[i+6]/255);return{color:a,topColor:u}}setTexture(e,n,i){let a=this.image.data,u=e*this._width;a[u+8]=n?255:0,a[u+9]=i?255:0,a[u+10]=0,a[u+11]=0,this.needsUpdate=!0}getTexture(e){let n=this.image.data,i=e*this._width,a=n[i+8]===255,u=n[i+9]===255;return{texture:a,topTexture:u}}};l(eI,"BatchedPropertiesTexture");var Kb=eI;y();var Z8="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";y();var $8="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var OX=-.05,DX=1,rI=class rI extends na{constructor(e,n,i=1){super(e);b(this,"propertiesTexture");b(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});b(this,"colorSpace",fp);b(this,"showTextures",l(e=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(e,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new Kb(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=a=>{let u=this.uniforms.uGradientIntensity,h=this.uniforms.uGradientEnd,d=this.uniforms.uGradientStart,m=this.uniforms.uTopTexture,v=this.uniforms.uTexture,x=this.uniforms.uRepeatYFactor,S=this.uniforms.uBlendTexture;this.uniforms=a.uniforms,a.vertexShader=Z8,a.fragmentShader=$8,Object.assign(this.uniforms,{uGradientIntensity:u,uGradientEnd:h,uGradientStart:d,uMinSideAlpha:{value:OX},uMaxSideAlpha:{value:DX},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:m,uTexture:v,uRepeatYFactor:x,uBlendTexture:S})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(e){e!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=e,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(e){e.wrapS=Ga,e.wrapT=Ga,e.colorSpace=this.colorSpace,this.uniforms.uTexture.value=e}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(e){e.wrapS=Ga,e.wrapT=Ga,e.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=e}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(e){e!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=e,this.colorSpace=e?Ow:fp,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(e,n,i){this.uniforms.uGradientStart.value=e,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(e,n,i){this.propertiesTexture.setColor(e,n,i)}getColor(e){return this.propertiesTexture.getColor(e)}hideTextures(e){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(e,!1,!1),this.needsUpdate=!0)}removeSideTexture(e){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(e,!1,n),this.needsUpdate=!0}}removeTopTexture(e){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(e,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};l(rI,"BatchedStandardMaterial");var Fh=rI;y();function J8(r,t){var m,v,x;let e=0;for(let S of r)e+=((v=(m=S.components[0])==null?void 0:m.geometry)==null?void 0:v.attributes.position.count)||0;let n=new rn(t.color),i;i=new Fh({color:n,side:t.side==="back"?Pw:t.side==="front"?A0:jl,opacity:(x=t.opacity)!=null?x:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},r.length);let a=new Z0(r.length,e,0,i),u,h,d;for(let S of r)u=S.components[0],!(!(u instanceof Bn)||!u.geometry)&&(u.mesh=a,u.material=i,u.instanceIndex=a.addGeometry(u.geometry),a.addInstance(u.instanceIndex),a.userData.entities[u.instanceIndex]=S.id,i instanceof Fh&&i.setColor(u.instanceIndex,n,t.topColor?new rn(t.topColor):n),h=a.getGeometryIdAt(u.instanceIndex),u.batchedProps&&(d=a.getGeometryRangeAt(h),d&&(u.batchedProps.range=d),u.batchedProps.geometryId=h));return a.perObjectFrustumCulled=!0,a.matrixAutoUpdate=!1,a}l(J8,"batchGeometries");function Qd(r){return Xt(r).darken(30).toRgbString()}l(Qd,"darkenColorForOutline");function K8(r,t,e,n){if(t.length<1)return;r.boundingBox||r.computeBoundingBox();let i=r.boundingBox,a=r.getAttribute("position"),u=r.getAttribute("normal"),h=r.getAttribute("uv"),d,m;r.index?(d=r.index.count/3,m=l(function(L,B){return r.index.getX(L*3+B)},"meshIndex")):(d=a.count/3,m=l(function(L,B){return L*3+B},"meshIndex"));let v=new ns;v.makeRotationFromQuaternion(new dp().setFromEuler(new Ul(0,0,e/180*Math.PI)));let x=t.find(L=>L.face==="top"),S;x&&(S={min:n(x.bounds[1],x.bounds[0],0),max:n(x.bounds[3],x.bounds[2],i.max.z)});let I=t.find(L=>L.face==="side"),w;if(I&&(w={min:n(I.bounds[1],I.bounds[0],0),max:n(I.bounds[3],I.bounds[2],i.max.z)}),!(!w&&!S))for(let L=0;L<d;++L){let B=u.getX(m(L,0))+u.getX(m(L,1))+u.getX(m(L,2)),j=u.getY(m(L,0))+u.getY(m(L,1))+u.getY(m(L,2)),W=u.getZ(m(L,0))+u.getZ(m(L,1))+u.getZ(m(L,2)),$=Math.abs(B),F=Math.abs(j),J=Math.abs(W);var E,T;$<=F&&$<=J?(E="x",F<=J?T="y":T="z"):F<=$&&F<=J?(E="y",$<=J?T="x":T="z"):(E="z",$<=F?T="x":T="y"),E==="z"&&(E=T,T="z");let ot,K,H,_t,ct,ft;if(T==="z"||E==="z"){if(!I||!w)continue;ot=I.repeat.u,K=I.repeat.v,H=I.offset.u,_t=I.offset.v,ct=I.rotation,ft=w}else{if(!x||!S)continue;ot=x.repeat.u,K=x.repeat.v,H=x.offset.u,_t=x.offset.v,ct=(360-e+x.rotation)%360,ft=S}let{min:mt,max:St}=ft,dt=new zl;dt.position.set(mt.x,mt.y,0),dt.updateMatrix(),dt.updateMatrixWorld();let xt=mt.clone().applyMatrix4(v),q=St.clone().applyMatrix4(v),ee=Math.abs(q.x-xt.x),Gt=Math.abs(q.y-xt.y),Kt=new zt(ee,Gt,St.z).applyMatrix4(dt.matrixWorld),It=Math.abs(Kt[E]-mt[E]),ie=Math.abs(Kt[T]-mt[T]),vr=ct*Math.PI/180||0,Qe=Math.cos(vr),Nt=Math.sin(vr),At=dt.matrixWorld.clone().invert(),Ct=new dp().setFromEuler(new Ul(0,0,e/180*Math.PI));for(let _e=0;_e<3;_e++){let qr=new zt(a.getX(m(L,_e)),a.getY(m(L,_e)),a.getZ(m(L,_e))).applyMatrix4(At);qr.applyQuaternion(Ct);let me=qr.applyMatrix4(dt.matrixWorld),Se=me.x,br=me.y,Wr=me.z;var D,A;E==="x"?D=ot*(Se-mt[E])/It+H:E==="y"?D=ot*(br-mt[E])/It+H:D=ot*(Wr-mt[E])/It+H,T==="x"?A=K*(Se-mt[T])/ie+_t:T==="y"?A=K*(br-mt[T])/ie+_t:A=K*(Wr-mt[T])/ie+_t,D-=.5,A-=.5;let $i=D*Qe-A*Nt+.5,Yt=D*Nt+A*Qe+.5;h.setX(m(L,_e),$i),h.setY(m(L,_e),Yt)}}}l(K8,"updateUVsLegacy");y();var nI=class nI{constructor(){b(this,"focusMesh");b(this,"dirty",!0)}};l(nI,"FocusableComponent");var vu=nI;function Ei(r,t,e){if(t!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container"||r.type==="custom-geometry")return t===!0?(r instanceof gp&&r.components[1]===void 0?(r.components[1]=new Yd,r.components[1].dirty=!0):r instanceof Sr&&r.components[2]===void 0?(r.components[2]=new Yd,r.components[2].dirty=!0):r instanceof Er&&r.components[1]===void 0&&(r.components[1]=new Yd,r.components[1].dirty=!0),!0):(r instanceof gp?r.components[1]=void 0:r instanceof Sr?r.components[2]=void 0:r instanceof Er&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let n;for(let i of r.userData.entities3D.values())n=e.geometry3DMap.get(i),Ei(n,t,e);return!0}}return!1}l(Ei,"updateInteractivity");function Q8(r,t,e){if(!(!(e!=null&&e.color)&&!("topColor"in e))){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let n,i,a=r.components[0];for(let u of r.userData.entities3D.values())if(n=t.geometry3DMap.get(u),n){i=n.components[1],i.color===a.color&&(i.initialColor=e.color||a.color,i.color=e.color||a.color,i.dirty=!0);let h=n.components[3];h&&(h.color=Qd(i.color||a.color),h.dirty=!0),i.topColor===a.topColor&&(i.topColor=e.topColor||a.topColor,i.dirty=!0)}return e.color!==void 0&&(a.color=e.color,a.dirty=!0),"topColor"in e&&(a.topColor=e.topColor,a.dirty=!0),!0}return!1}}l(Q8,"updateGroupColor");function tO(r,t){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let e=r.components[0];return e.shading=e.shading||{},e.shading&&(t.start!==e.shading.start||t.end!==e.shading.end||t.intensity!==e.shading.intensity)&&(Object.assign(e.shading,t),r.userData.shadingDirty=!0),!0}return!1}l(tO,"updateGroupShading");function eO(r,t){t!==void 0&&r.type==="geometry"&&(t.showImage!==void 0&&(r.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}l(eO,"updateImageProps");function oI(r,t,e){if(e!==void 0){if(r.type==="geometry"){let n=r.components[1];if(n.height!==e)return n.height=e,n.dirty=!0,r.components[3]&&(r.components[3].dirty=!0),!0}else if(r.type==="geometry-group"){let n=r.components[0];for(let i of r.userData.entities3D.values()){let a=t.geometry3DMap.get(i),u;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(u=a.components[1],u.height===n.height&&(a.components[1].height=e,a.components[1].dirty=!0),a.components[3]&&(a.components[3].dirty=!0))}return r.components[0].height=e,!0}}return!1}l(oI,"updateHeight");function sI(r,t){if(t!==void 0){let e=!1;(r.type==="path"||r.type==="geometry")&&(t.initialColor!==void 0&&t.initialColor!==r.components[1].initialColor&&(r.components[1].initialColor=t.initialColor,e=!0),t.color!==void 0&&t.color!==r.components[1].color&&(r.components[1].color=t.color,e=!0,r.components[3]&&(r.components[3].color=Qd(t.color),r.components[3].dirty=!0)),"topColor"in t&&(r.components[1].topColor=t.topColor,e=!0),e&&(r.components[1].dirty=!0))}}l(sI,"updateColor");function aI(r,t,e){t!==void 0&&(r.type==="label"||r.type==="marker"?r.updatePosition(e(t[1],t[0],t[2]||0)):r.type==="custom-geometry"&&r.components[0].position.copy(e(t[1],t[0],t[2]||0)))}l(aI,"updatePosition");function lI(r,t){var e;return t!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parentObject3D!==t&&r.parentObject3D instanceof Er?((e=r.parentObject3D)==null||e.removeEntity(r),t.addEntity(r),!0):!1}l(lI,"updateParent");function rO(r,t){t!==void 0&&(r.type==="marker"||r.type==="label")&&r.components[0].enabled!==t&&(r.components[0].enabled=t)}l(rO,"updateEnabled");function nO(r,t,e){if(t!==void 0&&r.type==="marker"){let n=r.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(n.options.anchor=t.anchor,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{E3.parse(t.options||{})}catch(i){return tt.error(i),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Ei(r,!1,e)):(n.pointerEvents="none",Ei(r,t.options.interactive,e))),iO(r,t.options.rank),!0}}return!1}l(nO,"updateMarker");function iO(r,t){return t!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=Dd(t),!0):!1}l(iO,"updateRank");function oO(r,t,e){var n,i,a,u,h,d;if(t!==void 0&&r.type==="label"){let m=r.components[0];t.text!==void 0&&t.text!==m.text&&(m.text=t.text,m.textDirty=!0);try{q3((n=t.options)!=null?n:{})}catch(v){tt.error(v);return}z8(m.appearance,((i=t.options)==null?void 0:i.appearance)||{})&&(m.textDirty=!0),H8(m.appearance,((a=t.options)==null?void 0:a.appearance)||{})&&(m.markerDirty=!0),mP(m.appearance,((u=t.options)==null?void 0:u.appearance)||{}),Ei(r,(h=t.options)==null?void 0:h.interactive,e),iO(r,(d=t.options)==null?void 0:d.rank)}}l(oO,"updateLabel");function sO(r,t){t!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=t,r.components[1].dirty=!0)}l(sO,"updateHoverColor");function aO(r,t){if(t!==void 0){let e=r.components[2];if(r.type==="geometry"&&e!=null)return e.hover=t,e.dirty=!0,!0}return!1}l(aO,"updateHovered");function uI(r,t){t!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=t)}l(uI,"updateFlipImageToFaceCamera");function ml(r,t,e){if(e!==void 0)if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){e!==r.components[1].visible&&(r.components[1].visible=e,r.components[1].dirty=!0);let n=r.components[3];return n&&(n.visible=e,n.dirty=!0),!0}else{if(r.type==="geometry-group")return r.setVisible(e),!0;if(r.type==="group-container"){if(r.visible!==e)return r.setVisible(e),e===!1&&r.traverse(n=>{if(n instanceof iP){let i=t.geometry2DMap.get(n.userData.entityId);if(i){let a=i.components[0];a instanceof dl&&(a.canShow=e)}}}),!0}else if(r.type==="label")return r.components[0].visible=e,!0}return!1}l(ml,"updateVisibility");function cI(r,t,e){if(e!==void 0){if(r.type==="geometry-group"){let n=r.components[0];if(n.opacity!==e){for(let i of r.userData.entities3D.values()){let a=t.geometry3DMap.get(i),u;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(u=a.components[1],(!u.opacity||u.opacity===n.opacity)&&(u.opacity=e,u.dirty=!0))}return r.setOpacity(e),n.opacity=e,!0}}else if(r.type==="group-container"&&r.opacity!==e){r.setOpacity(e);let n=1;return r.parent instanceof Er&&(n=r.parent.opacity),lO(r,t,n),!0}}return!1}l(cI,"updateOpacity");function lO(r,t,e=1){if(r.type==="group-container"&&"children"in r&&r.children.length>0){let n=e*r.opacity;r.userData.computedOpacity=n;for(let i of r.children)(i instanceof io&&i.type==="geometry-group"||i instanceof Er&&i.type==="group-container")&&lO(i,t,n)}else if(r.type==="geometry-group")for(let n of r.userData.entities3D.values()){let i=t.geometry3DMap.get(n),a;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(a=i.components[1],a.dirty=!0)}}l(lO,"cascadeOpacity");function uO(r,t){if(t!==void 0&&r.type==="geometry-group"){let e=r.components[0];(t==null?void 0:t.texture)!=null&&e.texture!==(t==null?void 0:t.texture)&&(e.texture=t.texture,e.dirty=!0),(t==null?void 0:t.topTexture)!=null&&e.topTexture!==(t==null?void 0:t.topTexture)&&(e.topTexture=t.topTexture,e.dirty=!0)}}l(uO,"updateGroupTexture");function cO(r,t){if(r.type==="geometry"){let e=!1,n=r.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,e=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,e=!0),e&&r.components[0]instanceof Bn){let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),r.components[1].dirty=!0,!0}}return!1}l(cO,"updateIndividualGeometryTexture");function pO(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.opacity!==t){e.opacity=t;let n=r.components[0],i=r.components[3];i&&(i.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),t===0?e.visible=!1:e.visible=!0,e.dirty=!0;let a=r.parentObject3D;return(a==null?void 0:a.type)==="geometry-group"&&(a.userData.shadingDirty=!0),!0}}return!1}l(pO,"updateIndividualGeometryOpacity");function tm(r,t){if(t!==void 0)if(r.type==="geometry"||r.type==="path"||r.type==="custom-geometry"){let e=r.components[1];if(e.altitude!==t)return e.altitude=t,e.dirty=!0,r.components[3]&&(r.components[3].dirty=!0),!0}else{if(r.type==="group-container"&&r.altitude!==t)return r.setAltitude(t),!0;if(r.type==="geometry-group"&&r.altitude!==t)return r.setAltitude(t),!0}return!1}l(tm,"updateAltitude");function Qb(r,t,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)for(let n of r.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof Sr&&Qb(i,t,e)}else if(r.type==="geometry"){let n=r.components[3],i=r.components[1];!n&&e===!0?r.components[3]=new Kd(Qd(i.color)):n&&(n.visible=e,n.dirty=!0)}return!0}return!1}l(Qb,"updateOutline");function tx(r,t){if(t!==void 0){let e,n=4;if(r.type==="geometry"?(e=r.components[4],n=4):r.type==="group-container"&&(e=r.components[2],n=2),t===!0&&e==null)return r.components[n]=new vu,!0;if(t===!1&&e!=null)return r.components[n]=void 0,!0}return!1}l(tx,"updateFocusable");function hO(r,t){if(t!==void 0&&r.type==="geometry"){let e=r.components[1];if(e.renderOrder!==t){e.renderOrder=t;let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),e.dirty=!0,!0}}return!1}l(hO,"updateIndividualGeometryRenderOrder");function fO(r,t,e){let{visible:n,color:i}=e;if(r.type!=="path")return;let a=r.components[0];n!=null&&ml(r,t,n),i!=null&&sI(r,{color:i}),Object.assign(a,pI(e)),pP(e)||(a.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(a.dirty=!0),(e.nearZoomLevel!=null||e.farZoomLevel!=null)&&(a.dirty=!0))}l(fO,"handlePathUpdate");function pI(r){return is(r,AX)}l(pI,"pickPathOptions");var AX=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel","dashed","visibleThroughGeometry"];function dO(r){if(!(r instanceof Sr&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}l(dO,"assetGeometryIsText3D");var ex=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function mO(r,t,e){ml(r,t,e.visible);let n=r.components[1],i=is(e,ex);"margin"in e&&tt.warn("update to margin is not supported atm"),"content"in e&&tt.warn("content update is not supported atm");try{q8.parse(i)}catch(a){tt.error(a);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}l(mO,"handleText3DUpdate");var NX=["color","material","opacity","verticalOffset","rotation","position","scale"];function gO(r,t){let e=is(t,NX),n=r.components[1],i=r.components[0];Object.keys(e).length>0&&(e.material&&(n.material=e.material),e.opacity!=null&&(n.opacity=e.opacity,e.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),e.verticalOffset!=null&&(n.verticalOffset=e.verticalOffset),e.color!=null&&(n.color=e.color),e.position!=null&&(i.feature.geometry.coordinates=e.position,i.positionDirty=!0),e.rotation!=null&&(n.rotation=e.rotation),e.scale!=null&&(n.scale=e.scale),n.dirty=!0)}l(gO,"handleModelStyleUpdate");var Bh,gl,rx,Oc,yO,Fy,nx,vO,bO,By,ix,Gy,Vy,ox,hI=class hI{constructor(t){R(this,Oc);R(this,Bh,null);R(this,gl);b(this,"getCurrentSceneGLTF",l(async t=>{let e=U({onlyVisible:!0,binary:!0,light:!0,scale:1},t),n=await yt(this,Oc,yO).call(this),i=p(this,rx).call(this,e),a=await n.parseAsync(i,{trs:!1,maxTextureSize:1/0,onlyVisible:e.onlyVisible,binary:e.binary,scale:e.scale}),u;if(a instanceof ArrayBuffer)u=new Blob([a],{type:"application/octet-stream"});else{let h=JSON.stringify(a,null,2);u=new Blob([h],{type:"text/plain"})}return u},"getCurrentSceneGLTF"));R(this,rx,l(t=>{let{scale:e,light:n,onlyVisible:i}=t,a=new ic,u=new In().setFromObject(p(this,gl).entityScene);if(p(this,Fy).call(this,p(this,gl).entityScene,a,i),n){let h=new U0(16777215,.3*Math.PI);h.position.set(0,Math.max(u.max.x,u.max.y)*e*.5,u.max.y*e*4),h.lookAt(0,0,-1),h.target.position.set(0,0,-1),h.add(h.target),a.add(h)}return a},"#getExportedScene"));R(this,Fy,l((t,e,n)=>{t.material&&(t instanceof G0?yt(this,Oc,vO).call(this,t).forEach(i=>e.add(i)):t instanceof Vf&&e.add(yt(this,Oc,bO).call(this,t))),t.children.forEach(i=>{(!n||i.visible)&&p(this,Fy).call(this,i,e,n)})},"#processObject3D"));R(this,nx,l((t,e,n)=>{let i=new zw({color:new rn(t),metalness:0});return i.opacity=e,i.transparent=n,i},"#createStandardMaterial"));R(this,By,l(t=>{let{geometry:e,material:n,position:i,rotation:a,quaternion:u,scale:h}=t;if(!(e!=null&&e.isBufferGeometry))return t;let d=e.attributes.position,m=e.attributes.normal,v=e.attributes.uv;return p(this,ix).call(this,d,m),p(this,Vy).call(this,i,h,a,u),v&&p(this,ox).call(this,v),n!=null&&n.map&&e.type==="PlaneGeometry"&&(t.side=jl),t},"#convertGeometry"));R(this,ix,l((t,e)=>{let n=new zt,i=new zt;for(let a=0;a<t.count;a++)n.fromBufferAttribute(t,a),p(this,Gy).call(this,n),t.setXYZ(a,n.x,n.y,n.z),e&&(i.fromBufferAttribute(e,a),p(this,Gy).call(this,i),e.setXYZ(a,i.x,i.y,i.z))},"#convertAttributes"));R(this,Gy,l(t=>{let e=t.y;t.y=t.z,t.z=-e},"#convertVector"));R(this,Vy,l((t,e,n,i)=>{let a=t.y;t.y=t.z,t.z=-a;let u=e.y;if(e.y=e.z,e.z=u,n instanceof Ul)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let h=i.y;i.set(i.x,i.z,-h,i.w)}},"#convertObjectProperties"));R(this,ox,l(t=>{for(let e=0;e<t.count;e++){let n=t.getX(e),i=t.getY(e);t.setXY(e,n,i)}},"#convertUVs"));V(this,gl,t),p(this,gl).entityScene=t.entityScene,p(this,gl).geometry3DMap=t.geometry3DMap}destroy(){V(this,Bh,null)}};Bh=new WeakMap,gl=new WeakMap,rx=new WeakMap,Oc=new WeakSet,yO=l(async function(){if(!p(this,Bh)){let{GLTFExporter:t}=await import("./GLTFExporter-W4OR66GG.js");V(this,Bh,new t)}return p(this,Bh)},"#getGLTFExporter"),Fy=new WeakMap,nx=new WeakMap,vO=l(function(t){var u,h;let e=[],i=((u=t.userData)!=null&&u.entities?Object.values((h=t.userData)==null?void 0:h.entities):[]).map(d=>p(this,gl).geometry3DMap.get(d)),a=new Map;return i.forEach(d=>{var I;if(!d||!(d instanceof Sr))return;let m=d.components[1],v=d.components[2];if(!m.visible||m instanceof Ya&&m.opacity===0||m instanceof dg||m instanceof rv)return;let x=v!=null&&v.hover?m.hoverColor||p(this,gl).hoverColor:m.color,S="".concat(x,"-").concat(m.opacity,"-").concat(Number(m.visible));a.has(S)||a.set(S,[]),(I=a.get(S))==null||I.push(d)}),a.forEach((d,m)=>{let[v,x,S]=m.split("-"),I=d.reduce((D,A)=>{if(A.type==="custom-geometry")return D;let L=A.components[0];return"geometry"in L&&L.geometry instanceof B0&&D.push(L.geometry),D},[]),w=p(this,nx).call(this,v,Number(x),t.material.transparent),E=Ms(I,!0),T=new ue(E,w);T.position.copy(t.position),T.rotation.copy(t.rotation),T.scale.copy(t.scale),T.visible=!!S,p(this,Vy).call(this,T.position,T.scale,T.rotation,T.quaternion),e.push(p(this,By).call(this,T))}),e},"#processBatchedMesh"),bO=l(function(t){let e=t.geometry.clone(),n=t.material,i=new On({color:n.color,side:jl});i.opacity=n.opacity,i.transparent=n.transparent;let a=new Vf(e,i);return a.position.copy(t.position),a.rotation.copy(t.rotation),a.scale.copy(t.scale),a.visible=t.visible,p(this,By).call(this,a)},"#processLineSegments"),By=new WeakMap,ix=new WeakMap,Gy=new WeakMap,Vy=new WeakMap,ox=new WeakMap,l(hI,"ExporterSystem");var Ry=hI;y();y();y();var mI=$r(EO());function OO(r){this.name="JSClipperError",this.message=r,this.stack=new Error().stack}l(OO,"JSClipperError");OO.prototype=Error.prototype;mI.default.Error=function(r){throw new OO(r)};var pi=mI.default;var wq="gray",Pq=.1,zy=100,gI=new pi.ClipperOffset;function Eq(r,t){gI.Clear(),t/=2;let e=r.map(i=>({X:i.x*zy,Y:i.y*zy}));gI.AddPath(e,pi.JoinType.jtMiter,pi.EndType.etClosedPolygon);let n=new pi.Paths;return gI.Execute(n,t*zy),n.length?n.map(a=>a.map(u=>({x:u.X/zy,y:u.Y/zy}))):[r]}l(Eq,"offset");function px(r,t,e){var S,I,w,E,T;let{color:n=wq,opacity:i=1,altitude:a=0,height:u=Pq}=e||{};Array.isArray(i)&&(i=1);let h={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:u+a},center:{x:0,y:0,z:(u+a)/2}},m=r.geometry.coordinates[0].map(D=>{let A=t(D[1],D[0]);return h.min.x=Math.min(h.min.x,A.x),h.min.y=Math.min(h.min.y,A.y),h.max.x=Math.max(h.max.x,A.x),h.max.y=Math.max(h.max.y,A.y),A});((I=(S=r.properties)==null?void 0:S.style)==null?void 0:I.edgeOffset)!=null&&r.properties.style.edgeOffset!==0||((w=r.properties)==null?void 0:w.image)!=null?m=Eq(m,((T=(E=r.properties)==null?void 0:E.style)==null?void 0:T.edgeOffset)||0):m=[m];let v=[];for(let D of m){let A=new Va;A.moveTo(D[0].x,D[0].y),D.slice(1).forEach(W=>A.lineTo(W.x,W.y)),A.lineTo(D[0].x,D[0].y);let L=r.geometry.coordinates.slice(1);A.holes=L.map(W=>{let $=W.map(J=>t(J[1],J[0])),F=new sc;return F.moveTo($[0].x,$[0].y),$.slice(1).forEach(J=>F.lineTo(J.x,J.y)),F.lineTo($[0].x,$[0].y),F});let B={bevelEnabled:!1,depth:u},j=new ja(A,B);j.userData={style:{color:n,opacity:i}},v.push(j)}if(v.length===1)return v[0];let x=Ms(v);return x.userData={style:{color:n,opacity:i},_split:!0},x}l(px,"renderPolygonGeometry");y();var Oq="gray",Dq=.1;function hx(r,t,e){let{color:n=Oq,opacity:i=1,altitude:a=0,height:u=Dq}=e||{};Array.isArray(i)&&(i=1);let h={min:{x:1/0,y:1/0,z:a},max:{x:-1/0,y:-1/0,z:u+a}},d={bevelEnabled:!1,depth:u},m=[];r.geometry.coordinates.forEach(x=>{let S=new Va,I=x[0].map(T=>{let D=t(T[1],T[0]);return h.min.x=Math.min(h.min.x,D.x),h.min.y=Math.min(h.min.y,D.y),h.max.x=Math.max(h.max.x,D.x),h.max.y=Math.max(h.max.y,D.y),D});S.moveTo(I[0].x,I[0].y),I.slice(1).forEach(T=>S.lineTo(T.x,T.y)),S.lineTo(I[0].x,I[0].y);let w=x.slice(1);S.holes=w.map(T=>{let D=T.map(L=>t(L[1],L[0])),A=new sc;return A.moveTo(D[0].x,D[0].y),D.slice(1).forEach(L=>A.lineTo(L.x,L.y)),A.lineTo(D[0].x,D[0].y),A});let E=new ja(S,d);m.push(E)});let v=Ms(m);return v.translate(0,0,a||0),v.userData={style:{color:n,opacity:i}},v}l(hx,"renderMultiPolygonGeometry");y();var Lq="gray",yI=new pi.ClipperOffset,wo=100;function DO(r,t,e){let{color:n=Lq,opacity:i=1,width:a=1,join:u="round",cap:h="round",height:d=.01,altitude:m=0}=e||{};Array.isArray(i)&&(i=0);let v=[];for(let E=0;E<r.geometry.coordinates.length-1;E++){let T=t(r.geometry.coordinates[E][1],r.geometry.coordinates[E][0]),D=t(r.geometry.coordinates[E+1][1],r.geometry.coordinates[E+1][0]);v.push([T,D])}yI.AddPaths(v.map(E=>E.map(T=>({X:T.x*wo,Y:T.y*wo}))),u==="round"?pi.JoinType.jsRound:u==="miter"?pi.JoinType.jsMiter:pi.JoinType.jsSquare,h==="round"?pi.EndType.etOpenRound:h==="butt"?pi.EndType.etOpenButt:pi.EndType.etOpenSquare);let x=new pi.PolyTree;yI.Execute(x,a/2*wo);let S=[],I={bevelEnabled:!1,depth:d};for(let E of x.m_AllPolys){let T=new Va;if(E.IsHole())continue;let D=E.m_polygon;T.moveTo(D[0].X/wo,D[0].Y/wo),D.slice(1).forEach(A=>T.lineTo(A.X/wo,A.Y/wo)),T.lineTo(D[0].X/wo,D[0].Y/wo),T.holes=E.m_Childs.map(A=>{let L=new sc,B=A.m_polygon;return L.moveTo(B[0].X/wo,B[0].Y/wo),B.slice(1).forEach(j=>L.lineTo(j.X/wo,j.Y/wo)),L.lineTo(B[0].X/wo,B[0].Y/wo),L}),S.push(new ja(T,I))}let w=Ms(S);return w.translate(0,0,m||0),w.userData={style:{color:n,opacity:i}},yI.Clear(),w}l(DO,"renderLineStringGeometry");y();var Po=100,Aq=.22,Nq=.01;function LO(r,t,e={}){let{width:n=Aq,height:i=Nq,color:a="gray",opacity:u=1,altitude:h=0}=e,d={min:{x:1/0,y:1/0,z:h},max:{x:-1/0,y:-1/0,z:h+i}},m={bevelEnabled:!1,depth:i},v=new pi.ClipperOffset,x=r.geometry.coordinates.map(E=>E.map(T=>t(T[1],T[0])));v.AddPaths(x.map(E=>E.map(T=>({X:T.x*Po,Y:T.y*Po}))),pi.JoinType.jsMiter,pi.EndType.etOpenRound);let S=new pi.PolyTree;v.Execute(S,n/2*Po);let I=[];for(let E of S.m_AllPolys){let T=new Va;if(E.IsHole())continue;d.min.x=Math.min(d.min.x,E.m_polygon[0].X),d.min.y=Math.min(d.min.y,E.m_polygon[0].Y),d.max.x=Math.max(d.max.x,E.m_polygon[0].X),d.max.y=Math.max(d.max.y,E.m_polygon[0].Y);let D=E.m_polygon;T.moveTo(D[0].X/Po,D[0].Y/Po),D.slice(1).forEach(A=>T.lineTo(A.X/Po,A.Y/Po)),T.lineTo(D[0].X/Po,D[0].Y/Po),T.holes=E.m_Childs.map(A=>{let L=new sc,B=A.m_polygon;return L.moveTo(B[0].X/Po,B[0].Y/Po),B.slice(1).forEach(j=>L.lineTo(j.X/Po,j.Y/Po)),L.lineTo(B[0].X/Po,B[0].Y/Po),L}),I.push(new ja(T,m))}let w=Ms(I);return w.translate(0,0,h||0),w.userData={style:{color:a,opacity:u}},v.Clear(),w}l(LO,"renderMultiLineStringGeometry");y();y();var nm=Q.object({type:Q.enum(["Point"]),coordinates:Q.array(Q.number()).min(2).max(3)});var kq=Q.object({rotation:Q.array(Q.number()).length(3).optional(),altitude:Q.number().optional(),scale:Q.array(Q.number()).length(3).optional(),interactive:Q.boolean().optional(),verticalOffset:Q.number().optional(),id:Q.union([Q.number(),Q.string()]).optional()}),Rq=Q.object({type:Q.enum(["Feature"]),geometry:nm,properties:kq}),Fq=Q.object({type:Q.enum(["FeatureCollection"]),features:Q.array(Rq)}),Bq=Q.object({color:Q.string()}),Gq=Q.object({url:Q.string(),color:Q.string().optional(),opacity:Q.number().optional(),material:Q.record(Q.string(),Bq).optional()});function NO(r,t,e){Q.union([Q.number(),Q.string()]).parse(r),Fq.parse(t),Gq.parse(e)}l(NO,"validateModelGroup");var Hy,Xy,vI=class vI{constructor(t){b(this,"mesh");b(this,"type","model");b(this,"positionDirty",!0);b(this,"outline");b(this,"geometry");b(this,"material");b(this,"feature");b(this,"instanceIndex",-1);b(this,"visible",!0);b(this,"color",new rn);b(this,"position",new zt);R(this,Hy,0);R(this,Xy,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return p(this,Hy)}set altitude(t){this.mesh&&(this.mesh.position.z=t,V(this,Hy,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(Ie.degToRad(t[0]),Ie.degToRad(t[1]),Ie.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return p(this,Xy)}set opacity(t){var e,n,i;if(this.mesh){if(this.mesh.children[0]instanceof oc){for(let a of this.mesh.children)if(a instanceof oc){((e=a.userData)==null?void 0:e.originalOpacity)===void 0&&(a.userData.originalOpacity=a.material.opacity);let u=Ha(t,0,(n=a.userData)==null?void 0:n.originalOpacity,0,1);a.material.opacity=u,a.material.transparent=u<1,a.material.needsUpdate=!0}}else(i=this.mesh)==null||i.traverse(a=>{a instanceof ue&&a.material&&(Array.isArray(a.material)?a.material.forEach(u=>{AO(u,t)}):AO(a.material,t))});V(this,Xy,t)}}};Hy=new WeakMap,Xy=new WeakMap,l(vI,"ModelComponent");var Ac=vI;function AO(r,t){r.opacity!==t&&(t===1?(r.opacity=1,r.transparent=!1):(r.opacity=t,r.transparent=!0),r.needsUpdate=!0)}l(AO,"updateMaterialOpacity");y();function fx(r){var h,d;let t=r.components[0],e=r.components[1];e.opacity!=null&&e.opacity!==t.opacity&&(t.opacity=e.opacity);let n=e.material,i=e.color;if(n||i){let m=Vq(i,n);(h=t.mesh)==null||h.traverse(v=>{v instanceof ue&&v.material&&(Array.isArray(v.material)?v.material.forEach(x=>{m[x.name]?x.color.set(m[x.name].color):x.color.set(i)}):m[v.material.name]?v.material.color.set(m[v.material.name].color):v.material.color.set(i))})}let a=(d=t.feature.geometry.coordinates[2])!=null?d:0,u=e.verticalOffset+a;t.altitude!==u&&(t.altitude=u),e.visible!==t.visible&&(t.visible=e.visible),e.rotation&&t.setRotation(e.rotation),e.scale&&t.setScale(e.scale)}l(fx,"applyModelGeometryStyle");function Vq(r,t){let e={};if(r&&Object.assign(e,{Default:{color:r},Fabric:{color:r},Mpdn_Logo:{color:r},CouchLogo:{color:r}}),t)for(let n in t)t[n].color&&(e[n]?e[n].color=t[n].color:e[n]={color:t[n].color});return e}l(Vq,"consolidateColorAndMaterial");function kO(r,t){var u,h;let e=r.components[0],i=(u=r.components[1].verticalOffset)!=null?u:0,a=e.feature.geometry.coordinates.slice();a[2]=((h=a[2])!=null?h:0)+i,e.mesh?e.mesh.position.copy(t(a)):e.position.copy(t(a))}l(kO,"applyModelPosition");function jq(r){let{color:t,opacity:e,topColor:n,texture:i,topTexture:a}=r;return"".concat(t).concat(e).concat(n||"").concat(i||"").concat(a||"")}l(jq,"generateIndex");var bI=class bI extends le{constructor(e,n){super();b(this,"state");b(this,"convertTo3DMapPosition");b(this,"loader");b(this,"optimizePromise",[]);this.state=e,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:e}=await import("./GLTFLoader-CWW4SC4X.js");return this.loader=new e,this.loader}createEntityFromFeature(e,n,i){var h,d;let a=new Bn(n),u=new Sr(a,new Ya(rt(U({},i),{url:(d=(h=n.properties)==null?void 0:h.image)==null?void 0:d.path})));return i!=null&&i.outline&&(u.components[3]=new Kd(Qd(i.color))),i!=null&&i.focusable&&(u.components[4]=new vu),u.id=e,u}createModelFromFeature(e,n,i){let a=new Ac(n),u=U({},i);n.properties.verticalOffset!=null&&(u.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(u.rotation=n.properties.rotation),n.properties.scale!=null&&(u.scale=n.properties.scale);let h=new rv(u),d=new Sr(a,h);return d.id=e,d}populateEntityMesh(e,n){let i=e.components[0];i.geometry=n,i.batchedProps={range:{start:0,count:1/0,indexCount:1/0,indexStart:0,vertexCount:1/0,vertexStart:0,reservedVertexCount:1/0,reservedIndexCount:1/0},geometryId:-1,positionCount:n.attributes.position.count},i.currentHeight=e.components[1].height,i.dirty=!1}async populateModelGroup(e,n,i){let a=new ns,u=new Ul,h=new dp,d=new zt,m=new oa,v=await this.getGLTFLoader(),x=new Promise(S=>{v.load(n,I=>{"entities3D"in i.userData&&(i.userData.entities3D.size>1?I.scene.traverse(w=>{let E=w;if("isMesh"in E&&E.isMesh===!0){let T=new oc(E.geometry,E.material,e.size);T.userData={entities:{}},m.add(T),i.add(m)}}):(I.scene.traverse(w=>{"isMesh"in w&&w.isMesh===!0&&(w.position.set(0,0,0),w.rotation.set(0,0,0),w.scale.set(1,1,1),w.updateMatrix())}),m.add(I.scene),i.add(m),m.userData.isSingleModel=!0,m.userData.entityId=e.values().next().value,m.userData.type="model")),S()})});return this.optimizePromise.push(x.then(()=>{var w,E,T,D,A,L,B,j,W,$,F,J;let S=0,I;for(let ot of e.values()){if(I=this.state.geometry3DMap.get(ot),!I||(I==null?void 0:I.type)!=="model")continue;let K=I.components[0],H=I.components[1],_t=I.components[0].feature;K.mesh=m,K.instanceIndex=S,fx(I),I.components[1].dirty=!1;let{x:ct,y:ft}=this.convertTo3DMapPosition(_t.geometry.coordinates[1],_t.geometry.coordinates[0],0);K.position.set(ct,ft,K.altitude),u.set(Ie.degToRad((E=(w=H.rotation)==null?void 0:w[0])!=null?E:Wf[0]),Ie.degToRad((D=(T=H.rotation)==null?void 0:T[1])!=null?D:Wf[1]),Ie.degToRad((L=(A=H.rotation)==null?void 0:A[2])!=null?L:Wf[2])),d.set((j=(B=H.scale)==null?void 0:B[0])!=null?j:qf[0],($=(W=H.scale)==null?void 0:W[1])!=null?$:qf[1],(J=(F=H.scale)==null?void 0:F[2])!=null?J:qf[2]),h.setFromEuler(u),a.compose(K.position,h,d),m.children.forEach(mt=>{!I||(I==null?void 0:I.type)!=="model"||!(mt instanceof oc)||(mt.setMatrixAt(S,a),mt.userData.entities[S]=I.id)}),K.mesh.userData.isSingleModel&&(K.mesh.matrix.copy(a),K.mesh.matrix.decompose(K.mesh.position,K.mesh.quaternion,K.mesh.scale)),S++}this.publish("model-loaded")})),m}populateEntityGroup(e){var h;let n,i,a,u;for(let d of e.values())u=this.state.geometry3DMap.get(d),u.components[0]instanceof Bn&&(i=u.components[0].feature,a=u.components[1],i.geometry.type==="Polygon"?(n=px(i,this.convertTo3DMapPosition,a),(h=i.properties)!=null&&h.textures&&i.properties.textures.length>0&&K8(n,i.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(u,n)):i.geometry.type==="MultiPolygon"?(n=hx(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(u,n)):i.geometry.type==="LineString"?(n=DO(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(u,n)):i.geometry.type==="MultiLineString"&&(n=LO(i,this.convertTo3DMapPosition,a),this.populateEntityMesh(u,n)));return e}update(){var e;for(let n of this.state.geometryGroupIdsToLoad.values()){let i=this.state.geometry3DMap.get(n);if(i instanceof io&&i.userData.dirty){if(i.userData.modelURL)i.userData.modelURL&&(this.populateModelGroup(i.userData.entities3D,i.userData.modelURL,i),i.userData.dirty=!1);else try{this.populateEntityGroup(i.userData.entities3D)}catch(h){tt.warn(h)}let a,u={};for(let h of i.userData.entities3D.values()){a=this.state.geometry3DMap.get(h);let d=a==null?void 0:a.components[0];if((a==null?void 0:a.type)==="geometry"){let m=a.components[1],v=jq(m);u[v]===void 0&&(u[v]={style:m,entities:[]}),u[v].entities.push(a)}else d&&"mesh"in d&&d.mesh&&((e=d.mesh)==null?void 0:e.parent)!==i&&i.add(d.mesh)}for(let h in u){let d=J8(u[h].entities,u[h].style);i.add(d)}for(let h of i.userData.entities3D.values())if(a=this.state.geometry3DMap.get(h),a!=null&&a.entities2D.size>0)for(let d of a.entities2D.values())d&&(a.attach(d),this.publish("geometry-2d-added"));this.publish("geometry-group-added"),i.userData.dirty=!1}}return Promise.resolve()}};l(bI,"MeshCreationAndOptimizationSystem");var dx=bI;y();var xI=class xI{constructor(t,e){b(this,"state");b(this,"dirty",!0);b(this,"domTree");this.state=t,this.domTree=e}update(){if(this.dirty){let t;for(let e of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(e.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(e.userData.entityId))&&this.domTree.removeChild(e)}else this.domTree.removeChild(e);for(let e of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(e),t){let n=t.components[0];n instanceof fl&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:t.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};l(xI,"DOMVisibilitySystem");var mx=xI;y();var _I=class _I{constructor(t,e){b(this,"state");b(this,"project");this.state=t,this.project=e}update(){let t,e=0,n,i;for(let a of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(a),t){i=t.components[0];let u=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(u instanceof Sr)if(this.state.geometry3DIdsInScene.has(u.id)){n=u.components[1],i=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(e=n.height,t.setAltitude(e));let h=n.visible&&n.opacity>0;i.visible!==h&&(i.visible=h)}else i.visible===!0&&(i.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};l(_I,"TwoDProjectionSystem");var gx=_I;y();y();var Uq=l(function(){let t,e;return n=>{if((!e||!e)&&(t=document.createElement("canvas"),t.width=500*n,t.height=500*n,t.style.width="500px",t.style.height="500px",e=t.getContext("2d")),!e)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:e}}},"createMeasureCanvasContext")(),RO=l(({text:r,size:t,maxWidth:e,pixelRatio:n,maxLines:i=2,lineHeight:a=1.2,options:u={strokeText:!0}})=>{let h="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:d}=Uq(n);d.font=h;let m=[],v=r.split(" "),x=0,S=0,I=0;for(;S<v.length;){let D=v[S];if(x===i&&x>0){m[x-1]+="...";break}if(m[x]==null&&(m[x]=D,S++),v.length===1){m[x]=D;break}if(v[S]==null)break;let{width:A}=d.measureText(m[x]+" "+v[S]);A<=e*n?(m[x]+=" "+v[S],S++):x++}m.forEach(D=>{let{width:A}=d.measureText(D);I=Math.max(A,I)});let w=t*n*a,E=m.length*w;return{maxWidth:I,maxHeight:E,lines:m.length,draw:l((D,A,L)=>{m.length===1?(u.strokeText&&D.strokeText(m[0],A,L),D.fillText(m[0],A,L)):(u.strokeText&&(D.strokeText(m[0],A,L-w/2),D.strokeText(m[1],A,L+w/2)),D.fillText(m[0],A,L-w/2),D.fillText(m[1],A,L+w/2))},"draw")}},"shaveText");y();function FO(r){let t=new Image;return r&&(/<svg[\s\S]*>/i.test(r)?t.src="data:image/svg+xml;base64,".concat(btoa(r)):t.src=r),t}l(FO,"createImage");var CI=class CI extends le{constructor(e,n,i){super();b(this,"dirty",!1);b(this,"state");b(this,"colliderContext");b(this,"colliderCanvas");b(this,"transformRequestFunc");b(this,"transformRequest",l(async e=>this.transformRequestFunc?await this.transformRequestFunc(e):{url:e},"transformRequest"));b(this,"pinCache",{});b(this,"imageCache",{});b(this,"imagePromiseCache",{});b(this,"imageDimensionsCache",{});b(this,"textCache",{});b(this,"update",l(e=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let i,a,u,h,d,m,v;for(let x of this.state.geometry2DIdsInScene)if(v=this.state.geometry2DMap.get(x),v!=null&&(m=v.components[0],m instanceof dl&&!v.disposed)){if(d=m.appearance.marker.iconVisibleAtZoomLevel,m.appearance.marker.icon!=null&&d&&e>=d!==m.iconVisible&&(m.iconVisible=e>=d,m.dirty=!0),(m.dirty||this.dirty)&&m.calculateMarkerSize(),a=m.appearance.marker.foregroundColor,u=m.appearance.marker.backgroundColor,h=Uf(m.markerSize,2),i="".concat(a.active,"-").concat(a.inactive,"-").concat(u.active,"-").concat(u.inactive,"-").concat(h,"-").concat(m.iconVisible),m.labelCacheId=i,(!this.pinCache[i]||this.dirty)&&(this.prepare(m,i,this.colliderContext),m.dirty=!0),(m.appearance.marker.icon&&(!m.imageHash||m.markerDirty)||this.dirty)&&this.cacheImage(m),this.textCache[m.id]==null||m.textDirty||this.dirty){m.dirty=!0,this.textCache[m.id]={};let{textDrawFn:I,width:w,height:E}=this.processText(m.text,m.appearance.text.size,m.appearance.text.maxWidth,m.appearance.text.numLines,m.appearance.text.lineHeight);["left","center","right"].forEach(T=>{this.textCache[m.id][T]=this.textToCanvas(I,m.appearance.text.size,T,w,E,m.appearance.text.foregroundColor,m.appearance.text.backgroundColor)}),m.dimensions={width:Math.ceil(w/n),height:Math.ceil(E/n)}}let S=1;if(m.appearance.marker.iconScale)if(typeof m.appearance.marker.iconScale=="number")S=m.appearance.marker.iconScale;else{let{on:I,input:w,output:E,easing:T}=m.appearance.marker.iconScale;I==="zoom-level"?S=tP(e,w,E,T!=null?T:"linear"):tt.warn("Unsupported interpolation property: ".concat(I))}m.recomputeCurrentStrategy(m.iconVisible?S:1),m.canShow&&m.visible&&(m.enabled||m.visibilityNeedsUpdate!==!1)&&this.draw(m,i,this.colliderContext),m.textDirty=!1,m.markerDirty=!1}this.dirty=!1},"update"));b(this,"processText",l((e,n,i,a,u)=>{let h=this.state.pixelRatio,{draw:d,maxWidth:m,maxHeight:v}=RO({text:e,size:n,pixelRatio:h,maxWidth:i,maxLines:a,lineHeight:u});return{textDrawFn:d,width:m+2.5*h*2,height:v+2.5*h*2}},"processText"));b(this,"textToCanvas",l((e,n,i,a,u,h,d)=>{let m=this.state.pixelRatio,v,x=a,S=u;window.OffscreenCanvas!=null&&!cP()?v=new OffscreenCanvas(x,S):(v=document.createElement("canvas"),v.width=x,v.height=S,v.style.width=x+"px",v.style.height=S+"px");let I=v.getContext("2d",{willReadFrequently:!0});if(!I)return;I.textAlign=i,I.font="bold ".concat(n*m,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),I.textBaseline="middle",I.lineJoin="miter",I.miterLimit=2,I.strokeStyle="white",I.lineWidth=2.5*m,I.fillStyle=h,I.strokeStyle=d;let w=i==="left"?0:i==="center"?x/2:x-2.5*m/2;return e(I,w,(S+2.5*m/2)/2),v},"textToCanvas"));b(this,"cacheImage",l(e=>{if(!e.appearance.marker.icon)return;let n=yP(e.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(i=>{this.transformRequest(e.appearance.marker.icon).then(a=>{let u=FO(a.url);u.onload=()=>{this.imageCache[n]=u,this.publish("img:loaded"),i(u)}})})),e.imageHash!==n&&(e.imageHash=n,this.imagePromiseCache[n].then(()=>{e.dirty=!0}))},"cacheImage"));b(this,"createPinCanvas",l((e,n,i,a,u=1)=>{let h,d=this.state.pixelRatio,m=e.totalMarkerSize*2*d*u;window.OffscreenCanvas!=null?h=new OffscreenCanvas(m,m):(h=document.createElement("canvas"),h.width=m,h.height=m,h.style.width=m/d+"px",h.style.height=m/d+"px");let v=h.getContext("2d");return v.shadowColor="rgba(0,0,0,0.3)",v.shadowOffsetY=2*d,v.shadowBlur=5*d,v.beginPath(),v.arc(m/2,m/2,(n/2+2.5*d/2)*u,0,2*Math.PI),v.fillStyle=i,v.fill(),v.beginPath(),v.arc(m/2,m/2,n/2*u,0,2*Math.PI),v.shadowColor="transparent",v.fillStyle=a,v.fill(),h},"createPinCanvas"));b(this,"prepare",l((e,n,i)=>{let a=this.state.pixelRatio;i.lineWidth=4*a;let u=typeof e.appearance.marker.iconScale=="number"?[e.appearance.marker.iconScale]:e.appearance.marker.iconScale==null?[]:e.appearance.marker.iconScale.output,h=u.length>0?Math.max(...u):void 0,d=this.createPinCanvas(e,e.markerSize,e.appearance.marker.backgroundColor.active,e.appearance.marker.foregroundColor.active,h),m=this.createPinCanvas(e,e.iconVisible?e.markerSize:3.5*a,e.appearance.marker.backgroundColor.inactive,e.appearance.marker.foregroundColor.inactive,h);this.pinCache[n]=[d,m]},"prepare"));this.state=e,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=i}draw(e,n,i){var m,v;if(!e.canShow||!e.visible)return;i.save(),i.globalAlpha=e.opacity;let a=this.state.pixelRatio,u=e.projection.x*a,h=e.projection.y*a,d=e.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(i.drawImage(d,u-e.scaledMarkerSize*a,h-e.scaledMarkerSize*a,e.scaledMarkerSize*2*a,e.scaledMarkerSize*2*a),e.appearance.marker.icon&&e.iconVisible&&e.imageHash&&e.appearance.marker.iconSize&&this.imageCache[e.imageHash]){let x=this.imageCache[e.imageHash],S=(e.scaledMarkerSize-e.scaledIconPadding)*a,I=e.appearance.marker.iconFit,w=S,E=S,T="".concat(e.imageHash,"_").concat(I);if(this.imageDimensionsCache[T])w=this.imageDimensionsCache[T].width,E=this.imageDimensionsCache[T].height;else{let D=x.width*a,A=x.height*a;if(I==="contain"){let L=Math.sqrt(D**2+A**2),B=S/L;w=D*B,E=A*B}if(I==="cover"){let L=S/D,B=S/A,j=Math.max(L,B);w=D*j,E=A*j}}i.save(),i.beginPath(),i.arc(u,h,S/2,0,2*Math.PI),i.closePath(),((v=(m=e==null?void 0:e.appearance)==null?void 0:m.marker)==null?void 0:v.iconOverflow)!=="visible"&&i.clip(),i.drawImage(x,u-w/2,h-E/2,w,E),i.restore()}e.style.textLabelVisible&&e.style.textAlign!=null&&e.style.left!=null&&e.style.top!=null&&i.drawImage(this.textCache[e.id][e.style.textAlign],u+e.style.left*a,h+e.style.top*a),i.restore()}};l(CI,"TwoDDrawSystem");var yx=CI;y();y();var Nc=class Nc{constructor(){b(this,"loader");this.loader=new jf}static getInstance(){return Nc.instance||(Nc.instance=new Nc),Nc.instance}getLoader(){return this.loader}load(t){return new Promise((e,n)=>{this.loader.load(t,e,void 0,n)})}};l(Nc,"TextureLoaderSingleton"),b(Nc,"instance");var SI=Nc,kc=SI.getInstance();function Yq(r,t){let e=r.components[2],n=r.components[1];return e!=null&&e.hover?[n.hoverColor||t,n.hoverColor||t]:[n.color,n.topColor||n.color]}l(Yq,"processColor");var Uh,qy,II=class II extends le{constructor(e,n){super();R(this,Uh);b(this,"state");b(this,"convertTo3DMapPosition");b(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=e}setShading(e,n){e.material&&e.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(e,n,i){var a;if(n.texture!==e.texture&&n.texture!==""&&yt(this,Uh,qy).call(this,n.texture,e,"texture"),n.topTexture!==e.topTexture&&n.topTexture!==""&&yt(this,Uh,qy).call(this,n.topTexture,e,"topTexture"),(e.texture==null||e.topTexture==null)&&Array.isArray((a=e.feature.properties)==null?void 0:a.textures)&&e.feature.properties.textures.length>0)for(let u of e.feature.properties.textures)u.face==="top"&&e.topTexture!==u.path?yt(this,Uh,qy).call(this,u.path,e,"topTexture"):u.face==="side"&&e.texture!==u.path&&yt(this,Uh,qy).call(this,u.path,e,"texture"),e.blendTexture=!0;(e.texture!=null||e.topTexture!=null)&&(i!=null&&i.hover&&e.texturesVisible?e.hideTextures():e.texturesVisible||e.showTextures(),n.texture===""&&e.removeSideTexture(),n.topTexture===""&&e.removeTopTexture())}update(){var a,u,h,d,m,v,x,S;let e,n,i;for(let I of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(I),i instanceof io&&i.type==="geometry-group"){let w=i.components[0];if(i.userData.shadingDirty){let E=i.userData.entities3D.values().next().value;if(E==null)continue;let T=this.state.geometry3DMap.get(E);T instanceof Sr&&(T.type==="geometry"||T.type==="custom-geometry")&&(e=T.components[0],i.userData.shadingDirty&&w.shading&&this.setShading(e,w.shading));let D,A;for(let L of i.userData.entities3D.values())D=this.state.geometry3DMap.get(L),A=D.components[0],D.type==="geometry"&&A.detached&&i.userData.shadingDirty&&w.shading&&this.setShading(A,w.shading);i.userData.shadingDirty=!1}if(w.dirty){let E=i.getfirstChildEntityId();if(E){let D=this.state.geometry3DMap.get(E),A=D==null?void 0:D.components[0];A instanceof Bn&&this.processTextures(A,w)}let T=w.opacity*yp(i);i.getOpacity()!==T&&i.setOpacity(T),w.dirty=!1}}else if(i&&(i.type==="geometry"||i.type==="custom-geometry")&&((a=i.components[1])!=null&&a.dirty||(u=i.components[2])!=null&&u.dirty)){let w=i.components[0],E=i.components[1];n=i.components[2];let T=Yq(i,this.state.hoverColor);if(w.setColor(T[0],T[1]),E.visible!==w.visible&&(w.visible=E.visible,w instanceof Bn&&w.textMesh)){let A=this.state.geometry3DMap.get(w.textMesh.userData.entityId);(A==null?void 0:A.type)==="text3d"&&A.components[0].polygonEntityId!=null&&(A.components[0].visible=E.visible)}E.altitude!==w.altitude&&(w.altitude=E.altitude);let D=E.opacity*yp(i);D!==w.opacity&&(w.opacity=D),E.renderOrder!==w.renderOrder&&(w.renderOrder=E.renderOrder),E.dirty=!1,w instanceof Bn&&this.processTextures(w,E,n),i.components[2]&&(i.components[2].dirty=!1)}else if((i==null?void 0:i.type)==="model")i.components[1].dirty&&(fx(i),i.components[1].dirty=!1),i.components[0].positionDirty&&(kO(i,this.convertTo3DMapPosition),i.components[0].positionDirty=!1);else if((i==null?void 0:i.type)==="image"&&((h=i.components[1])!=null&&h.dirty)){e=i.components[0];let w=i.components[1];w.visible!==e.visible&&(e.visible=w.visible),w.dirty=!1}else if((i==null?void 0:i.type)==="text3d"&&((d=i.components[1])!=null&&d.dirty)&&i.components[0].polygonEntityId!=null){e=i.components[0];let w=i.components[1];w.visible!=null&&w.visible!==e.visible&&(e.visible=w.visible);let{textMesh:E}=e;if(E){Object.assign(E,w.getState());let T=(m=w.hoverColor)!=null?m:this.state.text3dHoverColor;E.color=w.hoverByPolygon?T:(v=w.color)!=null?v:Yf.color,E.outlineColor=w.hoverByPolygon?T:(x=w.outlineColor)!=null?x:Yf.outlineColor,E.strokeColor=w.hoverByPolygon?T:(S=w.strokeColor)!=null?S:Yf.strokeColor}w.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async e=>{(await e).dispose()}),this.textureLoadingCache.clear()}};Uh=new WeakSet,qy=l(async function(e,n,i){if(!(!e||!n.showTextures))if(this.textureLoadingCache.has(e)){i==="topTexture"?n.topTexture=await this.textureLoadingCache.get(e):n.texture=await this.textureLoadingCache.get(e),n.showTextures();return}else{let a=new Promise((u,h)=>{kc.getLoader().load(e,d=>{i==="topTexture"?n.topTexture=d:n.texture=d,n.showTextures(),this.publish("texture-loaded"),u(d)},void 0,()=>{tt.error("Failed to load texture: ".concat(e)),h("Failed to load texture: ".concat(e))})});this.textureLoadingCache.set(e,a)}},"#loadTexture"),l(II,"DrawSystem");var vx=II;y();var MI=class MI extends le{constructor(e){super();b(this,"state");b(this,"animating",new Map);b(this,"isAnimating",!1);b(this,"startTime",-1);b(this,"showDuration",300);b(this,"hideDuration",250);b(this,"update",l(()=>{this.animating.clear();let e,n;for(let i of this.state.geometry2DIdsInScene)e=this.state.geometry2DMap.get(i),e&&(n=e.components[0],n instanceof dl&&(n.visibilityNeedsUpdate==="show"?(n.canShow=!0,this.animating.set(n,[n.opacity,1])):n.visibilityNeedsUpdate==="hide"&&this.animating.set(n,[n.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));b(this,"playAnimations");this.state=e,this.playAnimations=this._playAnimations}_playAnimations(){let e=performance.now();for(let[n,[i,a]]of this.animating.entries()){let u=a===1?this.showDuration:this.hideDuration,h=(e-this.startTime)/u;n.opacity=Ha(h,0,1,i,a,a===0?Kw:Qw),e-this.startTime>=u&&(a===1?n.canShow=!0:a===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};l(MI,"TwoDVisibilitySystem");var bx=MI;y();var TI=class TI extends le{constructor(e,n,i,a,u,h,d){super();b(this,"state");b(this,"renderer");b(this,"mode");b(this,"scene");b(this,"cameraObject");b(this,"viewCamera");b(this,"systems");b(this,"needs2DRecompute",!1);b(this,"twoDdirty",!0);b(this,"threeDdirty",!0);b(this,"frameId",null);b(this,"twoDFrameId",null);b(this,"animationFrameId",null);b(this,"nextFrame",null);b(this,"update",l((e=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(e){let i=this.commitRenderState();return this.paint(),i}else return this.frameId?Promise.resolve():new Promise((i,a)=>{this.frameId=requestAnimationFrame(()=>{var u,h;return((u=this.renderer)==null?void 0:u.renderer)==null?i():this.mode==="standalone"?(h=this.commitRenderState())==null?void 0:h.then(()=>{this.paint(),i()}).catch(d=>{a(d)}):i()})})},"update"));b(this,"animate2D",l(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));b(this,"drawEntities2D",l(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));b(this,"updateEntities2D",l(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));b(this,"commitRenderState",l(()=>{try{let e=[];this.frameId=null,this.publish("pre-render"),this.state.internalTweenGroup.update(),this.state.externalTweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),dP(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),this.state.geometryGroupIdsToLoad.clear(),fP(this.state.entityScene,this.state.geometry3DIdsInScene,this.state.geometryGroupIdsToLoad),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let n=this.systems.meshOptimizationSystem.update();n&&e.push(n),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),e.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getRotation()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let i=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!i)}),this.systems.drawSystem.update(),this.systems.geometryDisposalSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.systems.cameraSystem.stateDirty&&(this.publish("camera-state-change"),this.systems.cameraSystem.stateDirty=!1),this.publish("post-render"),Promise.all(e)}catch(e){return Promise.reject(e)}},"commitRenderState"));this.renderer=e,this.state=n,this.mode=i,this.scene=a,this.cameraObject=u,this.viewCamera=h,this.systems=d,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var e;(e=this.renderer)!=null&&e.renderer&&(this.mode==="standalone"&&this.renderer.clear(),this.renderer.render(this.scene,this.state.useStandaloneCamera||this.mode==="standalone"?this.cameraObject:this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};l(TI,"RenderSystem");var xx=TI;y();var qq=Q.object({interactive:Q.boolean().optional(),id:Q.string().optional(),nearRadius:Q.number().optional(),farRadius:Q.number().optional(),accentColor:Q.string().optional(),displayArrowsOnPath:Q.boolean().optional(),animateArrowsOnPath:Q.boolean().optional(),nearZoomLevel:Q.number().optional(),farZoomLevel:Q.number().optional(),visibleThroughGeometry:Q.boolean().optional(),dashed:Q.boolean().optional()}),Wq=Q.object({type:Q.enum(["Feature"]),geometry:nm,properties:Q.object({parentId:Q.any().optional()})});function BO(r,t){Q.object({features:Q.array(Wq)}).parse(r),qq.parse(t)}l(BO,"validatePath");var Wy,wI=class wI{constructor(t,e){b(this,"type","path");b(this,"mesh",new oa);b(this,"material");b(this,"geometry");b(this,"outline");b(this,"feature");b(this,"options");b(this,"nearRadius",.2);b(this,"farRadius",.4);b(this,"nearZoomLevel");b(this,"farZoomLevel");b(this,"nearZoomAltitude");b(this,"farZoomAltitude");b(this,"accentColor","blue");b(this,"completeFraction",1);b(this,"altitudeAdjustment",1);b(this,"displayArrowsOnPath",!1);b(this,"animateArrowsOnPath",!1);b(this,"visibleThroughGeometry",!1);b(this,"dashed",!1);b(this,"isVertical",!1);b(this,"dirty",!0);b(this,"materialDirty",!0);b(this,"position",new zt);R(this,Wy,0);var n,i,a,u,h,d,m;this.feature=t,this.options=e||{},this.accentColor=(n=e==null?void 0:e.accentColor)!=null?n:this.accentColor,this.nearRadius=(i=e==null?void 0:e.nearRadius)!=null?i:this.nearRadius,this.farRadius=(a=e==null?void 0:e.farRadius)!=null?a:this.farRadius,this.nearZoomLevel=e==null?void 0:e.nearZoomLevel,this.farZoomLevel=e==null?void 0:e.farZoomLevel,this.displayArrowsOnPath=(u=e==null?void 0:e.displayArrowsOnPath)!=null?u:this.displayArrowsOnPath,this.animateArrowsOnPath=(h=e==null?void 0:e.animateArrowsOnPath)!=null?h:this.animateArrowsOnPath,this.visibleThroughGeometry=(d=e==null?void 0:e.visibleThroughGeometry)!=null?d:this.visibleThroughGeometry,this.dashed=(m=e==null?void 0:e.dashed)!=null?m:this.dashed}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return p(this,Wy)}set altitude(t){this.mesh&&(this.mesh.position.z=t,V(this,Wy,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};Wy=new WeakMap,l(wI,"PathComponent");var Rc=wI;y();var PI=class PI{constructor(t){b(this,"rendererState");this.rendererState=t}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(e),t instanceof Er&&t.components[0]){let n=t.components[0];if(n.dirty){for(let i of t.children)(i instanceof io||i instanceof Er)&&(i.userData.entityId!==t.components[0].activeId?i.setVisible(!1):i.setVisible(!0));n.dirty=!1}}}};l(PI,"StackSystem");var _x=PI;y();y();y();var Vn=Object.freeze({Linear:Object.freeze({None:l(function(r){return r},"None"),In:l(function(r){return r},"In"),Out:l(function(r){return r},"Out"),InOut:l(function(r){return r},"InOut")}),Quadratic:Object.freeze({In:l(function(r){return r*r},"In"),Out:l(function(r){return r*(2-r)},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},"InOut")}),Cubic:Object.freeze({In:l(function(r){return r*r*r},"In"),Out:l(function(r){return--r*r*r+1},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},"InOut")}),Quartic:Object.freeze({In:l(function(r){return r*r*r*r},"In"),Out:l(function(r){return 1- --r*r*r*r},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},"InOut")}),Quintic:Object.freeze({In:l(function(r){return r*r*r*r*r},"In"),Out:l(function(r){return--r*r*r*r*r+1},"Out"),InOut:l(function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},"InOut")}),Sinusoidal:Object.freeze({In:l(function(r){return 1-Math.sin((1-r)*Math.PI/2)},"In"),Out:l(function(r){return Math.sin(r*Math.PI/2)},"Out"),InOut:l(function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))},"InOut")}),Exponential:Object.freeze({In:l(function(r){return r===0?0:Math.pow(1024,r-1)},"In"),Out:l(function(r){return r===1?1:1-Math.pow(2,-10*r)},"Out"),InOut:l(function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},"InOut")}),Circular:Object.freeze({In:l(function(r){return 1-Math.sqrt(1-r*r)},"In"),Out:l(function(r){return Math.sqrt(1- --r*r)},"Out"),InOut:l(function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},"InOut")}),Elastic:Object.freeze({In:l(function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},"In"),Out:l(function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},"Out"),InOut:l(function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:l(function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},"In"),Out:l(function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},"Out"),InOut:l(function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},"InOut")}),Bounce:Object.freeze({In:l(function(r){return 1-Vn.Bounce.Out(1-r)},"In"),Out:l(function(r){return r<.36363636363636365?7.5625*r*r:r<.7272727272727273?7.5625*(r-=.5454545454545454)*r+.75:r<.9090909090909091?7.5625*(r-=.8181818181818182)*r+.9375:7.5625*(r-=.9545454545454546)*r+.984375},"Out"),InOut:l(function(r){return r<.5?Vn.Bounce.In(r*2)*.5:Vn.Bounce.Out(r*2-1)*.5+.5},"InOut")}),generatePow:l(function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:l(function(t){return Math.pow(t,r)},"In"),Out:l(function(t){return 1-Math.pow(1-t,r)},"Out"),InOut:l(function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5},"InOut")}},"generatePow")}),Zy=l(function(){return performance.now()},"now"),Cx=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return l(r,"Group"),r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var i=0,a=e;i<a.length;i++){var u=a[i];(t=u._group)===null||t===void 0||t.remove(u),u._group=this,this._tweens[u.getId()]=u,this._tweensAddedDuringUpdate[u.getId()]=u}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,i=t;n<i.length;n++){var a=i[n];a._group=void 0,delete this._tweens[a.getId()],delete this._tweensAddedDuringUpdate[a.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=Zy()),e===void 0&&(e=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var a=this._tweens[n[i]],u=!e;a&&a.update(t,u)===!1&&!e&&this.remove(a)}n=Object.keys(this._tweensAddedDuringUpdate)}},r}(),im={Linear:l(function(r,t){var e=r.length-1,n=e*t,i=Math.floor(n),a=im.Utils.Linear;return t<0?a(r[0],r[1],n):t>1?a(r[e],r[e-1],e-n):a(r[i],r[i+1>e?e:i+1],n-i)},"Linear"),Bezier:l(function(r,t){for(var e=0,n=r.length-1,i=Math.pow,a=im.Utils.Bernstein,u=0;u<=n;u++)e+=i(1-t,n-u)*i(t,u)*r[u]*a(n,u);return e},"Bezier"),CatmullRom:l(function(r,t){var e=r.length-1,n=e*t,i=Math.floor(n),a=im.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(i=Math.floor(n=e*(1+t))),a(r[(i-1+e)%e],r[i],r[(i+1)%e],r[(i+2)%e],n-i)):t<0?r[0]-(a(r[0],r[0],r[1],r[1],-n)-r[0]):t>1?r[e]-(a(r[e],r[e],r[e-1],r[e-1],n-e)-r[e]):a(r[i?i-1:0],r[i],r[e<i+1?e:i+1],r[e<i+2?e:i+2],n-i)},"CatmullRom"),Utils:{Linear:l(function(r,t,e){return(t-r)*e+r},"Linear"),Bernstein:l(function(r,t){var e=im.Utils.Factorial;return e(r)/e(t)/e(r-t)},"Bernstein"),Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var n=t;n>1;n--)e*=n;return r[t]=e,e}}(),CatmullRom:l(function(r,t,e,n,i){var a=(e-r)*.5,u=(n-t)*.5,h=i*i,d=i*h;return(2*t-2*e+a+u)*d+(-3*t+3*e-2*a-u)*h+a*i+t},"CatmullRom")}},GO=function(){function r(){}return l(r,"Sequence"),r.nextId=function(){return r._nextId++},r._nextId=0,r}(),EI=new Cx,Ho=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Vn.Linear.None,this._interpolationFunction=im.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=GO.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=EI,EI.add(this))}return l(r,"Tween"),r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=Zy()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var a in this._valuesEnd)i[a]=this._valuesEnd[a];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,n,i,a){for(var u in n){var h=t[u],d=Array.isArray(h),m=d?"array":typeof h,v=!d&&Array.isArray(n[u]);if(!(m==="undefined"||m==="function")){if(v){var x=n[u];if(x.length===0)continue;for(var S=[h],I=0,w=x.length;I<w;I+=1){var E=this._handleRelativeValue(h,x[I]);if(isNaN(E)){v=!1,console.warn("Found invalid interpolation list. Skipping.");break}S.push(E)}v&&(n[u]=S)}if((m==="object"||d)&&h&&!v){e[u]=d?[]:{};var T=h;for(var D in T)e[u][D]=T[D];i[u]=d?[]:{};var x=n[u];if(!this._isDynamic){var A={};for(var D in x)A[D]=x[D];n[u]=x=A}this._setupProperties(T,e[u],x,i[u],a)}else(typeof e[u]>"u"||a)&&(e[u]=h),d||(e[u]*=1),v?i[u]=n[u].slice().reverse():i[u]=e[u]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=Zy()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=Zy()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=Vn.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=im.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var n=this,i;if(t===void 0&&(t=Zy()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var u=t-this._startTime,h=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),d=this._duration+this._repeat*h,m=l(function(){if(n._duration===0||u>d)return 1;var E=Math.trunc(u/h),T=u-E*h,D=Math.min(T/n._duration,1);return D===0&&u===n._duration?1:D},"calculateElapsedPortion"),v=m(),x=this._easingFunction(v);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,x),this._onUpdateCallback&&this._onUpdateCallback(this._object,v),this._duration===0||u>=this._duration)if(this._repeat>0){var S=Math.min(Math.trunc((u-this._duration)/h)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=S);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=h*S,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var I=0,w=this._chainedTweens.length;I<w;I++)this._chainedTweens[I].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,n,i){for(var a in n)if(e[a]!==void 0){var u=e[a]||0,h=n[a],d=Array.isArray(t[a]),m=Array.isArray(h),v=!d&&m;v?t[a]=this._interpolationFunction(h,i):typeof h=="object"&&h?this._updateProperties(t[a],u,h,i):(h=this._handleRelativeValue(u,h),typeof h=="number"&&(t[a]=u+(h-u)*i))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}();var UOt=GO.nextId,yl=EI,zOt=yl.getAll.bind(yl),HOt=yl.removeAll.bind(yl),XOt=yl.add.bind(yl),YOt=yl.remove.bind(yl),qOt=yl.update.bind(yl);y();y();y();var VO=l((r,t)=>(t-r+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),jO=l((r,t)=>new ne(r.clientX-t.offsetLeft,r.clientY-t.offsetTop),"getTouchPos"),OI=l((r,t)=>Math.atan2(t.y-r.y,t.x-r.x),"angle"),$y=l((r,t)=>Math.sqrt((t.y-r.y)**2+(t.x-r.x)**2),"distance"),DI=l((r,t)=>new ne((r.x+t.x)/2,(r.y+t.y)/2),"average"),LI=l(r=>{let t=0,{wheelDelta:e,detail:n}=r;return e!==void 0?t=e:n!==void 0&&(t=-n),t},"getScrollDelta");var AI=class AI{constructor(t,e){b(this,"input1");b(this,"input2");b(this,"lastAngle");b(this,"lastDistance");b(this,"totalDistance");b(this,"first");b(this,"second");this.input1=t,this.input2=e,this.lastAngle=OI(t,e),this.lastDistance=$y(t,e),this.totalDistance=0,this.first=t,this.second=e}update(t,e){let n=$y(t,e);this.input1=t,this.input2=e;let i=OI(t,e);this.lastAngle=i,this.lastDistance=n,this.totalDistance+=($y(this.first,t)+$y(this.second,e))/2,this.first=DI(this.first,t),this.second=DI(this.second,e)}};l(AI,"InputSet");var Sx=AI;y();var NI=class NI{constructor(t,e,n){b(this,"touch");b(this,"camera");b(this,"cameraPlane");b(this,"viewCoordinate");b(this,"snapHolderMatrix");b(this,"snapCamera");b(this,"cameraPosition");b(this,"raycaster");b(this,"worldCoordinate");b(this,"snapshotted",!1);this.touch=t,this.camera=e,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new ne(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Ua,this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=e&&e.length>0?e[0].point:null,this.snapshotted=!0}updateAnchorState(t,e){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(e),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var n,i;let t=new ne(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(t,this.snapCamera);let e=(i=this.raycaster)==null?void 0:i.intersectObject(this.cameraPlane,!0)[0];return e?e.point:void 0}};l(NI,"TouchAnchor");var Jy=NI;var Fs={};K2(Fs,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>$q,CLIPPING_RADIUS:()=>Ky,CONTROL_OPTIONS:()=>Zq,DEFAULT_ANIMATION_DURATION:()=>GI,DEFAULT_BEARING:()=>eW,DEFAULT_MAX_ZOOM_LEVEL:()=>Qq,DEFAULT_MIN_ZOOM_LEVEL:()=>VI,DEFAULT_PITCH:()=>tW,DEFAULT_ZOOM_LEVEL:()=>Kq,EVENTS:()=>wx,MAPLIBRE_TILE_SIZE:()=>Ix,MAX_LAT:()=>RI,MAX_MERCATOR_ZOOM_LEVEL:()=>Tx,MIN_LAT:()=>kI,MIN_MERCATOR_ZOOM_LEVEL:()=>Mx,ROOM_MERCATOR_ZOOM_LEVEL:()=>Jq,TWO_PI:()=>FI,WHEEL_ZOOM_MULTIPLIER:()=>BI,ZRANGE:()=>om});y();var Ix=512,kI=-85.051129,RI=85.051129,Ky=1e4,Zq={chain:"chain",cancel:"cancel"},FI=Math.PI*2,om=100,BI=1e4,Mx=0,Tx=24,$q=17,Jq=20,GI=200,wx=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],Kq=18,VI=12,Qq=22,tW=0,eW=0;y();function UO(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}l(UO,"scrubMaterial");function Jr(r){for(let t=r.children.length-1;t>=0;t--)Jr(r.children[t]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(t){UO(t)}):"material"in r&&typeof r.material<"u"&&UO(r.material)}l(Jr,"destroyObject3D");var Px=!1,rW=!1;var Ex,Ox=class Ox extends le{constructor(e,n,i,a,u){super();b(this,"dirty",!1);b(this,"zoomDirty",!1);b(this,"rotationDirty",!1);b(this,"panDirty",!1);b(this,"stateDirty",!1);R(this,Ex,VI);b(this,"zoomSpeed",5);b(this,"rotateSpeed",100);b(this,"enabled",!0);b(this,"enableZoom",!0);b(this,"enablePan",!0);b(this,"enablePedestal",!1);b(this,"maxPedestal",1/0);b(this,"minPedestal",0);b(this,"enableRotate",!0);b(this,"minZoomAltitude",0);b(this,"maxZoomAltitude",1/0);b(this,"ignoreZoomLimits",!1);b(this,"zoomFactor",1);b(this,"panBounds",{min:new zt(1/0,1/0),max:new zt(-1/0,-1/0),center:new zt(0,0,0),radius:1/0});b(this,"minTilt",0);b(this,"maxTilt",1.2);b(this,"MOUSE_BUTTONS",{ORBIT:L0.RIGHT,ZOOM:L0.MIDDLE,PAN:L0.LEFT});b(this,"camera");b(this,"scene");b(this,"renderer");b(this,"elevation");b(this,"orbit");b(this,"cameraPlane");b(this,"raycaster",new Ua);b(this,"rendererState");b(this,"options");b(this,"state",-1);b(this,"intersection");b(this,"viewState",null);b(this,"tweens",new Map);b(this,"clock",new Xw(!0));b(this,"coords",{mouse:new ne,rotateStart:new ne,rotateEnd:new ne,rotateDelta:new ne,panStart:new zt,panCameraStart:new zt,panEnd:new zt,panDelta:new zt,initialShiftPos:new ne,initialPedestal:0,floorAnchor:new zt});b(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});b(this,"scrollTimer",null);b(this,"lastWheelTime",0);b(this,"resetZoom",!1);b(this,"zoomStart");b(this,"pedestalScaleFactor",1);b(this,"isUserZooming",!1);b(this,"stayInsideBounds",!0);b(this,"userInteracting",!1);b(this,"cameraMoving",!1);b(this,"lastCameraMoveTime",Date.now());b(this,"raycastToFloor",l(e=>{this.raycaster.setFromCamera(e,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new zt},"raycastToFloor"));b(this,"isUserInteracting",l(()=>this.userInteracting,"isUserInteracting"));b(this,"getPosition",l(()=>new zt(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));b(this,"getPedestal",l(()=>this.orbit.position.z,"getPedestal"));b(this,"pan",l((e,n)=>{isNaN(e)||isNaN(n)||(this.setPosition(this.orbit.position.x+e,this.orbit.position.y+n),this.publish("position-updated"))},"pan"));b(this,"postRender",l(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));b(this,"isCameraMoving",l(()=>this.cameraMoving,"isCameraMoving"));b(this,"lastCameraStoppedMovingTime",l(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));b(this,"setPosition",l((e,n)=>{e===void 0||n===void 0||isNaN(e)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(e,n),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0,this.stateDirty=!0)},"setPosition"));b(this,"updateCameraPosition",l((e,n)=>{let i=e-this.panBounds.center.x,a=n-this.panBounds.center.y,u=Math.sqrt(i*i+a*a);if(this.stayInsideBounds&&u>this.panBounds.radius){let h=Math.atan2(a,i),d={x:Math.cos(h)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(h)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=d.x,this.orbit.position.y=d.y}else this.orbit.position.x=e,this.orbit.position.y=n},"updateCameraPosition"));b(this,"tilt",l(e=>{if(isNaN(e))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(e+this.getTilt(),this.maxTilt),this.minTilt):e+this.getTilt();n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end"),this.stateDirty=!0},"tilt"));b(this,"zoomIn",l((e,n,i)=>{let a=this.getZoomAltitude();this.animateCamera({zoom:a/1.5},e,n,i)},"zoomIn"));b(this,"zoomOut",l((e,n,i)=>{let a=this.getZoomAltitude();this.animateCamera({zoom:a*1.5},e,n,i)},"zoomOut"));b(this,"getRotation",l(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));b(this,"cancelAnimation",l(()=>{let e=Array.from(this.tweens.keys()),n=e[e.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)},"cancelAnimation"));b(this,"animateCamera",l((e,n,i,a,u,h)=>{let d=U({interruptible:!0},h),m={},v={},x=this.getPosition();if(e.position!=null&&(e.position.x!==void 0&&(m.x=x.x,v.x=e.position.x),e.position.y!==void 0&&(m.y=x.y,v.y=e.position.y),e.position.z!==void 0&&(m.z=x.z,v.z=e.position.z)),e.zoom!==void 0&&(m.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?v.zoom=e.zoom:v.zoom=Math.min(Math.max(e.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),e.rotation!==void 0){let{start:L,end:B}=X0(this.getRotation(),e.rotation);m.rotation=L,v.rotation=B}e.tilt!==void 0&&(m.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?v.tilt=e.tilt:v.tilt=Math.max(Math.min(e.tilt,this.maxTilt),this.minTilt));let S=m.zoom!==v.zoom,I=m.rotation!==v.rotation,w=m.tilt!==v.tilt,E=new Ho(m).to(v,P.env.TESTING?0:n).onUpdate(L=>{this.setMulti({x:L.x,y:L.y,z:L.z},L.zoom,L.rotation,L.tilt)}).onComplete(()=>{this.completeTween(E),this.publish("multi-end",{zooming:S,rotating:I,tilting:w}),a&&a()}).onStart(()=>{this.state!==7&&(this.state=7,E.state=7,this.publish("multi-start",{zooming:S,rotating:I,tilting:w})),this.publish("change")});this.rendererState.internalTweenGroup.add(E);let T=Array.from(this.tweens.entries()),D=T[T.length-1],A=!1;return D!=null&&(D[1].interruptible?(typeof D[1].cancelledCallback=="function"&&D[1].cancelledCallback(),this.completeTween(D[0])):(A=!0,D[0].chain(E))),this.tweens.set(E,{cancelledCallback:u,interruptible:d.interruptible}),i?E.easing(i):E.easing(Vn.Quadratic.In),!e.doNotAutoStart&&!A&&(E.start(),this.publish("change")),E.cameraAnimation=!0,E},"animateCamera"));b(this,"setMulti",l((e,n,i,a,u=!0)=>{this.state===-1&&this.publish("multi-start");let h=!1;e!=null&&(e.x!==void 0&&!isNaN(e.x)&&e.y!==void 0&&!isNaN(e.y)&&(this.updateCameraPosition(e.x,e.y),h=!0),e.z!==void 0&&!isNaN(e.z)&&(this.setPedestal(e.z,!0,!1),h=!0)),h&&this.publish("position-updated");let d={zooming:!1,tilting:!!n,rotating:!1};if(n!==void 0&&!isNaN(n)){let m=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;m!==this.camera.position.z&&(d.zooming=!0,this.camera.position.z=m,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>Ky&&(this.camera.near=n-Ky,this.camera.far=n+Ky):(this.camera.near=n/om,this.camera.far=n*om),this.camera.updateProjectionMatrix())}if(i!==void 0&&!isNaN(i)&&i!==this.getRotation()&&(d.rotating=!0,this.orbit.rotation.z=-i,this.publish("rotation-updated")),a!==void 0&&!isNaN(a)){let m=this.stayInsideBounds?Math.max(Math.min(a,this.maxTilt),this.minTilt):a;m!==this.elevation.rotation.x&&(d.tilting=!0,this.elevation.rotation.x=m,this.publish("tilt-updated"))}u&&this.publish("change"),this.state===-1&&this.publish("multi-end",d),this.stateDirty=!0},"setMulti"));b(this,"getZoomScaledMin",l(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));b(this,"getZoomScaledMax",l(()=>{let e=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,e)},"getZoomScaledMax"));b(this,"setRotation",l((e,n)=>{if(isNaN(e))return;this.state===-1&&!n&&this.publish("rotate-start");let i=-(e%FI);i!==this.orbit.rotation.z&&(this.orbit.rotation.z=i,n||this.publish("rotation-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0,n||(this.stateDirty=!0)},"setRotation"));b(this,"setZoomAltitude",l(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(e,this.getZoomScaledMin()),this.getZoomScaledMax()):e;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/om,this.camera.far=n*om,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0,this.stateDirty=!0},"setZoomAltitude"));b(this,"setZoomLevel",l(e=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(e))},"setZoomLevel"));b(this,"getZoomAltitude",l(()=>this.camera.position.z,"getZoomAltitude"));b(this,"getZoomLevel",l(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));b(this,"setTilt",l((e,n)=>{if(isNaN(e))return;this.state===-1&&!n&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(e,this.maxTilt),this.minTilt):e;i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,n||this.publish("tilt-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,n||(this.stateDirty=!0)},"setTilt"));b(this,"getTilt",l(()=>this.elevation.rotation.x,"getTilt"));b(this,"setCameraPlaneElevation",l(e=>{this.cameraPlane.position.z=e},"setCameraPlaneElevation"));b(this,"zoom",l(e=>{if(isNaN(e))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-e;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(n,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):n,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.stateDirty=!0},"zoom"));b(this,"getProjectionScaleFactor",l((e,n,i)=>h_(e,n,i),"getProjectionScaleFactor"));b(this,"update",l(()=>{this.orbit.updateMatrixWorld(),this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));b(this,"setPedestal",l((e,n=!1,i=!0)=>{typeof e=="number"&&!isNaN(e)&&(this.orbit.position.z=e,n&&(this.publishPedestalChangeEvent(e),this.publish("pedestal-change",{pedestal:e})),this.publish("change"),this.dirty=!0,i&&(this.stateDirty=!0))},"setPedestal"));b(this,"dispose",l(()=>{for(let e of wx)e.endsWith("start")?(this.off(e,this.setCameraMoving),e.startsWith("user")&&this.off(e,this.setUserInteracting)):(e.endsWith("end")||e.endsWith("cancel"))&&(this.off(e,this.unsetCameraMoving),e.startsWith("user")&&this.off(e,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));b(this,"createCameraPlane",l(()=>{let e=Px?2e3:1e10,n=Px?100:1,i=new ra(e,e,n,n),a=new On({color:0,wireframe:Px,visible:Px}),u=new ue(i,a);return this.scene.add(u),u},"createCameraPlane"));b(this,"addEventListeners",l(()=>{let{domElement:e}=this.renderer;for(let n of wx)n.endsWith("start")?(this.on(n,this.setCameraMoving),n.startsWith("user")&&this.on(n,this.setUserInteracting)):(n.endsWith("end")||n.endsWith("cancel"))&&(this.on(n,this.unsetCameraMoving),n.startsWith("user")&&this.on(n,this.unsetUserInteracting));e.addEventListener("contextmenu",this.onContextMenu,!1),e.addEventListener("mousedown",this.onMouseDown,!1),e.addEventListener("wheel",this.onMouseWheel,{passive:!1}),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));b(this,"addMouseEventListeners",l(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));b(this,"addMouseMoveEventListeners",l(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));b(this,"removeMouseMoveEventListeners",l(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));b(this,"removeEventListeners",l(()=>{let{domElement:e}=this.renderer;e.removeEventListener("contextmenu",this.onContextMenu,!1),e.removeEventListener("mousedown",this.onMouseDown,!1),e.removeEventListener("wheel",this.onMouseWheel,!1),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));b(this,"removeMouseUpEventListeners",l(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));b(this,"onContextMenu",l(e=>{e.preventDefault()},"onContextMenu"));b(this,"onMouseUp",l(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}},"onMouseUp"));b(this,"onMouseMove",l(e=>{if(this.enabled!==!1)if(e.preventDefault(),this.mouseToScene(e),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(e)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(e)},"onMouseMove"));b(this,"onTouchStart",l(e=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(e),e.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(e),this.state=9):this.enablePan&&(this.handleTouchStartPan(e),this.state=6);break;case 2:this.touch.inputs=new Sx(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));b(this,"onTouchMove",l(e=>{if(this.enabled!==!1)switch(this.touchToScene(e),e.touches.length){case 2:e.preventDefault(),e.stopPropagation();let n=U({},this.touch.inputs.first),i=U({},this.touch.inputs.second),a=new ne(this.touch.touches[0].x,this.touch.touches[0].y),u=new ne(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(e);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let h=n.y<a.y&&i.y<u.y,d=n.y>a.y&&i.y>u.y;this.enableRotate&&this.state!==4&&(d||h)?(this.handleTouchStartTilt(e),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(e.preventDefault(),e.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(e):this.enablePan&&this.state===6&&this.handleTouchMovePan(e);break;default:this.state=-1}},"onTouchMove"));b(this,"onTouchEnd",l(e=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}e.touches.length?this.onTouchStart(e):this.state=-1}},"onTouchEnd"));b(this,"handleTouchMovePan",l(e=>{let n=Object.hasOwn(e,"x")?new ne(e.x,e.y):this.touch.touches[0],i=this.raycastToFloor(n);this.coords.panEnd.set(i.x,i.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleTouchMovePan"));b(this,"handleTouchStartDolly",l(()=>{let e=this.touch.touches[0].x-this.touch.touches[1].x,n=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let i=new ne(this.touch.touches[0].x-e/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(i),this.orbit.updateMatrixWorld(),this.touch.anchor1=new Jy(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new Jy(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));b(this,"handleMouseMovePan",l(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(e.x,e.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleMouseMovePan"));b(this,"handleTouchStartTilt",l(e=>{this.coords.rotateStart.set(e.touches[1].clientX,e.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));b(this,"handleTouchMovePedestal",l(e=>{this.handleMouseMovePedestal(e.touches[0])},"handleTouchMovePedestal"));b(this,"handleTouchMoveTilt",l(e=>{this.coords.rotateEnd.set(e.touches[1].clientX,e.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));b(this,"handleTouchMoveDolly",l(()=>{let e=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:e.x,y:e.y},this.touch.anchor2.viewCoordinate={x:n.x,y:n.y};let i=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);i&&this.setCameraFromTransformMatrix(i),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,e),this.touch.anchor2.updateAnchorState(this.camera,n)},"handleTouchMoveDolly"));b(this,"handleTouchEnd",l(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));b(this,"handleTouchStartPan",l(e=>{let n=Object.hasOwn(e,"x")?new ne(e.x,e.y):this.touch.touches[0],i=this.raycastToFloor(n);this.coords.panStart.set(i.x,i.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));b(this,"handleTouchStartPedestal",l(e=>{this.handleMouseDownPedestal(e.touches[0])},"handleTouchStartPedestal"));b(this,"onMouseDown",l(e=>{if(this.enabled!==!1){if(this.mouseToScene(e),e.preventDefault(),this.state===3&&this.publish("zoom-end"),e.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(e),this.state=0}else e.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(e),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));b(this,"onMouseWheel",l(e=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(e.preventDefault(),e.stopPropagation(),this.mouseToScene(e),this.canScrollZoom(e)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(e)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(e))},"onMouseWheel"));b(this,"handleMouseWheel",l(e=>{if(this.publish("zoom-start"),!this.canScrollZoom(e)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),i=n-LI(e)*n/BI*this.zoomSpeed;if(this.setZoomAltitude(i),this.enablePan){let a=i/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-a),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));b(this,"setCameraFromTransformMatrix",l(e=>{this.orbit.updateMatrixWorld();let n=new Ul;n.setFromRotationMatrix(e,"ZYX");let i=(e.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),a=n.z,u=new zt(0,0,1);u.applyEuler(n),u.setLength(i);let h=new zt;h.setFromMatrixPosition(e),h.sub(u),this.enablePan&&this.setPosition(h.x,h.y),this.enableZoom&&this.setZoomAltitude(i),this.enableRotate&&this.setRotation(-a)},"setCameraFromTransformMatrix"));b(this,"makeTransformFromTouchAnchors",l((e,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let i=this.camera.projectionMatrix.clone(),a=e.worldCoordinate,u=n.worldCoordinate,h=e.reUnproject(),d=n.reUnproject();if(!h||!d||!a||!u)return null;let m=e.viewCoordinate,v=n.viewCoordinate,x=u.x-a.x,S=u.y-a.y,I=Math.atan2(S,x),w=d.x-h.x,E=d.y-h.y,T=Math.atan2(E,w),D=VO(I,T),A=new ns;A.makeRotationZ(-D);let L=A.clone();L.multiply(e.snapHolderMatrix);let B=l((Ai,Hn,Ni)=>Ai.elements[(Hn-1)*4+Ni-1],"m"),j=B(i,1,1)*B(L,1,1)-m.x*B(i,3,4)*B(L,3,1),W=B(i,1,1)*B(L,1,2)-m.x*B(i,3,4)*B(L,3,2),$=B(i,1,1)*B(L,1,3)-m.x*B(i,3,4)*B(L,3,3),F=a.x*j+a.y*W+a.z*$,J=B(i,2,2)*B(L,2,1)-m.y*B(i,3,4)*B(L,3,1),ot=B(i,2,2)*B(L,2,2)-m.y*B(i,3,4)*B(L,3,2),K=B(i,2,2)*B(L,2,3)-m.y*B(i,3,4)*B(L,3,3),H=a.x*J+a.y*ot+a.z*K,_t=B(i,1,1)*B(L,1,1)-v.x*B(i,3,4)*B(L,3,1),ct=B(i,1,1)*B(L,1,2)-v.x*B(i,3,4)*B(L,3,2),ft=B(i,1,1)*B(L,1,3)-v.x*B(i,3,4)*B(L,3,3),mt=u.x*_t+u.y*ct+u.z*ft,St=B(i,2,2)*B(L,2,1)-v.y*B(i,3,4)*B(L,3,1),dt=B(i,2,2)*B(L,2,2)-v.y*B(i,3,4)*B(L,3,2),xt=B(i,2,2)*B(L,2,3)-v.y*B(i,3,4)*B(L,3,3),q=u.x*St+u.y*dt+u.z*xt,ee=Math.abs(_t-j),Gt=Math.abs(ct-W),Kt=Math.abs(ft-$),It=Math.abs(_t-J),ie=Math.abs(ct-ot),vr=Math.abs(ft-K),Qe=Math.abs(St-j),Nt=Math.abs(dt-W),At=Math.abs(xt-$),Ct=Math.abs(St-J),_e=Math.abs(dt-ot),de=Math.abs(xt-K),qr=Math.min(ee+Gt+Kt,It+ie+vr),me=Math.min(Qe+Nt+At,Ct+_e+de);qr<me&&(_t=St,ct=dt,ft=xt,mt=q);let Se=J*$-j*K,br=ot*$-W*K,Wr=H*$-F*K,$i=_t*K-J*ft,Yt=ct*K-ot*ft,mr=mt*K-H*ft,co=(mr*br-Wr*Yt)/($i*br-Se*Yt),Ji=(mr*Se-Wr*$i)/(Yt*Se-br*$i),po=ot*j-W*J,En=K*j-$*J,wt=H*j-F*J,Hs=ct*J-ot*_t,Zo=ft*J-K*_t,ho=((mt*J-H*_t)*po-wt*Hs)/(Zo*po-En*Hs),Pa=L.clone();return Pa.elements[12]=co,Pa.elements[13]=Ji,Pa.elements[14]=ho,ho>0?Pa:null},"makeTransformFromTouchAnchors"));b(this,"updateTouchOrigin",l(()=>{let e=this.renderer.domElement;this.touch.origin.offsetLeft=e.getBoundingClientRect().left,this.touch.origin.offsetTop=e.getBoundingClientRect().top},"updateTouchOrigin"));b(this,"touchToScene",l(e=>{this.touch.touches=[];for(let n=0,i=e.touches.length;n<i;n++){let a=e.touches[n],u=jO(a,this.touch.origin);this.touch.touches.push(new ne(u.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(u.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));b(this,"canScrollZoom",l(e=>{let n=LI(e),i=this.getZoomAltitude();return!(n<0&&i===this.getZoomScaledMax()||n>0&&i===this.getZoomScaledMin())},"canScrollZoom"));b(this,"mouseToScene",l(e=>{let n=this.getMousePos(e);return this.coords.mouse.x=n.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(n.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));b(this,"getMousePos",l(e=>({x:e.offsetX,y:e.offsetY}),"getMousePos"));b(this,"handleMouseDownRotate",l(e=>{this.coords.rotateStart.set(e.clientX,e.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));b(this,"handleMouseDownPan",l(()=>{let e=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(e.x,e.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));b(this,"handleMouseDownPedestal",l(e=>{let n=new ne(e.clientX,e.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=h_(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));b(this,"handleMouseMovePedestal",l(e=>{let n={x:e.clientX,y:e.clientY},i=this.coords.initialPedestal+this.pedestalScaleFactor*(n.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(i<this.minPedestal?i=Math.max(i,this.minPedestal):i>this.maxPedestal&&(i=Math.min(i,this.maxPedestal))),i!==this.getPedestal()&&this.setPedestal(i,!0)},"handleMouseMovePedestal"));b(this,"handleMouseMoveRotate",l(e=>{this.coords.rotateEnd.set(e.clientX,e.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));b(this,"publishUserZoomDebounced",fg(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));b(this,"publishUserZoomEvent",l(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));b(this,"setCameraMoving",l(()=>{this.cameraMoving=!0},"setCameraMoving"));b(this,"unsetCameraMoving",l(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));b(this,"setUserInteracting",l(()=>{this.userInteracting=!0},"setUserInteracting"));b(this,"unsetUserInteracting",l(()=>{this.userInteracting=!1},"unsetUserInteracting"));b(this,"publishPedestalChangeEvent",l(e=>{this.publish("pedestal-change",{pedestal:e,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));b(this,"convertAltitudeToZoomLevel",l(e=>{let[,n]=this.center,a=e*2*Math.tan(Ie.degToRad(this.camera.fov)/2)/this.options.canvasHeight,u=Math.cos(Ie.degToRad(n))*2*Math.PI*Q2/a;return Ie.clamp(Math.log2(u/512),Mx,Tx)},"convertAltitudeToZoomLevel"));b(this,"convertZoomLevelToAltitude",l(e=>{let[,n]=this.center,i=Ie.clamp(e,Mx,Tx),a=Math.pow(2,i),u=Ie.clamp(n,kI,RI),h=a*512;return Math.cos(Ie.degToRad(u))*Math.PI*2*Q2/h*this.options.canvasHeight/2/Math.tan(Ie.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));b(this,"completeTween",l(e=>{e.isPlaying()&&e.stop(),this.rendererState.internalTweenGroup.remove(e),this.tweens.delete(e)},"completeTween"));b(this,"debugContainer",new zl);this.camera=e,this.renderer=i,this.rendererState=a,this.scene=n,this.options=u,this.elevation=e.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=e.position.z,u.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(e){this.minZoomAltitude=this.convertZoomLevelToAltitude(e),this.stateDirty=!0}get defaultMinZoomLevel(){return p(this,Ex)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(e){this.maxZoomAltitude=this.convertZoomLevelToAltitude(e),this.stateDirty=!0}get scrollPercent(){let e=this.minPedestal,n=this.maxPedestal,i=this.getPedestal();return i=Math.min(i,n),i=Math.max(i,e),(i-e)/(n-e)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var a,u,h,d;let e=this.getPosition(),{lat:n,lon:i}=K0((u=(a=this.rendererState.center)==null?void 0:a[1])!=null?u:0,(d=(h=this.rendererState.center)==null?void 0:h[0])!=null?d:0,e.x,e.y);return[i,n]}setCenter(e,n){var u,h,d,m;let{x:i,y:a}=Q0((h=(u=this.rendererState.center)==null?void 0:u[1])!=null?h:0,(m=(d=this.rendererState.center)==null?void 0:d[0])!=null?m:0,n,e);this.setPosition(i,a)}get isAnimating(){return this.rendererState.internalTweenGroup.getAll().some(e=>e.cameraAnimation)}getCameraFrameForCoordinates(e,n){let i=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,a=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,u=this.options.canvasWidth,h=this.options.canvasHeight,d=this.getRotation(),m=this.getTilt(),v=this.getPosition();this.setRotation(n.rotation||d,!0),this.setTilt(n.tilt||m,!0);let x=zO(e,{canvasWidth:u,canvasHeight:h,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:i,maxZoom:a,position:v,camera:this.camera,orbit:this.orbit});return this.setRotation(d,!0),this.setTilt(m,!0),{center:x.position,zoomLevel:this.convertAltitudeToZoomLevel(x.zoom)}}focusOn(e,n){if(rW){this.debugContainer&&Jr(this.debugContainer);let T=new Fo(4,4,4),D=new On({color:65280,depthTest:!1}),A=new oc(T,D,e.length),L=new ns;e.forEach((B,j)=>{L.setPosition(B),A.setMatrixAt(j,L)}),A.instanceMatrix.needsUpdate=!0,this.debugContainer.add(A),this.scene.add(this.debugContainer)}let i=n.curve,a=n.callback,u=n.cancelledCallback,h=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,d=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,m=this.options.canvasWidth,v=this.options.canvasHeight,x;n.duration!==void 0?x=n.duration:P.env.TESTING==="true"?x=0:x=GI;let S=n.padding,I=this.getRotation(),w=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let E=zO(e,{canvasHeight:v,paddingOption:S,canvasWidth:m,minZoom:h,maxZoom:d,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(I),this.setTilt(w),this.animateCamera({position:E.position,tilt:n.tilt,rotation:n.rotation,zoom:E.zoom},x,i,a,u,n)}resize(e,n){this.options.canvasWidth=e,this.options.canvasHeight=n}};Ex=new WeakMap,l(Ox,"CameraSystem"),b(Ox,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var sm=Ox;function zO(r,{canvasWidth:t,orbit:e,paddingOption:n,verticalPadding:i=0,canvasHeight:a,minZoom:u,maxZoom:h,camera:d,position:m}){let v={zoom:u,position:m};if(r.length===0)return v;for(let Se of sm.CAMERA_FRAME_PADDING_SIDES)typeof n[Se]!="number"&&(n[Se]=0);let x=n.type==="portion"?{top:n.top*a,bottom:n.bottom*a,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(x.left+x.right>=t||x.top+x.bottom>=a)return v;e.updateMatrixWorld();let S=d.matrixWorldInverse,I=d.fov*(Math.PI/180)/2,w=I,T=Math.atan(Math.tan(I)*(t/a)),D=new zt(1/0,1/0,1/0),A=new zt(-1/0,-1/0,-1/0),L=new In,B=new zt;for(let Se=0,br=r.length;Se<br;Se++)B.copy(r[Se]),L.expandByPoint(B),B.applyMatrix4(S),D.min(B),A.max(B),B.copy(r[Se]),B.z-=i,B.applyMatrix4(S),D.min(B),A.max(B),B.copy(r[Se]),B.z+=i,B.applyMatrix4(S),D.min(B),A.max(B);let j=A.x-D.x,W=A.y-D.y,$=t-x.left-x.right,F=a-x.top-x.bottom,J=(A.x+D.x)/2,ot=(A.y+D.y)/2,K=j/$,H=W/F,_t=u,ct=h,ft=_t*Math.tan(T)*2,mt=ct*Math.tan(T)*2,St=ft/t,dt=mt/t,xt=Math.max(K,H);xt=Ie.clamp(xt,St,dt);let q=$*xt,ee=F*xt,Gt={min:{x:J-q/2-x.left*xt,y:ot-ee/2-x.bottom*xt},max:{x:J+q/2+x.right*xt,y:ot+ee/2+x.top*xt}},Kt=(Gt.min.x+Gt.max.x)/2,It=(Gt.min.y+Gt.max.y)/2,ie=L.getCenter(new zt),vr=Math.abs(Kt-Gt.min.x),Qe=Math.abs(It-Gt.min.y),Nt=vr/Math.tan(T),At=Qe/Math.tan(w),Ct=new zt;Ct.set(Kt,It,A.z+Math.max(Nt,At)),Ct.applyMatrix4(d.matrixWorld);let _e=new zt;_e.set(Kt,It,A.z),_e.applyMatrix4(d.matrixWorld);let de=new zt().subVectors(_e,Ct),qr=(ie.z-Ct.z)/de.z,me=new zt().copy(Ct).add(de.clone().multiplyScalar(qr));return _e.set(me.x,me.y,me.z),Ct.sub(_e),{position:me,zoom:Ct.length()}}l(zO,"getCameraFrameForPoints");y();var nW=300,Qy,t1,jI=class jI{constructor(t){b(this,"state");R(this,Qy,new zt);R(this,t1,new zt);this.state=t}update(t){var i;let e,n;this.state.cameraObject.getWorldPosition(p(this,t1));for(let a of this.state.geometry2DIdsInScene)if(e=this.state.geometry2DMap.get(a),e&&(n=e.components[0],n&&"containerEl"in n&&n.markerContainer!=null)){if(n.visibilityNeedsUpdate!==!1&&(n.visibilityNeedsUpdate==="show"?n.canShow=!0:n.canShow=!1),(n.canShow&&n.visible===!0||((i=n.animation)==null?void 0:i.pending)===!0)&&!n.offscreen)if(n.options.zIndex!=null)n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(n.options.zIndex,"px)");else{e.object3d.getWorldPosition(p(this,Qy));let u=p(this,t1).distanceTo(p(this,Qy));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-u,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=t?"none":n.pointerEvents:n.markerContainer.style.pointerEvents="none",n.currentStrategyIndex===-1&&n.visible&&n.visibilityNeedsUpdate==="show")continue;n.visibilityNeedsUpdate!==!1&&!n.offscreen&&(n.visibilityNeedsUpdate==="show"&&(n.markerContainer.style.opacity="0"),n.animation&&n.animation.cancel(),n.animation=n.markerContainer.animate([{opacity:n.canShow&&n.visible?"1":"0"}],{duration:nW,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};Qy=new WeakMap,t1=new WeakMap,l(jI,"DOMDrawSystem");var Dx=jI;y();var UI=class UI{constructor(){b(this,"percentExpanded",0);b(this,"activeId","");b(this,"gap",20);b(this,"dirty",!0)}};l(UI,"StackComponent");var Lx=UI;y();var zI=class zI extends le{constructor(e,n){super();b(this,"state");b(this,"dirty",!0);b(this,"domTree");b(this,"observers",new Map);b(this,"updateDimensions",l(e=>{e.forEach(n=>{var u;let a=(u=n.target.parentElement)==null?void 0:u.getAttribute("data-marker-id");if(a){let h=this.state.geometry2DMap.get(a),d=h==null?void 0:h.components[0];h&&d instanceof fl&&(d.updateDimensions(n.contentRect.width,n.contentRect.height),d.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=e,this.domTree=n}setupObserver(){var i;if(this.observers){for(let a of this.observers.values())a.disconnect();this.observers.clear()}let e,n;for(let a of this.domTree.children){let u=a.getAttribute("data-marker-id");if(u!=null&&(e=this.state.geometry2DMap.get(u),n=e.components[0],(i=n.options)!=null&&i.dynamicResize)){let h=new ResizeObserver(this.updateDimensions);h.observe(n.containerEl),this.observers.set(a.userData.entityId,h)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let e of this.observers.values())e.disconnect();this.observers.clear()}};l(zI,"DOMResizeSystem");var Ax=zI;y();var iW=0,oW=90,sW=(P.env.NODE_ENV==="test",!1),xu={linear:Vn.Linear.None,"ease-in":Vn.Quadratic.In,"ease-out":Vn.Quadratic.Out,"ease-in-out":Vn.Quadratic.InOut},aW=-50,$t,pe,bu,e1,r1,XI,YI=class YI{constructor(t,e,n){R(this,r1);R(this,$t);R(this,pe);R(this,bu);R(this,e1);V(this,$t,t),V(this,pe,e),V(this,bu,n),p(this,pe).cameraSystem.on("pedestal-change",({pedestal:i})=>{p(this,$t).map&&(p(this,$t).map.transform.elevation=i,p(this,$t).map.transform.minElevationForCurrentTile=aW,p(this,$t).map.triggerRepaint()),p(this,pe).cameraSystem.setCameraPlaneElevation(i)})}get center(){var t,e;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(e=(t=p(this,$t).map).getCenter)==null?void 0:e.call(t).toArray():p(this,pe).cameraSystem.center}setCenter(t){var e;if(p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map){(e=p(this,$t).map)==null||e.setCenter(t),p(this,pe).interactionSystem.handleHover();return}p(this,pe).cameraSystem.setCenter(t[0],t[1]),p(this,pe).interactionSystem.handleHover()}get zoomLevel(){var t;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(t=p(this,$t).map)==null?void 0:t.getZoom():p(this,pe).cameraSystem.getZoomLevel()}setZoomLevel(t){var e;p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map&&((e=p(this,$t).map)==null||e.setZoom(t)),p(this,pe).cameraSystem.setZoomLevel(za(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}getState(){return{zoomLevel:this.zoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,minPitch:this.minPitch,maxPitch:this.maxPitch,autoMinZoomLevel:this.autoMinZoomLevel,panMode:this.panMode,screenOffsets:this.insetsPadding,center:this.center,bearing:this.bearing,pitch:this.pitch,elevation:this.elevation}}get isAnimating(){return p(this,pe).cameraSystem.isAnimating}cancelAnimation(){p(this,pe).cameraSystem.cancelAnimation()}get maxZoomLevel(){return p(this,pe).cameraSystem.maxZoomLevel}get minZoomLevel(){return p(this,pe).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){p(this,pe).panBoundsSystem.autoMinZoomLevel=t,t&&(p(this,pe).panBoundsSystem.dirty=!0,p(this,pe).panBoundsSystem.update())}get autoMinZoomLevel(){return p(this,pe).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,e=!1){var i;e&&this.setAutoMinZoomLevel(!1);let n=za(t,Fs.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(Fs.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));p(this,pe).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(i=p(this,$t).map)==null||i.setMinZoom(n)}setMaxZoomLevel(t){var n;let e=za(t,this.minZoomLevel,Fs.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(Fs.MAX_MERCATOR_ZOOM_LEVEL,"."));p(this,pe).cameraSystem.setMaxZoomLevel(e),this.zoomLevel>e&&this.setZoomLevel(e),(n=p(this,$t).map)==null||n.setMaxZoom(e)}get maxPitch(){var t,e;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(e=(t=p(this,$t).map)==null?void 0:t.getMaxPitch)==null?void 0:e.call(t):Ie.radToDeg(p(this,pe).cameraSystem.maxTilt)}get minPitch(){var t,e;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(e=(t=p(this,$t).map)==null?void 0:t.getMinPitch)==null?void 0:e.call(t):Ie.radToDeg(p(this,pe).cameraSystem.minTilt)}setMinPitch(t){var n;let e=Math.max(iW,t);(n=p(this,$t).map)==null||n.setMinPitch(e),p(this,pe).cameraSystem.minTilt=Ie.degToRad(e)}setMaxPitch(t){var n;let e=Math.min(oW,t);(n=p(this,$t).map)==null||n.setMaxPitch(e),p(this,pe).cameraSystem.maxTilt=Ie.degToRad(e)}get bearing(){var t;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(t=p(this,$t).map)==null?void 0:t.getBearing():Ie.radToDeg(p(this,pe).cameraSystem.getRotation())}setBearing(t){var e;if(p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map){(e=p(this,$t).map)==null||e.setBearing(t);return}p(this,pe).cameraSystem.setRotation(Ie.degToRad(t))}get pitch(){var t;return p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(t=p(this,$t).map)==null?void 0:t.getPitch():Ie.radToDeg(p(this,pe).cameraSystem.getTilt())}setPitch(t){var e;if(p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map){(e=p(this,$t).map)==null||e.setPitch(t);return}p(this,pe).cameraSystem.setTilt(Ie.degToRad(za(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return p(this,pe).cameraSystem.getPedestal()}setElevation(t){p(this,pe).cameraSystem.setPedestal(t,!0)}animateElevation(t,e){return p(this,e1)&&p(this,e1).stop(),new Promise(n=>{var i;p(this,pe).cameraSystem.animateCamera({position:{z:t}},(e==null?void 0:e.duration)||300,xu[(e==null?void 0:e.easing)||"ease-in-out"],n,n,{interruptible:(i=e==null?void 0:e.interruptible)!=null?i:!0})})}get insetsPadding(){return p(this,bu).insetsPadding}get panMode(){return p(this,pe).cameraSystem.enablePan===!1&&p(this,pe).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(p(this,pe).cameraSystem.enablePan=!0,p(this,pe).cameraSystem.enablePedestal=!1):(p(this,pe).cameraSystem.enablePan=!1,p(this,pe).cameraSystem.enablePedestal=!0))}setInsetPadding(t){p(this,bu).insetsPadding=Object.assign({},p(this,bu).insetsPadding,t)}animateTo(t){var u,h,d,m,v,x;if(p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map)return(x=p(this,$t).map)==null||x.flyTo({center:(u=t.center)!=null?u:this.center,zoom:(h=t.zoomLevel)!=null?h:this.zoomLevel,bearing:(d=t.bearing)!=null?d:this.bearing,pitch:(m=t.pitch)!=null?m:this.pitch,duration:(v=t.duration)!=null?v:600}),Promise.resolve();let e=t.center?p(this,$t).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?p(this,pe).cameraSystem.convertZoomLevelToAltitude(za(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,i=t.bearing!==void 0?Ie.degToRad(t.bearing):void 0,a=t.pitch!==void 0?Ie.degToRad(za(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(S=>{var I;p(this,pe).cameraSystem.animateCamera({position:e,zoom:n,rotation:i,tilt:a},t.duration||0,xu[t.easing||"ease-in-out"],()=>{p(this,pe).interactionSystem.handleHover(),S()},S,{interruptible:(I=t==null?void 0:t.interruptible)!=null?I:!0})})}getCameraFrameForCoordinates(t,e){let n=yt(this,r1,XI).call(this,e||{},()=>Promise.resolve()),{pointCloud:i}=HO(t,p(this,$t),p(this,bu).geometry3DMap);if(i.length===0)return tt.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:a,zoomLevel:u}=p(this,pe).cameraSystem.getCameraFrameForCoordinates(i,n);return{center:p(this,$t).convert3DMapPositionToCoordinate(a),zoomLevel:u}}focusOn(t,e){var u,h,d,m;let{pointCloud:n,geoBounds:i,firstPosition:a}=HO(t,p(this,$t),p(this,bu).geometry3DMap);return n.length===0?(tt.error("No valid coordinates found in targets:",t),Promise.resolve()):p(this,$t).mode==="outdoors-overlay"&&p(this,$t).map?(n.length===1&&a?(u=p(this,$t).map)==null||u.flyTo({center:[a[0],a[1]],duration:(e==null?void 0:e.duration)||p(this,$t).map.getBearing(),animate:!0,bearing:(e==null?void 0:e.bearing)===void 0?p(this,$t).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?p(this,$t).map.getPitch():e==null?void 0:e.pitch,zoom:(e==null?void 0:e.maxZoomLevel)||p(this,$t).map.getMaxZoom()}):(sW&&lW(p(this,$t),i),(m=p(this,$t).map)==null||m.fitBounds(i,{duration:(h=e==null?void 0:e.duration)!=null?h:Fs.DEFAULT_ANIMATION_DURATION,bearing:(e==null?void 0:e.bearing)===void 0?p(this,$t).map.getBearing():e==null?void 0:e.bearing,pitch:(e==null?void 0:e.pitch)===void 0?p(this,$t).map.getPitch():e==null?void 0:e.pitch,maxZoom:(d=e==null?void 0:e.maxZoomLevel)!=null?d:p(this,$t).map.getMaxZoom()})),p(this,pe).interactionSystem.handleHover(),Promise.resolve()):new Promise(v=>{p(this,pe).cameraSystem.focusOn(n,yt(this,r1,XI).call(this,e||{},v))})}};$t=new WeakMap,pe=new WeakMap,bu=new WeakMap,e1=new WeakMap,r1=new WeakSet,XI=l(function(t,e){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:p(this,pe).cameraSystem.convertZoomLevelToAltitude(za(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:p(this,pe).cameraSystem.convertZoomLevelToAltitude(za(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},$0,t==null?void 0:t.padding):this.insetsPadding,curve:xu[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Ie.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Ie.degToRad(za(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:l(()=>{p(this,pe).interactionSystem.handleHover(),e()},"callback"),cancelledCallback:e,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),l(YI,"Camera");var Nx=YI;function HI(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}l(HI,"updateBounds");function HO(r,t,e){var h;let n=[],i=[1/0,1/0,-1/0,-1/0],a=null;if(!r||!Array.isArray(r)||r.length===0)return{pointCloud:n,geoBounds:i,firstPosition:a};let u=t.getSystems().renderSystem;(u.threeDdirty||u.twoDdirty)&&t.renderSync();for(let d of r)if(typeof d=="string"){let m=e.get(d);if(!m){tt.error("Entity not found with id:",d);continue}let v=new In;uP(t,"userData"in m&&(h=m.userData.entityId)!=null?h:m.id,n,v,m instanceof Er?m.position.z:void 0);let x=t.convert3DMapPositionToCoordinate(v.min),S=t.convert3DMapPositionToCoordinate(v.max);HI(i,x),HI(i,S),a||(a=t.convert3DMapPositionToCoordinate(v.getCenter(new zt)))}else n.push(t.convertTo3DMapPosition(d[1],d[0],d[2]||0)),HI(i,d),a||(a=d);return{pointCloud:n,geoBounds:i,firstPosition:a}}l(HO,"processTargets");function lW(r,t){var n,i,a,u;let e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(n=r.map)!=null&&n.getLayer("bounds-outline")&&r.map.removeLayer("bounds-outline"),(i=r.map)!=null&&i.getSource("bounds-source")&&r.map.removeSource("bounds-source"),(a=r.map)==null||a.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}}),(u=r.map)==null||u.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}l(lW,"drawBounds");y();y();var XO="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";y();var YO="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";y();var qO=4.291666666666667,WO=15,ZO=25,$O=43/60;y();var JO=["horizontal","icon"],uW=new Map([[JO[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[JO[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),cW=/<svg([^>]*)>/g;function KO(r,t,e,n){let i=uW.get(r);return i?i.replace(cW,'<svg$1 width="'.concat(e,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}l(KO,"getLogoIcon");var QO=!1,Yr,_u,am,hi,Eo,zh,ga,vl,qI=class qI extends le{constructor(e,n,i){super();R(this,Yr,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:l(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});R(this,_u);R(this,am);R(this,hi);R(this,Eo);R(this,zh);R(this,ga,0);R(this,vl,0);b(this,"dirty",!0);b(this,"getPositionAlignedCanvasCoordinates",l((e,n)=>({"top-left":{x:0,y:0},"top-right":{x:e,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:e,y:n},center:{x:e/2,y:n/2},top:{x:e/2,y:0},bottom:{x:e/2,y:n},left:{x:0,y:n/2},right:{x:e,y:n/2}})[p(this,Yr).position],"getPositionAlignedCanvasCoordinates"));b(this,"getPositionAlignedPadding",l(()=>{var i,a,u,h;let e=p(this,Yr).padding;if(typeof e=="number")return{"top-left":{x:e,y:e},"top-right":{x:-e,y:e},"bottom-left":{x:e,y:-e},"bottom-right":{x:-e,y:-e},center:{x:0,y:0},top:{x:0,y:e},bottom:{x:0,y:-e},left:{x:e,y:0},right:{x:-e,y:0}}[p(this,Yr).position];let n={top:(i=e.top)!=null?i:0,right:(a=e.right)!=null?a:0,bottom:(u=e.bottom)!=null?u:0,left:(h=e.left)!=null?h:0};return{x:n.left-n.right,y:n.top-n.bottom}},"getPositionAlignedPadding"));i&&Object.entries(i).forEach(([a,u])=>{u!==void 0&&(p(this,Yr)[a]=u)}),V(this,am,e),V(this,_u,n)}get color(){return p(this,Yr).color==="light"?"white":"#293136"}get iconName(){return p(this,Yr).iconOnly?"icon":"horizontal"}get minWidth(){return p(this,Yr).iconOnly?WO:75}get defaultWidth(){return p(this,Yr).iconOnly?ZO:150}get aspectRatio(){return p(this,Yr).iconOnly?$O:qO}get options(){return U({},p(this,Yr))}set options(e){var n,i;V(this,Yr,{padding:e.padding||p(this,Yr).padding,position:e.position||p(this,Yr).position,iconOnly:e.iconOnly||p(this,Yr).iconOnly,color:e.color||p(this,Yr).color,scale:e.scale||p(this,Yr).scale,onClick:p(this,Yr).onClick,interactive:(n=e.interactive)!=null?n:p(this,Yr).interactive,visible:(i=e.visible)!=null?i:p(this,Yr).visible})}get icon(){return KO(this.iconName,this.color,p(this,ga)*p(this,_u).pixelRatio,p(this,vl)*p(this,_u).pixelRatio)}setSize(e,n){p(this,Eo)&&(p(this,Eo).uniforms.uSize.value.x=e,p(this,Eo).uniforms.uSize.value.y=n)}setXY(e,n){p(this,Eo)&&(p(this,Eo).uniforms.uSize.value.w=e,p(this,Eo).uniforms.uSize.value.z=n)}get width(){return p(this,ga)}get height(){return p(this,vl)}getPositionAlignedOffset(e,n){return{"top-left":{x:0,y:0},"top-right":{x:-e,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-e,y:-n},center:{x:-(e/2),y:-(n/2)},top:{x:-(e/2),y:0},bottom:{x:-(e/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-e,y:-(n/2)}}[p(this,Yr).position]}insertIntoQuadTree(e){p(this,zh)!=null&&typeof p(this,Yr).onClick=="function"&&p(this,Yr).interactive&&e.insert(p(this,zh))}resize(e,n){if(p(this,Yr).visible!==!0)return;let i=this.getPositionAlignedCanvasCoordinates(e,n),a=this.getPositionAlignedPadding(),u=this.getPositionAlignedOffset(p(this,ga),p(this,vl)),h=Math.min(e-p(this,ga),Math.max(0,i.x+a.x+u.x)),d=Math.min(n-p(this,vl),Math.max(0,i.y+a.y+u.y));this.setSize(p(this,ga)/e,p(this,vl)/n),this.setXY(h/e,d/n),V(this,zh,new Nr(h,d,p(this,ga),p(this,vl),{entityId:"watermark"}))}update(){this.dirty&&(p(this,Yr).visible===!0?(V(this,ga,Math.min(p(this,_u).canvasWidth,Math.max(this.minWidth,this.defaultWidth*p(this,Yr).scale))),V(this,vl,p(this,ga)/this.aspectRatio),kc.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),e=>{if(V(this,Eo,new nc({uniforms:{uTexture:{value:e},uSize:{value:new kw(0,0,0,0)},uOpacity:{value:.7}},vertexShader:XO,fragmentShader:YO,depthWrite:!1,depthTest:!1,defines:{debug:QO},wireframe:QO,transparent:!0,visible:!0})),p(this,hi))p(this,hi).visible=!0,p(this,hi).material=p(this,Eo),p(this,hi).material.needsUpdate=!0;else{let n=new ra(2,2,1,1);V(this,hi,new ue(n,p(this,Eo))),p(this,hi).position.set(0,0,-1),p(this,hi).frustumCulled=!1,p(this,hi).renderOrder=999;let i=new Fo(1,1,1),a=new ue(i,new On({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));a.frustumCulled=!1,a.layers.set(1),p(this,hi).add(a),p(this,am).add(p(this,hi))}this.resize(p(this,_u).canvasWidth,p(this,_u).canvasHeight),this.publish("texture-loaded")})):p(this,hi)&&(p(this,hi).visible=!1),this.dirty=!1)}destroy(){p(this,hi)&&(p(this,am).remove(p(this,hi)),Jr(p(this,hi))),V(this,hi,void 0),p(this,Eo)&&p(this,Eo).dispose(),V(this,Eo,void 0),V(this,zh,void 0)}};Yr=new WeakMap,_u=new WeakMap,am=new WeakMap,hi=new WeakMap,Eo=new WeakMap,zh=new WeakMap,ga=new WeakMap,vl=new WeakMap,l(qI,"WatermarkSystem");var kx=qI;y();var Rx=100,fW=!1,WI=class WI extends le{constructor(e,n){super();b(this,"currentTotalBoundingBox");b(this,"state");b(this,"cameraSystem");b(this,"debugMesh",null);b(this,"dirty",!0);b(this,"autoMinZoomLevel",!0);this.state=e,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new In,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new zt(0,0,0),new zt(Rx*2,Rx*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(Rx)));let e=new In().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(e);let n=e.getSize(new zt),i=Math.max(n.x,n.y,n.z);for(let u of this.state.geometry2DMap.values())u.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(u.position),u.positionDirty=!1);let a=Fx.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(i,Rx)).getBoundingSphere(dW).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new zt),min:Fx.min,max:Fx.max,radius:a},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,fW&&this.state.entityScene.parent instanceof ic){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new zl,this.debugMesh.add(new ue(new j0(this.cameraSystem.panBounds.radius),new On({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let u=new zt;Fx.getSize(u);let h=new Fo(u.x,u.y,u.z),d=new On({color:65280,wireframe:!0,transparent:!0,opacity:.5}),m=new ue(h,d);m.position.copy(this.currentTotalBoundingBox.getCenter(new zt)),this.debugMesh.add(m)}}}};l(WI,"PanBoundsSystem");var Bx=WI,Fx=new In,dW=new Fw;y();var tD="\xA9 Mappedin",mW="https://info.mappedin.com/feedback",$I=["top-left","top-right","bottom-left","bottom-right"],gW=640,yW=l(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),ZI={custom:[],position:"bottom-right",feedback:!0},JI=class JI{constructor(t){b(this,"controlContainerEl");b(this,"controlPositions");b(this,"compact");b(this,"attribContainerEl");b(this,"attribInnerEl");b(this,"attribButtonEl");b(this,"feedbackLinkEl");b(this,"attribHTML",tD);b(this,"customAttributions",[]);b(this,"toggleAttribution",l(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=$I.reduce((e,n)=>{let i=document.createElement("div");return i.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(i),e[n]=i,e},{})}addAttributionControl(t=ZI){var i;let e=t.position&&$I.includes(t.position)?t.position:ZI.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(e)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[e].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=yW(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((i=t.feedback)!=null?i:ZI.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=mW,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let e=[tD],n=t.style.sourceCaches;for(let i in n){let a=n[i];if(a.used||a.usedForTerrain){let u=a.getSource();u.attribution&&e.indexOf(u.attribution)<0&&e.push(u.attribution)}}e=e.filter(i=>String(i).trim()),e=e.filter((i,a)=>{for(let u=a+1;u<e.length;u++)if(e[u].indexOf(i)>=0)return!1;return!0}),this.attribHTML=e.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=gW||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};l(JI,"HTMLControlsSystem");var Gx=JI;y();var n1,i1,KI=class KI{constructor(t,e){b(this,"mesh");b(this,"type","custom-geometry");b(this,"dirty",!0);b(this,"feature");b(this,"builder");b(this,"outline");R(this,n1,1);b(this,"color",new rn);R(this,i1,0);this.mesh=new oa,this.feature=t,this.builder=e}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){V(this,n1,t)}get opacity(){return p(this,n1)}setColor(t){this.color.set(t)}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return p(this,i1)}set altitude(t){this.mesh&&(this.mesh.position.z=t,V(this,i1,t))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}};n1=new WeakMap,i1=new WeakMap,l(KI,"CustomGeometryComponent");var lm=KI;y();var QI=class QI{constructor(t,e){b(this,"state");b(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=e}update(){let t,e;for(let n of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(n);(i==null?void 0:i.type)==="custom-geometry"&&(t=i.components[0],e=i.components[1],t.dirty&&e.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],e.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(a=>{a.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),e.visible!==!1&&t.builder.update(t.mesh))}}};l(QI,"CustomGeometrySystem");var Vx=QI;y();y();function eD(r){return r.children.some(t=>t.userData.isOutline)}l(eD,"hasOutline");function jx(r,t,e,n){let a=r.getAttribute("position").array,u=-1/0;for(let h=0;h<t.count;h++){let m=(t.start+h)*3,v=a[m+2];u=Math.max(u,v)}for(let h=0;h<t.count;h++){let m=(t.start+h)*3,v=a[m+2];Math.abs(v-u)<1e-4?a[m+2]=Math.max(e+n,2e-4+n):a[m+2]=n}r.attributes.position.needsUpdate=!0}l(jx,"updateBufferGeometryHeight");y();function tM(r){var m,v;let t=new B0,e=(m=r.mesh)==null?void 0:m.geometry;if(!e||!((v=r.batchedProps)!=null&&v.range))return;let n=r.batchedProps.range,i=n.start,a=n.count,u=e.getAttribute("position");if(u){let x=new Float32Array(a*3);for(let S=0;S<a;S++){let I=i+S;x[S*3]=u.array[I*3],x[S*3+1]=u.array[I*3+1],x[S*3+2]=u.array[I*3+2]}t.setAttribute("position",new Ro(x,3))}let h=e.getAttribute("normal");if(h){let x=new Float32Array(a*3);for(let S=0;S<a;S++){let I=i+S;x[S*3]=h.array[I*3],x[S*3+1]=h.array[I*3+1],x[S*3+2]=h.array[I*3+2]}t.setAttribute("normal",new Ro(x,3))}let d=e.getAttribute("uv");if(d){let x=new Float32Array(a*2);for(let S=0;S<a;S++){let I=i+S;x[S*2]=d.array[I*2],x[S*2+1]=d.array[I*2+1]}t.setAttribute("uv",new Ro(x,2))}if(e.index){let x=e.index,S=new Uint32Array(a);for(let I=0;I<a;I++)S[I]=x.array[i+I];t.setIndex(new Ro(S,1))}return t}l(tM,"extractBufferGeometryFromBatchedGeometry");function rD(r,t){let e=tM(r);if(!e||!r.mesh)return;r.mesh.deleteInstance(r.instanceIndex),r.mesh.optimize();let n=t.addGeometry(e);t.addInstance(n);let i=t.getGeometryIdAt(n),a=t.getGeometryRangeAt(i);return a&&r.batchedProps&&(r.batchedProps.range=a),e.dispose(),n}l(rD,"transferGeometryToNewBatchedMesh");var xW=80,Hh,um,zx,Hx,eM=class eM{constructor(t){b(this,"rendererState");b(this,"outlineOpacitiesDirty",!0);R(this,Hh,!0);R(this,um,-1/0);R(this,zx,new Map);R(this,Hx,new e_({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:A0}));this.rendererState=t}get geometries3DDirty(){return p(this,Hh)}set geometries3DDirty(t){V(this,Hh,t)}update(t,e=!0){let n;if(this.geometries3DDirty){for(let a of this.rendererState.geometry3DIdsInScene){let u=this.rendererState.geometry3DMap.get(a);if(u instanceof io&&u.components[0].outline&&!eD(u)&&u.userData.entities3D.size>0){let h=[];for(let w of u.userData.entities3D.values()){let E=this.rendererState.geometry3DMap.get(w);if(E instanceof Sr&&E.type==="geometry"&&E.components[3]&&E.components[3].dirty===!0&&E.components[0].material!=null){let T=E.components[0].geometry,D=!1;T||(T=tM(E.components[0]),D=!0),h.push([E.components[3],new r_(T,xW)]),D&&(T==null||T.dispose(),T=void 0)}}if(h.length===0)continue;let d=Ms(h.map(w=>w[1]),!1);if(d==null)continue;let m=d.getAttribute("position"),v=new Float32Array(m.count*4),x=new Ro(v,4);d.setAttribute("color",x);let S=0;for(let w=0;w<h.length;w++){let[E,T]=h[w],D=T.getAttribute("position").count;E.edgeColors=x,E.geometry=d,E.ranges={count:D,start:S},S+=D,T.dispose()}let I=new Vf(d,p(this,Hx));I.userData.isOutline=!0,u.add(I)}}V(this,Hh,!1),this.outlineOpacitiesDirty=!0}for(let a of this.rendererState.geometry3DIdsInScene){let u=this.rendererState.geometry3DMap.get(a);if(u instanceof Sr&&u.type==="geometry"&&u.components[3]&&u.components[3].dirty===!0&&u.components[0].material!=null&&u.parentObject3D instanceof io){let h=u.components[3].geometry;if(!h)continue;let d=u.components[3];if(!d)continue;let m=d.edgeColors;if(!m||!d.ranges)continue;let v=new rn(d.color);for(let I=0;I<d.ranges.count;I++){let w=d.ranges.start+I;m.setXYZ(w,v.r,v.g,v.b)}let x=u.components[1].height,S=u.components[1].altitude;jx(h,d.ranges,x,S),h.attributes.color.needsUpdate=!0,h.computeBoundingSphere(),d.dirty=!1}}let i=e?Ha(t,16,19,0,1):p(this,um);if((i!==p(this,um)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let a of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(a),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof Bn){let u=n.components[3];if(u&&u.edgeColors&&u.geometry){let h=u.visible,d=Math.min(i,h?n.components[1].opacity*yp(n):0);if(u.currentOpacity!==d){for(let m=0;m<u.ranges.count;m++){let v=u.ranges.start+m;u.edgeColors.setW(v,d)}u.geometry.attributes.color.needsUpdate=!0}}}}V(this,um,i),V(this,Hh,!1),this.outlineOpacitiesDirty=!1}destroy(){p(this,zx).clear()}};Hh=new WeakMap,um=new WeakMap,zx=new WeakMap,Hx=new WeakMap,l(eM,"OutlineInterpolationSystem");var Ux=eM;y();y();var rM=class rM extends ue{constructor(){super(...arguments);b(this,"userData",{entityId:""})}};l(rM,"EntityMesh");var Xx=rM,_W=Q.object({flipImageToFaceCamera:Q.boolean().optional(),url:Q.string()}),CW=Q.object({type:Q.enum(["Feature"]),properties:Q.object({width:Q.number(),height:Q.number(),rotation:Q.number().min(0).max(360).optional(),verticalOffset:Q.number().optional()}),geometry:nm});function nD(r,t,e){Q.union([Q.number(),Q.string()]).parse(r),CW.parse(t),_W.parse(e)}l(nD,"validateImage");var nM=class nM{constructor(t){b(this,"mesh",new oa);b(this,"imageMesh");b(this,"outline");b(this,"type","image");b(this,"instanceIndex",-1);b(this,"geometry");b(this,"material");b(this,"feature");b(this,"position",new zt);this.feature=t}get visible(){var t,e;return(e=(t=this.mesh)==null?void 0:t.visible)!=null?e:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};l(nM,"ImageComponent");var Yx=nM;y();function iM(r,t){return{x:r.x*Math.cos(t)-r.y*Math.sin(t),y:r.x*Math.sin(t)+r.y*Math.cos(t)}}l(iM,"rotatePoint");function SW(r,t){return r.map(e=>iM(e,t))}l(SW,"rotatePoints");function IW(r){let t=1/0,e=1/0,n=-1/0,i=-1/0;for(let a of r)t=Math.min(t,a.x),e=Math.min(e,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:t,minY:e,maxX:n,maxY:i}}l(IW,"getBounds");function MW(r,t){let e=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let a=t[n].x,u=t[n].y,h=t[i].x,d=t[i].y;u>r.y!=d>r.y&&r.x<(h-a)*(r.y-u)/(d-u)+a&&(e=!e)}return e}l(MW,"pointInPolygon");function iD(r,t,e,n,i){for(let a=0;a<i;a++)for(let u=0;u<n;u++)if(r[e+a][t+u]!==1)return!1;return!0}l(iD,"isValidRectangle");function TW(r,t,e){let n=r.maxX-r.minX,i=r.maxY-r.minY,a,u,h=U({},r);return n/i>t?(u=i/e,a=u*t,h.minX+=(n-a*e)/2):(a=n/e,u=a/t,h.minY+=(i-u*e)/2),{dx:a,dy:u,gridBounds:h}}l(TW,"calculateGridDimensions");function wW(r,t,e,n,i){let a=Array(e).fill(0).map(()=>Array(e).fill(0));for(let u=0;u<e;u++)for(let h=0;h<e;h++){let d={x:t.minX+h*n,y:t.minY+u*i};MW(d,r)&&(a[u][h]=1)}return a}l(wW,"createAndFillGrid");function PW(r,t){let e=Array(t).fill(0).map(()=>Array(t).fill(0));for(let n=0;n<t;n++)for(let i=0;i<t;i++)if(r[n][i]===1){let a=0;for(let u=1;u<=Math.min(t-i,t-n)&&iD(r,i,n,u,u);u++)a=u;e[n][i]=a}return e}l(PW,"calculateRectSizes");function EW(r,t,e,n,i,a){let u=0,h=0,d=0;for(let m=0;m<n;m++)for(let v=0;v<n;v++)if(r[m][v]===1){let x=Math.pow(t[m][v],2),S=e.minX+v*i,I=e.minY+m*a;u+=x,h+=S*x,d+=I*x}return{x:h/u,y:d/u}}l(EW,"calculatePolygonCenter");function OW(r,t,e,n,i,a,u){let h=-1/0,d=null,m=r.length,v=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let x=0;x<m;x++)for(let S=0;S<m;S++)if(r[x][S]===1)for(let I=1;I<=m-S;I++){let w=I;if(!(w>m-x)&&iD(r,S,x,I,w)){let E=I*w,T=t.minX+(S+I/2)*e,D=t.minY+(x+w/2)*n,A={x:T,y:D},B=Math.sqrt(Math.pow(A.x-i.x,2)+Math.pow(A.y-i.y,2))/v,j=E*(1-a)-B*a*E;j>h&&(h=j,d={center:A,width:I*e*u,height:I*n*u})}}return d}l(OW,"findBestRectangle");function oM(r,t,e,n={}){let{scaleFactor:i=.9,centerPriority:a=.5,resolution:u=100,minimumSizeRatio:h=.5}=n,d=Zw(e),m=r.width/r.height,v=SW(t,d),x=IW(v),{dx:S,dy:I,gridBounds:w}=TW(x,m,u),E=wW(v,w,u,S,I),T=PW(E,u),D=EW(E,T,w,u,S,I),A=OW(E,w,S,I,D,a,i);return!A||A.width<r.width*h||A.height<r.height*h?r:rt(U({},A),{center:iM(A.center,-d),rotation:e,polygonCenter:iM(D,-d)})}l(oM,"findLargestInteriorRectangle");var o1=Math.PI*2,DW=Math.PI/2,LW=Math.PI*1.5,AW=Uf(DW,2),NW=Uf(LW,2),kW=.01,oD=!1,sM=class sM extends le{constructor(e,n,i=0,a=0,u={}){super();b(this,"rendererState");b(this,"convertTo3DMapPosition");b(this,"initialBearing",0);b(this,"naturalBearing",0);b(this,"imagePlacementOptions");b(this,"imageLoadingCache",new Map);this.rendererState=e,this.convertTo3DMapPosition=n,this.initialBearing=i,this.naturalBearing=a,this.imagePlacementOptions=u}createImageMesh(e,n,i,a=0,u,h){var w,E,T;let d={width:i.width,height:i.height,center:this.convertTo3DMapPosition(u),rotation:(w=i.rotation)!=null?w:0},m=(E=this.imagePlacementOptions.mode)!=null?E:"default",v=(()=>{switch(m){case"fit-nearest-90":let D=(this.initialBearing-this.naturalBearing+360)%180;return D>=45&&D<=135?oM(d,h,d.rotation+90,this.imagePlacementOptions):d;case"fit-initial-bearing":return oM(d,h,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return d}})();if(oD&&v.polygonCenter){let D=new ue(new j0(1),new na({color:65280}));D.position.set(v.polygonCenter.x,v.polygonCenter.y,a),this.rendererState.entityScene.add(D)}let x=new na({transparent:!0,depthWrite:!1,side:jl}),S=new ra(v.width,v.height),I=new Xx(S);if(I.visible=!1,(T=this.getOrDownloadImage(n))==null||T.then(D=>{x.map=D,x.needsUpdate=!0,x.map.colorSpace=fp,I.visible=!0,this.publish("image-loaded")}),I.userData.entityId=e,I.material=x,oD){let D=new ue(new ra(i.width,i.height),new na({color:"gray"}));I.add(D);let A=new qw;I.add(A),A.scale.set(10,10,10)}return I.position.set(v.center.x,v.center.y,a+kW),I.rotation.z=(-Ie.degToRad(v.rotation)+o1)%o1,I}getOrDownloadImage(e){var n;if(this.imageLoadingCache.has(e))return(n=this.imageLoadingCache.get(e))==null?void 0:n.promise;{let i=new Promise(a=>{kc.getLoader().load(e,u=>{let h=this.imageLoadingCache.get(e);h&&!h.loaded&&(h.loaded=!0),a(u)})});return this.imageLoadingCache.set(e,{loaded:!1,promise:i}),i}}flipIfNeeded(e,n){if(e.imageMesh==null)return;let i=-n,a=e.imageMesh.rotation.z,u=Uf((a-i+o1)%o1,2);u>AW&&u<NW&&(e.imageMesh.rotation.z=(a+Math.PI)%o1)}update(e){var u,h,d,m,v;let n,i,a;for(let x of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(x),(n==null?void 0:n.type)==="image"){if(i=n.components[0],a=n.components[1],a.url&&i.imageMesh==null){let S=this.convertTo3DMapPosition(i.feature.geometry.coordinates),I={x:S.x,y:S.y};i.imageMesh=this.createImageMesh(n.id,a.url,i.feature.properties,i.feature.properties.verticalOffset,i.feature.geometry.coordinates,[I]),i.mesh.add(i.imageMesh),i.position.copy(i.imageMesh.position)}i.imageMesh&&a.flipImageToFaceCamera&&this.flipIfNeeded(i,e)}else if((n==null?void 0:n.type)==="geometry"){if(i=n.components[0],a=n.components[1],a.showImage&&((u=i.feature.properties)!=null&&u.image)&&i.imageMesh==null&&i.visible&&i.mesh!=null&&i.mesh.parent!=null&&((h=i.feature.properties)==null?void 0:h.image.position)!=null&&i.feature.geometry.coordinates!=null&&i.feature.geometry.coordinates.length>0){let S=i.feature.geometry.coordinates[0].map(w=>{let E=this.convertTo3DMapPosition(w);return{x:E.x,y:E.y}}),I=this.createImageMesh(x,(d=i.feature.properties)==null?void 0:d.image.path,(m=i.feature.properties)==null?void 0:m.image,a.height,(v=i.feature.properties)==null?void 0:v.image.position,S);i.mesh.parent.add(I),i.imageMesh=I}if(i.imageMesh){if(!i.visible)i.imageMesh.visible=!1;else if(a.showImage&&!i.imageMesh.visible)if(a.url){let S=this.imageLoadingCache.get(a.url);S&&S.loaded&&(i.imageMesh.visible=!0)}else i.imageMesh.visible=!0;else!a.showImage&&i.imageMesh.visible&&(i.imageMesh.visible=!1);a.flipImageToFaceCamera&&this.flipIfNeeded(i,e)}}}};l(sM,"ImageSystem");var qx=sM;y();var RW=250,Fc,aM=class aM extends le{constructor(e,n){super();b(this,"cameraDirty",!0);b(this,"focusablesDirty",!0);b(this,"state");b(this,"camera");b(this,"debugEl",null);b(this,"raycasters",[]);b(this,"collisions",new Map);b(this,"focusableEntities",new Set);b(this,"debugRaycasters",!1);R(this,Fc);b(this,"update",l((e=!1,n=Date.now())=>{this.focusablesDirty&&this.updateFocusableEntities(),!e&&(Date.now()-n>RW||(p(this,Fc)&&cancelAnimationFrame(p(this,Fc)),V(this,Fc,requestAnimationFrame(()=>{this.updateRaf()}))))},"update"));this.state=e,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let e=new ne(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new ne(e.x/1.2,e.y/1.2),i=new ne(e.x+(e.x-n.x),n.y),a=new ne(n.x,e.y+(e.y-n.y)),u=new ne(i.x,a.y),h=new ne(e.x,e.y/1.5),d=new ne(e.x,e.y+(e.y-h.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[e,h,d,n,i,a,u].map((m,v)=>{if(this.debugRaycasters){let E=document.createElement("div");E.style.position="absolute",E.style.top=m.y+"px",E.style.left=m.x+"px",E.style.width="10px",E.style.height="10px",E.style.backgroundColor="red",this.debugEl.append(E)}let x=m.x/this.state.canvasWidth*2-1,S=-(m.y/this.state.canvasHeight)*2+1,I=new ne(x,S),w=new Ua;return w.setFromCamera(I,this.camera),[w,I,v===0?10:v<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let e,n,i;for(let a of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(a),i!=null){if(i.type==="group-container"&&i.components[2]!==void 0&&i.components[2]instanceof vu){if(n=i.components[2],n.dirty===!0||n.focusMesh==null){n.focusMesh&&Jr(n.focusMesh);let u=new In;u.setFromObject(i);let h=u.max.x-u.min.x,d=u.max.y-u.min.y,m=u.max.z-u.min.z;if(!isFinite(h)||!isFinite(d)||!isFinite(m)||isNaN(h)||isNaN(d)||isNaN(m)||h<=0||d<=0||m<=0)continue;let v=new Fo(h,d,m),x={transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters};if(this.debugRaycasters){let w=["red","green","blue","yellow","purple","orange","pink","brown","gray","black"];x.color=w[Math.floor(Math.random()*w.length)]}let S=new On(x),I=new ue(v,S);I.position.set((u.min.x+u.max.x)/2,(u.min.y+u.max.y)/2,0),I.userData={entityId:i.userData.entityId},n.focusMesh=I,i.add(I),i.components[2].dirty=!1}this.focusableEntities.add(n.focusMesh)}else if(i.type==="geometry"&&i.components[4]&&i.components[4]instanceof vu&&(e=i.components[0],n=i.components[4],e instanceof Bn&&e.geometry!=null&&(n.dirty===!0||n.focusMesh==null))){if(n.focusMesh==null){let u=new ue(e.geometry);u.userData={entityId:i.id},n.focusMesh=u}this.focusableEntities.add(n.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.cameraDirty&&this.raycast()}raycast(){this.collisions.clear();for(let[n,i]of this.raycasters)n.setFromCamera(i,this.camera);for(let[n,i,a]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(h=>{var d;if((h==null?void 0:h.object)!=null&&"isMesh"in h.object&&(h!=null&&h.object.isMesh)){let m=h.object.userData.entityId,v=(d=this.collisions.get(m))!=null?d:0;this.collisions.set(m,v+a)}});let e=Array.from(this.collisions,([n,i])=>({entityId:n,weight:i})).sort((n,i)=>i.weight-n.weight).map(({entityId:n})=>n);this.publish("geometry-in-focus",e),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){p(this,Fc)&&cancelAnimationFrame(p(this,Fc)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Fc=new WeakMap,l(aM,"GeometryInFocusSystem");var Wx=aM;y();var sD=20,FW=5e3,Bs,s1,a1,Bc,Xh,Yh,$x,l1,lM=class lM{constructor(t){b(this,"dirty",!0);b(this,"map");b(this,"stylesheetId","");b(this,"userHiddenLayers",new Set);b(this,"hiddenLayersInStyle",new Set);b(this,"centerPoint");b(this,"bbox");b(this,"polygons");R(this,Bs,null);R(this,s1,l(()=>{p(this,Bs)&&(clearTimeout(p(this,Bs)),V(this,Bs,null),this.dirty=!1)},"#stopTrying"));R(this,a1,l(()=>{p(this,Bs)&&(clearTimeout(p(this,Bs)),V(this,Bs,null)),V(this,Bs,setTimeout(()=>{p(this,s1).call(this)},FW))},"#startTrying"));b(this,"handleRender",l(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(p(this,Bc)&&(p(this,$x).call(this),V(this,Bc,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),e=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(e.length>0){for(let n of e)this.expr.push(["!=",["id"],n.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(n=>{this.map.setFilter(n,["all",...this.expr])}),this.expr=[],V(this,Bc,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){V(this,Bc,!0);for(let e=0;e<t.length;e+=sD){let n=t.slice(e,e+sD);p(this,Xh).push(()=>{for(let i of n)if(i.geometry!=null&&"coordinates"in i.geometry){if(this.polygons==null)return;let a;if(i.geometry.type==="Polygon"?a=zr(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(a=ia(i.geometry.coordinates)),!a)continue;for(let u of this.polygons)if(Eg(u,a)){this.expr.push(["!=",["id"],i.id]);continue}}})}p(this,l1).call(this)}}}},"handleRender"));b(this,"expr",[]);R(this,Bc,!1);R(this,Xh,[]);R(this,Yh,null);R(this,$x,l(()=>{p(this,Yh)&&(globalThis.cancelAnimationFrame(p(this,Yh)),V(this,Yh,null)),V(this,Xh,[])},"#cancelJobs"));R(this,l1,l(()=>{let t=p(this,Xh).pop();typeof t=="function"&&(t(),p(this,Xh).length>0&&V(this,Yh,globalThis.requestAnimationFrame(p(this,l1)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(e=>{this.map.setFilter(e,["all",...this.expr])}),this.dirty=!1),this.expr=[],V(this,Bc,!1),p(this,s1).call(this)},"#runJobs"));b(this,"handleStyleChange",l(t=>{var e,n;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let i=(n=(e=t==null?void 0:t.style)==null?void 0:e.stylesheet)==null?void 0:n.id;(!i||i!==this.stylesheetId)&&(this.stylesheetId=i,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,e){p(this,a1).call(this),this.centerPoint=t;for(let n of e)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,e,n){p(this,Bs)&&clearTimeout(p(this,Bs)),p(this,a1).call(this),this.bbox=t,this.polygons=e.reduce((i,a)=>{if(a.geometry.type==="Polygon"){let u=zr(a.geometry.coordinates);i.push(u)}else a.geometry.type==="MultiPolygon"&&i.push(...a.geometry.coordinates.map(u=>zr(u)));return i},[]);for(let i of n)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};Bs=new WeakMap,s1=new WeakMap,a1=new WeakMap,Bc=new WeakMap,Xh=new WeakMap,Yh=new WeakMap,$x=new WeakMap,l1=new WeakMap,l(lM,"OutdoorLayers");var Zx=lM;y();y();y();y();var Jx="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping y = mx + b where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // 'nearRadius' to 'farRadius' when the camera is at 'farZoom'.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";y();var uM="#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform bool dashed;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of pathRadius. Since we've\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered \"long\", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered \"short\", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path's length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping 'y = mx + b' where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the 'complete' value as it varies from 0.0 to 1.0.\n // Fragments that are at the 'complete' value or past it will be fully\n // transparent, while fragments that are at 'complete - completeLength'\n // or before it will be fully opaque. However, we adjust the 'complete'\n // value here so that it overshoots by one full 'completeLength', so that\n // the entire path will be opaque when the 'complete' value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at 'arrowMargin' instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // \"zooming off\" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as 'arrowAnimationTimer' goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a \"looping sawtooth\" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the \"looping\" design is preferred is because\n // it takes advantage of WebGL's 'GL_REPEAT' texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (dashed) {\n float dashLength = 0.1; // Adjust this value to change the dash length\n float gapLength = 0.1; // Adjust this value to change the gap length\n float totalLength = dashLength + gapLength;\n float numSegments = ceil(1.0 / totalLength);\n float adjustedTotalLength = 1.0 / numSegments;\n float adjustedDashLength = adjustedTotalLength * (dashLength / (dashLength + gapLength));\n float pattern = mod(fragPathDistance, adjustedTotalLength);\n opacity = pattern < adjustedDashLength ? 1.0 : 0.0;\n }\n\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from 'pulse'\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the 'pulse' value and whether it's covered by an arrow -- but if it's\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like \"holes\" when they're overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}\n";y();var aD="uniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nvarying float fragPathDistance;\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping 'y = mx + b' where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // this ensures that the stencil mask moves along with the path above it, to avoid the progress bar effect\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, opacity);\n}";var lD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==";var GW=new jf;function uD(r,t,e){let{nearRadius:n,farRadius:i,accentColor:a,completeFraction:u,isVertical:h,visibleThroughGeometry:d,dashed:m}=t,{color:v}=e,x=!0,S=0,I=1/0,w=t.displayArrowsOnPath,E=!0,T=w,D=n/2+VW,A=0;r[0].z+=D;for(let Nt=1;Nt<r.length;++Nt){r[Nt].z+=D;let At=r[Nt].x-r[Nt-1].x,Ct=r[Nt].z-r[Nt-1].z;if(h)A+=Math.sqrt(At*At+Ct*Ct);else{let _e=r[Nt].y-r[Nt-1].y;A+=Math.sqrt(At*At+_e*_e+Ct*Ct)}}if(!h){let Nt=r[0],At=r[r.length-1];r.push(At.clone().setZ(At.z-.01)),r.unshift(Nt.clone().setZ(Nt.z-.01))}let L=new Nw;T&&(L=GW.load(lD),L.colorSpace=fp);let B=new rn(v),j=new rn(a),W={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new ne(1,1)},cameraParameters:{type:"v2",value:new ne(S,0)},complete:{type:"f",value:x?0:1},color:{type:"c",value:B},pathLength:{type:"f",value:A},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:i},nearZoom:{type:"f",value:S},farZoom:{type:"f",value:I},pulseColor:{type:"c",value:j},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:h},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:L},displayArrowsOnPath:{type:"b",value:w},showPulse:{type:"b",value:E},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:m}},$=new jw(r);$.curveType="catmullrom",$.tension=0;let F=30,J=8,ot=F*r.length,K=new Uw($,ot,n,J,!1),H=new Float32Array(K.attributes.position.count);for(let Nt=r.length;Nt<H.length;Nt++)H[Nt]=Nt;K.setAttribute("vertexIndex",new Ro(H,1));let _t=new Float32Array(K.attributes.position.count),ct=new Ro(_t,1);for(let Nt=0;Nt<=ot;Nt++)for(let At=0;At<=J;++At)ct.setX(Nt*(J+1)+At,Nt/ot);K.setAttribute("pathDistance",ct);let ft=new Float32Array(K.attributes.normal.count*3),mt=new Ro(ft,3);for(let Nt=0;Nt<ot;Nt++){let At=K.tangents[Nt];for(let Ct=0;Ct<=J;++Ct)mt.setXYZ(Nt*(J+1)+Ct,At.x,At.y,At.z)}K.setAttribute("pathTangent",mt);let St=new Float32Array(K.attributes.normal.count*3),dt=new Ro(St,3);for(let Nt=0;Nt<ot;Nt++){let At=K.tangents[Nt];var xt,q,ee;h?(xt=At.x*At.y,q=-1+At.y*At.y,ee=At.z*At.y):(xt=-At.x*At.z,q=-At.y*At.z,ee=1-At.z*At.z);let Ct=Math.sqrt(xt*xt+q*q+ee*ee);Ct===0&&(Ct=1);let _e=xt/Ct,de=q/Ct,qr=ee/Ct;for(let me=0;me<=J;++me)dt.setXYZ(Nt*(J+1)+me,_e,de,qr)}K.setAttribute("pathNormal",dt);let Gt=new nc({uniforms:W,vertexShader:Jx,fragmentShader:uM});Gt.transparent=!0,Gt.alphaTest=.5,W.resolution.value.x=1,W.resolution.value.y=1,W.vertexes.value=H.length,W.arrowTexture.value.wrapS=Ga,W.arrowTexture.value.wrapT=Ga,W.arrowTexture.value.anisotropy=16;let Kt=new ue(K,Gt),It=Kt.clone(),ie=rt(U({},W),{opacityMultiplier:{type:"f",value:.25}});ie.complete.value=1,It.material=new nc({uniforms:ie,vertexShader:Jx,fragmentShader:uM}),It.material.transparent=!0,It.material.alphaTest=.5,It.material.depthWrite=!1,It.material.depthTest=!1,ie.resolution.value.x=1,ie.resolution.value.y=1,ie.vertexes.value=H.length,ie.arrowTexture.value.wrapS=Ga,ie.arrowTexture.value.wrapT=Ga,ie.arrowTexture.value.anisotropy=16,ie.complete.value=u,Kt.userData=It.userData=t.mesh.userData;let vr=t.mesh;if(!d){let Nt=new nc({uniforms:W,vertexShader:Jx,fragmentShader:aD}),At=new ue(K,Nt);At.name="stencil",At.material.colorWrite=!1,At.material.stencilWrite=!0,At.material.stencilRef=1,At.material.stencilFunc=Lw,At.material.stencilZPass=F0,At.material.stencilZFail=F0,At.material.stencilFail=F0,At.material.depthWrite=!1,At.material.depthTest=!1,At.userData=t.mesh.userData,vr.add(At),vr.add(It)}if(vr.add(Kt),h){let Nt=new In().setFromObject(Kt),At=new zt;Nt.getCenter(At),vr.children.forEach(Ct=>{Ct.geometry.center(),Ct.position.copy(At)})}d&&(Kt.material.stencilWrite=!0,Kt.material.stencilRef=1,Kt.material.stencilFunc=Dw,Kt.material.stencilZPass=R0,Kt.material.stencilZFail=R0,Kt.material.stencilFail=R0,Kt.material.needsUpdate=!0,Kt.layers.disableAll(),Kt.layers.enable(J0.ALWAYS_ON_TOP)),K.computeBoundingBox();let Qe=new zt;return K.boundingBox.getCenter(Qe),{mesh:vr,material:Gt,center:Qe}}l(uD,"buildPath");var VW=.15;var jW=.5,cM=class cM extends le{constructor(e,n,i,a){super();b(this,"rendererState");b(this,"altitudeDirty",!0);b(this,"convertTo3DMapPosition");b(this,"getParentContainer");b(this,"convertZoomLevelToAltitude");this.rendererState=e,this.convertTo3DMapPosition=n,this.getParentContainer=i,this.convertZoomLevelToAltitude=a}update(e,n,i,a=0){let u,h=!1;for(let d of this.rendererState.geometry3DIdsInScene)if(u=this.rendererState.geometry3DMap.get(d),u&&u.type==="path"&&u.components[0].type==="path"){let m=u.components[0],v=u.components[1],x=m.isVertical&&this.altitudeDirty;if(!(m instanceof Rc))continue;let S=[];if(m.dirty||x){if(m.mesh.parent!=null)for(let I=m.mesh.children.length-1;I>=0;I--)Jr(m.mesh.children[0]);if(m.feature.features.length===2&&m.feature.features[0].properties.parentId&&m.feature.features[1].properties.parentId){let I=m.feature.features[0],w=m.feature.features[m.feature.features.length-1],E,T,D=I.geometry.coordinates[2]||0,A=w.geometry.coordinates[2]||0;I.properties.parentId&&(E=this.getParentContainer(I.properties.parentId,!0),E!=null&&E.altitude!=null&&(D+=E.altitude,m.isVertical=!0)),w.properties.parentId&&(T=this.getParentContainer(w.properties.parentId,!0),T!=null&&T.altitude!=null&&(A+=T.altitude,m.isVertical=!0));let L=this.convertTo3DMapPosition(I.geometry.coordinates[1],I.geometry.coordinates[0],D),B=this.convertTo3DMapPosition(w.geometry.coordinates[1],w.geometry.coordinates[0],A);Math.abs(L.z-B.z)>jW&&E!=null&&E.visible&&T!=null&&T.visible&&(S=[L,B])}else{let I=m.feature.features;for(let w=0;w<I.length;w++)if(w===0||!xP(I[w].geometry.coordinates,I[w-1].geometry.coordinates)){let E=this.convertTo3DMapPosition(I[w].geometry.coordinates[1],I[w].geometry.coordinates[0],I[w].geometry.coordinates[2]||0);S.push(E)}}if(S.length>1){let{mesh:I,material:w,center:E}=uD(S,m,{color:v.color});m.mesh=I,m.material=w,m.position=E}m.dirty&&(m.nearZoomLevel!=null&&(m.nearZoomAltitude=this.convertZoomLevelToAltitude(m.nearZoomLevel)),m.farZoomLevel!=null&&(m.farZoomAltitude=this.convertZoomLevelToAltitude(m.farZoomLevel))),m.dirty=!1}v.dirty&&(m.mesh.children.forEach(I=>{I.name!=="stencil"&&(I.material.uniforms.color.value.set(v.color),I.material.visible=v.visible,I.material.needsUpdate=!0)}),m.mesh.position.z=v.altitude,v.dirty=!1),m.isVertical&&m.mesh.children.forEach(I=>{I.rotation.z=-a}),m.material&&(m.mesh.children.forEach(I=>{var E,T;let w=I.material.uniforms;if(I.name==="stencil"){m.materialDirty&&(w.complete.value=m.completeFraction);return}w.nearZoom.value=(E=m.nearZoomAltitude)!=null?E:e,w.farZoom.value=(T=m.farZoomAltitude)!=null?T:n,w.cameraParameters.value.x=i,m.materialDirty&&(w.nearRadius.value=m.nearRadius,w.displayArrowsOnPath.value=m.displayArrowsOnPath,w.farRadius.value=m.farRadius,w.pulseColor.value.set(m.accentColor),w.complete.value=m.completeFraction)}),m.displayArrowsOnPath&&m.animateArrowsOnPath&&(m.mesh.children.forEach(I=>{I.name!=="stencil"&&(I.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,I.material.needsUpdate=!0)}),h=!0),m.materialDirty=!1)}this.altitudeDirty=!1,h&&this.publish("animate:path")}};l(cM,"PathSystem");var u1=cM;y();var ti,cm,Cu,pM=class pM{constructor(t){b(this,"rendererState");b(this,"dirty",!1);R(this,ti);R(this,cm);R(this,Cu);this.rendererState=t}updateOne(t){if(t instanceof Sr&&t.components[0]instanceof Bn&&t.components[1]instanceof Ya&&t.parentObject3D instanceof io&&(V(this,ti,t.components[0]),V(this,Cu,t.components[1]),p(this,ti).detached&&p(this,ti).dirty&&p(this,ti).mesh!=null&&p(this,ti).material!=null&&p(this,ti).batchedProps!=null)){V(this,cm,t.parentObject3D),p(this,ti).visible=!1;let e=new rn(p(this,Cu).color),n=p(this,Cu).opacity*yp(t),i=new Fh({color:e,side:jl,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,p(this,ti).material.repeatYFactor),a=new Z0(1,p(this,ti).batchedProps.positionCount,0,i),u=rD(p(this,ti),a);if(u==null)return;a.userData={entities:{0:t.id},detached:!0},p(this,ti).instanceIndex=u,p(this,ti).material.setColor(p(this,ti).instanceIndex,e,p(this,Cu).topColor?new rn(p(this,Cu).topColor):e),p(this,ti).mesh=a,p(this,ti).material=i,p(this,cm).add(a),p(this,ti).dirty=!1}}update(){if(!this.dirty)return;let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){V(this,ti,void 0),V(this,cm,void 0),V(this,Cu,void 0)}};ti=new WeakMap,cm=new WeakMap,Cu=new WeakMap,l(pM,"MeshDetachmentSystem");var Kx=pM;y();y();function cD(r,t,e){var n;if((n=r.batchedProps)!=null&&n.range&&r.mesh){let i=t||1e-4,a=i/Math.max(e,1e-4);return jx(r.mesh.geometry,r.batchedProps.range,i,0),r.material&&(r.material.repeatYFactor=a),r.currentHeight=i,!0}return!1}l(cD,"updateHeight");function pD(r,t,e,n,i,a){return r.mesh&&r.instanceIndex!==-1?(r.mesh.getMatrixAt(r.instanceIndex,e),e.decompose(n,i,a),n.z=t,e.compose(n,i,a),r.mesh.setMatrixAt(r.instanceIndex,e),r.altitude=t,!0):!1}l(pD,"updateAltitude");var ya,bl,t2,e2,r2,n2,hM=class hM{constructor(t){b(this,"rendererState");b(this,"dirty",!1);R(this,ya);R(this,bl);R(this,t2,new ns);R(this,e2,new zt);R(this,r2,new dp);R(this,n2,new zt);this.rendererState=t}updateOne(t){var e;if(t instanceof Sr&&t.type==="geometry"&&((e=t.components[1])!=null&&e.dirty)&&(V(this,ya,t.components[0]),V(this,bl,t.components[1]),t.type==="geometry")){let n=!1;p(this,bl).height!==p(this,ya).currentHeight&&(n=cD(p(this,ya),p(this,bl).height,p(this,bl).initialHeight)),p(this,bl).altitude!==p(this,ya).altitude&&(n=pD(p(this,ya),p(this,bl).altitude,p(this,t2),p(this,e2),p(this,r2),p(this,n2))),n&&p(this,ya).mesh!=null&&p(this,ya).mesh.computeBoundingSphere()}}update(){let t;for(let e of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(e),this.updateOne(t);this.cleanup()}cleanup(){V(this,ya,void 0),V(this,bl,void 0)}};ya=new WeakMap,bl=new WeakMap,t2=new WeakMap,e2=new WeakMap,r2=new WeakMap,n2=new WeakMap,l(hM,"MeshModificationSystem");var Qx=hM;y();var UW={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},fM=class fM{constructor(t){b(this,"state",UW);b(this,"core");this.core=t}update(t){let e={};for(let[n,i]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=i,e[n]=i);this.handleUpdate(e)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};l(fM,"Debug");var i2=fM;y();var c1=9,zW=!1,hD=.1;function HW(r,t,e){for(let n=0;n<t;n++){let i=(e&16711680)>>16,a=(e&65280)>>8,u=e&255;r[n*3]=i/255,r[n*3+1]=a/255,r[n*3+2]=u/255}}l(HW,"fillArrayWithColor");var dM=class dM{constructor(t,e,n){b(this,"state");b(this,"renderer");b(this,"renderService");b(this,"pickingTexture");b(this,"pickingMaterial");b(this,"pixelBuffer");b(this,"width",0);b(this,"height",0);b(this,"scale",1/2);b(this,"color",1);b(this,"convertTo3DMapPosition");b(this,"destroyed",!1);b(this,"enabled",!1);b(this,"backgroundId",16777215);b(this,"resize",l(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new Rw(this.width,this.height,{format:k0,type:N0,internalFormat:"RGBA"})},"resize"));b(this,"shouldShowByXY",l((t,e,n)=>{if(this.pixelBuffer==null)return!1;let i=t+(this.height-e-1)*this.width,a=this.pixelBuffer[i*4],u=this.pixelBuffer[i*4+1],h=this.pixelBuffer[i*4+2],d=a<<16|u<<8|h;return d===n||d===this.backgroundId},"shouldShowByXY"));b(this,"activeOccluders",new Set);b(this,"update",l(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,e;for(let i of this.state.geometry3DIdsInScene){let a=this.state.geometry3DMap.get(i);if(a&&a instanceof Er&&a.userData.occluderFeature!=null&&a.userData.occluderId!=null&&(this.activeOccluders.add(a.userData.occluderId),a.userData.occluderDirty)){if(t=a.userData.occluderFeature,t.geometry.type==="Polygon"){let u=px(t,this.convertTo3DMapPosition,{color:"white",height:hD});e=this.createOccluderMesh(u,a.userData.occluderId),a.add(e)}else if(t.geometry.type==="MultiPolygon"){let u=hx(t,this.convertTo3DMapPosition,{color:"white",height:hD});e=this.createOccluderMesh(u,a.userData.occluderId),a==null||a.add(e)}a.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new rn(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(c1),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(c1),zW?this.renderService.enabledLayers.add(c1):this.renderService.enabledLayers.delete(c1),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let i of this.state.geometry2DIdsInScene){let a=this.state.geometry2DMap.get(i);if(a&&(a==null?void 0:a.occluderId)!=null&&this.activeOccluders.has(a==null?void 0:a.occluderId)){let u=a.components[0].projection,h=Math.floor(u.x*this.scale),d=Math.floor(u.y*this.scale),m=this.shouldShowByXY(h,d,a.occluderId);a.components[0].isOccluded=!m}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=e,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new nc({glslVersion:Aw,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,e){let n=t.attributes.position,i=new Float32Array(n.count*3);HW(i,n.count,e),t.setAttribute("color",new Ro(i,3))}createOccluderMesh(t,e){let n=new ue(t,this.pickingMaterial);return n.layers.set(c1),this.applyId(n.geometry,e),n.userData.occluderId=e,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};l(dM,"Occlusion2DSystem");var o2=dM;y();var mM=class mM{constructor(t){this.state=t;b(this,"dirty",!0)}update(){var t;if(this.dirty){for(let e of this.state.geometry3DIdsInScene){let n=this.state.geometry3DMap.get(e);if(n instanceof Sr&&n.type==="geometry"&&((t=n.components[0])==null?void 0:t.geometry)!=null){let i=n.components[0];i.geometry&&(i.geometry.dispose(),i.geometry=void 0)}}this.dirty=!1}}};l(mM,"GeometryDisposalSystem");var s2=mM;var fD=new Ua;var{DEFAULT_PITCH:xM,DEFAULT_BEARING:_M,DEFAULT_ZOOM_LEVEL:CM,DEFAULT_MIN_ZOOM_LEVEL:XW,DEFAULT_MAX_ZOOM_LEVEL:YW}=Fs,qW=Ie.radToDeg(.6435011087932844),wn,Cn,qh,p1,pm,Gc,Wh,hm,Yi,yM,it,Vr,va,Pn,xl,Oi,nt,h1,ei,jr,dD,mD,gD,Su,a2,f1,d1,m1,fm,l2,g1,y1,v1,dm,vM,Zh,b1,x1,Oo,Do,bM,mm,_1,SM=class SM extends le{constructor(e,n={}){var S,I,w,E,T,D,A,L,B,j,W,$,F,J,ot;super();R(this,Yi);b(this,"options");b(this,"container");b(this,"Debug");R(this,wn);R(this,Cn);R(this,qh);R(this,p1);R(this,pm);R(this,Gc);R(this,Wh);R(this,hm);b(this,"rendererDomElement");R(this,it,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,geometryGroupIdsToLoad:new Set,entityScene:new Er("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:$0,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,internalTweenGroup:new Cx,externalTweenGroup:new Cx,cameraObject:new t_,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});b(this,"camera");R(this,Vr);R(this,va);R(this,Pn);R(this,xl);R(this,Oi);R(this,nt,{});R(this,h1,window.matchMedia("screen and (min-resolution: 2dppx)"));b(this,"map");R(this,ei,l(()=>{p(this,nt).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));R(this,jr,l(()=>{p(this,nt).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));R(this,Su,"standalone");R(this,a2,l(()=>{p(this,nt).geometryDisposalSystem.dirty=!0,this.render()},"#setGeometryDisposalDirty"));R(this,f1,l(e=>Math.trunc(e*10)/10,"#round10"));R(this,d1,l(()=>{yt(this,Yi,yM).call(this,Xf()),p(this,nt).twoDDrawSystem.dirty=!0,p(this,fm).call(this,void 0,void 0,!0)},"#handlePixelRatioChange"));R(this,m1,l(()=>{p(this,fm).call(this)},"#handleWindowResizeWithEvent"));R(this,fm,l((e,n,i=!1)=>{let a=e!=null?e:this.rendererDomElement.clientWidth,u=n!=null?n:this.rendererDomElement.clientHeight;if((a===0||u===0)&&!i)return;p(this,it).canvasWidth=a,p(this,it).canvasHeight=u,yt(this,Yi,yM).call(this,Xf()),p(this,dm).call(this),yt(this,Yi,gD).call(this),p(this,nt).cameraSystem.resize(this.canvasWidth,this.canvasHeight),p(this,nt).cameraSystem.dirty=!0,p(this,nt).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),p(this,nt).htmlControlsSystem.resize(this.canvasWidth),p(this,nt).geometryInFocusSystem.resize(),p(this,nt).occlusion2DSystem.resize();let{top:h,left:d}=this.container.getBoundingClientRect();p(this,it).containerOffset=[h,d],this.publish("resize"),this.render()},"#handleWindowResize"));R(this,l2,l(()=>{this.renderSync()},"#renderFull"));R(this,g1,new zt);R(this,y1,l((e,n)=>{let i=this.mode==="standalone"?p(this,Cn):this.viewCamera;if(p(this,Cn).position.z+this.camera.elevation>n.z){p(this,g1).copy(n);let a=p(this,g1).project(i),u=(a.x+1)/2*this.canvasWidth-0/2,h=(-a.y+1)/2*this.canvasHeight-0/2,d=p(this,f1).call(this,u),m=p(this,f1).call(this,h);e.x=d,e.y=m}else e.x=-1e3,e.y=-1e3},"#project"));R(this,v1,l((e,n)=>{p(this,Oi).setBufferSize(e,n),p(this,Cn).aspect=e/n,p(this,Cn).updateProjectionMatrix(),p(this,Cn).updateMatrixWorld(!0),p(this,pm).x=e,p(this,pm).y=n},"#setBufferSize"));R(this,dm,l(()=>{var u;let e=p(this,it).canvasWidth=this.rendererDomElement.clientWidth,n=p(this,it).canvasHeight=this.rendererDomElement.clientHeight,i=Math.floor(e*this.resolutionScale),a=Math.floor(n*this.resolutionScale);p(this,v1).call(this,i,a),(u=this.map)==null||u.resize(),p(this,it).shouldMeasureCanvas=!1},"#measureCanvas"));b(this,"getParentContainer",l((e,n=!0)=>{if(!e)return n?p(this,it).entityScene:void 0;if(typeof e=="string"||typeof e=="number"){let i=p(this,it).geometry3DMap.get(e);return i instanceof Er?i:(tt.warn("Parent (".concat(typeof e=="object"?e.id:e,") is not a valid container, adding to scene")),n?p(this,it).entityScene:void 0)}else if(e.type==="group-container"){let i=p(this,it).geometry3DMap.get(e.id);if(i instanceof Er)return i}return n?p(this,it).entityScene:void 0},"getParentContainer"));b(this,"showCollisionBoxes",l(()=>{p(this,nt).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));b(this,"hideCollisionBoxes",l(()=>{p(this,nt).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));b(this,"projectScreenXYToCoordinate",l((e,n,i=!1)=>{var S,I;let a=p(this,it).containerOffset[0],u=p(this,it).containerOffset[1],h=(e-u)/p(this,it).canvasWidth*2-1,d=-((n-a)/p(this,it).canvasHeight)*2+1,m=new ne(h,d),v,x;if(i)fD.setFromCamera(m,p(this,Cn)),v=(S=fD.intersectObject(p(this,Gc),!1)[0])==null?void 0:S.point;else{let w=p(this,nt).interactionSystem.getThreeDIntersectsFromXY(m);v=(I=w==null?void 0:w[0])==null?void 0:I.point,x=p(this,nt).interactionSystem.getGroupContainerIntersectsFromXY(m)}if(v)return{coordinate:this.convert3DMapPositionToCoordinate(v),groupContainers:x}},"projectScreenXYToCoordinate"));b(this,"projectCoordinateToScreenXY",l(e=>{let n=this.convertTo3DMapPosition(e[1],e[0],e[2]||0),i=new ne;return p(this,y1).call(this,i,n),{x:i.x,y:i.y}},"projectCoordinateToScreenXY"));b(this,"convert3DMapPositionToCoordinate",l(e=>{var a,u,h,d;let{lat:n,lon:i}=K0((u=(a=p(this,it).center)==null?void 0:a[1])!=null?u:0,(d=(h=p(this,it).center)==null?void 0:h[0])!=null?d:0,e.x,e.y);return[i,n,e.z]},"convert3DMapPositionToCoordinate"));b(this,"setBackgroundColor",l((e,n)=>{p(this,Oi).setBackgroundColor(e,n)},"setBackgroundColor"));b(this,"getMetresPerPixel",l(()=>{let e=this.container.clientWidth,n=this.container.clientHeight/2,i=this.projectScreenXYToCoordinate(0,n,!0),a=this.projectScreenXYToCoordinate(e,n,!0);return i==null||a==null?void 0:H0(i.coordinate,a.coordinate)/e},"getMetresPerPixel"));b(this,"hideOutdoorLayersUnderPoint",l((e,n)=>{!this.map||(n==null?void 0:n.length)===0||(p(this,nt).outdoorLayersSystem.hideLayersUnderPoint(e,n),this.render())},"hideOutdoorLayersUnderPoint"));b(this,"hideOutdoorLayersIntersectingPolygons",l((e,n,i)=>{p(this,nt).outdoorLayersSystem.hideLayersIntersectingPolygons(e,n,i),this.render()},"hideOutdoorLayersIntersectingPolygons"));R(this,Zh,new Vw);R(this,b1,new ns);R(this,x1,l(e=>{var n;tt.error("Render failed: ",e,(n=e.stack)!=null?n:"No stack trace available"),this.publish("render-error",{error:e})},"#onRenderError"));b(this,"render",l(()=>{var e;if(((e=p(this,nt))==null?void 0:e.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return p(this,nt).renderSystem.update().catch(p(this,x1))},"render"));b(this,"renderSync",l(()=>p(this,nt).renderSystem.update(!0).catch(p(this,x1)),"renderSync"));R(this,Oo,fg(()=>{this.publish("user-interaction-start",void 0)},0,!0));R(this,Do,fg(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));b(this,"on",l((e,n)=>{super.on(e,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(e)&&this.mode==="standalone"&&P.env.NODE_ENV!=="test"&&(tt.warn('"'.concat(e,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(e))},"on"));b(this,"off",l((e,n)=>{super.off(e,n)},"off"));b(this,"getCursor",l(()=>p(this,nt).interactionSystem.getCursor(),"getCursor"));b(this,"destroy",l(()=>{var e;p(this,nt)&&(p(this,nt).cameraSystem.off("user-dolly-start",p(this,Oo)),p(this,nt).cameraSystem.off("user-pan-start",p(this,Oo)),p(this,nt).cameraSystem.off("user-rotate-start",p(this,Oo)),p(this,nt).cameraSystem.off("user-zoom-start",p(this,Oo)),p(this,nt).cameraSystem.off("user-tilt-start",p(this,Oo)),p(this,nt).cameraSystem.off("user-pedestal-start",p(this,Oo)),p(this,nt).cameraSystem.off("user-dolly-end",p(this,Do)),p(this,nt).cameraSystem.off("user-pan-end",p(this,Do)),p(this,nt).cameraSystem.off("user-rotate-end",p(this,Do)),p(this,nt).cameraSystem.off("user-zoom-end",p(this,Do)),p(this,nt).cameraSystem.off("user-tilt-end",p(this,Do)),p(this,nt).cameraSystem.off("user-pedestal-end",p(this,Do)),p(this,nt).renderSystem.off("measure-canvas",p(this,dm)),p(this,nt).meshOptimizationSystem.off("geometry-2d-added",this.render),p(this,nt).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),p(this,ei).call(this),p(this,jr).call(this),this.renderSync(),p(this,nt).renderSystem.destroy(),p(this,nt).cameraSystem.off("change",this.render),p(this,nt).pathSystem.off("animate:path",this.render),p(this,nt).cameraSystem.dispose(),p(this,nt).exporterSystem.destroy(),p(this,nt).outdoorLayersSystem.destroy(),p(this,nt).drawSystem.destroy(),window.removeEventListener("resize",p(this,m1),!1),p(this,h1).removeEventListener("change",p(this,d1)),p(this,Wh)&&p(this,Wh).disconnect(),this._subscribers={},p(this,Oi).destroy(),(e=p(this,wn))==null||e.traverse(n=>{Jr(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),V(this,wn,void 0),p(this,nt).htmlControlsSystem.destroy(),p(this,nt).collisionSystem.destroy(),p(this,nt).interactionSystem.destroy(),p(this,nt).domMutationSystem.destroy(),p(this,nt).geometryInFocusSystem.destroy(),V(this,nt,void 0),p(this,Su)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(p(this,xl)),this.container.removeChild(p(this,Vr)),V(this,Oi,void 0))},"destroy"));R(this,mm,new zt);R(this,_1,new zt);if(p(this,it).useStandaloneCamera=(S=n.useStandaloneCamera)!=null?S:!1,p(this,it).naturalBearing=(I=n.naturalBearing)!=null?I:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!e.clientWidth||!e.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(n.mode==="outdoors-interleaved"||n.mode==="outdoors-overlay")&&n.map&&(V(this,Su,n.mode),this.map=n.map),p(this,it).entityScene.addEventListener("childadded",()=>{p(this,jr).call(this),p(this,ei).call(this)}),p(this,it).entityScene.addEventListener("childremoved",()=>{p(this,jr).call(this),p(this,ei).call(this)}),p(this,it).geometry3DMap.set(p(this,it).entityScene.userData.entityId,p(this,it).entityScene),n.center&&(p(this,it).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=e,yt(this,Yi,dD).call(this),yt(this,Yi,mD).call(this),p(this,nt).htmlControlsSystem=new Gx(this.container),p(this,Su)!=="outdoors-overlay"&&p(this,nt).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),P.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),V(this,Oi,new db({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(w=n.gl)==null?void 0:w.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:l(K=>{var H;(H=n.onWebGLContextRestored)==null||H.call(n,K),p(this,ei).call(this),p(this,jr).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(E=n.backgroundAlpha)!=null?E:1})),V(this,wn,new ic),p(this,Su)!=="standalone"&&p(this,wn).add(_P()),p(this,wn).add(p(this,it).entityScene);let i=window.__THREE_DEVTOOLS__;P.env.NODE_ENV==="dev"&&typeof i<"u"&&(i.dispatchEvent(new CustomEvent("observe",{detail:p(this,wn)})),i.dispatchEvent(new CustomEvent("observe",{detail:p(this,Oi)}))),V(this,Cn,new t_(qW,this.aspect,50,1e5)),p(this,it).cameraObject=p(this,Cn),V(this,p1,new Bw),p(this,Cn).renderOrder=999;let a=new zl;a.add(p(this,Cn)),V(this,hm,new zl),p(this,hm).add(a),p(this,wn).add(p(this,hm)),p(this,Cn).updateProjectionMatrix(),p(this,Cn).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:l(()=>0,"getNorth"),georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=p(this,Oi).domElement(),V(this,pm,new ne);let u=new ra(1e6,1e6),h=new On({color:0,visible:!1});V(this,Gc,new ue(u,h)),p(this,Gc).name="worldPlane",p(this,wn).add(p(this,Gc)),(T=n.gl)!=null&&T.canvas||e.appendChild(this.rendererDomElement),window.addEventListener("resize",p(this,m1),!1),p(this,h1).addEventListener("change",p(this,d1)),typeof ResizeObserver=="function"&&((D=P.env)==null?void 0:D.NODE_ENV)!=="test"&&(V(this,Wh,new ResizeObserver(sP(K=>{p(this,fm).call(this,K[0].contentRect.width,K[0].contentRect.height)},50))),(A=p(this,Wh))==null||A.observe(e)),e.classList.add("mappedin-map"),this.rendererDomElement.style.width=(L=globalThis.MappedinDebug)!=null&&L.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(B=globalThis.MappedinDebug)!=null&&B.TEST_IOS?"1920px":"100%",P.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),p(this,it).canvasWidth=this.rendererDomElement.clientWidth,p(this,it).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let d=this.canvasWidth,m=this.canvasHeight;p(this,nt).watermarkSystem=new kx(p(this,Cn),p(this,it),n==null?void 0:n.watermark),p(this,nt).watermarkSystem.on("texture-loaded",this.render),p(this,it).shouldMeasureCanvas=!0,p(this,it).pixelRatio=this.resolutionScale,p(this,v1).call(this,Math.floor(d*this.resolutionScale),Math.floor(m*this.resolutionScale));let v=new U0(16777215,.3*Math.PI);v.position.set(-150,-150,350),p(this,wn).add(v);let x=new Hw(16777215,.741*Math.PI);p(this,wn).add(x),p(this,nt).cameraSystem=new sm(p(this,Cn),p(this,wn),p(this,Oi).renderer,p(this,it),{mode:this.mode,canvasHeight:m,canvasWidth:d}),p(this,nt).cameraSystem.on("user-dolly-start",p(this,Oo)),p(this,nt).cameraSystem.on("user-pan-start",p(this,Oo)),p(this,nt).cameraSystem.on("user-rotate-start",p(this,Oo)),p(this,nt).cameraSystem.on("user-zoom-start",p(this,Oo)),p(this,nt).cameraSystem.on("user-tilt-start",p(this,Oo)),p(this,nt).cameraSystem.on("user-pedestal-start",p(this,Oo)),p(this,nt).cameraSystem.on("user-dolly-end",p(this,Do)),p(this,nt).cameraSystem.on("user-pan-end",p(this,Do)),p(this,nt).cameraSystem.on("user-rotate-end",p(this,Do)),p(this,nt).cameraSystem.on("user-zoom-end",p(this,Do)),p(this,nt).cameraSystem.on("user-tilt-end",p(this,Do)),p(this,nt).cameraSystem.on("user-pedestal-end",p(this,Do)),p(this,nt).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),p(this,nt).geometryInFocusSystem&&(p(this,nt).geometryInFocusSystem.cameraDirty=!0),this.render()}),p(this,nt).pathSystem=new u1(p(this,it),this.convertTo3DMapPosition,this.getParentContainer,p(this,nt).cameraSystem.convertZoomLevelToAltitude),p(this,nt).pathSystem.on("animate:path",this.render),p(this,nt).panBoundsSystem=new Bx(p(this,it),p(this,nt).cameraSystem),p(this,nt).panBoundsSystem.on("update",()=>{let{panBounds:K,fov:H,convertAltitudeToZoomLevel:_t}=p(this,nt).cameraSystem;if(p(this,nt).panBoundsSystem.autoMinZoomLevel){if(K.radius<=0)return;let ct=Math.min(p(this,it).canvasWidth/p(this,it).canvasHeight,1),ft=H*Math.PI/180*ct,mt=Math.tan(ft/2),{radius:St,center:dt}=p(this,nt).cameraSystem.panBounds,xt=St/mt,q=this.getThreeCamera().getWorldPosition(new zt),ee=dt.distanceTo(q),Gt=Math.abs(q.z-dt.z),Kt=xt*Gt/ee,It=_t(Kt);bP(It,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(It)}this.publish("pan-bounds-change",p(this,nt).cameraSystem.panBounds)}),this.camera=new Nx(this,p(this,nt),p(this,it)),this.camera.setZoomLevel((j=n.zoomLevel)!=null?j:CM),this.camera.setBearing((W=n.bearing)!=null?W:_M),this.camera.setPitch(($=n.pitch)!=null?$:xM),this.camera.setMaxZoomLevel(YW),this.camera.setMinZoomLevel(XW),p(this,nt).domVisiblitySystem=new mx(p(this,it),p(this,xl)),p(this,nt).domMutationSystem=new Ax(p(this,it),p(this,xl)),p(this,nt).domMutationSystem.on("dimensions-update",()=>{p(this,nt).collisionSystem.collidersDirty=!0,this.render()}),p(this,nt).domDrawSystem=new Dx(p(this,it)),p(this,nt).collisionSystem=new yb(p(this,va),p(this,it),((F=n.useCollisionWorker)!=null?F:!0)&&((J=n.useWorkers)!=null?J:!0)),p(this,nt).twoDDrawSystem=new yx(p(this,it),p(this,Pn),n.transformImageRequest),p(this,nt).twoDDrawSystem.on("img:loaded",this.render),p(this,nt).interactionSystem=new dy(this.rendererDomElement,p(this,it),p(this,Cn),p(this,Gc),p(this,nt).cameraSystem.isUserInteracting),p(this,nt).interactionSystem.on("doubletap-with-onefinger",K=>{var H;this.camera.animateTo({center:(H=this.projectScreenXYToCoordinate(K.clientX,K.clientY))==null?void 0:H.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:l_,easing:"ease-out"})}),p(this,nt).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:l_,easing:"ease-out"})}),p(this,nt).interactionSystem.on("hover",this.render),p(this,nt).interactionSystem.on("click",K=>{var _t,ct,ft,mt,St,dt,xt,q,ee,Gt,Kt,It;if(((_t=K.entity2D)==null?void 0:_t.id)==="watermark"&&typeof p(this,nt).watermarkSystem.options.onClick=="function"&&p(this,nt).watermarkSystem.options.interactive){p(this,nt).watermarkSystem.options.onClick();return}let H=K.entity3D?[(ct=K.entity3D)==null?void 0:ct.id]:[];(St=(mt=(ft=K.entity3D)==null?void 0:ft.parentObject3D)==null?void 0:mt.userData)!=null&&St.entityId&&H.push((q=(xt=(dt=K.entity3D)==null?void 0:dt.parentObject3D)==null?void 0:xt.userData)==null?void 0:q.entityId),this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(K.position),geometry:H,paths:((ee=K.entity3D)==null?void 0:ee.components[0])instanceof Rc?[K.entity3D.id]:[],markers:((Gt=K.entity2D)==null?void 0:Gt.components[0])instanceof fl?[K.entity2D.id]:[],models:((Kt=K.entity3D)==null?void 0:Kt.components[0])instanceof Ac?[K.entity3D.id]:[],labels:((It=K.entity2D)==null?void 0:It.components[0])instanceof dl?[K.entity2D.id]:[],containers:Array.isArray(K.groupContainers)?K.groupContainers.map(ie=>ie.userData.entityId):[],pointerEvent:K.pointerEvent})}),p(this,nt).interactionSystem.on("hover",K=>{var H,_t,ct,ft,mt,St;K.position&&((H=K.entity2D)==null?void 0:H.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(K.position),geometry:K.entity3D?[(_t=K.entity3D)==null?void 0:_t.id]:[],paths:((ct=K.entity3D)==null?void 0:ct.components[0])instanceof Rc?[K.entity3D.id]:[],markers:((ft=K.entity2D)==null?void 0:ft.components[0])instanceof fl?[K.entity2D.id]:[],models:((mt=K.entity3D)==null?void 0:mt.components[0])instanceof Ac?[K.entity3D.id]:[],labels:((St=K.entity2D)==null?void 0:St.components[0])instanceof dl?[K.entity2D.id]:[],containers:Array.isArray(K.groupContainers)?K.groupContainers.map(dt=>dt.userData.entityId):[]})}),p(this,nt).geometryInFocusSystem=new Wx(p(this,it),p(this,Cn)),p(this,nt).geometryInFocusSystem.on("geometry-in-focus",K=>{this.publish("geometry-in-focus",K)}),p(this,nt).twoDVisiblitySystem=new bx(p(this,it)),p(this,nt).drawSystem=new vx(p(this,it),this.convertTo3DMapPosition),p(this,nt).drawSystem.on("texture-loaded",this.render),p(this,nt).stackSystem=new _x(p(this,it)),p(this,nt).twoDProjectionSystem=new gx(p(this,it),p(this,y1)),p(this,nt).exporterSystem=new Ry(p(this,it)),p(this,nt).meshOptimizationSystem=new dx(p(this,it),this.convertTo3DMapPosition),p(this,nt).meshOptimizationSystem.on("model-loaded",this.render),p(this,nt).meshOptimizationSystem.on("geometry-2d-added",this.render),p(this,nt).meshOptimizationSystem.on("geometry-group-added",p(this,a2)),p(this,nt).meshDetachmentSystem=new Kx(p(this,it)),p(this,nt).meshModificationSystem=new Qx(p(this,it)),p(this,nt).geometryDisposalSystem=new s2(p(this,it)),p(this,nt).customGeometrySystem=new Vx(p(this,it),this.convertTo3DMapPosition),p(this,nt).outlineInterpolationSystem=new Ux(p(this,it)),p(this,nt).renderSystem=new xx(p(this,Oi),p(this,it),this.mode,p(this,wn),p(this,Cn),this.viewCamera,p(this,nt)),p(this,nt).imageSystem=new qx(p(this,it),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),p(this,nt).text3DSystem=new $b(p(this,it),this.convertTo3DMapPosition,(ot=n.useWorkers)!=null?ot:!0),p(this,nt).text3DSystem.on("render",this.render),p(this,nt).imageSystem.on("image-loaded",this.render),p(this,nt).renderSystem.on("pre-render",()=>this.publish("pre-render")),p(this,nt).renderSystem.on("post-render",()=>this.publish("post-render")),p(this,nt).renderSystem.on("measure-canvas",p(this,dm)),p(this,nt).outdoorLayersSystem=new Zx(this.map),p(this,nt).occlusion2DSystem=new o2(p(this,it),this.convertTo3DMapPosition,p(this,Oi)),n.occlusionEnabled&&p(this,nt).occlusion2DSystem.enable(),this.Debug=new i2(this),n.environment!==!1&&V(this,qh,yt(this,Yi,bM).call(this)),p(this,l2).call(this)}get viewCamera(){return p(this,p1)}get canvasWidth(){return p(this,it).canvasWidth}get canvasHeight(){return p(this,it).canvasHeight}get resolutionScale(){var e,n;return(n=(e=this.map)==null?void 0:e._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:Xf()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return p(this,Su)}addGroupContainer(e,n,i){if(!p(this,it).geometry3DMap.has(e)&&!p(this,it).geometry2DMap.has(e)){let a=new Er(e);a.addEventListener("childadded",()=>{p(this,jr).call(this),p(this,ei).call(this)}),a.addEventListener("childremoved",()=>{p(this,jr).call(this),p(this,ei).call(this)}),(n==null?void 0:n.visible)!==void 0&&(a.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&a.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&Ei(a,n.interactive,p(this,it)),(n==null?void 0:n.focusable)!==void 0&&tx(a,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(a.userData.preloadGeometry=n.preloadGeometry),p(this,it).geometry3DMap.set(e,a);let u=this.getParentContainer(i);u instanceof Er&&u.addEntity(a),p(this,jr).call(this),this.render()}else tt.error("Group container with ID '".concat(e,"' already exists. The group container cannot be added."));return{id:e,type:"group-container"}}addStackContainer(e,n,i){if(p(this,it).geometry3DMap.has(e))tt.error("Stack container with ID '".concat(e,"' already exists. The stack container cannot be added."));else{let a=new Er(e);a.addEventListener("childadded",()=>{p(this,jr).call(this),p(this,ei).call(this)}),a.addEventListener("childremoved",()=>{p(this,jr).call(this),p(this,ei).call(this)}),a.components[0]=new Lx,(n==null?void 0:n.visible)!==void 0&&(a.visible=n.visible),p(this,it).geometry3DMap.set(e,a);let u=this.getParentContainer(i);u instanceof Er&&u.addEntity(a)}return{id:e,type:"stack-container"}}addCustomGeometry(e,n,i,a,u){if(p(this,it).geometry3DMap.has(e))tt.error("Custom geometry with ID '".concat(e,"' already exists. The custom geometry cannot be added."));else{let h=new lm(n,i),d=new Sr(h,new Ya(a));(a==null?void 0:a.interactive)!==void 0&&Ei(d,a.interactive,p(this,it)),d.id=e,h.mesh.userData={entityId:e,type:"custom-geometry"},p(this,it).geometry3DMap.set(d.id,d);let m=this.getParentContainer(u);m instanceof Er&&m.addEntity(d),p(this,jr).call(this),this.render()}return{id:e,type:"custom-geometry"}}addGeometryGroup(e,n,i,a){var u,d;if(!p(this,it).geometry3DMap.has(e)&&!p(this,it).geometry2DMap.has(e)){let m=new io(e,new s_(i));m.addEventListener("childadded",()=>{p(this,jr).call(this),p(this,ei).call(this)}),m.addEventListener("childremoved",()=>{p(this,jr).call(this),p(this,ei).call(this)}),m.userData.dirty=!0,p(this,it).geometry3DMap.set(e,m);for(let x of n.features){if(x.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(x.geometry.type))continue;let S=(x==null?void 0:x.id)||((u=x==null?void 0:x.properties)==null?void 0:u.id)||Mr(),h=i||{color:nP},{visible:I,altitude:w}=h,E=ea(h,["visible","altitude"]),T=p(this,nt).meshOptimizationSystem.createEntityFromFeature(S,x,rt(U({},E),{outline:!0}));p(this,it).geometry3DMap.set(S,T),m.userData.entities3D.add(S)}m.setVisible((d=i==null?void 0:i.visible)!=null?d:!0),(i==null?void 0:i.altitude)!=null&&m.setAltitude(i.altitude);let v=this.getParentContainer(a);v instanceof Er&&v.addEntity(m),p(this,jr).call(this),this.render()}else tt.error("Geometry group with ID '".concat(e,"' already exists. The geometry group cannot be added."));return p(this,nt).outlineInterpolationSystem.geometries3DDirty=!0,{id:e,type:"geometry-group"}}addOccluder(e,n){let i=this.getParentContainer(n),a=p(this,nt).occlusion2DSystem.reserveOccluderId();return i==null||i.addOccluderFeature(e,a),a}addImage(e,n,i,a){try{nD(e,n,i)}catch(u){tt.error(u);return}if(!p(this,it).geometry3DMap.has(e)&&!p(this,it).geometry2DMap.has(e)){let u=new Yx(n),h=new Sr(u,new Ya(i));h.id=e||Mr(),u.mesh.userData={entityId:h.id,type:"path"},p(this,it).geometry3DMap.set(h.id,h);let d=this.getParentContainer(a);d instanceof Er&&d.addEntity(h),p(this,jr).call(this),this.render()}else tt.error("Image with ID '".concat(e,"' already exists. The image cannot be added."));return{id:e,type:"image"}}addModelGroup(e,n,i,{parent:a,onComplete:u}={}){var h,d;try{NO(e,n,i)}catch(m){tt.error(m);return}if(!p(this,it).geometry3DMap.has(e)&&!p(this,it).geometry2DMap.has(e)){let m=new io(e,new s_(rt(U({},i),{outline:!1})));m.addEventListener("childadded",()=>{p(this,jr).call(this),p(this,ei).call(this)}),m.addEventListener("childremoved",()=>{p(this,jr).call(this),p(this,ei).call(this)}),p(this,it).geometry3DMap.set(e,m),m.userData.dirty=!0,m.userData.modelURL=i.url;for(let x of n.features){let S=x.id||x.properties.id||Mr(),I=p(this,nt).meshOptimizationSystem.createModelFromFeature(S,x,i);(x.properties.interactive!==void 0||i.interactive!=null)&&Ei(I,(h=x.properties.interactive)!=null?h:i.interactive,p(this,it)),p(this,it).geometry3DMap.set(S,I),m.userData.entities3D.add(S)}let v=this.getParentContainer(a);v instanceof Er&&v.addEntity(m),p(this,jr).call(this),(d=this.render())==null||d.then(u)}else tt.error("Model group with ID '".concat(e,"' already exists. The model group cannot be added."));return{id:e,type:"geometry-group"}}addMarker2D(e,n,i,a){var h;let u=i==null?void 0:i.id;try{Q9(e,n,i||{})}catch(d){tt.error(d);return}if(u===void 0||!p(this,it).geometry2DMap.has(u)&&!p(this,it).geometry3DMap.has(u)){let d=yt(this,Yi,vM).call(this,e,new fl(n,i),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);d.id=u||String(d.id),u=d.id,(i==null?void 0:i.interactive)!=null&&i.interactive!=="pointer-events-auto"&&Ei(d,i==null?void 0:i.interactive,p(this,it));let m=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?p(this,it).geometry3DMap.get(i.attachTo):void 0;m instanceof Sr&&m.attach(d),(h=this.getParentContainer(a))==null||h.addEntity(d),this.render()}else tt.error("Marker2D with ID '".concat(u,"' already exists. The marker cannot be added."));return{id:u,type:"marker"}}addText3D(e,n,i,a){if(!p(this,it).geometry3DMap.has(e)&&!p(this,it).geometry2DMap.has(e)){let u=new Ec(rt(U({},n),{properties:rt(U({},n.properties),{id:e,content:n.properties.text})})),h=new Sr(u,new dg(i==null?void 0:i.appearance));h.id=e,u.mesh.userData.entityId=e.toString(),u.mesh.userData.type="text3d",p(this,it).geometry3DMap.set(e,h);let d=this.getParentContainer(a);d instanceof Er&&d.addEntity(h),p(this,jr).call(this),this.render()}else tt.error("Text3D with ID '".concat(e,"' already exists. The text3d cannot be added."));return{id:e,type:"text3d"}}labelText3D(e,n,i={}){var m,v;try{if(!n||!e)throw new Error("content and meshGeometryId are required");W8.parse(i)}catch(x){tt.error(x);return}let a=p(this,it).geometry3DMap.get(e);if((a==null?void 0:a.type)!=="geometry"){tt.error(".labelText3D failed: target incorrect");return}let u=a==null?void 0:a.components[0];if(!u.feature.properties.textArea)return;if(u.textEntityId){let x=p(this,it).geometry3DMap.get(u.textEntityId);if((x==null?void 0:x.type)!=="text3d"){tt.error(".labelText3D failed: existing text3d not found");return}return{id:x.id,type:x.type}}let h=new Ec({type:"Feature",geometry:{coordinates:(m=u.feature.properties.textArea)==null?void 0:m.position,type:"Point"},properties:{textArea:u.feature.properties.textArea,content:n,id:Mr()}});h.polygonEntityId=e;let d=new Sr(h,new dg(i==null?void 0:i.appearance));return u.textEntityId=d.id.toString(),h.mesh.userData.entityId=d.id.toString(),h.mesh.userData.type="text3d",p(this,it).geometry3DMap.set(d.id.toString(),d),i.parentId&&((v=this.getParentContainer(i.parentId))==null||v.addEntity(d)),this.render(),{id:d.id,type:"text3d"}}addLabel2D(e,n,i,a){var h;let u=i==null?void 0:i.id;try{U8(e,n,i||{})}catch(d){tt.error(d);return}if(u===void 0||!p(this,it).geometry2DMap.has(u)&&!p(this,it).geometry3DMap.has(u)){let d=yt(this,Yi,vM).call(this,e,new dl(n,i||{},p(this,it)),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);d.id=u||String(d.id),u=d.id,(i==null?void 0:i.interactive)!=null&&Ei(d,i==null?void 0:i.interactive,p(this,it));let m=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?p(this,it).geometry3DMap.get(i.attachTo):void 0;m instanceof Sr&&m.attach(d),(h=this.getParentContainer(a))==null||h.addEntity(d),p(this,ei).call(this),this.render()}else tt.error("Label2D with ID '".concat(u,"' already exists. The label cannot be added."));return{id:u,type:"label"}}addPath(e,n={},i){var d;try{BO(e,n||{})}catch(m){tt.error(m);return}let a=new Rc(e,pI(n)),u=new Sr(a,new Ya({color:(d=n==null?void 0:n.color)!=null?d:"#ff834c"}));u.id=(n==null?void 0:n.id)||Mr(),a.mesh.userData={entityId:u.id,type:"path"},p(this,it).geometry3DMap.set(u.id,u),(n==null?void 0:n.interactive)!=null&&Ei(u,n==null?void 0:n.interactive,p(this,it));let h=this.getParentContainer(i);return h instanceof Er&&h.addEntity(u),p(this,jr).call(this),this.render(),{id:u.id,type:"path"}}updateWatermark(e){p(this,nt).watermarkSystem.options=e,p(this,nt).watermarkSystem.dirty=!0,p(this,nt).collisionSystem.collidersDirty=!0,this.render()}remove(e){var i;let n;if(typeof e=="string"||typeof e=="number"?(n=p(this,it).geometry2DMap.get(e),n==null&&(n=p(this,it).geometry3DMap.get(e))):typeof e.id=="string"||typeof e.id=="number"?(n=p(this,it).geometry2DMap.get(e.id),n==null&&(n=p(this,it).geometry3DMap.get(e.id))):n=e,n!=null){if(n.type==="custom-geometry")p(this,it).geometry3DMap.delete(n.id),n.object3d&&Jr(n.object3d);else if(n.type==="group-container"){p(this,it).geometry3DMap.delete(n.userData.entityId);for(let u of n.childrenIds.values())this.remove(u),n.userData.entities2D.delete(u);let a=n.components[2];a&&a.focusMesh&&Jr(a.focusMesh),Jr(n)}else if(n.type==="geometry-group"){p(this,it).geometry3DMap.delete(n.userData.entityId);for(let a of n.userData.entities3D.values())this.remove(a),n.userData.entities3D.delete(a);Jr(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let a=n.components[0],u=n.components[4];if(n.entities2D.size>0){for(let h of n.entities2D.values())this.remove(h);n.removeAllEntities()}if(n.object3d&&(((i=n.parentObject3D)==null?void 0:i.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),Jr(n.object3d)),n.type==="geometry"){let h=n.components[3];h&&(h.visible=!1,h.dirty=!0)}u&&"focusMesh"in u&&u.focusMesh!=null&&Jr(u.focusMesh),"textMesh"in a&&a.textMesh!=null&&this.remove(a.textMesh.userData.entityId),p(this,it).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let a=n.attachedTo;if(a){let u=p(this,it).geometry3DMap.get(a);u instanceof Sr&&u.detach(n)}n.object3d&&Jr(n.object3d),n.type==="label"&&delete p(this,nt).twoDDrawSystem.textCache[n.id],p(this,it).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&Jr(n.object3d),p(this,it).geometry3DMap.delete(n.id);else if(n.type==="text3d"){Jr(n.object3d);let{batchedText:a,textMesh:u,polygonEntityId:h}=n.components[0];if(u&&(a&&a.removeText(u),Jr(u)),h){p(this,nt).text3DSystem.remove(h);let d=p(this,it).geometry3DMap.get(h);(d==null?void 0:d.type)==="geometry"&&(d.components[0].textMesh=void 0,d.components[0].textEntityId=void 0)}p(this,it).geometry3DMap.delete(n.id)}p(this,jr).call(this),p(this,ei).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return p(this,wn)}getThreeCamera(){return p(this,Cn)}async setEnvironment(e){if(p(this,wn))if(e==="basic"){p(this,qh)||V(this,qh,yt(this,Yi,bM).call(this));let n=await p(this,qh);p(this,wn).environment=n}else p(this,wn).environment=null}getEnvironment(){var e;return(e=p(this,wn))!=null&&e.environment?"basic":!1}getCurrentSceneGLTF(e){return p(this,nt).exporterSystem.getCurrentSceneGLTF(e)}getBoundingArea(e){(p(this,nt).renderSystem.threeDdirty||p(this,nt).renderSystem.twoDdirty)&&this.renderSync();let n=new In;if(e==null)n.setFromObject(p(this,it).entityScene);else{let i=Hf(p(this,it),e);if((i==null?void 0:i.type)==="geometry"&&(i==null?void 0:i.object3d)!=null){let a=i.components[0],u=a instanceof Bn?a.geometry:void 0;a.mesh instanceof G0&&u?(u.computeBoundingBox(),u.boundingBox&&n.union(u.boundingBox)):n.setFromObject(i.object3d)}else((i==null?void 0:i.type)==="geometry-group"||(i==null?void 0:i.type)==="group-container")&&(i==null?void 0:i.userData.entityId)!=null&&n.setFromObject(i)}if(Is(n))return lP(n).map(this.convert3DMapPositionToCoordinate)}hasState(e){return Hf(p(this,it),e)!=null}getState(e){var i,a,u,h,d,m,v,x,S,I;if(e==null)return{type:"map-view",hoverColor:p(this,it).hoverColor,text3dHoverColor:p(this,it).text3dHoverColor};let n=Hf(p(this,it),e);if((n==null?void 0:n.type)==="custom-geometry"){let w=n.components[0],E=n.components[1];return{id:n.id,type:"custom-geometry",visible:E.visible,altitude:E.altitude,parent:(i=n.parentObject3D)==null?void 0:i.userData.entityId,position:this.convert3DMapPositionToCoordinate(w.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let w=[];for(let T of n.userData.entities3D.values()){let D=this.getState(T);((D==null?void 0:D.type)==="geometry"||(D==null?void 0:D.type)==="model")&&w.push(D)}let E=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:E.opacity,color:E.color,initialColor:E.initialColor,height:E.height,altitude:n.altitude,topColor:E.topColor,outline:E.outline,shading:E.shading,texture:E.texture,topTexture:E.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(T=>p(this,it).geometry3DMap.get(T)).every(T=>T&&T.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(T=>this.getState(T)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(w=>this.getState(w)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let w=n.components[0],E=n.object3d.parent,T=E==null?void 0:E.userData.entityId;return{id:n.id,type:"label",text:w.text||"",parent:{id:T,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:w.enabled,visible:w.visible,initialRank:hy(w.initialRank),options:{rank:hy(w.rank),appearance:w.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let w=n.components[0],E=n.object3d.parent,T=E==null?void 0:E.userData.entityId;return{id:n.id,type:"marker",enabled:w.enabled,visible:w.visible,anchor:w.options.anchor,dynamicResize:w.options.dynamicResize,parent:{id:T,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),element:w.containerEl,initialRank:hy(w.initialRank),contentHTML:w.contentHtml,options:{rank:hy(w.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:w.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:w,hoverColor:E,initialColor:T,initialTopColor:D,topColor:A,altitude:L}=n.components[1],B=n.components[0],j=n.components[2],W=n.components[1],$=n.components[2],F=n.components[3],J=n.parentObject3D;return{id:n.id,type:"geometry",opacity:W.opacity,initialColor:T,color:w,focusable:j!=null&&j.focusMesh!=null,initialTopColor:D,topColor:A,hoverColor:E,hovered:!!($!=null&&$.hover),height:W.height,visible:W.visible,outline:F==null?void 0:F.visible,showImage:W.showImage,texture:W.texture,topTexture:W.topTexture,flipImageToFaceCamera:W.flipImageToFaceCamera,parent:{id:J==null?void 0:J.userData.entityId,type:J==null?void 0:J.type},altitude:L,position:this.convert3DMapPositionToCoordinate(B.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let w=n.components[0],E=n.components[1],T=n.components[2];return{id:n.id,type:"model",position:w.mesh?this.convert3DMapPositionToCoordinate((a=w.mesh)==null?void 0:a.getWorldPosition(new zt)):this.convert3DMapPositionToCoordinate(w.position),interactive:T!=null,material:E.material,parent:(u=n.parentObject3D)!=null&&u.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:E.visible,verticalOffset:E.verticalOffset,color:E.color,opacity:E.opacity,rotation:(h=E.rotation)!=null?h:Wf,scale:(d=E.scale)!=null?d:qf}}else if((n==null?void 0:n.type)==="path"){let w=n.components[0],E=n.components[2],T=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(w.position),visible:T.visible,interactive:E!=null,completeFraction:w.completeFraction,color:T.color,accentColor:w.accentColor,nearRadius:w.nearRadius,farRadius:w.farRadius,animateArrowsOnPath:w.animateArrowsOnPath,displayArrowsOnPath:w.displayArrowsOnPath,nearZoomLevel:w.nearZoomLevel,farZoomLevel:w.farZoomLevel,altitude:T.altitude}}else if((n==null?void 0:n.type)==="image"){let w=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(w.position),visible:n.components[1].visible,verticalOffset:(m=w.feature.properties.verticalOffset)!=null?m:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof Ec&&"textArea"in n.components[0].feature.properties){dO(n);let w=n.components[0],E=n.components[1],{textMesh:T}=w,D=(v=w.mesh)==null?void 0:v.parent;D instanceof Er&&((x=D.children.find(B=>B.type==="batchedtext"))==null||x.getWorldPosition(p(this,_1))),p(this,mm).set(0,0,0);let A=T?T.getWorldPosition(p(this,mm)):p(this,mm);return Object.assign({},Yf,E.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(A.add(p(this,_1))),visible:(S=w.visible)!=null?S:!1,content:(I=w.feature.properties.content)!=null?I:""})}else return}}setState(e,n){var a,u;if(typeof e=="object"&&n==null){"hoverColor"in e&&(hg(e.hoverColor)?p(this,it).hoverColor=(a=e.hoverColor)!=null?a:p(this,it).hoverColor:tt.warn('Failed to update global hover color. Invalid color "'.concat(e.hoverColor,'".'))),"text3dHoverColor"in e&&(p(this,it).text3dHoverColor=(u=e.text3dHoverColor)!=null?u:p(this,it).text3dHoverColor);return}let i=Hf(p(this,it),e);if(i!=null){if(i.type==="custom-geometry"){let h=p(this,it).geometry3DMap.get(i.id);if(h instanceof Sr&&h.components[0]instanceof lm){let d=n;ml(i,p(this,it),d.visible),tm(i,d.altitude),aI(i,d.position,this.convertTo3DMapPosition),lI(i,this.getParentContainer(d.parent,!1)),Ei(i,d.interactive,p(this,it))&&p(this,jr).call(this)}}else if(i.type==="path"){let h=n;Ei(i,h.interactive,p(this,it))&&p(this,jr).call(this),tm(i,h.altitude),fO(i,p(this,it),h)}else if(i.type==="model"){let h=n;Ei(i,h.interactive,p(this,it))&&p(this,jr).call(this),ml(i,p(this,it),h.visible),gO(i,h)}else if(i.type==="group-container"){let h=n;ml(i,p(this,it),h.visible)&&(p(this,nt).outlineInterpolationSystem.outlineOpacitiesDirty=!0,p(this,nt).pathSystem.altitudeDirty=!0,p(this,nt).geometryInFocusSystem.focusablesDirty=!0),tm(i,h.altitude)&&(p(this,nt).pathSystem.altitudeDirty=!0),Ei(i,h.interactive,p(this,it))&&p(this,jr).call(this),cI(i,p(this,it),h.opacity)&&(p(this,nt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),h.preloadGeometry&&i.userData.preloadGeometry!==!0&&(i.userData.preloadGeometry=!0,p(this,nt).outlineInterpolationSystem.geometries3DDirty=!0),tx(i,h.focusable)&&(p(this,nt).geometryInFocusSystem.focusablesDirty=!0)}else if(i.type==="geometry-group"){let h=n;ml(i,p(this,it),h.visible)&&(p(this,nt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Q8(i,p(this,it),h),Qb(i,p(this,it),h.outline),h.height!=null&&oI(i,p(this,it),h.height),tm(i,h.altitude),uO(i,h),tO(i,h.shading),cI(i,p(this,it),h.opacity)&&(p(this,nt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Ei(i,h.interactive,p(this,it))&&(p(this,jr).call(this),p(this,ei).call(this))}else if(i.type==="geometry"){if(i.components[0]instanceof Bn){let h=n;ml(i,p(this,it),h.visible)&&(p(this,nt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Qb(i,p(this,it),h.outline),eO(i,h),tx(i,h.focusable)&&(p(this,nt).geometryInFocusSystem.focusablesDirty=!0),hO(i,h.renderOrder)&&(p(this,nt).meshDetachmentSystem.dirty=!0),pO(i,h.opacity)&&(p(this,nt).meshDetachmentSystem.dirty=!0,p(this,nt).interactionSystem.dirty3D=!0,p(this,nt).outlineInterpolationSystem.outlineOpacitiesDirty=!0),uI(i,h.flipImageToFaceCamera),tm(i,h.altitude),h.height!=null&&oI(i,p(this,it),h.height),cO(i,h)&&(p(this,nt).meshDetachmentSystem.dirty=!0),sI(i,h),sO(i,h.hoverColor),Ei(i,h.interactive,p(this,it)),aO(i,h.hovered)}p(this,jr).call(this)}else if(i.type==="label"||i.type==="marker"){let h=n;oO(i,n,p(this,it)),nO(i,n,p(this,it))&&(p(this,ei).call(this),p(this,nt).domMutationSystem.dirty=!0),aI(i,h.position,this.convertTo3DMapPosition),lI(i,this.getParentContainer(h.parent,!1))&&(p(this,ei).call(this),p(this,nt).panBoundsSystem.dirty=!0),rO(i,h.enabled),ml(i,p(this,it),h.visible)}else if(i.type==="image"){let h=n;ml(i,p(this,it),h.visible),uI(i,h.flipImageToFaceCamera)}else if(i.type==="text3d"){let h=n;mO(i,p(this,it),h)}this.render()}}convertTo3DMapPosition(e,n,i=0,a){var d,m,v,x,S;if(Array.isArray(e))return this.convertTo3DMapPosition(e[1],e[0],(d=e[2])!=null?d:i,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:u,y:h}=Q0((v=(m=p(this,it).center)==null?void 0:m[1])!=null?v:0,(S=(x=p(this,it).center)==null?void 0:x[0])!=null?S:0,e,n);return a?(a.set(u,h,i),a):new zt(u,h,i)}get backgroundColor(){return typeof p(this,Oi).backgroundColor=="string"?p(this,Oi).backgroundColor:"#".concat(p(this,Oi).backgroundColor.getHexString())}get backgroundAlpha(){return p(this,Oi).backgroundAlpha}getThreeRenderer(){return p(this,Oi)}getCenter(e){let n=Array.isArray(e)?e:this.getBoundingArea(e);return n?vP(n):void 0}isInView(e){let n=Hf(p(this,it),e);if(p(this,b1).identity().multiply(p(this,Cn).projectionMatrix).multiply(p(this,Cn).matrixWorldInverse),p(this,Zh).setFromProjectionMatrix(p(this,b1)),n instanceof gp)return p(this,Zh).containsPoint(n.position);if(n instanceof Sr){let i=n==null?void 0:n.components[0];if(i instanceof lm||i instanceof Ac)return p(this,Zh).containsPoint(this.convertTo3DMapPosition(i.feature.geometry.coordinates));if(i instanceof Bn){let a=new In(this.convertTo3DMapPosition(i.featureBbox[1],i.featureBbox[0],0),this.convertTo3DMapPosition(i.featureBbox[3],i.featureBbox[2],0));return p(this,Zh).intersectsBox(a)}}return!1}getSystems(){return p(this,nt)}getInternalState(){return p(this,it)}getInternalTweenGroup(){return p(this,it).internalTweenGroup}getExternalTweenGroup(){return p(this,it).externalTweenGroup}computeMinZOffsetBetweenContainers(e,n,i){if(!e||!n)return-1;Hl(e,"group-container"),Hl(n,"group-container");let a=ev(e,this.getThreeCamera()),u=n.clone(),h=ev(u,this.getThreeCamera());if(!Is(a)||!Is(h))return-1;let d=0,m;i&&this.container.querySelectorAll(".debug-box").forEach(x=>x.remove());do{if(d>1e4)return-1;if(d+=20,u.position.z=d,u.updateMatrixWorld(),h.makeEmpty(),ev(u,p(this,Cn),h),m=a.intersectsBox(h),i){let v=f_(a,"blue",this.container),x=f_(h,m?"red":"green",this.container);v.classList.add("debug-box"),x.classList.add("debug-box")}}while(m);return d}};wn=new WeakMap,Cn=new WeakMap,qh=new WeakMap,p1=new WeakMap,pm=new WeakMap,Gc=new WeakMap,Wh=new WeakMap,hm=new WeakMap,Yi=new WeakSet,yM=l(function(e){var n;p(this,Su)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(e)),p(this,it).pixelRatio=this.resolutionScale},"#setResolutionScale"),it=new WeakMap,Vr=new WeakMap,va=new WeakMap,Pn=new WeakMap,xl=new WeakMap,Oi=new WeakMap,nt=new WeakMap,h1=new WeakMap,ei=new WeakMap,jr=new WeakMap,dD=l(function(){V(this,Vr,document.createElement("div")),p(this,Vr).classList.add("mappedin__smart-collision-engine__container"),V(this,va,document.createElement("canvas")),p(this,va).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(p(this,Vr)),V(this,Pn,document.createElement("canvas")),p(this,Pn).classList.add("mappedin__smart-collision-engine__container"),p(this,Pn).width=p(this,Vr).clientWidth*this.resolutionScale,p(this,Pn).height=p(this,Vr).clientHeight*this.resolutionScale,p(this,Pn).style.width=p(this,Vr).clientWidth+"px",p(this,Pn).style.height=p(this,Vr).clientHeight+"px",p(this,Vr).appendChild(p(this,va)),p(this,Vr).appendChild(p(this,Pn)),p(this,va).width=p(this,Vr).clientWidth,p(this,va).height=p(this,Vr).clientHeight,p(this,Pn).width=p(this,Vr).clientWidth*this.resolutionScale,p(this,Pn).height=p(this,Vr).clientHeight*this.resolutionScale,p(this,Pn).style.width=p(this,Vr).clientWidth+"px",p(this,Pn).style.height=p(this,Vr).clientHeight+"px"},"#renderEntity2DContainer"),mD=l(function(){V(this,xl,document.createElement("div")),p(this,xl).classList.add("mappedin-2d-entities"),Object.assign(p(this,xl).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(p(this,xl))},"#renderEntityDOMContainer"),gD=l(function(){p(this,Pn).width=p(this,Vr).clientWidth*this.resolutionScale,p(this,Pn).height=p(this,Vr).clientHeight*this.resolutionScale,p(this,Pn).style.width=p(this,Vr).clientWidth+"px",p(this,Pn).style.height=p(this,Vr).clientHeight+"px",p(this,va).width=p(this,Vr).clientWidth,p(this,va).height=p(this,Vr).clientHeight,p(this,Pn).width=p(this,Vr).clientWidth*this.resolutionScale,p(this,Pn).height=p(this,Vr).clientHeight*this.resolutionScale,p(this,Pn).style.width=p(this,Vr).clientWidth+"px",p(this,Pn).style.height=p(this,Vr).clientHeight+"px",p(this,nt).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Su=new WeakMap,a2=new WeakMap,f1=new WeakMap,d1=new WeakMap,m1=new WeakMap,fm=new WeakMap,l2=new WeakMap,g1=new WeakMap,y1=new WeakMap,v1=new WeakMap,dm=new WeakMap,vM=l(function(e,n,i,a){let u=new gp(n,this.convertTo3DMapPosition(e[1],e[0],e[2]||0),a);return u.occluderId=i!=null?i:p(this,nt).occlusion2DSystem.backgroundId,p(this,it).geometry2DMap.set(u.id,u),u},"#createEntity2D"),Zh=new WeakMap,b1=new WeakMap,x1=new WeakMap,Oo=new WeakMap,Do=new WeakMap,bM=l(async function(){return kc.load(J7).then(e=>{var n;return p(this,wn)&&((n=p(this,wn).environment)==null||n.dispose(),e.mapping=Ew,p(this,wn).environment=e,this.render()),e})},"#loadEnvMap"),mm=new WeakMap,_1=new WeakMap,l(SM,"Core");var gM=SM,C1=gM;y();function WW(r,t){ZW(r,t)(r.getScene(),t),$W(r,t),t.addFolder("Export").add({export:l(async()=>{let u=await r.getCurrentSceneGLTF({binary:!0}),h=new Blob([u],{type:"application/octet-stream"});var d=document.createElement("a");document.body.appendChild(d),d.style.display="none";let m=window.URL.createObjectURL(h);d.href=m,d.download="scene.glb",d.click(),window.URL.revokeObjectURL(m)},"export")},"export");let i=t.addFolder("Camera"),a={get bearing(){return r.camera.bearing},set bearing(u){r.camera.setBearing(u)},get pitch(){return r.camera.pitch},set pitch(u){r.camera.setPitch(u)},get zoomLevel(){return r.camera.zoomLevel},set zoomLevel(u){r.camera.setZoomLevel(u)}};i.add(a,"bearing",-359,359,1),i.add(a,"pitch",r.camera.minPitch,r.camera.maxPitch,1),i.add(a,"zoomLevel",r.camera.minZoomLevel,r.camera.maxZoomLevel,.1)}l(WW,"mountSceneGraphVisualizer");function ZW(r,t){let e=t;return l(function n(i,a){let u=a.addFolder("".concat([i.type]," ").concat(i.id.slice(0,16)));if(a.close(),i.type==="geometry"||i.type==="model"||i.type==="path"||i.type==="image"){let h={get height(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry"?d.height:0},set height(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry"&&r.setState(i,{height:d})},set flipImageToFaceCamera(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="image"&&r.setState(i,{flipImageToFaceCamera:d})},get flipImageToFaceCamera(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="image"?d.flipImageToFaceCamera:!1},set visible(d){let m=r.getState(i.id);((m==null?void 0:m.type)==="geometry"||(m==null?void 0:m.type)==="path"||(m==null?void 0:m.type)==="image")&&r.setState(i,{visible:d})},get visible(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry"||(d==null?void 0:d.type)==="path"||(d==null?void 0:d.type)==="image"?d.visible:!1},set outline(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry"&&r.setState(i,{outline:d})},get outline(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry"?d.outline:!1},get opacity(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry"?d.opacity:1},set opacity(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry"&&r.setState(m,{opacity:d})},get color(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry"&&d.color?Xt(d.color).toHexString():"#ffffff"},set color(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry"&&r.setState(m,{color:d})},set interactive(d){let m=r.getState(i.id);((m==null?void 0:m.type)==="geometry"||(m==null?void 0:m.type)==="model"||(m==null?void 0:m.type)==="path")&&(r.setState(i,{interactive:d}),e.controllersRecursive().forEach(v=>v.updateDisplay()))},get interactive(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry"||(d==null?void 0:d.type)==="model"||(d==null?void 0:d.type)==="path"?d.interactive:!1},get completeFraction(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="path"?d.completeFraction:1},set completeFraction(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="path"&&r.setState(m,{completeFraction:d})},focus:l(()=>{},"focus")};u.add(h,"focus").onChange(()=>{let d=r.getState(i.id);(d==null?void 0:d.type)==="model"||(d==null?void 0:d.type)==="path"||(d==null?void 0:d.type)==="image"?r.camera.focusOn([d.position]):(d==null?void 0:d.type)==="geometry"&&r.camera.focusOn(r.getBoundingArea(d))}),u.add(h,"visible"),i.type==="image"?u.add(h,"flipImageToFaceCamera"):(u.add(h,"interactive"),i.type==="path"&&u.add(h,"completeFraction",0,1,.1),i.type!=="model"&&(u.addColor(h,"color"),u.add(h,"outline"))),i.type==="geometry"&&(u.add(h,"height"),u.add(h,"opacity",0,1,.1))}else if(i.type==="marker"){let h={get interactive(){var m;let d=r.getState(i.id);return(d==null?void 0:d.type)==="marker"?(m=d.options)==null?void 0:m.interactive:!1},set interactive(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="marker"&&(r.setState(m,{options:{interactive:d}}),e.controllersRecursive().forEach(v=>v.updateDisplay()))},focus:l(()=>{},"focus")};u.add(h,"focus").onChange(()=>{let d=r.getState(i.id);(d==null?void 0:d.type)==="marker"&&r.camera.focusOn([d.position])}),u.add(h,"interactive")}else if(i.type==="label"){let h={get interactive(){var m;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(m=d.options)==null?void 0:m.interactive:!1},set interactive(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&(r.setState(m,{options:{interactive:d}}),e.controllersRecursive().forEach(v=>v.updateDisplay()))},get text(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?d.text:""},set text(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(m,{text:d})},get"Text Color"(){var m,v;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(v=(m=d.options.appearance)==null?void 0:m.text)==null?void 0:v.foregroundColor:"#000000"},set"Text Color"(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(i.id,{text:h.text,options:{appearance:{text:{foregroundColor:d}}}})},get"Text Size"(){var m,v;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(v=(m=d.options.appearance)==null?void 0:m.text)==null?void 0:v.size:10},set"Text Size"(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(m,{text:h.text,options:{appearance:{text:{size:d}}}})},get"Icon Size"(){var m,v;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(v=(m=d.options.appearance)==null?void 0:m.marker)==null?void 0:v.iconSize:10},set"Icon Size"(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(m,{text:h.text,options:{appearance:{marker:{iconSize:d}}}})},get"Active Foreground Color"(){var m,v,x;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(x=(v=(m=d.options.appearance)==null?void 0:m.marker)==null?void 0:v.foregroundColor)==null?void 0:x.active:"#000000"},set"Active Foreground Color"(d){var v,x;let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(m,{text:h.text,options:{appearance:{marker:{foregroundColor:rt(U({},(x=(v=m.options.appearance)==null?void 0:v.marker)==null?void 0:x.foregroundColor),{active:d})}}}})},get"Inactive Foreground Color"(){var m,v,x;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(x=(v=(m=d.options.appearance)==null?void 0:m.marker)==null?void 0:v.foregroundColor)==null?void 0:x.inactive:"#000000"},set"Inactive Foreground Color"(d){var v,x;let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(m,{text:h.text,options:{appearance:{marker:{foregroundColor:rt(U({},(x=(v=m.options.appearance)==null?void 0:v.marker)==null?void 0:x.foregroundColor),{inactive:d})}}}})},get"Active Background Color"(){var m,v,x;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(x=(v=(m=d.options.appearance)==null?void 0:m.marker)==null?void 0:v.backgroundColor)==null?void 0:x.active:"#000000"},set"Active Background Color"(d){var v,x;let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(m,{text:h.text,options:{appearance:{marker:{backgroundColor:rt(U({},(x=(v=m.options.appearance)==null?void 0:v.marker)==null?void 0:x.backgroundColor),{active:d})}}}})},get"Inactive Background Color"(){var m,v,x;let d=r.getState(i.id);return(d==null?void 0:d.type)==="label"?(x=(v=(m=d.options.appearance)==null?void 0:m.marker)==null?void 0:v.backgroundColor)==null?void 0:x.inactive:"#000000"},set"Inactive Background Color"(d){var v,x;let m=r.getState(i.id);(m==null?void 0:m.type)==="label"&&r.setState(m,{text:h.text,options:{appearance:{marker:{backgroundColor:rt(U({},(x=(v=m.options.appearance)==null?void 0:v.marker)==null?void 0:x.backgroundColor),{inactive:d})}}}})},focus:l(()=>{},"focus")};u.add(h,"focus").onChange(()=>{let d=r.getState(i.id);(d==null?void 0:d.type)==="label"&&r.camera.focusOn([d.position])}),u.add(h,"interactive"),u.add(h,"text"),u.add(h,"Text Size",10,50),u.add(h,"Icon Size",10,50),u.addColor(h,"Text Color"),u.addColor(h,"Active Background Color"),u.addColor(h,"Inactive Background Color"),u.addColor(h,"Active Foreground Color"),u.addColor(h,"Inactive Foreground Color")}else if(i.type==="geometry-group"){let h={get opacity(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"?d.opacity:1},set opacity(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&r.setState(i,{opacity:d})},set visible(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&r.setState(i,{visible:d})},get visible(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"?d.visible:!1},set outline(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&r.setState(i,{outline:d})},get outline(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"?d.outline:!1},set altitude(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&r.setState(i,{altitude:d})},get altitude(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"?d.altitude:0},set interactive(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&(r.setState(i,{interactive:d}),e.controllersRecursive().forEach(v=>v.updateDisplay()))},get interactive(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"?d.interactive:!1},get shadingStart(){var m,v;let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"&&(v=(m=d.shading)==null?void 0:m.start)!=null?v:0},set shadingStart(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&r.setState(m,{shading:{start:d}})},get shadingEnd(){var m,v;let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"&&(v=(m=d.shading)==null?void 0:m.end)!=null?v:0},set shadingEnd(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&r.setState(m,{shading:{end:d}})},get shadingIntensity(){var m,v;let d=r.getState(i.id);return(d==null?void 0:d.type)==="geometry-group"&&(v=(m=d.shading)==null?void 0:m.intensity)!=null?v:0},set shadingIntensity(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="geometry-group"&&r.setState(m,{shading:{intensity:d}})}};u.add(h,"visible"),u.add(h,"opacity",0,1,.1),u.add(h,"interactive"),u.add(h,"outline"),u.add(h,"altitude",0,100,1),u.add(h,"shadingStart",0,1,.1),u.add(h,"shadingEnd",0,1,.1),u.add(h,"shadingIntensity",0,1,.1)}else if(i.type==="group-container"){let h={set visible(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="group-container"&&r.setState(i,{visible:d})},get visible(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="group-container"?d.visible:!1},set interactive(d){let m=r.getState(i.id);(m==null?void 0:m.type)==="group-container"&&(r.setState(m,{interactive:d}),e.controllersRecursive().forEach(v=>v.updateDisplay()))},get interactive(){let d=r.getState(i.id);return(d==null?void 0:d.type)==="group-container"?d.interactive:!1}};u.add(h,"visible"),u.add(h,"interactive")}if(u.close(),i.children)for(let h of i.children.values())n(h,u)},"parseChild")}l(ZW,"createParseChild");function $W(r,t){let e=t.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};e.add(n,"padding",0,100,1),e.add(n,"scale",.5,1.5,.1),e.add(n,"color",["dark","light"]),e.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),e.add(n,"iconOnly"),e.onChange(()=>{r.updateWatermark(n)})}l($W,"createWatermarkChild");y();y();y();y();y();y();var IM=class IM{constructor({origin:t,destination:e,distance:n=0,angle:i=0,pathWeight:a=0,multiplicativeDistanceWeightScaling:u=!0}){b(this,"origin");b(this,"destination");b(this,"distance");b(this,"angle");b(this,"weight");if(this.origin=t,this.destination=e,this.distance=n,this.angle=i,this.weight=a||0,u?t.properties.floor===e.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===e.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};l(IM,"Edge");var $h=IM;y();y();y();y();function Iu([r,t],[e,n]){let i=t-n,a=r-e;return(Math.atan2(a,i)+Math.PI*3)%(Math.PI*2)}l(Iu,"getAngle");y();var JW=63710088e-1;function ps(r,t){let[e,n]=r.map(v=>v*Math.PI/180),[i,a]=t.map(v=>v*Math.PI/180),u=a-n,h=i-e,d=Math.sin(u/2)*Math.sin(u/2)+Math.cos(n)*Math.cos(a)*Math.sin(h/2)*Math.sin(h/2),m=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return JW*m}l(ps,"getDistance");y();y();function u2(r,t,e,n){let[i,a]=r,[u,h]=t,[d,m]=e,[v,x]=n;if(a===h&&i===u||m===x&&d===v)return null;let S=(v-d)*(h-a)-(x-m)*(u-i);if(S===0)return null;let I=((x-m)*(i-d)-(v-d)*(a-m))/S,w=((h-a)*(i-d)-(u-i)*(a-m))/S;if(I<0||I>1||w<0||w>1)return null;let E=a+I*(h-a);return[i+I*(u-i),E]}l(u2,"getLineIntersection");y();function MM(r,t,e,n){let i=ss(r,e/1e3,n),a=ss(t,e/1e3,n);return[i.geometry.coordinates,a.geometry.coordinates]}l(MM,"getOffsetLine");y();function TM(r){let t=r*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}l(TM,"radToDegNormalized");var yD=111e3;function wM(r,t,e=[],n=0){let i=!0,a=r.geometry.coordinates,u=t.geometry.coordinates,h=TM(Iu(a,u)-Math.PI/2),d=TM(Iu(a,u)+Math.PI/2),m=n/yD,v=n/(yD*Math.cos(a[1]*Math.PI/180)),x=Math.min(a[1],u[1])-m,S=Math.max(a[1],u[1])+m,I=Math.min(a[0],u[0])-v,w=Math.max(a[0],u[0])+v;for(let E of e)if(!(Math.max(E[0][1],E[1][1])<x||Math.min(E[0][1],E[1][1])>S||Math.max(E[0][0],E[1][0])<I||Math.min(E[0][0],E[1][0])>w)){if(n>0){let T=MM(a,u,n,h),D=MM(a,u,n,d);if(u2(T[0],T[1],E[0],E[1])||u2(D[0],D[1],E[0],E[1])){i=!1;return}}else if(u2(a,u,E[0],E[1])){i=!1;return}}return i}l(wM,"hasLineOfSight");var Jh,qi,PM,vD,bD,xD,_D,CD,SD,p2,EM=class EM{constructor({nodes:t,groupBy:e,multiplicativeDistanceWeightScaling:n}){R(this,qi);b(this,"edges",{});b(this,"nodesById");b(this,"nodesByGroup",new Map);R(this,Jh);R(this,p2,l((t,e)=>{let n=0;for(let i of e)(!i[p(this,Jh)]||i[p(this,Jh)]===t.properties[p(this,Jh)])&&cn(t.geometry.coordinates,i.geometry.geometry)&&(n+=Math.max(0,i.cost));return n},"#getZonalCost"));V(this,Jh,e);let{features:i}=t;this.nodesById=yt(this,qi,vD).call(this,i),yt(this,qi,bD).call(this),yt(this,qi,xD).call(this,i,e,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,e){return e.reduce((n,i)=>{let a=ps(t.geometry.coordinates,i.geometry.coordinates);return Math.min(n,a)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:e,excludedNodeIds:n,disabledConnectionNodeIds:i,zones:a,overrideEdgeWeights:u}){var S;let h=yt(this,qi,PM).call(this,t),d=yt(this,qi,PM).call(this,e);if(h.length===0||d.length===0)return[];let{frontier:m,cameFrom:v,costSoFar:x}=yt(this,qi,_D).call(this,h,d);for(;m.length>0;){let I=m.shift();if(!I)break;if(yt(this,qi,CD).call(this,I.origin,d))return yt(this,qi,SD).call(this,v,I.origin.properties.id);for(let w of this.edges[I.origin.properties.id]){let E=(S=u==null?void 0:u.get(w))!=null?S:w.weight;if(i!=null&&i.has(w.origin.properties.id)&&w.destination.properties.map!==w.origin.properties.map)continue;let T=x[I.origin.properties.id]+E+p(this,p2).call(this,w.destination,a);if(!(T===1/0||n!=null&&n.has(w.destination.properties.id))&&(x[w.destination.properties.id]==null||T<x[w.destination.properties.id])){let D=T+this.getShortestEuclideanDistance(w.destination,d);x[w.destination.properties.id]=T,v[w.destination.properties.id]=w,m.push({origin:w.destination,priority:D})}}m.sort((w,E)=>w.priority-E.priority)}return[]}};Jh=new WeakMap,qi=new WeakSet,PM=l(function(t){return t.map(e=>this.nodesById[e]).filter(Boolean)},"#filterValidNodes"),vD=l(function(t){return t.reduce((e,n)=>(e[n.properties.id]=n,e),{})},"#createNodesById"),bD=l(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:e})=>!!this.nodesById[e]))},"#removeInvalidNeighbors"),xD=l(function(t,e,n){t.forEach(i=>{let a=e==="default"?e:i.properties[e];this.nodesByGroup.has(a)||this.nodesByGroup.set(a,[]),this.nodesByGroup.get(a).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:u,weight:h})=>{let d=this.nodesById[u],m=ps(i.geometry.coordinates,d.geometry.coordinates),v=Iu(i.geometry.coordinates,d.geometry.coordinates);return new $h({origin:i,destination:d,pathWeight:h,distance:m,angle:v,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),_D=l(function(t,e){let n=[],i={},a={};return t.forEach(u=>{let h=this.getShortestEuclideanDistance(u,e);n.push({origin:u,priority:h}),i[u.properties.id]=null,a[u.properties.id]=0}),n.sort((u,h)=>u.priority-h.priority),{frontier:n,cameFrom:i,costSoFar:a}},"#initializeSearch"),CD=l(function(t,e){return e.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),SD=l(function(t,e){let n=[],i=t[e];for(;i;)n.push(i),i=t[i.origin.properties.id];return n.reverse()},"#reconstructPath"),p2=new WeakMap,l(EM,"NavigationGraph");var c2=EM;var ID=.4,OM=class OM{constructor({nodes:t,geojsonCollection:e,groupBy:n="default",multiplicativeDistanceWeightScaling:i}){b(this,"groupBy");b(this,"graph");b(this,"geometryEdgesByMapId",new Map);b(this,"generatePath",l(t=>{let{destination:e}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let a=0;a<t.length;a++){let{origin:u,destination:h}=t[a],d={id:u.properties.id,angle:t[a].angle,distance:t[a].distance,destination:h.properties.id,edges:this.graph.edges[u.properties.id]};this.groupBy!=="default"&&(d.groupBy=u.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[u.geometry.coordinates[0],u.geometry.coordinates[1]]},properties:d})}let i={id:e.properties.id,edges:this.graph.edges[e.properties.id]};return this.groupBy!=="default"&&(i.groupBy=e.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[e.geometry.coordinates[0],e.geometry.coordinates[1]]},properties:i}),n},"generatePath"));b(this,"hasLineOfSight",l((t,e,n,i=ID)=>wM({type:"Feature",properties:{id:"origin",neighbors:[]},geometry:{type:"Point",coordinates:t}},{type:"Feature",properties:{id:"destination",neighbors:[]},geometry:{type:"Point",coordinates:e}},this.geometryEdgesByMapId.get(n),i)===!0,"hasLineOfSight"));b(this,"getDistance",l((t,e)=>ps(t,e),"getDistance"));b(this,"getAngle",l((t,e)=>Iu(t,e),"getAngle"));this.groupBy=n,this.graph=new c2({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:i}),((e==null?void 0:e.features)||[]).forEach(u=>{let h=null;if(u.geometry.type==="LineString"?h=u.geometry.coordinates:u.geometry.type==="Polygon"&&(h=u.geometry.coordinates.flat()),h){let d=this.groupBy==="default"?this.groupBy:u.properties[this.groupBy];this.geometryEdgesByMapId.has(d)||this.geometryEdgesByMapId.set(d,[]),h.forEach((m,v)=>{this.geometryEdgesByMapId.get(d).push([m,h[v+1]||h[0]])})}})}getDirections({zones:t,originIds:e,destinationNodeIds:n,excludedNodeIds:i,disabledConnectionNodeIds:a,simplify:u,multiplicativeDistanceWeightScaling:h,overrideEdgeWeights:d}){var S,I;let m=(S=u==null?void 0:u.enabled)!=null?S:!0,v=t!=null?t:[],x=this.graph.aStar({originIds:e,destinationNodeIds:n,zones:v,excludedNodeIds:new Set(i),disabledConnectionNodeIds:new Set(a),overrideEdgeWeights:d});return x.length===0?{type:"FeatureCollection",features:[]}:(m&&(x=this.simplifyAllSteps(x,(I=u==null?void 0:u.bufferRadius)!=null?I:ID,h)),this.generatePath(x))}simplifyAllSteps(t,e,n){var m,v;let i=[],a=[t[0]];for(let x=1;x<t.length;x++)if(this.groupBy!=="default"&&t[x].origin.properties[this.groupBy]!==t[x-1].origin.properties[this.groupBy]){let S=t[x-1].origin.properties[this.groupBy],I=(m=this.geometryEdgesByMapId.get(S))!=null?m:[];i.push(...this.simplifySteps(a,I,e,n)),a=[t[x]]}else a.push(t[x]);let u=t[t.length-1],h=this.groupBy==="default"?this.groupBy:u.origin.properties[this.groupBy],d=(v=this.geometryEdgesByMapId.get(h))!=null?v:[];return i.push(...this.simplifySteps(a,d,e,n)),i}simplifySteps(t,e,n,i){if(t.length<3)return t;let a=[t[0]],u=1;for(let h=u+2;h<t.length;h++)if(t[u].origin.properties.preventSmoothing||!wM(t[u].origin,t[h].origin,e,n)){let d=h-1;a.push(new $h(rt(U({},t[u]),{destination:t[d].origin,distance:ps(t[u].origin.geometry.coordinates,t[d].origin.geometry.coordinates),angle:Iu(t[u].origin.geometry.coordinates,t[d].origin.geometry.coordinates)}))),u=d}return a.push(new $h(rt(U({},t[u]),{destination:t[t.length-1].origin,distance:ps(t[u].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:Iu(t[u].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:i})),t[t.length-1]),a}};l(OM,"Navigator");var gm=OM;var MD="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",KW="https://auth.mappedin.com/oauth2/token";var h2="";function DM(r){h2=r,aP(r)}l(DM,"setMaplibreWorkerUrl");var hh="";function LM(r){hh=r}l(LM,"setCollisionWorkerUrl");async function TD(r,t){var i,a,u,h,d,m,v,x;let e=(i=t==null?void 0:t.useWorkers)!=null?i:!0,n=rt(U({},t),{watermark:t==null?void 0:t.watermark,attribution:t==null?void 0:t.attribution,antialias:t==null?void 0:t.antialias,occlusionEnabled:t==null?void 0:t.occlusionEnabled,transformImageRequest:t==null?void 0:t.transformImageRequest,naturalBearing:(a=t==null?void 0:t.naturalBearing)!=null?a:0,imagePlacementOptions:t==null?void 0:t.imagePlacementOptions,onWebGLContextCreationError:t==null?void 0:t.onWebGLContextCreationError,onWebGLContextLost:t==null?void 0:t.onWebGLContextLost,onWebGLContextRestored:t==null?void 0:t.onWebGLContextRestored,onWebGLRendererError:t==null?void 0:t.onWebGLRendererError,useStandaloneCamera:(u=t==null?void 0:t.useStandaloneCamera)!=null?u:!1,useCollisionWorker:(h=t==null?void 0:t.useCollisionWorker)!=null?h:!0,useWorkers:e});if(e===!0&&((d=t==null?void 0:t.outdoorView)!=null&&d.enabled)){let{Map:S,MercatorCoordinate:I}=await import("./outdoor-context-v4-FKKIRNTV.js"),w=t.outdoorView.headers;w==null&&(w=await gP(KW));let E=t.center||[0,0],T=new S({container:r,style:t.outdoorView.style||MD,center:E,attributionControl:!1,zoom:(m=t.zoomLevel)!=null?m:CM,pitch:(v=t.pitch)!=null?v:xM,bearing:(x=t.bearing)!=null?x:_M,transformRequest:hP(w),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:Xf(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),D=T.painter.context.gl,A=new C1(r,U({center:E,zoomLevel:T.getZoom(),pitch:T.getPitch(),bearing:T.getBearing(),gl:D,map:T,mode:"outdoors-interleaved"},n)),L={center:T.getCenter().toArray(),zoom:T.getZoom(),bearing:T.getBearing(),pitch:T.getPitch()};T.setMinZoom(A.camera.minZoomLevel),T.setMaxZoom(A.camera.maxZoomLevel),A.on("camera-change",J=>{L.center=J.center,L.zoom=J.zoomLevel,L.bearing=J.bearing,L.pitch=J.pitch,T.jumpTo(L)});let B=I.fromLngLat(E,0),j=tv(B,A.viewCamera,A.camera,()=>{A.renderSync()});T.on("style.load",async()=>{T&&(T.addLayer(j),A.renderSync())});let W=!1,$=!1;T.on("idle",()=>{T&&(W||(A.publish("outdoor-view-loaded"),W=!0),$||($=!0,A.publish("outdoor-style-loaded")))});let F=l(J=>{J&&(J.sourceDataType==="metadata"||J.sourceDataType==="visibility"||J.dataType==="style"||J.type==="terrain")&&A.getSystems().htmlControlsSystem.updateData(T)},"updateData");return T.on("styledata",J=>{T&&J&&J.dataType==="style"&&J.type==="styledata"&&($=!1),F(J)}),T.on("sourcedata",F),T.on("terrain",F),T.on("error",J=>{var ot;if(((ot=J.error)==null?void 0:ot.url)===MD){tt.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(w["x-mappedin-tiles-key"],'"'));return}tt.warn(J)}),A}else return new C1(r,n)}l(TD,"createRenderer");y();y();y();var AM=(a=>(a.Departure="Departure",a.TakeConnection="TakeConnection",a.ExitConnection="ExitConnection",a.Turn="Turn",a.Arrival="Arrival",a))(AM||{}),f2=(u=>(u.Straight="Straight",u.Right="Right",u.SlightRight="SlightRight",u.Left="Left",u.SlightLeft="SlightLeft",u.Back="Back",u))(f2||{}),NM=(m=>(m.stairs="stairs",m.elevator="elevator",m.escalator="escalator",m.door="door",m.ramp="ramp",m.slide="slide",m.portal="portal",m.security="security",m.shuttle="shuttle",m))(NM||{}),S1=(e=>(e.Exterior="exterior-walls",e.Interior="interior-walls",e))(S1||{}),I1=(e=>(e.Interior="interior-doors",e.Exterior="exterior-doors",e))(I1||{});y();y();var ym=class ym{constructor(t,e,n){b(this,"id");b(this,"text");b(this,"target");b(this,"__type",ym.__type);this.id=t,this.text=e,this.target=n}static is(t){return t.__type===ym.__type}get focusTarget(){return this.target.anchorTarget}};l(ym,"Label"),b(ym,"__type","Label");var Vc=ym;y();var Qh,Kh=class Kh{constructor(t,e,n){b(this,"id");R(this,Qh);b(this,"__type",Kh.__type);b(this,"contentEl");this.id=t,this.contentEl=e,V(this,Qh,n)}get target(){return p(this,Qh)}get coordinate(){return p(this,Qh).anchorTarget}toJSON(){return{id:this.id,__type:Kh.__type,target:this.target,coordinate:this.coordinate}}static is(t){return t.__type===Kh.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){V(this,Qh,t)}};Qh=new WeakMap,l(Kh,"Marker"),b(Kh,"__type","Marker");var Mu=Kh;y();var T1,w1,vm=class vm{constructor(t,e,n){R(this,T1);R(this,w1);b(this,"target");b(this,"__type",vm.__type);V(this,T1,t),V(this,w1,e),this.target=n}static is(t){return t.__type===vm.__type}get id(){return p(this,T1)}get url(){return p(this,w1)}};T1=new WeakMap,w1=new WeakMap,l(vm,"Image"),b(vm,"__type","Image");var M1=vm;y();var ef,tf=class tf{constructor(t,e,n){b(this,"id");b(this,"groupId");b(this,"__type",tf.__type);R(this,ef);this.id=t,this.groupId=e,V(this,ef,n)}get target(){return p(this,ef)}static is(t){return t.__type===tf.__type}updateTarget(t){V(this,ef,t)}toJSON(){return{id:this.id,__type:tf.__type,groupId:this.groupId,target:p(this,ef)}}};ef=new WeakMap,l(tf,"Model"),b(tf,"__type","Model");var rf=tf;y();var bm=class bm{constructor(t,e){b(this,"id");b(this,"coordinates");b(this,"__type",bm.__type);this.id=t,this.coordinates=e}static is(t){return t.__type===bm.__type}get focusTarget(){return this.coordinates}};l(bm,"PathSegment"),b(bm,"__type","PathSegment");var xm=bm,nf=class nf{constructor(t,e,n,i){b(this,"id");b(this,"animation");b(this,"coordinates");b(this,"segments");b(this,"__type",nf.__type);this.id=t,this.animation=e,this.coordinates=n,this.segments=i.map(({id:a,coordinates:u})=>new xm(a.toString(),u))}static is(t){return t.__type===nf.__type}get focusTarget(){return this.coordinates}toJSON(){return{__type:nf.__type,id:this.id,coordinates:this.coordinates,segments:this.segments}}};l(nf,"Path"),b(nf,"__type","Path");var ba=nf;y();var jc,kM=class kM{constructor(t){R(this,jc);V(this,jc,t)}toJSON(){return{center:this.center,bearing:this.bearing,pitch:this.pitch,zoomLevel:this.zoomLevel}}get center(){return p(this,jc).center}get bearing(){return p(this,jc).bearing}get pitch(){return p(this,jc).pitch}get zoomLevel(){return p(this,jc).zoomLevel}};jc=new WeakMap,l(kM,"CameraTransform");var P1=kM;y();var _m=class _m{constructor(t){b(this,"id");b(this,"__type",_m.__type);this.id=t}static is(t){return t.__type===_m.__type}get focusTarget(){return this}};l(_m,"Shape"),b(_m,"__type","Shape");var Tu=_m;y();var E1=class E1{constructor(t,e){b(this,"id");b(this,"target");b(this,"__type","Text3D");this.id=t,this.target=e}static is(t){return t.__type===E1.__type}};l(E1,"Text3D"),b(E1,"__type","Text3D");var Uc=E1;y();y();y();var QW=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),tZ=/<svg([^>]*)>/g;function wD(r,t,e){let n=QW.get(r);return n?n.replace(tZ,'<svg$1 style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}l(wD,"getStyledIcon");var eZ=l(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(r,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),rZ=l(r=>'\n <div class="pin-shadow" style="background: '.concat(r,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(r,'"\n />\n </svg>\n '),"getDestinationPin"),RM="#722ED1",FM="#1890FF",PD=l(({type:r="departure",color:t=FM})=>'<div class="dropped-pin-wrapper">\n '.concat(r==="departure"?eZ(t):rZ(t),"\n </div>"),"DroppedPin"),nZ=l(r=>{switch(r){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),ED=l(({type:r="stairs",color:t=RM,direction:e="up"})=>{let n=nZ("default"),i=n/2+2,a=e&&e!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(wD("connection-"+r+"-16x16","white",i)||"","\n </div>\n ").concat(a?'<div style="margin-left: -'.concat(n*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(n,"px; height: ").concat(n,'px;">\n <div class="').concat(e==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(i,"px; height: ").concat(i,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");y();var OD=l(async r=>new Promise(t=>setTimeout(t,r)),"ms");var iZ={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},oZ={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},zc={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:iZ,inactivePathOptions:oZ,markerOptions:{departureColor:FM,destinationColor:RM},animatePathDrawing:!0},wu,xa,Gs,yr,L1,Pu,of,jn,_a,Xo,Vs,Hc,Kr,DD,LD,BM,O1,d2,Cm,GM,Sm,VM=class VM{constructor(t,e,n){R(this,Kr);R(this,wu,new Map);R(this,xa);R(this,Gs);R(this,yr,zc);R(this,L1);R(this,Pu);R(this,of);R(this,jn,[]);R(this,_a);R(this,Xo,new Map);R(this,Vs,new Map);R(this,Hc,new Map);R(this,Sm,l(t=>{var e;if((e=p(this,yr).createMarkers)!=null&&e.connection&&t.markers.length>0){let{instruction:n}=p(this,wu).get(t.markers[0]);n!=null&&n.action.toFloor&&(p(this,yr).setMapOnConnectionClick&&this.currentMap.setFloor(n.action.toFloor.id,"navigation-connection-click"),p(this,Gs).publish("navigation-connection-click",{instruction:n,fromFloor:n.action.fromFloor,toFloor:n.action.toFloor}))}},"#handleClick"));V(this,xa,t),V(this,L1,n),V(this,Gs,e)}get currentMap(){return p(this,L1).call(this)}get isMultiFloor(){if(!p(this,jn).length)return!1;let t=new Set;for(let e of p(this,jn))for(let n of e.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return p(this,Xo).get(t)}getMarkerById(t){return p(this,wu).get(t)}get paths(){let t=new Set;return p(this,Xo).forEach(({path:e})=>t.add(e)),Array.from(t)}get activeDirections(){return p(this,Hc).get(p(this,_a))}get activePath(){var t;if(p(this,_a))return(t=p(this,Xo).get(p(this,_a).id))==null?void 0:t.path}get floorStacks(){let t=p(this,Gs).getMapData();if(!p(this,jn).length||!t)return[];let e=new Set;for(let n of p(this,jn))for(let i of n.coordinates)if(i.floorId){let a=t.getById("floor",i.floorId);a&&e.add(a.floorStack)}return Array.from(e)}get floors(){let t=p(this,Gs).getMapData();if(!p(this,jn).length||!t)return[];let e=new Set;for(let n of p(this,jn))for(let i of n.coordinates)if(i.floorId){let a=t.getById("floor",i.floorId);a&&e.add(a)}return Array.from(e)}setActivePathByIndex(t){let e=p(this,jn)[t];if(!p(this,jn).length){tt.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!p(this,jn)[t]){tt.warn("Direction #".concat(t," does not exist"));return}let n=p(this,Vs).get(e);if(!n){tt.warn("The direction is not a part of muli-direcional path");return}yt(this,Kr,d2).call(this,n)}setActivePath(t){if(!p(this,jn).length){tt.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!p(this,Hc).get(t)){tt.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}yt(this,Kr,d2).call(this,t)}setActivePathByDirections(t){if(!p(this,jn).length){tt.warn("[setActivePathByDirections] Cannot set an active path before drawing. Call Navigation.draw() first.");return}let e=p(this,Vs).get(t);if(!e){let n=p(this,jn).find(i=>i.id===t.id);if(!n){tt.warn("[setActivePathByDirections] Cannot find directions for id");return}e=p(this,Vs).get(n)}if(!e){tt.warn("[setActivePathByDirections] Cannot find path for directions");return}yt(this,Kr,d2).call(this,e)}drawSync(t,e={}){var h,d,m;p(this,of)&&this.clear(),V(this,of,!0),yt(this,Kr,BM).call(this,e);let n=Array.isArray(t)?t:[t],i=n[0],a=n[n.length-1],u=i.coordinates[0];V(this,jn,n),u.floorId&&p(this,yr).setMapToDeparture&&this.currentMap.setFloor(u.floorId),(h=p(this,yr).createMarkers)!=null&&h.departure&&yt(this,Kr,Cm).call(this,i.coordinates[0],"departure",i.instructions[0]);for(let v=0;v<n.length;v++){let x=n[v],S=v?U({},p(this,yr).inactivePathOptions):U({},p(this,yr).pathOptions);if(x.coordinates.length<2){tt.warn("Directions must have at least 2 coordinates");return}let I=this.currentMap.Paths.add(x.coordinates,rt(U({},S),{animateDrawing:p(this,yr).animatePathDrawing})),w=I.paths.map(T=>T.id.toString()),E=new ba(Mr(),I.animation,x.coordinates,I.paths);for(let T of w){p(this,Xo).set(T,{path:E,entityIds:w});let D=v?rt(U({},p(this,yr).inactivePathOptions),{altitude:0}):rt(U({},p(this,yr).pathOptions),{altitude:.05});p(this,xa).setState(T,D)}p(this,Xo).set(E.id,{path:E,entityIds:w}),p(this,Vs).set(x,E),p(this,Hc).set(E,x),(d=p(this,yr).createMarkers)!=null&&d.connection&&yt(this,Kr,GM).call(this,x.instructions,"connection"),v===0&&(V(this,_a,p(this,Vs).get(p(this,jn)[0])),p(this,xa).on("click",p(this,Sm)))}(m=p(this,yr).createMarkers)!=null&&m.destination&&yt(this,Kr,Cm).call(this,a.coordinates[a.coordinates.length-1],"destination",a.instructions[a.instructions.length-1]),p(this,Gs).mapObjects.forEach(v=>{v.processFloorChange(v.currentFloorId)}),yt(this,Kr,O1).call(this)}async draw(t,e={}){p(this,Pu)&&this.clear(),yt(this,Kr,BM).call(this,e);let n=Array.isArray(t)?t:[t],a=n[0].coordinates[0];return V(this,jn,n),a.floorId&&p(this,yr).setMapToDeparture&&this.currentMap.setFloor(a.floorId),yt(this,Kr,LD).call(this,n)}clear(){p(this,wu).forEach((t,e)=>{this.currentMap.Markers.remove(e.toString())}),p(this,wu).clear(),p(this,Xo).forEach(({path:t,entityIds:e})=>{p(this,Xo).delete(t.id),e.forEach(n=>p(this,Xo).delete(n)),this.currentMap.Paths.remove(e)}),p(this,Pu)&&(p(this,Pu).cancel(),V(this,Pu,void 0)),p(this,of)&&V(this,of,!1),V(this,jn,[]),p(this,Vs).clear(),p(this,Hc).clear(),V(this,_a,void 0),p(this,xa).off("click",p(this,Sm)),p(this,Gs).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)}),yt(this,Kr,O1).call(this)}};wu=new WeakMap,xa=new WeakMap,Gs=new WeakMap,yr=new WeakMap,L1=new WeakMap,Pu=new WeakMap,of=new WeakMap,jn=new WeakMap,_a=new WeakMap,Xo=new WeakMap,Vs=new WeakMap,Hc=new WeakMap,Kr=new WeakSet,DD=l(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),LD=l(function(t){let e=t[0],n=t[t.length-1],i=!1;return V(this,Pu,{promise:new Promise(async a=>{var u,h,d;if(P.env.NODE_ENV!=="test"&&await OD(500),i||!t.length){a();return}(u=p(this,yr).createMarkers)!=null&&u.departure&&yt(this,Kr,Cm).call(this,e.coordinates[0],"departure",e.instructions[0]);for(let m=0;m<t.length;m++){let v=t[m],x=m?U({},p(this,yr).inactivePathOptions):U({},p(this,yr).pathOptions);if(v.coordinates.length<2){tt.warn("Directions must have at least 2 coordinates"),a();return}let S=this.currentMap.Paths.add(v.coordinates,rt(U({},x),{animateDrawing:p(this,yr).animatePathDrawing})),I=S.paths.map(E=>E.id.toString()),w=new ba(Mr(),S.animation,v.coordinates,S.paths);for(let E of I){p(this,Xo).set(E,{path:w,entityIds:I});let T=m?rt(U({},p(this,yr).inactivePathOptions),{altitude:0}):rt(U({},p(this,yr).pathOptions),{altitude:.05});p(this,xa).setState(E,T)}if(p(this,Xo).set(w.id,{path:w,entityIds:I}),p(this,Vs).set(v,w),p(this,Hc).set(w,v),P.env.NODE_ENV!=="test"&&await S.animation,i){a();return}(h=p(this,yr).createMarkers)!=null&&h.connection&&yt(this,Kr,GM).call(this,v.instructions,"connection"),m===0&&(V(this,_a,p(this,Vs).get(p(this,jn)[0])),p(this,xa).on("click",p(this,Sm)))}if((d=p(this,yr).createMarkers)!=null&&d.destination&&yt(this,Kr,Cm).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),i){a();return}p(this,Gs).mapObjects.forEach(m=>{m.processFloorChange(m.currentFloorId)}),yt(this,Kr,O1).call(this),a()}),cancel:l(()=>{i=!0},"cancel")}),p(this,Pu).promise},"#drawAsync"),BM=l(function(t){var e,n,i;V(this,yr,{setMapOnConnectionClick:(e=t.setMapOnConnectionClick)!=null?e:zc.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:zc.setMapToDeparture,pathOptions:U(U({},zc.pathOptions),t.pathOptions),inactivePathOptions:U(U({},zc.inactivePathOptions),t.inactivePathOptions),createMarkers:U(U({},zc.createMarkers),t.createMarkers),markerOptions:U(U({},zc.markerOptions),t.markerOptions),animatePathDrawing:(i=t.animatePathDrawing)!=null?i:zc.animatePathDrawing})},"#setupOptions"),O1=l(function(){p(this,Gs).publish("navigation-state-change",{isMultiFloor:this.isMultiFloor,floorStacks:this.floorStacks,floors:this.floors,activeDirections:this.activeDirections,activePath:this.activePath,paths:this.paths})},"#emitNavigationStateChanged"),d2=l(function(t){V(this,_a,t),p(this,jn).forEach(e=>{let n=p(this,Vs).get(e);if(n){let i=p(this,Xo).get(n.id),a=i.path.id===p(this,_a).id?rt(U({},p(this,yr).pathOptions),{altitude:.05}):rt(U({},p(this,yr).inactivePathOptions),{altitude:0});i.entityIds.forEach(u=>{p(this,xa).setState(u,a)})}}),p(this,Gs).publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath}),yt(this,Kr,O1).call(this)},"#setActiveDirections"),Cm=l(function(t,e,n){var i,a,u,h,d;if(e==="connection"&&n){let m=n.action.type==="ExitConnection"?p(this,yr).markerOptions.departureColor:p(this,yr).markerOptions.destinationColor,v;if(typeof((i=p(this,yr).createMarkers)==null?void 0:i.connection)=="function"){let S=p(this,yr).createMarkers.connection(n);p(this,xa).setState(S.id.toString(),{options:{interactive:!0}}),v={id:S.id,type:"marker"}}else v=this.currentMap.Markers.add(n.coordinate,ED({type:(u=(a=n.action.connection)==null?void 0:a.type)!=null?u:n.action.connectionType,color:m,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let x=this.currentMap.Markers.getContentEl(v.id.toString());if(!x)throw new Error("marker component should exist");p(this,wu).set(v.id,{instruction:n,marker:new Mu(v.id.toString(),x,n.coordinate)})}else{let m=e==="departure"?p(this,yr).markerOptions.departureColor:p(this,yr).markerOptions.destinationColor,v;typeof((h=p(this,yr).createMarkers)==null?void 0:h.departure)=="function"&&e==="departure"?v={id:p(this,yr).createMarkers.departure(n).id,type:"marker"}:typeof((d=p(this,yr).createMarkers)==null?void 0:d.destination)=="function"&&e==="destination"?v={id:p(this,yr).createMarkers.destination(n).id,type:"marker"}:v=this.currentMap.Markers.add(t,PD({type:e,color:m}),{anchor:"top",rank:"always-visible"}),p(this,wu).set(v.id,void 0)}},"#addMarker"),GM=l(function(t,e){t.filter(i=>yt(this,Kr,DD).call(this,i.action)).forEach(i=>{yt(this,Kr,Cm).call(this,i.coordinate,e,i)})},"#addMarkers"),Sm=new WeakMap,l(VM,"Navigation");var D1=VM;y();y();y();var sZ=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),aZ=/<svg([^>]*)>/g;function AD(r,t,e){let n=sZ.get(r);return n?n.replace(aZ,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(e,"px; height:").concat(e,'px">')):""}l(AD,"getStyledIcon");var sf,Im,Yo,jM,ND,kD,UM,RD,zM=class zM{constructor(t,e){R(this,Yo);R(this,sf);R(this,Im);b(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});V(this,sf,t),V(this,Im,e)}auto(){let t=[],e=p(this,Im)[Object.keys(p(this,Im))[0]];return[...e.getByType("connection"),...e.getByType("point-of-interest"),...e.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(i=>{let a=n.name||n.externalId;if(a){let u=p(this,sf).Labels.add(i,a,yt(this,Yo,jM).call(this,n));t.push(u)}});else{n.__type==="space"&&n.name!==""&&p(this,sf).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let i=n.name;if(i){let a=p(this,sf).Labels.add(n,i,yt(this,Yo,jM).call(this,n));t.push(a)}}}),{labels:t}}};sf=new WeakMap,Im=new WeakMap,Yo=new WeakSet,jM=l(function(t){let e=AD(yt(this,Yo,ND).call(this,t),"white",12);return{appearance:{text:{foregroundColor:yt(this,Yo,UM).call(this,t)},marker:{foregroundColor:{active:yt(this,Yo,UM).call(this,t)},icon:e,iconSize:12}},interactive:!0,rank:yt(this,Yo,RD).call(this,t)}},"#generatLabelAppearance"),ND=l(function(t){return t.__type==="connection"?yt(this,Yo,kD).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),kD=l(function(t){let e="";switch(t){case"elevator":e="connection-elevator-12x12";break;case"escalator":e="connection-escalator-12x12";break;case"stairs":e="connection-stairs-12x12";break}return e},"#attemptIconNameForConnection"),UM=l(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),RD=l(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),l(zM,"Labels");var m2=zM;var HM=class HM{constructor(t,e){b(this,"Labels");b(this,"auto",l(()=>this.Labels.auto(),"auto"));this.Labels=new m2(t,e)}};l(HM,"DefaultTheme");var g2=HM;y();var he,N1,Eu,y2,XM,YM=class YM{constructor(t){R(this,Eu);R(this,he);R(this,N1);b(this,"interactions",{set:l(t=>{(t==null?void 0:t.pan)!=null&&(p(this,he).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(p(this,he).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(p(this,he).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:l(()=>{p(this,he).getSystems().cameraSystem.enablePan=!0,p(this,he).getSystems().cameraSystem.enableZoom=!0,p(this,he).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:l(()=>{p(this,he).getSystems().cameraSystem.enablePan=!1,p(this,he).getSystems().cameraSystem.enableZoom=!1,p(this,he).getSystems().cameraSystem.enableRotate=!1},"disable")});b(this,"setMinPitch",l(t=>{p(this,he).camera.setMinPitch(t)},"setMinPitch"));b(this,"setMaxPitch",l(t=>{p(this,he).camera.setMaxPitch(t)},"setMaxPitch"));b(this,"setMinZoomLevel",l(t=>{p(this,he).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));b(this,"setMaxZoomLevel",l(t=>{p(this,he).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));V(this,N1,t),V(this,he,t.core)}setScreenOffsets(t){p(this,he).camera.setInsetPadding(t)}get screenOffsets(){return p(this,he).camera.insetsPadding}get panMode(){return p(this,he).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&p(this,he).camera.setPanMode(t)}getFocusOnTransform(t,e){var i,a,u;let n=p(this,he).camera.getCameraFrameForCoordinates(yt(this,Eu,XM).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,verticalPadding:(i=e==null?void 0:e.axisAlignedPadding)==null?void 0:i.vertical,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,easing:e==null?void 0:e.easing});return{center:new ve(n.center[1],n.center[0]),zoomLevel:n.zoomLevel,bearing:(a=e==null?void 0:e.bearing)!=null?a:this.bearing,pitch:(u=e==null?void 0:e.pitch)!=null?u:this.pitch}}focusOn(t,e){var n;return p(this,he).camera.focusOn(yt(this,Eu,XM).call(this,t),{pitch:e==null?void 0:e.pitch,bearing:e==null?void 0:e.bearing,padding:(e==null?void 0:e.screenOffsets)||this.screenOffsets,maxZoomLevel:e==null?void 0:e.maxZoomLevel,minZoomLevel:e==null?void 0:e.minZoomLevel,duration:e==null?void 0:e.duration,verticalPadding:(n=e==null?void 0:e.axisAlignedPadding)==null?void 0:n.vertical,easing:e==null?void 0:e.easing})}animateTo(t,e){var d;let{center:n,zoomLevel:i,bearing:a,pitch:u}=t,h=n!=null?n:this.center;return p(this,he).camera.animateTo({center:n!=null?[h.longitude,h.latitude,p(this,he).camera.elevation]:void 0,zoomLevel:i,bearing:a,pitch:u,duration:(d=e==null?void 0:e.duration)!=null?d:600,easing:e==null?void 0:e.easing})}set(t){let{center:e=this.center,zoomLevel:n=this.zoomLevel,bearing:i=this.bearing,pitch:a=this.pitch}=t,u=[e.longitude,e.latitude];p(this,he).camera.setCenter(u),p(this,he).camera.setZoomLevel(n),p(this,he).camera.setBearing(i),p(this,he).camera.setPitch(a)}get center(){let t=p(this,he).camera.center;return new ve(t[1],t[0],void 0)}setAutoMinZoomLevel(t){p(this,he).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return p(this,he).camera.autoMinZoomLevel}get zoomLevel(){return p(this,he).camera.zoomLevel}get pitch(){return p(this,he).camera.pitch}get minPitch(){return p(this,he).camera.minPitch}get maxPitch(){return p(this,he).camera.maxPitch}get bearing(){let t=p(this,he).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return p(this,he).camera.minZoomLevel}get maxZoomLevel(){return p(this,he).camera.maxZoomLevel}setElevation(t){p(this,he).camera.setElevation(t)}get elevation(){return p(this,he).camera.elevation}animateElevation(t,e){return p(this,he).camera.animateElevation(t,e)}updateFacadesInView(){p(this,he).getSystems().geometryInFocusSystem.raycast()}};he=new WeakMap,N1=new WeakMap,Eu=new WeakSet,y2=l(function(t){var n,i,a,u,h,d;let e=p(this,he).camera.elevation;return ve.is(t)&&t.floorId!=null?(i=(n=p(this,he).getState(t.floorId))==null?void 0:n.altitude)!=null?i:e:Io.is(t)?(u=(a=p(this,he).getState(t.id))==null?void 0:a.altitude)!=null?u:e:"floor"in t&&Io.is(t.floor)&&(d=(h=p(this,he).getState(t.floor.id))==null?void 0:h.altitude)!=null?d:e},"#getFloorAltitude"),XM=l(function(t){var a;let e=[],i=(Array.isArray(t)?t:[t]).flatMap(u=>{var h;return(h=u==null?void 0:u.focusTarget)!=null?h:[u]});for(let u of i)if(u!=null)if(ve.is(u)){let h=yt(this,Eu,y2).call(this,u);e.push([u.longitude,u.latitude,h])}else if((u==null?void 0:u.id)!=null){let h=yt(this,Eu,y2).call(this,u);if(Io.is(u)&&((a=p(this,N1).getMapDataInternal())!=null&&a.enterpriseMode)){e.push(u.id);continue}else if("geoJSON"in u&&u.geoJSON.geometry.coordinates.length>0){Ui(u.geoJSON,m=>{e.push([m[0],m[1],h])});continue}let d=p(this,he).getBoundingArea(u.id);if(d)e.push(...d.map(m=>[m[0],m[1],h]));else if("geoJSONBoundingBox"in u){let m=yt(this,Eu,y2).call(this,u);if(u.geoJSONBoundingBox!=null){let v=[[u.geoJSONBoundingBox[0],u.geoJSONBoundingBox[1],m],[u.geoJSONBoundingBox[2],u.geoJSONBoundingBox[3],m]];e.push(...v)}}}else nS(u)&&e.push(u);return e},"#computeCoordinateCloud"),l(YM,"Camera");var A1=YM;y();var Mm,qM=class qM{constructor({currentMapGetter:t}){R(this,Mm);V(this,Mm,t)}get currentMap(){return p(this,Mm).call(this)}async getCurrentSceneGLTF(t){let e=p(this,Mm).call(this);return e?e==null?void 0:e.Exporter.getCurrentSceneGLTF(t):(tt.error("There is no map to export. Please load a map first."),new Blob)}};Mm=new WeakMap,l(qM,"Exporter");var k1=qM;y();var _l,F1,WM=class WM{constructor({currentMapGetter:t}){R(this,_l,new Map);R(this,F1);V(this,F1,t)}get currentMap(){return p(this,F1).call(this)}getById(t){return p(this,_l).get(t)}add(t,e,n){let i=t.anchorTarget,a=this.currentMap;if(!a)throw new Error("currentMap should exist");let u=a.Labels.add(i,e,rt(U({},n),{attachTo:Tm(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),h=new Vc(u.id.toString(),e,t);return p(this,_l).set(h.id,{label:h,entityId:h.id}),h}all(t){var n;let e=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:l((i,a,u)=>{let h=new Vc(i.toString(),a,u);p(this,_l).set(h.id,{label:h,entityId:h.id}),e.push(h)},"onCreate"),labelOptions:t}),e}remove(t){var n;let e=p(this,_l).get(t.id);e&&((n=this.currentMap)==null||n.Labels.remove(e),p(this,_l).delete(t.id.toString()))}removeAll(){let t=[];return p(this,_l).forEach(({label:e})=>{this.remove(e),t.push(e),p(this,_l).delete(e.id.toString())}),t}};_l=new WeakMap,F1=new WeakMap,l(WM,"Labels");var R1=WM;y();y();var ZM={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},FD={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},BD=.5,KM=class KM{constructor(t,e,n=new Map){b(this,"containerId");b(this,"layers");b(this,"renderer");this.containerId=e,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};l(KM,"Layer");var Ou=KM,af,QM=class QM{constructor(t,e,n,i,a,u,h,d){b(this,"id");b(this,"name");b(this,"elevation");b(this,"containerId");b(this,"externalId");b(this,"metadata");b(this,"shortName");b(this,"subtitle");b(this,"occluderId");b(this,"loaded",!1);b(this,"styleMap",{});b(this,"obstructions");b(this,"entrances");b(this,"spaces");b(this,"floorImages");b(this,"floorText");b(this,"renderer");b(this,"options");b(this,"layers",new Map);b(this,"footprint");b(this,"floorStackId");b(this,"multiFloorView");b(this,"mapDataInternal");b(this,"facadesByStyleId",new Map);R(this,af);b(this,"load",l(()=>{var i,a,u,h,d,m,v,x,S,I,w,E,T,D,A,L;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(iu,"-").concat(this.id),{},this.id);this.layers.set(iu,new Ou(this.renderer,t.id.toString()));let e=this.renderer.addGroupContainer("".concat(ol,"-").concat(this.id),{},this.id);this.layers.set(ol,new Ou(this.renderer,e.id.toString()));let n=this.renderer.addGroupContainer("".concat(Gn,"-").concat(this.id),{},this.id);if(this.layers.set(Gn,new Ou(this.renderer,n.id.toString())),((i=this.footprint)==null?void 0:i.geometry)!=null&&((a=this.footprint)==null?void 0:a.geometry.coordinates.length)!==0){let B=ZM;if(this.obstructions!=null&&this.obstructions.features.length>0){let $=this.obstructions.features.filter(F=>{var J;return F.geometry.type==="LineString"&&((J=F.properties.kind)==null?void 0:J.toLowerCase())==="wall"&&F.properties.footprintComponent===!0});$!=null&&$.length>0&&(B=this.styleMap[(u=$[0].properties)==null?void 0:u.id])}let j=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},rt(U({},B),{height:(d=(h=this.multiFloorView)==null?void 0:h.floorHeight)!=null?d:10,altitude:0,outline:(v=(m=this.options.style)==null?void 0:m.outlines)!=null?v:!0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":B.color,renderOrder:2}),this.id);this.layers.set(qg,new Ou(this.renderer,j.id.toString()));let W=this.renderer.addGroupContainer("".concat(qp,"-").concat(this.id),{},this.id);this.layers.set(qp,new Ou(this.renderer,W.id.toString()))}if(this.spaces!=null&&this.spaces.features.length>0){let B=[],j=new Map;this.spaces.features.filter(J=>{var ot;return J.geometry.type==="Polygon"&&((ot=J.properties.kind)==null?void 0:ot.toLowerCase())!=="void"}).forEach(J=>{var K;let ot=(K=this.mapDataInternal)==null?void 0:K.facadesBySpaceId[J.properties.id];if(ot){let H=j.get(ot.id)||[];j.set(ot.id,[...H,J])}else B.push(J)});let W=v2(B,this.styleMap),$=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),F=0;for(let[J,ot]of W){let K=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(F),{features:ot},wm(J,this.options),$);F++;let H=$.id.toString();this.layers.get(Gn).layers.set(J.id||H,K.id.toString())}if(j.size>0){let J=this.renderer.addGroupContainer("".concat(Wp,"-").concat(this.id),{},this.id);this.layers.set(Wp,new Ou(this.renderer,J.id.toString()));for(let[ot,K]of j){let H=this.renderer.addGroupContainer(ot,{focusable:!0},J),_t=this.renderer.addGroupContainer("".concat(ot,"-geometry"),{},H),ct=v2(K,this.styleMap),ft=0;for(let[mt,St]of ct){let dt=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(ot,"-").concat(ft),{features:St},rt(U({},wm(mt,this.options)),{renderOrder:3}),_t);ft++;let xt=mt.id||dt.id.toString();this.layers.get(Wp).layers.set("".concat(ot,"-").concat(xt),dt.id.toString()),this.facadesByStyleId.has(xt)?(x=this.facadesByStyleId.get(xt))==null||x.push(ot):this.facadesByStyleId.set(xt,[ot])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let B=this.obstructions.features.filter(_t=>_t.geometry.type==="Polygon"&&(_t.properties.kind==="object"||_t.properties.kind==="unknown")),j=v2(B,this.styleMap),W=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),$=0;for(let[_t,ct]of j){let ft=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat($),{features:ct},wm(_t,this.options),W);$++;let mt=W.id.toString();this.layers.get(Gn).layers.set(_t.id||mt,ft.id.toString())}let F=this.obstructions.features.filter(_t=>{var ct;return _t.geometry.type==="LineString"&&((ct=_t.properties.kind)==null?void 0:ct.toLowerCase())==="wall"&&_t.properties.footprintComponent===!1}),J=this.obstructions.features.filter(_t=>{var ct;return _t.geometry.type==="LineString"&&((ct=_t.properties.kind)==null?void 0:ct.toLowerCase())==="wall"&&_t.properties.footprintComponent===!0}),ot=this.entrances,K=ZM,H=ZM;if(F!=null&&F.length>0){let _t=this.styleMap[(S=F[0].properties)==null?void 0:S.id];_t!=null&&(K=U({},_t)),H=K;let{walls:ct,entrances:ft}=$M(F,(ot==null?void 0:ot.features)||[]),mt=Math.max(K.height-.11,BD),St=rt(U({},FD),{height:mt}),dt=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),ft,St,n);this.layers.get(Gn).layers.set(Sd,dt.id.toString());let xt=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[ct]},wm(K,this.options),n);this.layers.get(Gn).layers.set(yc,xt.id.toString())}if(J!=null&&J.length>0){let _t=this.styleMap[(I=J[0].properties)==null?void 0:I.id];_t!=null&&(H=rt(U({},_t),{id:il}));let{walls:ct,entrances:ft}=$M(J,(ot==null?void 0:ot.features)||[]),mt=Math.max(H.height-.11,BD),St=rt(U({},FD),{height:mt}),dt=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),ft,St,n);this.layers.get(Gn).layers.set(Id,dt.id.toString());let xt=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[ct]},wm(H,this.options),n);this.layers.get(Gn).layers.set(il,xt.id.toString())}}if(this.floorImages!=null){let B=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let j of this.floorImages.features||[])"anchorId"in j.properties||"anchorId"in j.properties&&((w=j.properties)==null?void 0:w.anchorId)==null||this.renderer.addImage(Mr(),j,{url:j.properties.path,flipImageToFaceCamera:(E=this.options.flipImagesToFaceCamera)!=null?E:!0},B);this.layers.set(sl,new Ou(this.renderer,B.id.toString()))}if(this.floorText!=null)for(let B of this.floorText.features||[]){let j=0;"geometryId"in B.properties?j=(D=(T=this.renderer.getState(B.properties.geometryId))==null?void 0:T.height)!=null?D:0:j=(A=B.properties.verticalOffset)!=null?A:0,this.renderer.addText3D(Mr(),rt(U({},B),{properties:rt(U({},B.properties),{verticalOffset:j})}),{},this.id)}return(L=this.multiFloorView)!=null&&L.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var v,x,S,I,w;this.id=e.id,this.options=a;let m=n.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(v=a.preloadFloors)==null?void 0:v.map(E=>E.id).includes(e.id)},t);this.containerId=m.id.toString(),this.externalId=e.externalId,this.metadata=e.metadata,this.shortName=e.shortName,this.subtitle=e.subtitle,this.name=e.name,this.elevation=e.elevation,u!=null&&h!=null&&(this.styleMap=h,this.spaces=u.space[this.id],this.entrances=u.entrance[this.id],this.obstructions=u.obstruction[this.id],this.floorImages=(x=u.floorImages)==null?void 0:x[this.id],this.floorText=(I=(S=u.enterprise)==null?void 0:S.floorText)==null?void 0:I[this.id],this.footprint=(w=u["floor.geojson"])==null?void 0:w.features.find(E=>E.properties.id===e.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=i,this.mapDataInternal=d}get geoJSONBoundingBox(){if(p(this,af))return p(this,af);if(!this.footprint){tt.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return V(this,af,b2(this.footprint)),p(this,af)}addOccluder(){let t=this.layers.get(qp);if(t==null||t.containerId==null||this.footprint==null){tt.warn("Tried to add occluder to floor ".concat(this.id," but the floor does not have an occlusion layer."));return}this.occluderId=this.renderer.addOccluder(this.footprint,t.containerId)}get hasFacadeGeometry(){return this.facadesByStyleId.size>0}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};af=new WeakMap,l(QM,"FloorObject");var B1=QM;y();var tT=50,eT=!1,lZ=1e3,fn,Pm,Cl,Ca,Di,V1,Yc,Em,qc,Wi,nT,lf,j1,U1,z1,H1,Du,UD,X1,Wc,iT,oT,zD,HD,uf,sT=class sT extends le{constructor({currentMapGetter:e}){super();R(this,Wi);R(this,fn);R(this,Pm,0);R(this,Cl);R(this,Ca,!1);R(this,Di,[]);R(this,V1,0);R(this,Yc,tT);R(this,Em,!1);R(this,qc,"collapsed");b(this,"expandedFactor",0);R(this,lf,"all-floors");R(this,j1,l(()=>{let e=p(this,fn).call(this);if(p(this,V1)===this.expandedFactor||e==null||!p(this,Ca))return;V(this,V1,this.expandedFactor);let n=Ha(this.expandedFactor,0,1,0,this.distanceBetweenFloors),a=Ha(this.expandedFactor,0,.1,0,1)===0;p(this,Di).forEach((u,h)=>{e.api.updateState(u.containerId,{visible:a?u.id===e.currentFloorId:!0,altitude:n*h})}),this.expandedFactor===0?(V(this,Ca,!1),e.renderer.camera.setPanMode("default"),p(this,Wc)&&p(this,Wc).call(this)):this.expandedFactor===1&&(V(this,Ca,!1),p(this,Wc)&&p(this,Wc).call(this))},"#handlePreRender"));R(this,U1,l(()=>{var e,n,i;this.expanded&&V(this,Pm,(n=(e=p(this,fn).call(this))==null?void 0:e.renderer.camera.elevation)!=null?n:0),(i=p(this,fn).call(this))==null||i.renderer.on("user-interaction-end",p(this,H1))},"#handleUserInteractionStart"));R(this,z1,l(()=>{var n;let e=p(this,fn).call(this);if(e!=null&&this.expanded&&p(this,Em)&&!p(this,Ca)){let i=e.currentFloorId,a=[1/0,e.currentFloorId];for(let u=0;u<p(this,Di).length;u++){let h=p(this,Di)[u],d=Math.abs(((n=e.renderer.camera.elevation)!=null?n:0)-u*this.distanceBetweenFloors);d<this.distanceBetweenFloors/3&&(a[0]=d,a[1]=h.id)}a[1]!==e.currentFloorId&&(e.currentFloorId=a[1],p(this,Di).forEach(u=>{e.api.updateState(u.containerId,{visible:p(this,lf)==="all-floors"?!0:e.currentFloor.id===u.id})}),e.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:e.currentFloorId,previousFloorId:i}))}},"#determineCurrentMapBasedOnElevation"));R(this,H1,l(()=>{var n,i;let e=p(this,fn).call(this);if(this.expanded&&e&&p(this,Pm)!==((n=e.renderer.camera.elevation)!=null?n:0)){let a=[1/0,e.currentFloorId,0];for(let u=0;u<p(this,Di).length;u++){let h=p(this,Di)[u],d=Math.abs(((i=e.renderer.camera.elevation)!=null?i:0)-u*this.distanceBetweenFloors);d<a[0]&&(a[0]=d,a[1]=h.id,a[2]=u*this.distanceBetweenFloors)}p(this,Em)&&yt(this,Wi,UD).call(this,a[2]),V(this,Pm,0),e.renderer.off("user-interaction-end",p(this,H1))}},"#handleUserInteractionEnd"));R(this,Du,null);R(this,X1,null);R(this,Wc);R(this,uf);V(this,fn,e);let n=p(this,fn).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",p(this,U1)),n.renderer.on("camera-change",p(this,z1)),n.renderer.on("pre-render",p(this,j1)))}get state(){return p(this,qc)}get expanded(){return p(this,qc)!=="collapsed"}get distanceBetweenFloors(){if(p(this,Yc)==="auto"){if(p(this,uf)!=null)return p(this,uf);let e=yt(this,Wi,HD).call(this);if(e)return V(this,uf,e),e}return typeof p(this,Yc)=="number"?p(this,Yc):tT}clearCachedFloorSeparationDistance(){V(this,uf,void 0)}get includedFloors(){var e;return(e=p(this,Wi,nT))!=null&&e.api.mapData?p(this,Di).map(n=>{var i,a;return(a=(i=p(this,Wi,nT))==null?void 0:i.api.mapData)==null?void 0:a.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return p(this,lf)}setFloorVisiblityMode(e){V(this,lf,e);let n=p(this,fn).call(this);n!=null&&p(this,Di).forEach(i=>{n.api.updateState(i.containerId,{visible:p(this,lf)==="all-floors"?!0:n.currentFloor.id===i.id})})}changeFloorOnElevationChanges(e){V(this,Em,e)}async expand(e){var i,a,u;let n=p(this,fn).call(this);if(n!=null)return(e==null?void 0:e.distanceBetweenFloors)==="auto"?V(this,Yc,"auto"):V(this,Yc,(i=e==null?void 0:e.distanceBetweenFloors)!=null?i:tT),V(this,Di,(e==null?void 0:e.includedFloors)!=null&&(e==null?void 0:e.includedFloors.length)>0?e==null?void 0:e.includedFloors.map(h=>n.floorsById.get(h.id)).filter(Boolean):n.currentFloorStack.floorObjects),p(this,Di).sort((h,d)=>h.elevation-d.elevation),p(this,Di).length<=1||this.expanded===!0?Promise.resolve():(V(this,Ca,!0),n.api.Camera.setPanMode((a=e==null?void 0:e.cameraPanMode)!=null?a:"elevation"),this.changeFloorOnElevationChanges((u=e==null?void 0:e.changeFloorOnElevationChanges)!=null?u:!0),yt(this,Wi,iT).call(this,"expand",e).then(()=>{V(this,qc,"expanded"),yt(this,Wi,oT).call(this),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{V(this,Ca,!1)}))}async collapse(e){let n=p(this,fn).call(this);if(n!=null)return this.expanded===!0?(V(this,Ca,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),yt(this,Wi,iT).call(this,"collapse",e).then(()=>{V(this,qc,"collapsed"),yt(this,Wi,oT).call(this),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{V(this,Ca,!1)})):Promise.resolve()}destroy(){let e=p(this,fn).call(this);e!=null&&(e.renderer.off("user-interaction-start",p(this,U1)),e.renderer.off("camera-change",p(this,z1)),e.renderer.off("pre-render",p(this,j1)))}};fn=new WeakMap,Pm=new WeakMap,Cl=new WeakMap,Ca=new WeakMap,Di=new WeakMap,V1=new WeakMap,Yc=new WeakMap,Em=new WeakMap,qc=new WeakMap,Wi=new WeakSet,nT=l(function(){return p(this,fn).call(this)},"#currentMap"),lf=new WeakMap,j1=new WeakMap,U1=new WeakMap,z1=new WeakMap,H1=new WeakMap,Du=new WeakMap,UD=l(function(e){var i,a,u;p(this,Du)&&p(this,Du).stop();let n=p(this,fn).call(this);n!=null&&(V(this,Du,new Ho({elevation:(i=n.renderer.camera.elevation)!=null?i:0}).to({elevation:e},150).easing(Vn.Quadratic.Out).onComplete(()=>{var h;p(this,Du)&&((h=p(this,fn).call(this))==null||h.renderer.getInternalTweenGroup().remove(p(this,Du)))}).onUpdate(({elevation:h})=>{n.renderer.camera.setElevation(h)}).start()),(a=p(this,fn).call(this))==null||a.renderer.getInternalTweenGroup().add(p(this,Du)),(u=p(this,fn).call(this))==null||u.renderer.render())},"#animateElevationTo"),X1=new WeakMap,Wc=new WeakMap,iT=l(function(e,n){var h,d,m,v;p(this,Cl)&&p(this,Cl).stop();let i=p(this,fn).call(this);if(i==null)return Promise.reject(new Error("No current map"));let a=p(this,Di).indexOf(i.currentFloor),u=(h=i.renderer.camera.elevation)!=null?h:0;return V(this,X1,new Promise(x=>{V(this,Wc,x)})),V(this,Cl,new Ho({percentExpanded:this.expandedFactor}).to({percentExpanded:e==="expand"?1:0},(d=n==null?void 0:n.duration)!=null?d:lZ).easing(xu[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:x})=>{this.expandedFactor=x;let S=a*this.distanceBetweenFloors;i.renderer.camera.setElevation(e==="expand"?S*x:u*x)}).onComplete(()=>{var x;p(this,Cl)&&((x=p(this,fn).call(this))==null||x.renderer.getInternalTweenGroup().remove(p(this,Cl)))}).start()),p(this,Cl).cameraAnimation=!0,(m=p(this,fn).call(this))==null||m.renderer.getInternalTweenGroup().add(p(this,Cl)),(v=p(this,fn).call(this))==null||v.renderer.render(),p(this,X1)},"#animate"),oT=l(function(){var n,i;let e=p(this,fn).call(this);if(e!=null&&e.options.hideImagesNotOnCurrentFloor)for(let a of p(this,Di)){let u=e.floorsById.get(a.id);u&&(p(this,qc)==="expanded"?(n=u.layers.get(sl))==null||n.setVisible(!0):(i=u.layers.get(sl))==null||i.setVisible(u.id===e.currentFloor.id))}},"#showOrHideImagesOnAllFloorsInStack"),zD=l(function(e,n,i,a){let u=rT(e,i),h=n.clone(),d=rT(h,i);if(!Is(u)||!Is(d))return-1;let m=0,v;eT&&a.querySelectorAll(".debug-box").forEach(S=>S.remove());do{if(m>1e4)return-1;if(m+=20,h.position.z=m,h.updateMatrixWorld(),d.makeEmpty(),rT(h,i,d),v=u.intersectsBox(d),eT){let x=jD(u,"blue",a),S=jD(d,v?"red":"green",a);x.classList.add("debug-box"),S.classList.add("debug-box")}}while(v);return m},"#computeMinZOffsetToSeparateFirstTwoFloors"),HD=l(function(){let e=p(this,fn).call(this);if(!e)return;let n=e.renderer,i=n.getThreeScene();if(!e.api.mapData||!i)return;let u=p(this,Di).length>0?p(this,Di):e.currentFloorStack.floorObjects;if(u.length<2)return;let h=n.getInternalState().geometry3DMap.get(u[0].id),d=n.getInternalState().geometry3DMap.get(u[1].id);if(!h||!d)return;if(Hl(h,"group-container"),Hl(d,"group-container"),eT){let v=new In;v.setFromObject(h);let x=new In;if(x.setFromObject(d),h.children.forEach(A=>{A instanceof ue&&A.userData.debugBox&&Jr(A)}),d.children.forEach(A=>{A instanceof ue&&A.userData.debugBox&&Jr(A)}),!Is(v)||!Is(x))return;let S=new Fo(v.max.x-v.min.x,v.max.y-v.min.y,v.max.z-v.min.z),I=new On({color:255,transparent:!0,opacity:.5}),w=new ue(S,I);w.position.set((v.min.x+v.max.x)/2,(v.min.y+v.max.y)/2,(v.min.z+v.max.z)/2),w.userData.debugBox=!0;let E=new Fo(x.max.x-x.min.x,x.max.y-x.min.y,x.max.z-x.min.z),T=new On({color:"cyan",transparent:!0,opacity:.5}),D=new ue(E,T);D.position.set((x.min.x+x.max.x)/2,(x.min.y+x.max.y)/2,(x.min.z+x.max.z)/2),D.userData.debugBox=!0,h.add(w),d.add(D)}let m=yt(this,Wi,zD).call(this,h,d,n.getThreeCamera(),n.container);if(m!==-1)return m},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),uf=new WeakMap,l(sT,"StackedMaps");var G1=sT,Xc=new zt,GD=new ne;function rT(r,t,e=new Yw){return r.traverse(n=>{if(n instanceof ue){let a=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let h=0;h<a.count;h++)Xc.fromBufferAttribute(a,h),Xc.applyMatrix4(n.matrixWorld),Xc.applyMatrix4(t.matrixWorldInverse),Xc.applyMatrix4(t.projectionMatrix),Xc.z<1&&Xc.z>0&&(GD.set(Xc.x,Xc.y),e.expandByPoint(GD))}}),e}l(rT,"projectToBox2D");function VD(r,t){let e=t.clientWidth,n=t.clientHeight;return new ne((r.x+1)*e/2,(1-r.y)*n/2)}l(VD,"ndcToScreen");function jD(r,t,e){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let i=VD(new ne(r.min.x,r.min.y),e),a=VD(new ne(r.max.x,r.max.y),e);n.style.left="".concat(i.x,"px"),n.style.top="".concat(a.y,"px");let u=Math.abs(a.x-i.x),h=Math.abs(a.y-i.y);return n.style.width="".concat(u,"px"),n.style.height="".concat(h,"px"),e.appendChild(n),n}l(jD,"drawProjectedBox");y();var Om,aT=class aT{constructor(t,e,n,i){b(this,"id");b(this,"externalId");b(this,"name");b(this,"type");b(this,"floorIds");b(this,"defaultFloorId");b(this,"floorObjects",[]);b(this,"floorObjectsByElevation",new Map);b(this,"metadata");b(this,"containerId");b(this,"facade");b(this,"renderer");R(this,Om);var u;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(u=t.floors)!=null?u:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let a=n.addGroupContainer(this.id,{visible:!0,interactive:!0},e);this.containerId=a.id.toString(),this.facade=i}get defaultFloor(){if(p(this,Om)==null){if(this.floorObjects.length===0)throw new Ci("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(e=>e.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((e,n)=>Math.abs(n.elevation)<Math.abs(e.elevation)?n:e)),V(this,Om,t)}return p(this,Om)}get isOutdoors(){var e;return((e=this.type)==null?void 0:e.toLowerCase())==="outdoor"?!0:this.facade!=null?!1:this.floorObjects.some(n=>n.hasFacadeGeometry)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){tt.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t),this.facade&&this.renderer.setState(t.containerId,{focusable:!0}),!this.isOutdoors&&!t.hasFacadeGeometry&&t.footprint!=null&&t.addOccluder()}};Om=new WeakMap,l(aT,"FloorStackObject");var Y1=aT;y();function XD(r,t,e,n){let i={outdoorOpacity:1,floorStates:[]},a=r.sort((v,x)=>v.elevation-x.elevation),u=Math.min(0,a[0].elevation),h=a[a.length-1].elevation,d,m;for(let v=u;v<=h;v++){let x=a.find(T=>T.elevation===v);if(x==null){v>=0&&(d==null?d=v:m=v);continue}let S=0,I=v<0?Math.abs(x.elevation)*e:e,w=!1;if(d===0&&m!=null){let T=e*m;S=-T,I=T,w=!0}else if(d!=null&&m!=null){let T=d,D=r.find(L=>L.elevation===T-1),A=i.floorStates.find(L=>L.floor===D);if(A){let L=e*(m-d+2);A.state.footprint=rt(U({},A.state.footprint),{altitude:0,height:L,visible:!0})}}d=void 0,m=void 0;let E={floor:x,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};i.floorStates.push(E),x.id===t.id?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.labels.enabled=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,(x.elevation<0||w)&&(x.elevation<0&&(i.outdoorOpacity=.2),E.state.footprint.height=I,E.state.footprint.altitude=S,E.state.footprint.visible=!0)):n.includes(x.id)&&x.elevation<t.elevation?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,E.state.footprint.visible=!0,x.elevation<0?(E.state.footprint.height=I,E.state.footprint.altitude=S,i.outdoorOpacity=.2):(E.state.footprint.height=I,E.state.footprint.altitude=S)):t.elevation>0&&x.elevation<t.elevation&&x.elevation>=0&&(E.state.visible=!0,E.state.footprint.visible=!0,E.state.footprint.height=e,E.state.footprint.altitude=S)}return i}l(XD,"getMultiFloorState");var uZ={linear:Vn.Linear.None,easeIn:Vn.Quadratic.In,easeOut:Vn.Quadratic.Out,easeInOut:Vn.Quadratic.InOut},Sl,cT=class cT extends le{constructor(e,n,i,a){var m,v,x,S;super();b(this,"floorStacksById",new Map);b(this,"floorsById",new Map);b(this,"startingFloorId","");b(this,"currentFloorId","");b(this,"currentFloorStackId","");b(this,"outdoorFloorStacks",new Set);b(this,"id");b(this,"renderer");b(this,"api");b(this,"mvf");b(this,"options",{});b(this,"styleMap");b(this,"StackedMaps");b(this,"animations",new Map);b(this,"Models",{add:l((e,n,i)=>{let x=i,{floorId:a,scale:u}=x,h=ea(x,["floorId","scale"]),d=a?this.floorsById.get(a):this.currentFloor,m=U({},h);u!=null&&(m.scale=Array.isArray(i.scale)?i.scale:[i.scale,i.scale,i.scale]);let v=this.renderer.addModelGroup(e,{type:"FeatureCollection",features:n.map(S=>{var I;return{type:"Feature",properties:{id:Mr(),rotation:i.rotation,scale:m.scale,interactive:i.interactive,verticalOffset:S.verticalOffset+((I=i.verticalOffset)!=null?I:0)},geometry:{type:"Point",coordinates:js(S)}}})},m,{parent:d.id});if(v==null)throw new Ci("error creating model");return this.renderer.getState(v).children},"add"),remove:l((e,n)=>{this.renderer.remove(e),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});b(this,"Images",{add:l((e,n,i)=>{let v=i,{floorId:a,flipImageToFaceCamera:u}=v,h=ea(v,["floorId","flipImageToFaceCamera"]),d=a?this.floorsById.get(a):this.currentFloor,m={type:"Feature",properties:h,geometry:{type:"Point",coordinates:e}};return this.renderer.addImage(Mr(),m,{url:n,flipImageToFaceCamera:u!=null?u:!1},d.id)},"add"),remove:l(e=>{this.renderer.remove(e)},"remove"),removeAll:l(()=>{},"removeAll")});b(this,"Markers",{add:l((e,n,i)=>{let a=uT(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),x=i,{attachTo:u}=x,h=ea(x,["attachTo"]),d=h;h.rank==="initial"&&(d.rank="medium");let m=a.layers.get(ol),v=this.renderer.addMarker2D(js(e),n,rt(U({},d),{occluderId:a==null?void 0:a.occluderId,attachTo:u}),m==null?void 0:m.containerId);if(!v)throw new Ci("Failed to create Marker");return v},"add"),remove:l(e=>{this.renderer.remove(e)},"remove"),getContentEl:l(e=>{let n=this.renderer.getState(e);if((n==null?void 0:n.type)==="marker")return n.element},"getContentEl"),removeAll:l(()=>{},"removeAll"),setPosition:l((e,n,i)=>{var h;let a=this.renderer.getState(e),u=i?this.floorsById.get(i):this.currentFloor;if(!a){tt.error('Failed to retrieve state for Marker with id "'.concat(e,'".'));return}if(a.type!=="marker"){tt.error('Geometry with id "'.concat(e,'" is not of type "marker".'));return}this.renderer.setState(a,{position:n,parent:(h=u==null?void 0:u.layers.get(ol))==null?void 0:h.containerId})},"setPosition"),animateTo:l((e,n,i,a)=>{let u=this.renderer.getState(e),h=i?this.floorsById.get(i):this.currentFloor;if(!u)return tt.error('Failed to retrieve state for Marker with id "'.concat(e,'".')),Promise.resolve();if(u.type!=="marker")return tt.error('Geometry with id "'.concat(e,'" is not of type "marker".')),Promise.resolve();let d=U({duration:1e3,easing:"ease-in-out"},a);this.cancelAnimation(e);let m=new Ho({lon:u.position[0],lat:u.position[1]}).to({lon:n[0],lat:n[1]},d.duration).easing(uZ[d.easing]).onUpdate(({lon:v,lat:x})=>{var I;if(!this.renderer.getState(e))this.cancelAnimation(e);else{let w=(I=h==null?void 0:h.layers.get(ol))==null?void 0:I.containerId;w&&this.Markers.setPosition(e,[v,x],w)}}).start();return this.renderer.getInternalTweenGroup().add(m),this.renderer.render(),this.animations.set(e,m),lT(m).then(()=>{this.animations.delete(e)})},"animateTo")});b(this,"Exporter",{getCurrentSceneGLTF:l(async e=>this.renderer.getCurrentSceneGLTF(e),"getCurrentSceneGLTF")});b(this,"Shapes",{add:l((e,n,i)=>{let a=i!=null&&i.floorId?this.floorsById.get(i==null?void 0:i.floorId):this.currentFloor,u="shape-"+Mr();return this.renderer.addGeometryGroup(u,e,n,a.id),u},"add"),remove:l(e=>(this.renderer.remove(e.id),e.id),"remove")});b(this,"Text3D",{label:l((e,n,i)=>{var u;if(!((u=this.api.getMapDataInternal())!=null&&u.enterpriseMode)){tt.warn("Enterprise mode is not enabled, skipping label creation");return}let a=YD(this.renderer,e,n,i);if(a)return{textInfo:a,target:e}},"label"),labelAll:l((e={})=>{var a;if(!((a=this.api.getMapDataInternal())!=null&&a.enterpriseMode))return tt.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let i=[];return n.getByType("space").forEach(u=>{var h,d;if(u.locations[0]){let m=YD(this.renderer,u,(d=(h=u.locations[0])==null?void 0:h.name)!=null?d:u.name,e);m&&i.push({textInfo:m,target:u})}}),i},"labelAll"),remove:l(e=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){tt.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(e),e},"remove")});b(this,"Labels",{all:l(({onCreate:e,labelOptions:n={}})=>{for(let i of Object.entries(this.mvf.space)){let[a,u]=i;u&&u.features.forEach(h=>{var E,T,D,A,L;let d=(E=this.api.getMapData())==null?void 0:E.getById("space",h.properties.id);if(!d)return;let m=(T=this.styleMap[h.properties.id])==null?void 0:T.showImage,v=(D=h.properties.details)==null?void 0:D.images,x=m&&((A=v==null?void 0:v[0])!=null&&A.url)?{icon:v[0].url}:{},S=U({marker:U(U({},x),(L=n.appearance)==null?void 0:L.marker)},n.appearance),w=(a?this.floorsById.get(a):this.currentFloor).layers.get(iu);if(h.properties.center&&d.name!==""){let B=this.renderer.addLabel2D(h.properties.center,d.name,rt(U({id:h.properties.id+"-label"},n),{appearance:S,rank:n.rank,attachTo:Tm(d)}),ui.is(d)?d.id:w==null?void 0:w.containerId);B&&e(B.id,d.name,d)}})}},"all"),add:l((e,n,i={})=>{let v=i,{attachTo:a}=v,u=ea(v,["attachTo"]),h=uT(e,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),d=h.layers.get(iu),m=this.renderer.addLabel2D(js(e),n,rt(U({},u),{occluderId:h.occluderId,attachTo:a}),d==null?void 0:d.containerId);if(!m)throw new Ci("label creating failed");return m},"add"),remove:l(({entityId:e})=>{this.renderer.remove(e)},"remove"),removeAll:l(()=>{},"removeAll")});b(this,"Paths",{add:l((e,n)=>{var m;let i=(m=n==null?void 0:n.animateDrawing)!=null?m:!0,a=[],u=e[0].floorId||"root",h=0;for(let v of e){let{floorId:x="root",latitude:S,longitude:I}=v;x!==u&&(h++,u=x),a[h]==null&&a.push({floorId:x,coordinates:[]});let w=x===v.floorId?v:new ve({longitude:I,latitude:S,floorId:x});a[h].coordinates.push(w)}let d=a.reduce((v,{floorId:x,coordinates:S},I)=>{if(I!==0){let E=a[I-1],T=E.coordinates[E.coordinates.length-1],D=S[0],A=js(T),L=js(D),B=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:E.floorId},geometry:{type:"Point",coordinates:A}},{type:"Feature",properties:{parentId:x},geometry:{type:"Point",coordinates:L}}]},n,this.id);B&&(n!=null&&n.animateDrawing&&this.renderer.setState(B.id,{completeFraction:0}),v.push(rt(U({},B),{coordinates:[T,D]})))}let w=this.renderer.addPath({type:"FeatureCollection",features:S.map(E=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:js(E)}}))},n,x);return w&&(n!=null&&n.animateDrawing&&this.renderer.setState(w.id,{completeFraction:0}),v.push(rt(U({},w),{coordinates:S}))),v},[]);if(i){let v=[],x=this.api.getMapData();return d.forEach(S=>{var w;let I=WD(S,x,this.api);v.push(new Ho({fraction:0}).to({fraction:1},I===!1?0:(w=n==null?void 0:n.drawDuration)!=null?w:1500).onUpdate(E=>{this.renderer.setState(S.id,{completeFraction:E.fraction})}))}),v.forEach((S,I)=>{I<v.length-1&&S.chain(v[I+1]),this.renderer.getInternalTweenGroup().add(S)}),v[0].start(),this.renderer.render(),this.animations.set(d[0].id.toString(),v[0]),{paths:d,animation:lT(v[v.length-1]).then(()=>{this.animations.delete(d[0].id.toString())})}}else return{paths:d,animation:Promise.resolve()}},"add"),remove:l(e=>{e.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});R(this,Sl,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=a.core,this.api=a,this.id=e,this.renderer.addGroupContainer(e,{},"root"),this.options=i!=null?i:{},this.StackedMaps=new G1({currentMapGetter:l(()=>this,"currentMapGetter")}),this.mvf=(m=n==null?void 0:n.mvf)!=null?m:{};let u=qD(this.mvf["styles.json"]||{});if(this.styleMap=u,V(this,Sl,U({enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0},i==null?void 0:i.multiFloorView)),!n){this.id!=="outdoors-container"&&tt.warn("Map (".concat(this.id,") created with no data."));let I=new Y1({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(I.id,I),this.currentFloorStackId=I.id;let w=new B1(I.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,p(this,Sl),i!=null?i:{});I.addFloor(w),this.floorsById.set(w.id,w),this.setFloor(w.id);return}let h=n.getMVFFeatureByType("floor-stack");if(h==null||h.length===0)throw new Ci("MVF does not contain any Floor Stacks.");for(let I of h){let w=new Y1(I,this.id,this.renderer,(v=this.mvf.facade)==null?void 0:v[I.id]);if(w.floorIds.length!==0){for(let E of w.floorIds){let T=n.getMVFFeatureById("floor",E);if(T!=null){let D=this.mvf.space[T.id],A=this.mvf.obstruction[T.id];if((D==null||D.features.length===0)&&(A==null||A.features.length===0))continue;let L=new B1(w.id,T,this.renderer,p(this,Sl),i!=null?i:{},this.mvf,u,n);w.addFloor(L),this.floorsById.set(L.id,L)}}this.floorStacksById.set(I.id,w),this.currentFloorStackId||(this.currentFloorStackId=I.id)}}for(let[I]of Object.entries(n.facadesBySpaceId)){let w=n.getById("space",I);w&&(this.outdoorFloorStacks.add(w.floor.floorStack.id),(x=this.floorsById.get(w.floor.id))==null||x.setVisible(!0))}let d=(S=this.mvf.enterprise)==null?void 0:S.venue.defaultMap;if(i!=null&&i.initialFloor){let I=Ug(i.initialFloor);I&&this.floorsById.has(I)?d=I:tt.error("Invalid initial floor specified (".concat(i.initialFloor,"), using default behavior instead"))}d||(d=this.currentFloorStack.defaultFloor.id),this.startingFloorId=d}get currentFloorStack(){let e=this.floorStacksById.get(this.currentFloorStackId);if(!e)throw new Ci('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return e}setFloorStack(e,n){if(this.currentFloorStackId===e)return;let i=this.floorStacksById.get(e);if(i==null){tt.error("Invalid floor stack passed to setFloorStack (".concat(e,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){tt.error("Floor stack (".concat(e,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(i.defaultFloor.id,n)}get currentFloor(){let e=this.floorsById.get(this.currentFloorId);if(!e)throw new Ci('Floor with id "'.concat(this.currentFloorId,'" not found'));return e}get floors(){return Array.from(this.floorsById.values())}processFloorChange(e){var a,u,h,d,m,v,x;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=(a=this.api.getMapDataInternal())==null?void 0:a.getById("floor",e),i=(u=this.api.getMapDataInternal())==null?void 0:u.getById("floor-stack",this.currentFloorStackId);if(n&&i)if(!((h=p(this,Sl))!=null&&h.enabled)||n.floorStack.id!==(i==null?void 0:i.id))for(let S of this.floorStacksById.values())S.floorObjects.forEach(I=>{I.id!==e&&I.setVisible(!1)});else{let S=XD(i.floors,n,p(this,Sl).floorHeight,((m=(d=this.api.Navigation)==null?void 0:d.floors)==null?void 0:m.map(I=>I.id))||[]);(x=(v=this.api)==null?void 0:v.Outdoor)==null||x.setOpacity(S.outdoorOpacity),S.floorStates.forEach(I=>{var w;if(I.floor){let E=(w=this.api.getMapData())==null?void 0:w.getById("floor",I.floor.id);E&&this.api.updateState(E,I.state)}}),p(this,Sl).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*p(this,Sl).floorHeight)}}setFloor(e,n){if(this.currentFloorId===e)return;if(!this.floorsById.get(e)){tt.error("Invalid floor passed to setFloor (".concat(e,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let a=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:a,floorId:e,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(e),this.currentFloorId=e,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.hideImagesOnAllFloorsExceptCurrent(),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:a})}hideImagesOnAllFloorsExceptCurrent(){var e,n;if(this.options.hideImagesNotOnCurrentFloor&&!((e=this.options.multiFloorView)!=null&&e.enabled))for(let i of this.floorsById.values())(n=i.layers.get(sl))==null||n.setVisible(i.id===this.currentFloor.id)}cancelAnimation(e){let n=this.animations.get(e);n&&(n.stop(),this.animations.delete(e),this.renderer.getInternalTweenGroup().remove(n))}};Sl=new WeakMap,l(cT,"GeojsonApiMapObject");var q1=cT;function YD(r,t,e,n){return r.labelText3D(t.id,e!=null?e:t.name,rt(U({},n),{parentId:t.floor.id}))}l(YD,"labelSpace");y();var Sa,Z1,pT=class pT{constructor({currentMapGetter:t}){R(this,Sa,new Map);R(this,Z1);V(this,Z1,t)}get currentMap(){return p(this,Z1).call(this)}getById(t){return p(this,Sa).get(t)}add(t,e,n){let i=t.anchorTarget;if(!i)throw new Error("get coordinate failed");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let u=a.Markers.add(i,e,rt(U({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:Tm(t)}));if(u==null)throw new Error("error creating marker");let h=a.Markers.getContentEl(u.id.toString());if(!h)throw new Error("marker component should exist");let d=new Mu(u.id.toString(),h,t);return p(this,Sa).set(d.id,{marker:d,entityId:u.id.toString()}),d}remove(t){var n;let e=p(this,Sa).get(t.id);e&&((n=this.currentMap)==null||n.Markers.remove(e.entityId),p(this,Sa).delete(t.id.toString()))}removeAll(){let t=[];return p(this,Sa).forEach(({marker:e})=>{this.remove(e),t.push(e),p(this,Sa).delete(e.id.toString())}),t}setPosition(t,e){var u;let n=e.anchorTarget;if(!n){tt.error("Cannot determine coordinate from target.");return}let i=this.currentMap;if(!i){tt.error("Cannot determine the current map.");return}let a=p(this,Sa).get(t.id);if(!a){tt.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}i.Markers.setPosition(a.entityId,js(n),(u=n.floorId)!=null?u:i.currentFloorId),a.marker.updateTarget(e)}animateTo(t,e,n){var h;let i=e.anchorTarget;if(!i)return tt.error("Cannot determine coordinate from target."),Promise.resolve();let a=this.currentMap;if(!a)return tt.error("Cannot determine the current map."),Promise.resolve();let u=p(this,Sa).get(t.id);return u?(u.marker.updateTarget(e),a.Markers.animateTo(u.entityId,js(i),(h=i.floorId)!=null?h:a.currentFloorId,n)):(tt.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};Sa=new WeakMap,Z1=new WeakMap,l(pT,"Markers");var W1=pT;y();var Lu,J1,hT=class hT{constructor({currentMapGetter:t}){R(this,Lu,new Map);R(this,J1);V(this,J1,t)}get currentMap(){return p(this,J1).call(this)}getById(t){return p(this,Lu).get(t)}add(t,e,n){var d;let i=t.anchorTarget;if(!i)throw new Error("Target does not implement IAnchorable.");let a=this.currentMap;if(!a)throw new Error("currentMap should exist");let u=a.Images.add(js(i),e,rt(U({},n),{floorId:i.floorId,verticalOffset:i.verticalOffset+((d=n.verticalOffset)!=null?d:0)}));if(!u)throw new Error("image component should exist");let h=new M1(u.id.toString(),e,t);return p(this,Lu).set(h.id,{image:h,entityId:u.id.toString()}),h}remove(t){var n;let e=p(this,Lu).get(t.id);e&&((n=this.currentMap)==null||n.Images.remove(e.entityId),p(this,Lu).delete(t.id.toString()))}removeAll(){let t=[];return p(this,Lu).forEach(({image:e})=>{this.remove(e),t.push(e),p(this,Lu).delete(e.id.toString())}),t}};Lu=new WeakMap,J1=new WeakMap,l(hT,"Images");var $1=hT;y();var Il,Q1,fT=class fT{constructor({currentMapGetter:t}){R(this,Il,new Map);R(this,Q1);V(this,Q1,t)}get currentMap(){return p(this,Q1).call(this)}getById(t){return p(this,Il).get(t)}add(t,e,n){let i=[t],a=i.reduce((d,m)=>{var v;return m?(d.has(m.floorId)||d.set(m.floorId,[]),(v=d.get(m.floorId))==null||v.push(m),d):(tt.error("Cannot determine coordinate from options."),d)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let u=this.currentMap;if(!u)throw new Error("currentMap should exist");let h=[];return a.forEach((d,m)=>{let v=Mr();u.Models.add(v,d,rt(U({},n),{url:e,floorId:m})).forEach(({id:S})=>{let I=new rf(S.toString(),v,d[0]);p(this,Il).set(I.id,{model:I,entityId:S.toString(),groupId:v}),h.push(I)})}),h[0]}remove(t){var n;let e=p(this,Il).get(t.id);e&&((n=this.currentMap)==null||n.Models.remove(e.entityId,e.groupId),p(this,Il).delete(t.id.toString()))}removeAll(){let t=[];return p(this,Il).forEach(({model:e})=>{var i;let n=p(this,Il).get(e.id);n&&(t.push(e),(i=this.currentMap)==null||i.Models.remove(n.entityId,n.groupId),p(this,Il).delete(e.id.toString()))}),t}};Il=new WeakMap,Q1=new WeakMap,l(fT,"Models");var K1=fT;y();var Ml,e0,dT=class dT{constructor({currentMapGetter:t}){R(this,Ml,new Map);R(this,e0);V(this,e0,t)}get currentMap(){return p(this,e0).call(this)}getById(t){return p(this,Ml).get(t)}add(t,e){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Paths.add(t,e),a=i.paths.map(h=>h.id.toString()),u=new ba(Mr(),i.animation,t,i.paths);for(let h of a)p(this,Ml).set(h,{path:u,entityIds:a});return p(this,Ml).set(u.id,{path:u,entityIds:a}),u}remove(t){var n;let e=p(this,Ml).get(t.id);e&&((n=this.currentMap)==null||n.Paths.remove(e.entityIds),p(this,Ml).delete(t.id),e.entityIds.forEach(i=>p(this,Ml).delete(i)))}removeAll(){let t=[];return p(this,Ml).forEach(({path:e})=>{this.remove(e),t.push(e)}),t}};Ml=new WeakMap,e0=new WeakMap,l(dT,"Paths");var t0=dT;y();y();var aL=$r(z3(),1);y();var r0="blue-dot",ZD="blue-dot-accuracy-ring";var mT="#2266ff",cZ="#808080",$D="#f5f5f5";var JD={radius:10,color:mT,inactiveColor:cZ,heading:{color:mT,opacity:.7},accuracyRing:{color:mT,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};y();var KD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";y();var QD=l((r,t,e=0)=>{if(Math.abs(r)>=Math.PI)throw new Error("Sector angle too wide!");let n=e/Math.tan(r/2),i=e/Math.sin(r/2),a=i+t,u=10,h=new Va;h.moveTo(-i*Math.sin(r/2),i*Math.cos(r/2)-n);for(let d=0;d<u;d++)h.lineTo(-(a*Math.sin(r/2-r/u*d)),a*Math.cos(r/2-r/u*d)-n);for(let d=0;d<u;d++)h.lineTo(-(e*Math.sin(Math.PI/-2+Math.PI/u*d)),e*Math.cos(Math.PI/-2+Math.PI/u*d));return new ja(h,{depth:.1,bevelEnabled:!1,UVGenerator:hZ(t)})},"createSectorGeometry"),gT=l((r,t,e)=>{let i=Math.sqrt(Math.pow(r,2)+Math.pow(t,2))/e;return i>1?i=1:i<0&&(i=0),new ne(0,i)},"generateRadialUV"),hZ=l(r=>({generateTopUV:l((t,e,n,i,a)=>{let u=e[n*3],h=e[n*3+1],d=e[i*3],m=e[i*3+1],v=e[a*3],x=e[a*3+1];return[gT(u,h,r),gT(d,m,r),gT(v,x,r)]},"generateTopUV"),generateSideWallUV:l(()=>[new ne(0,1),new ne(0,1),new ne(0,1),new ne(0,1)],"generateSideWallUV")}),"radialUVGenerator");function tL(r,t){if(t==null)return r;let e={latitude:r==null?void 0:r.latitude,longitude:r==null?void 0:r.longitude,accuracy:r==null?void 0:r.accuracy,floor:r==null?void 0:r.floor,heading:r==null?void 0:r.heading};return"latitude"in t&&(e.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?r==null?void 0:r.latitude:t.latitude),"longitude"in t&&(e.longitude=t.longitude==null||t.longitude==="device"?r==null?void 0:r.longitude:t.longitude),"accuracy"in t&&(e.accuracy=t.accuracy==="device"?r==null?void 0:r.accuracy:t.accuracy),"floor"in t&&(e.floor=t.floor==="device"?r==null?void 0:r.floor:t.floor),"heading"in t&&(e.heading=t.heading==="device"?r==null?void 0:r.heading:t.heading),e}l(tL,"getPositionWithOverrides");function fZ([r,t],[e,n],[i,a]){let u=e-r,h=n-t,d=u**2+h**2;if(d===0)return;let m=((i-r)*u+(a-t)*h)/d,v;m<=0?v=[r,t]:m>=1?v=[e,n]:v=[r+m*u,t+m*h];let x=H0([i,a],v);return{proportion:Math.max(0,Math.min(1,m)),intersection:v,distance:x}}l(fZ,"getPointLineIntersection");function eL(r,t){if(r==null||r.length<2)return;let e=Number.MAX_SAFE_INTEGER,n,i=0,a=0;for(let u=0;u<r.length-1;u++){let h=r[u],d=r[u+1],m=fZ(h,d,t);m!=null&&m.distance<e&&(e=m.distance,n=m.intersection,i=u,a=m.proportion)}if(n)return{intersection:n,distance:e,segmentIndex:i,proportion:a}}l(eL,"findBlueDotOnPath");function rL(r,t){let e=new na({color:r,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,i=.35*4,a=QD(Math.PI/6,i,n);new jf().load(KD,h=>{e.alphaMap=h,e.needsUpdate=!0});let u=new ue(a,e);return u.position.z=-.05,u.renderOrder=0,u}l(rL,"createHeadingCone");function nL(r,t){let e=new V0(1,1,.05,32),n=new na({transparent:!0,color:r,opacity:t,depthTest:!1,depthWrite:!1}),i=new ue(e,n);return i.scale.set(0,0,.05),i.renderOrder=1,i.rotation.x=Math.PI/2,i}l(nL,"createAccuracyRing");function iL(r){let t=new V0(.35,.35,.07,32),e=new na({transparent:!0,color:$D,depthTest:!1,depthWrite:!1}),n=new ue(t,e);n.renderOrder=2;let i=new V0(.35*.8,.35*.8,.01,32),a=new na({transparent:!0,color:r,depthTest:!1,depthWrite:!1}),u=new ue(i,a);return u.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,u.rotation.x=Math.PI/2,u.position.z=.07,{outerMesh:n,innerMesh:u}}l(iL,"createBlueDot");var lL=$r(oL(),1);var Or,Qr,cf,Au,hs,fs,Nu,pf,hf,ff,Un,qo,n0,ku,i0,o0,s0,_2,C2,a0,S2,l0,I2,Tl,Ru,M2,$c,Lm,wl,u0,yT=class yT{constructor(t,e){R(this,Or);R(this,Qr);R(this,cf,null);b(this,"primaryGeometry");b(this,"secondaryGeometry");R(this,Au);R(this,hs);R(this,fs);R(this,Nu);R(this,pf);R(this,hf);R(this,ff);R(this,Un,JD);R(this,qo,1);R(this,n0);R(this,ku);b(this,"bounds");b(this,"state","disabled");b(this,"following",!1);R(this,i0,l(t=>{var e;return(e=p(this,Qr).getMapData())==null?void 0:e.getById("floor",t)},"#getFloorByFloorId"));R(this,o0,l(t=>{var n;let e;if(t!=null){let i=(n=p(this,Qr).currentMap)==null?void 0:n.currentFloorStack.floorObjectsByElevation.get(t);e=i?p(this,i0).call(this,i.id):void 0}return e},"#getFloorByFloorLevel"));R(this,s0,l(()=>this.state!=="hidden"&&this.state!=="disabled","#shouldUpdateGeometry"));R(this,_2,l((t,e)=>{p(this,I2).call(this),t.scale.set(p(this,qo),p(this,qo),p(this,qo)),t.position.z=.07/2*p(this,qo),e.scale.set(p(this,qo),p(this,qo),p(this,qo)),e.position.z=.07*p(this,qo),this.state==="active"?e.material.color.set(p(this,Un).color):this.state==="inactive"&&e.material.color.set(p(this,Un).inactiveColor)},"#updatePrimaryGeometry"));R(this,C2,l((t,e)=>{if(this.state==="active"){let n=this.accuracy;n!=null?(t.visible=!0,p(this,hf)&&p(this,hf).stop(),V(this,hf,new Ho({scale:t.scale.x}).to({scale:n/2},150).onUpdate(({scale:a})=>{t.scale.set(a,1,a)}).start()),p(this,Or).getInternalTweenGroup().add(p(this,hf))):t.visible=!1;let i=this.heading;if(i!=null){e.visible=!0,p(this,ff)&&p(this,ff).stop();let{start:a,end:u}=X0(e.rotation.z,-Ie.degToRad(i));V(this,ff,new Ho({rotation:a}).to({rotation:u},150).onUpdate(({rotation:h})=>{e.rotation.z=h}).start()),p(this,Or).getInternalTweenGroup().add(p(this,ff)),e.scale.set(p(this,qo),p(this,qo),1)}else e.visible=!1}else this.state==="inactive"&&(e.visible=!1,t.visible=!1)},"#updateSecondaryGeometry"));R(this,a0,l(t=>{if(!p(this,s0).call(this))return;let[e,n]=t.children;p(this,_2).call(this,e,n)},"#updatePrimaryGeometryPerFrame"));R(this,S2,l(t=>{if(!p(this,s0).call(this))return;let[e,n]=t.children;p(this,C2).call(this,e,n)},"#updateSecondaryGeometryPerFrame"));R(this,l0,l(t=>{var h,d;let e;try{e=vZ.parse(tL(t,p(this,hs)))}catch(m){p(this,Tl).call(this,"error"),tt.error("BlueDot: Position parse failed",m instanceof Q.ZodError?m.message:String(m));return}p(this,Un).debug&&tt.log("BlueDot: Parsed position",e);let{min:n,max:i}=this.bounds||{};if(n!=null&&i!=null&&isFinite(n.x)&&isFinite(n.y)&&isFinite(i.x)&&isFinite(i.y)){let m=p(this,Or).convertTo3DMapPosition(e.latitude,e.longitude,0);if(!(m.x>=n.x&&m.x<=i.x&&m.y>=n.y&&m.y<=i.y)){tt.warn("BlueDot: Position [".concat(e.longitude,", ").concat(e.latitude,"] is outside map bounds. Position update will be discarded."));return}}V(this,fs,e),p(this,Tl).call(this,"position-update"),p(this,Nu)&&clearTimeout(p(this,Nu)),typeof p(this,Un).timeout=="number"&&p(this,Un).timeout<1/0&&V(this,Nu,setTimeout(()=>{p(this,Un).debug&&tt.log("BlueDot: Position timed out after ".concat(p(this,Un).timeout,"ms")),p(this,Tl).call(this,"timeout"),p(this,Or).render()},p(this,Un).timeout)),(d=p(this,Qr).getMapDataInternal())==null||d.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:e.latitude,longitude:e.longitude,floorLevel:(h=e.floor)==null?void 0:h.elevation,accuracy:e.accuracy}});let a=e.floor!=null?e.floor.id:p(this,Qr).currentFloor.id||"outdoors-container",u=[e.longitude,e.latitude];if(!this.primaryGeometry)this.primaryGeometry=p(this,Or).addCustomGeometry(r0,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:u}},{setup:l(m=>{let{outerMesh:v,innerMesh:x}=iL(p(this,Un).color);m.add(v),m.add(x),p(this,a0).call(this,m)},"setup"),update:p(this,a0)},{visible:!0,interactive:!0},a),this.secondaryGeometry=p(this,Or).addCustomGeometry(ZD,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:u}},{setup:l(m=>{let v=nL(p(this,Un).accuracyRing.color,p(this,Un).accuracyRing.opacity),x=rL(p(this,Un).heading.color,p(this,Un).heading.opacity);m.add(v),v.visible=!1,m.add(x),x.visible=!1},"setup"),update:p(this,S2)},{visible:!0,interactive:!1},a);else{let m=p(this,Or).getState(this.primaryGeometry);u=[m.position[0],m.position[1]]}p(this,pf)&&p(this,pf).stop(),V(this,pf,new Ho(u).to([e.longitude,e.latitude],1e3).easing(Vn.Cubic.Out).onUpdate(m=>{let v={position:[m[0],m[1]]};v.parent=a,this.primaryGeometry&&this.secondaryGeometry&&p(this,Or).setState(this.primaryGeometry,v),this.secondaryGeometry&&p(this,Or).setState(this.secondaryGeometry,v)}).start()),p(this,Or).getInternalTweenGroup().add(p(this,pf)),p(this,Qr).publish("blue-dot-position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),p(this,Or).render()},"#setPosition"));b(this,"onPositionUpdate",l(t=>{var e,n,i,a,u;if(this.state!=="disabled"){try{yZ.parse(t)}catch(h){p(this,Tl).call(this,"error"),tt.error("BlueDot: Browser sent invalid position",h instanceof Q.ZodError?h.message:String(h));return}V(this,Au,{latitude:(e=t.coords)==null?void 0:e.latitude,longitude:(n=t.coords)==null?void 0:n.longitude,accuracy:(i=t.coords)==null?void 0:i.accuracy,heading:(a=t.coords)==null?void 0:a.heading,floor:p(this,o0).call(this,(u=t.coords)==null?void 0:u.floorLevel)}),p(this,l0).call(this,p(this,Au))}},"onPositionUpdate"));b(this,"onPositionError",l(t=>{var e;switch(p(this,Tl).call(this,"error"),t.code){case t.PERMISSION_DENIED:tt.error("Geolocation permission denied by the user.",t),(e=p(this,Qr).getMapDataInternal())==null||e.Analytics.sendWatchPositionDenied();break;case t.POSITION_UNAVAILABLE:tt.error("Geolocation position unavailable.",t);break;case t.TIMEOUT:tt.error("Geolocation request timed out.",t);break;default:tt.error("An unknown geolocation error occurred.",t);break}p(this,Qr).publish("blue-dot-position-error",t)},"onPositionError"));R(this,I2,l(()=>{var e;let t=Math.round(p(this,Or).camera.zoomLevel*1e5);if(t!==p(this,n0)){V(this,n0,t);let n=(e=p(this,Or).getMetresPerPixel())!=null?e:1;V(this,qo,Math.max(p(this,Un).radius/(.35/n),1))}},"#updateScale"));R(this,Tl,l(t=>{let e=gZ[this.state].actions[t];if(e){switch(p(this,Un).debug&&tt.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(e," using ").concat(t)),e){case"hidden":case"disabled":this.primaryGeometry&&p(this,Or).setState(this.primaryGeometry,{visible:!1}),this.secondaryGeometry&&p(this,Or).setState(this.secondaryGeometry,{visible:!1});break;case"active":this.primaryGeometry&&p(this,Or).setState(this.primaryGeometry,{visible:!0}),this.secondaryGeometry&&p(this,Or).setState(this.secondaryGeometry,{visible:!0});break}this.state!==e&&(this.state=e,p(this,Qr).publish("blue-dot-state-change",{state:e,action:t}))}else tt.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(e," using ").concat(t))},"#transitionAction"));R(this,Ru);R(this,M2,l(()=>{if(p(this,Ru)==null&&p(this,Qr).Navigation.activeDirections!=null){let e=(Array.isArray(p(this,Qr).Navigation.activeDirections)?p(this,Qr).Navigation.activeDirections.flatMap(n=>n.coordinates):p(this,Qr).Navigation.activeDirections.coordinates).filter(n=>n.floorId===p(this,Qr).currentFloor.id);V(this,Ru,(0,lL.default)(e.map(n=>({x:n.longitude,y:n.latitude})),1e-5).map(n=>[n.x,n.y]))}return p(this,Ru)},"#getSimplifiedDirections"));R(this,$c,l(()=>{p(this,Or).camera.isAnimating&&p(this,Or).camera.cancelAnimation(),p(this,wl)&&(p(this,Qr).off("blue-dot-position-update",p(this,wl)),V(this,wl,void 0)),this.following=!1,V(this,Ru,void 0),p(this,Or).off("user-interaction-start",p(this,$c)),p(this,Qr).off("navigation-active-path-change",p(this,Lm)),p(this,Qr).publish("blue-dot-follow-change",{following:!1})},"#cancelFollow"));R(this,Lm,l(()=>{V(this,Ru,void 0)},"#pathChangeHandler"));R(this,wl);b(this,"follow",l((t,e)=>{var i,a,u,h;if(t===!1){p(this,$c).call(this);return}t!=="position-only"&&(e==null?void 0:e.bearing)!=null&&tt.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(t,"'. To control the bearing manually, use mode 'position-only'."));let n={zoomLevel:(i=e==null?void 0:e.zoomLevel)!=null?i:21,bearing:t==="position-only"?e==null?void 0:e.bearing:void 0,pitch:(a=e==null?void 0:e.pitch)!=null?a:45,duration:(u=e==null?void 0:e.duration)!=null?u:1e3,easing:(h=e==null?void 0:e.easing)!=null?h:"ease-in-out"};this.following?p(this,wl)&&p(this,Qr).off("blue-dot-position-update",p(this,wl)):(this.following=!0,p(this,Or).on("user-interaction-start",p(this,$c)),p(this,Qr).on("navigation-active-path-change",p(this,Lm))),V(this,wl,d=>{let{coordinate:m,heading:v,floor:x}=d;if(n.center=[m.longitude,m.latitude],x!=null&&x.id!==p(this,Qr).currentFloor.id&&(p(this,Qr).currentMap.setFloor(x.id),V(this,Ru,void 0)),t==="position-and-heading")n.bearing=v!=null?v:void 0;else if(t==="position-and-path-direction"){let S=p(this,M2).call(this);if(S!=null){let I=eL(S,[m.longitude,m.latitude]);if(I!=null){let w=S[I.segmentIndex],E=S[I.segmentIndex+1];n.bearing=$w(w,E)}}}p(this,Or).camera.animateTo(n)}),p(this,Qr).on("blue-dot-position-update",p(this,wl)),p(this,Qr).publish("blue-dot-follow-change",{following:!0,mode:t})},"follow"));R(this,u0,l(t=>{this.bounds=t},"#handlePanBoundsChange"));V(this,Or,t),V(this,Qr,e)}get heading(){var t;return(t=p(this,fs))==null?void 0:t.heading}get accuracy(){var t;return(t=p(this,fs))==null?void 0:t.accuracy}get coordinate(){var t,e;if(p(this,fs)!=null)return(p(this,ku)==null||((t=this.floor)==null?void 0:t.id)!==p(this,ku).floorId||p(this,fs).latitude!==p(this,ku).latitude||p(this,fs).longitude!==p(this,ku).longitude)&&V(this,ku,new ve(p(this,fs).latitude,p(this,fs).longitude,(e=this.floor)==null?void 0:e.id)),p(this,ku)}get floor(){var t;return(t=p(this,fs))==null?void 0:t.floor}enable(t){V(this,Un,(0,aL.default)({},t,p(this,Un))),p(this,Tl).call(this,"enable"),this.watchDevicePosition(p(this,Un).watchDevicePosition),this.bounds||(this.bounds=p(this,Or).getSystems().cameraSystem.panBounds,p(this,Or).on("pan-bounds-change",p(this,u0)))}disable(){this.primaryGeometry&&(p(this,Or).remove(this.primaryGeometry.id),this.primaryGeometry=void 0),this.secondaryGeometry&&(p(this,Or).remove(this.secondaryGeometry.id),this.secondaryGeometry=void 0),p(this,Nu)&&(clearTimeout(p(this,Nu)),V(this,Nu,void 0)),this.following&&p(this,$c).call(this),this.watchDevicePosition(!1),V(this,fs,void 0),V(this,hs,void 0),p(this,Tl).call(this,"disable"),p(this,Or).off("user-interaction-start",p(this,$c)),p(this,Qr).off("navigation-active-path-change",p(this,Lm)),p(this,Or).off("pan-bounds-change",p(this,u0))}watchDevicePosition(t){if(p(this,cf)&&(navigator.geolocation.clearWatch(p(this,cf)),V(this,cf,null)),p(this,Au)&&V(this,Au,void 0),t){if(this.state==="disabled"){tt.warn("BlueDot must be enabled before watching browser position.");return}V(this,cf,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(t){var n,i;t==null?V(this,hs,void 0):"coords"in t?V(this,hs,Object.assign({},p(this,hs),{latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy,heading:t.coords.heading,floor:p(this,o0).call(this,t.coords.floorLevel)})):(V(this,hs,Object.assign({},p(this,hs),t)),"floorOrFloorId"in t&&(p(this,hs).floor=typeof t.floorOrFloorId=="string"&&t.floorOrFloorId!=="device"?p(this,i0).call(this,t.floorOrFloorId):t.floorOrFloorId)),(((n=p(this,hs))==null?void 0:n.latitude)!=null&&((i=p(this,hs))==null?void 0:i.longitude)!=null||p(this,Au)!=null)&&p(this,l0).call(this,p(this,Au))}};Or=new WeakMap,Qr=new WeakMap,cf=new WeakMap,Au=new WeakMap,hs=new WeakMap,fs=new WeakMap,Nu=new WeakMap,pf=new WeakMap,hf=new WeakMap,ff=new WeakMap,Un=new WeakMap,qo=new WeakMap,n0=new WeakMap,ku=new WeakMap,i0=new WeakMap,o0=new WeakMap,s0=new WeakMap,_2=new WeakMap,C2=new WeakMap,a0=new WeakMap,S2=new WeakMap,l0=new WeakMap,I2=new WeakMap,Tl=new WeakMap,Ru=new WeakMap,M2=new WeakMap,$c=new WeakMap,Lm=new WeakMap,wl=new WeakMap,u0=new WeakMap,l(yT,"BlueDot");var Am=yT,gZ={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},yZ=Q.object({coords:Q.object({latitude:Q.number(),longitude:Q.number(),accuracy:Q.number(),altitude:Q.number().optional().nullable(),altitudeAccuracy:Q.number().optional().nullable(),heading:Q.number().optional().nullable(),speed:Q.number().optional().nullable(),floorLevel:Q.number().optional().nullable()}),timestamp:Q.number()}),vZ=Q.object({latitude:Q.number(),longitude:Q.number(),floor:Q.custom().optional(),accuracy:Q.number().optional(),heading:Q.number().optional().nullable()});y();var Fu,p0,vT=class vT{constructor({currentMapGetter:t}){R(this,Fu,new Map);R(this,p0);V(this,p0,t)}get currentMap(){return p(this,p0).call(this)}getById(t){return p(this,Fu).get(t)}add(t,e,n){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let a=i.Shapes.add(t,e||{},{floorId:n==null?void 0:n.id}),u=new Tu(a);return p(this,Fu).set(u.id,u),u}remove(t){var n;p(this,Fu).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),p(this,Fu).delete(t.id.toString()))}removeAll(){let t=[];return p(this,Fu).forEach(e=>{this.remove(e),t.push(e.id),p(this,Fu).delete(e.id.toString())}),t}};Fu=new WeakMap,p0=new WeakMap,l(vT,"Shapes");var c0=vT;y();var f0,bT=class bT{constructor({currentMapGetter:t}){R(this,f0);V(this,f0,t)}get currentMap(){return p(this,f0).call(this)}setFromStyleCollection(t){var e,n,i,a;for(let u in t)for(let h of((e=this.currentMap)==null?void 0:e.floors)||[]){if(t[u]==null||!h.layers.has(Gn))continue;let d=h.layers.get(Gn);if(d!=null&&d.layers.has(u)&&"color"in t[u]){let x=d.layers.get(u);x&&((n=this.currentMap)==null||n.renderer.setState(x,{color:t[u].color}))}if(d&&u===yc&&!(il in t)){let x=d.layers.get(il);x&&"color"in t[u]&&((i=this.currentMap)==null||i.renderer.setState(x,{color:t[u].color}))}if(!h.layers.has(Wp))continue;let m=h.layers.get(Wp),v=h.facadesByStyleId.get(u);if(v&&v.length>0)for(let x of v){let S=m.layers.get("".concat(x,"-").concat(u));S&&"color"in t[u]&&((a=this.currentMap)==null||a.renderer.setState(S,{color:t[u].color}))}}}};f0=new WeakMap,l(bT,"Style");var h0=bT;y();var xT={opacity:1},lo,d0,m0,Jc,Bu,df,_T,uL,CT=class CT{constructor(t,e){R(this,df);R(this,lo);R(this,d0,[]);R(this,m0,{opacity:"initial"});R(this,Jc,{opacity:new Map});R(this,Bu,new Set);V(this,lo,t),V(this,d0,e||[]);let n=p(this,lo).map;n&&n.on("idle",()=>{p(this,Jc).opacity.size||yt(this,df,_T).call(this,n)})}setStyle(t){var e,n;if(p(this,lo).map){(e=p(this,lo).map)==null||e.setStyle(t),p(this,Bu).size&&(p(this,Bu).clear(),this.hide()),yt(this,df,uL).call(this),yt(this,df,_T).call(this,p(this,lo).map),this.setOpacity(p(this,m0).opacity),(n=p(this,lo).map)==null||n.moveLayer(a_);for(let[i,a,u]of p(this,d0)||[])p(this,lo).hideOutdoorLayersIntersectingPolygons(i,a,u)}}get map(){return p(this,lo).map}get enabled(){return!!p(this,lo).map}get visible(){return p(this,Bu).size===0}show(){let t=p(this,lo).map;if(!t)return;let e=t.getStyle().layers;e&&(e.forEach(n=>{p(this,Bu).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),p(this,Bu).clear())}hide(t=[]){let e=p(this,lo).map;if(!e)return;let n=e.getStyle().layers;n&&n.forEach(i=>{let a=e.getLayoutProperty(i.id,"visibility");!t.includes(i.id)&&a!=="none"&&(e.setLayoutProperty(i.id,"visibility","none"),p(this,Bu).add(i.id))})}setOpacity(t,e=[]){var a,u;let n=p(this,lo).map;if(!n)return;let i=(u=(a=p(this,lo).map)==null?void 0:a.getStyle())==null?void 0:u.layers;i&&n.once("idle",()=>{i.forEach(h=>{let d=n.getLayoutProperty(h.id,"visibility");if(!e.includes(h.id)&&d!=="none")try{let m=p(this,Jc).opacity.get(h.id);m!==void 0&&(h.id==="background"||(h.type==="symbol"?(n.setPaintProperty(h.id,"icon-opacity",t==="initial"?m[0]:t),n.setPaintProperty(h.id,"text-opacity",t==="initial"?m[1]:t)):n.setPaintProperty(h.id,"".concat(h.type,"-opacity"),t==="initial"?m[0]:t)),p(this,m0).opacity=t)}catch(m){tt.warn("Error setting opacity:",m)}})})}};lo=new WeakMap,d0=new WeakMap,m0=new WeakMap,Jc=new WeakMap,Bu=new WeakMap,df=new WeakSet,_T=l(function(t){let e=t.getStyle().layers;e&&e.forEach(n=>{var a,u,h;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?p(this,Jc).opacity.set(n.id,[(a=t.getPaintProperty(n.id,"icon-opacity"))!=null?a:xT.opacity,(u=t.getPaintProperty(n.id,"text-opacity"))!=null?u:xT.opacity]):p(this,Jc).opacity.set(n.id,[(h=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?h:xT.opacity,void 0])))})},"#setInitialStyle"),uL=l(function(){Object.values(p(this,Jc)).forEach(t=>t.clear())},"#clearInitialStyle"),l(CT,"Outdoor");var Nm=CT;y();function cL(){Jb(!1)}l(cL,"disableText3DWorker");var Gu,Vu,Kc,ST=class ST{constructor({currentMapGetter:t}){R(this,Gu);R(this,Vu,new Map);R(this,Kc,new Map);V(this,Gu,t)}labelAll(t={}){var i,a;let e=[],n=new Set;return(a=(i=p(this,Gu).call(this))==null?void 0:i.Text3D.labelAll(t))==null||a.forEach(({textInfo:u,target:h})=>{let d=u.id.toString(),m=p(this,Kc).get(d);if(m){n.has(d)||e.push(m.text3DView),n.add(d);return}n.add(d);let v=new Uc(d,h);p(this,Vu).set(v.id,{targetId:h.id,text3d:d,text3DView:v}),p(this,Kc).set(d,{text3DView:v}),e.push(v)}),e}label(t,e,n={}){var a;if(p(this,Gu).call(this))if(ui.is(t)){let u=(a=p(this,Gu).call(this))==null?void 0:a.Text3D.label(t,e,n);if(!u)return;let h=u.textInfo.id.toString(),d=p(this,Kc).get(h);if(d)return d.text3DView;let m=new Uc(h,u.target);return p(this,Vu).set(m.id,{targetId:u.target.id,text3d:h,text3DView:m}),p(this,Kc).set(h,{text3DView:m}),m}else throw new Error("Non-space target is not supported")}remove(t){var i;let e=typeof t=="string"?t:t.id,n=p(this,Vu).get(e);n&&((i=p(this,Gu).call(this))==null||i.Text3D.remove(n.text3d),p(this,Vu).delete(e),p(this,Kc).delete(n.text3d))}removeAll(){p(this,Vu).forEach(t=>{var e;(e=p(this,Gu).call(this))==null||e.Text3D.remove(t.text3d)}),p(this,Vu).clear()}};Gu=new WeakMap,Vu=new WeakMap,Kc=new WeakMap,l(ST,"Text3D");var T2=ST;var w2=.05,y0,MT=class MT extends le{constructor(e,n,i){super();b(this,"core");b(this,"mapObjects",[]);b(this,"id");b(this,"mapDataExternal",{});b(this,"mapsByFloorId",{});b(this,"mapData");b(this,"currentMap");b(this,"hiddenOutdoorGeometries",[]);b(this,"lastFacadeIntersected");R(this,y0,!1);b(this,"mapView");b(this,"externalPubSub");b(this,"Camera");b(this,"Labels");b(this,"Text3D");b(this,"Markers");b(this,"Models");b(this,"Paths");b(this,"Exporter");b(this,"Navigation");b(this,"Outdoor");b(this,"BlueDot");b(this,"Shapes");b(this,"Style");b(this,"Images");b(this,"update",l(()=>{this.core.render()},"update"));this.core=e,this.mapView=n,this.externalPubSub=i,this.Camera=new A1(this),this.id=this.core.addGroupContainer("root").id.toString();let a=new q1("outdoors-container",void 0,void 0,this);this.mapObjects.push(a),this.currentMap=a,this.core.on("pre-render",()=>{i.publish("pre-render")}),this.core.on("post-render",()=>{i.publish("post-render")}),this.core.on("resize",()=>{i.publish("resize")}),this.core.on("render-error",({error:x})=>{i.publish("render-error",{error:new ww(x instanceof Error?x.message:"Unknown error")})});let u=l(x=>{let S=this.getMapDataObject(x);switch(S==null?void 0:S.__type){case"facade":return S;case"floor":return S.floorStack.facade;default:return null}},"getFacadeFromEntityId");this.core.on("geometry-in-focus",x=>{let S=new Set;for(let I of x){let w=u(I);w&&S.add(w)}i.publish("facades-in-view-change",{facades:Array.from(S)})}),this.core.getSystems().renderSystem.on("camera-state-change",()=>{i.publish("state-change-internal",{Camera:this.getCameraState()})});let h=new P1(this.Camera);this.core.on("camera-change",()=>{i.publish("camera-change",h)});let d=l(x=>S=>{let I=[],w=[],E=[],T=[];S.labels.forEach(J=>{let ot=this.Labels.getById(J.toString());ot&&I.push(ot.label)}),S.markers.forEach(J=>{let ot=this.Markers.getById(J.toString())||this.Navigation.getMarkerById(J.toString());ot&&w.push(ot.marker)}),S.models.forEach(J=>{let ot=this.Models.getById(J.toString());ot&&E.push(ot.model)}),S.paths.forEach(J=>{let ot=this.Paths.getById(J.toString())||this.Navigation.getPathById(J.toString());ot&&T.push(ot.path)});let D=S.geometry.includes(r0),A=S.geometry.filter(J=>J!==r0),L;A.length>0&&(L=A.map(J=>{var ot;return(ot=this.getMapDataInternal())==null?void 0:ot.getById("space",J)}).filter(Boolean)[0],L||(L=A.map(J=>{var ot;return(ot=this.getMapDataInternal())==null?void 0:ot.getById("object",J)}).filter(Boolean)[0]),L||(L=A.map(J=>this.Shapes.getById(J)).filter(Boolean)[0]));let B=S.containers.reduce((J,ot)=>{var H;let K=(H=this.getMapDataInternal())==null?void 0:H.getById("floor",ot);return K&&Io.is(K)&&J.push(K),J},[]),j,W=0;if(B.length>0){j=B[0].id;let J=this.core.getState(j);W=S.coordinate[2]?S.coordinate[2]-J.altitude:W}let $;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(J=>{this.core.setState(J.id,{hovered:!1})}),L&&ui.is(L)&&($=A.map(J=>{var ot;return(ot=this.getMapDataInternal())==null?void 0:ot.facadesBySpaceId[J]}).filter(Boolean)[0],$&&$.spaces.forEach(J=>{this.core.setState(J.id,{hovered:!0})})),this.lastFacadeIntersected=$;let F={coordinate:new ve({latitude:S.coordinate[1],longitude:S.coordinate[0],floorId:j,verticalOffset:W}),spaces:L&&ui.is(L)?[L]:[],objects:L&&Vo.is(L)?[L]:[],shapes:L&&Tu.is(L)?[L]:[],markers:w,labels:I,models:E,paths:T,blueDot:D,floors:B,facades:$?[$]:[]};"pointerEvent"in S&&(F.pointerEvent=S.pointerEvent),i.publish(x,F)},"createHandler");this.core.on("hover",d("hover")),this.core.on("click",d("click")),this.core.on("user-interaction-start",()=>{i.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{i.publish("user-interaction-end")});let m={currentMapGetter:l(()=>this.currentMap,"currentMapGetter")};this.Markers=new W1(m),this.Models=new K1(m),this.Labels=new R1(m),this.Text3D=new T2(m),this.Exporter=new k1(m),this.Paths=new t0(m),this.Navigation=new D1(this.core,this,m.currentMapGetter),this.on("navigation-state-change",x=>{this.externalPubSub.publish("state-change-internal",{Navigation:x})}),this.on("navigation-connection-click",x=>{this.externalPubSub.publish("navigation-connection-click",x)}),this.on("navigation-active-path-change",x=>{this.externalPubSub.publish("navigation-active-path-change",x)}),this.BlueDot=new Am(this.core,this),this.on("blue-dot-position-update",x=>{this._publishBlueDotState({coordinate:this.BlueDot.coordinate,heading:this.BlueDot.heading,accuracy:this.BlueDot.accuracy,floor:this.BlueDot.floor}),i.publish("blue-dot-position-update",x)}),this.on("blue-dot-state-change",x=>{this._publishBlueDotState({state:this.BlueDot.state}),i.publish("blue-dot-state-change",x)}),this.on("blue-dot-position-error",x=>{i.publish("blue-dot-position-error",x)}),this.on("blue-dot-follow-change",x=>{this._publishBlueDotState({following:this.BlueDot.following}),i.publish("blue-dot-follow-change",x)}),this.Outdoor=new Nm(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{i.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{i.publish("outdoor-style-loaded")})),this.Images=new $1(m),this.Shapes=new c0(m),this.Style=new h0(m);let v=new g2(n,this.mapDataExternal);this.auto=v.auto}get manualFloorVisibility(){return p(this,y0)}set manualFloorVisibility(e){V(this,y0,e),this.externalPubSub.publish("state-change-internal",{manualFloorVisibility:e})}get StackedMaps(){return this.currentMap.StackedMaps}preloadFloors(e){e.forEach(n=>{n instanceof Io&&this.core.setState(n.id,{preloadGeometry:!0})})}updateState(e,n){if(e==="interior-walls"){this.currentMap.floors.forEach(u=>{let h=u.layers.get(Gn);if(h){let d=h.layers.get(yc);d&&this.core.hasState(d)&&this.core.setState(d,IT(n,this.core.getState(d)))}});return}else if(e==="exterior-walls"){this.currentMap.floors.forEach(u=>{let h=u.layers.get(Gn);if(h){let d=h.layers.get(il);d&&this.core.hasState(d)&&this.core.setState(d,IT(n,this.core.getState(d)))}});return}else if(e==="interior-doors"){this.currentMap.floors.forEach(u=>{let h=u.layers.get(Gn);if(h){let d=h.layers.get(Sd);d&&this.core.hasState(d)&&this.core.setState(d,P2(n,this.core.getState(d)))}});return}else if(e==="exterior-doors"){this.currentMap.floors.forEach(u=>{let h=u.layers.get(Gn);if(h){let d=h.layers.get(Id);d&&this.core.hasState(d)&&this.core.setState(d,P2(n,this.core.getState(d)))}});return}let i=typeof e=="string"?this.getMapDataObject(e):e;if(i){if(i.__type!=="Path"&&!this.core.hasState(i.id)){tt.warn('Failed to update state for "'.concat(i.id,'". No ').concat(i.__type," found with that ID."));return}if(Vc.is(i))return this.core.setState(i.id,pL(rt(U({},n),{type:"label"}),this.core.getState(i.id)));if(Mu.is(i))return this.core.setState(i.id,hL(rt(U({},n),{type:"marker"}),this.core.getState(i.id)));if(ui.is(i)||Vo.is(i)){let u=this.core.getState(i.id);if(u!=null){let h=u.parent&&u.parent.type==="geometry-group"?this.core.getState(u.parent):void 0;this.core.setState(i.id,fL(rt(U({},n),{type:"geometry"}),u,h))}}if(ca.is(i)&&this.core.setState(i.id,P2(rt(U({},n),{type:"doors"}),this.core.getState(i.id))),Tu.is(i)&&this.core.setState(i.id,is(n,["altitude","color","opacity","height","visible","interactive"])),rf.is(i)){let a=n,{position:u,scale:h}=a,m=ea(a,["position","scale"]);u&&(m.position=[u.longitude,u.latitude,u.verticalOffset]),h!=null&&(Array.isArray(h)?m.scale=h:m.scale=[h,h,h]),u&&i.updateTarget(u),this.core.setState(i.id,m)}if(Io.is(i)){let u=this.currentMap.floorsById.get(i.id);if(u==null)return;this.core.setState(i.id,is(n,["visible","altitude"]));let h=u.layers.get(Gn);h!=null&&"geometry"in n&&this.core.setState(h.containerId,is(n.geometry,["opacity","visible"]));let d=u.layers.get(iu);d!=null&&"labels"in n&&"enabled"in n.labels&&typeof n.labels.enabled=="boolean"&&d.setVisible(n.labels.enabled);let m=u.layers.get(ol);m!=null&&"markers"in n&&"enabled"in n.markers&&typeof n.markers.enabled=="boolean"&&m.setVisible(n.markers.enabled);let v=u.layers.get(qg);v!=null&&"footprint"in n&&this.core.setState(v.containerId,is(n.footprint,["visible","height","opacity","side","color","altitude"]));let x=u.layers.get(qp);x!=null&&"occlusion"in n&&"enabled"in n.occlusion&&typeof n.occlusion.enabled=="boolean"&&x.setVisible(n.occlusion.enabled);let S=u.layers.get(sl);S!=null&&"images"in n&&"visible"in n.images&&typeof n.images.visible=="boolean"&&S.setVisible(n.images.visible)}if(Ps.is(i)){let u=this.core.getState(i.id);for(let h of u.children)h.type==="group-container"&&this.core.setState(h.id,is(n,["opacity","visible"]))}if(Uc.is(i)&&this.core.setState(i.id,is(n,ex)),ba.is(i))for(let u of i.segments)this.core.setState(u.id,is(n,bZ));xm.is(i)&&this.core.setState(i.id,is(n,xZ))}}getMapDataObject(e){var n;return(n=this.getMapDataInternal())==null?void 0:n.getMapDataById(e)}getMapDataInternal(){if(this.mapData)return py(this.mapData)}getMapData(){return this.mapData}addMap(e,n){return new Promise(i=>{var S,I,w,E;let a;try{a=py(e)}catch(T){tt.error("Error adding map",T),i(e);return}this.mapDataExternal[e.mapName]=e,this.mapData=e;let{mvf:u}=a,h=u["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new ve(h[1],h[0])});let d=u["manifest.geojson"].features[0].properties.name,m=new q1("mapObject-".concat(d),a,n,this);this.currentMap=m,this.currentMap.setFloor(this.currentMap.startingFloorId);let v=this.core.getBoundingArea(m.currentFloor.id);v==null&&tt.error("Could not determine bounding box for map:",m.currentFloor.id);let x=(I=(S=n==null?void 0:n.outdoorView)==null?void 0:S.layersHiddenByGeometry)!=null?I:[];if(x.length>0){let T,D=[];for(let A of m.floorStacksById.values())if(A.defaultFloor.footprint&&A.defaultFloor.footprint.geometry!=null&&((w=A.defaultFloor.footprint.geometry)==null?void 0:w.coordinates.length)>0){let L=A.defaultFloor.footprint,B=b2(L);T==null?T=B:mL(T,B),D.push(L)}D.length>0&&T!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(T,D,x),this.hiddenOutdoorGeometries.push([T,D,x]))}if(this.mapObjects.push(m),a.getMVFFeatureByType("floor").forEach(T=>{this.mapsByFloorId[T.id]=m}),m.StackedMaps.on("stacked-maps-state-change",({state:T})=>{this.externalPubSub.publish("stacked-maps-state-change",{state:T})}),m.on("floor-change-start",T=>{var D,A,L,B;this.externalPubSub.publish("floor-change-start",{reason:T.reason,floor:(A=(D=this.getMapDataInternal())==null?void 0:D.getById("floor",T.floorId))!=null?A:this.currentFloor,previousFloor:(B=(L=this.getMapDataInternal())==null?void 0:L.getById("floor",T.previousFloorId))!=null?B:this.currentFloor})}),m.on("floor-change",T=>{var D,A;this.externalPubSub.publish("floor-change",{reason:T.reason,floor:this.currentFloor,previousFloor:(A=(D=this.getMapDataInternal())==null?void 0:D.getById("floor",T.previousFloorId))!=null?A:this.currentFloor}),this.externalPubSub.publish("state-change-internal",{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack})}),(n==null?void 0:n.zoomLevel)!=null)this.core.camera.setZoomLevel(n.zoomLevel),i(e);else if(this.core.mode!=="outdoors-overlay"&&v){let T=(E=n==null?void 0:n.screenOffsets)!=null?E:{top:w2*this.core.canvasHeight,left:w2*this.core.canvasWidth,right:w2*this.core.canvasWidth,bottom:w2*this.core.canvasHeight};this.core.camera.focusOn(v,{duration:y7,padding:T}).then(()=>{this.Camera.setElevation(this.currentFloor.elevation),i(e)})}else i(e)})}setFloor(e,n){return this.currentMap.setFloor(Ug(e),n)}setFloorStack(e,n){return this.currentMap.setFloorStack(Ug(e),n)}updateWatermark(e){this.core.updateWatermark(e)}get currentFloorStack(){var i;let e=this.currentMap.currentFloorStack.id;if(!e)throw new Ci("Missing currentFloorStack.");let n=(i=this.mapData)==null?void 0:i.getById("floor-stack",e);if(!n)throw new Ci("FloorStack was not found in map data.");return n}get currentFloor(){var i;let e=this.currentMap.currentFloor.id;if(!e)throw new Ci("Missing currentFloor object from GeoJsonApi");let n=(i=this.mapData)==null?void 0:i.getById("floor",e);if(!n)throw new Ci("Missing currentFloor");return n}getState(e){var a,u,h,d,m,v,x,S,I,w,E,T,D,A,L,B,j,W,$,F,J,ot;typeof e=="object"&&ba.is(e)&&tt.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let n=dL(e,this),i=this.core.getState(n);if(i)if(["interior-walls","exterior-walls"].includes(e)){let{color:K,topColor:H,texture:_t,topTexture:ct,visible:ft,height:mt,opacity:St}=i;return{type:"walls",visible:ft,color:K,topColor:H,texture:_t?{url:_t}:void 0,topTexture:ct?{url:ct}:void 0,height:mt,opacity:St}}else if(["interior-doors","exterior-doors"].includes(e)){let{color:K,topColor:H,texture:_t,topTexture:ct,visible:ft,opacity:mt}=i;return{type:"doors",visible:ft,color:K,topColor:H,opacity:mt,texture:_t?{url:_t}:void 0,topTexture:ct?{url:ct}:void 0}}else if(i.type==="geometry"){let K;"parent"in i&&i.parent&&i.parent.type==="geometry-group"&&(K=this.core.getState(i.parent));let H=K!=null&&K.altitude?i.altitude+K.altitude:i.altitude;return{type:"geometry",interactive:i.interactive,hoverColor:i.hoverColor,color:i.color,visible:i.visible,opacity:i.opacity,height:i.height,texture:i.texture?{url:i.texture}:void 0,topTexture:i.topTexture?{url:i.topTexture}:void 0,flipImageToFaceCamera:i.flipImageToFaceCamera,topColor:i.topColor,altitude:H}}else{if(i.type==="label"&&i.options.appearance&&i.options.rank!==void 0&&i.options.interactive!==void 0)return{type:"label",text:i.text,appearance:i.options.appearance,rank:i.options.rank,enabled:i.enabled,interactive:i.options.interactive};if(i.type==="marker"&&((a=i.options)==null?void 0:a.rank)!==void 0&&i.options.interactive!==void 0){let K=typeof i.parent=="object"?i.parent.id:i.parent,H=this.Markers.getById(i.id.toString()),_t=H!=null&&H.marker.target?H==null?void 0:H.marker.target.anchorTarget:void 0;return _t==null&&(_t=new ve(i.position[1],i.position[0],K.toString())),{type:"marker",rank:i.options.rank,interactive:i.options.interactive,enabled:i.enabled,element:i.element,anchor:i.anchor,zIndex:i.options.zIndex,dynamicResize:i.dynamicResize,lowPriorityPin:i.options.lowPriorityPin,contentHTML:i.contentHTML}}else if(i.type==="model"){let K=i!=null&&typeof i.parent=="object"?i.parent.id.toString():(u=i.parent)==null?void 0:u.toString();return delete i.parent,rt(U({},i),{position:new ve({latitude:i.position[1],longitude:i.position[0],verticalOffset:i.position[2],floorId:K}),type:"model"})}else{if(i.type==="image")return{type:"image"};if(i.type==="text3d")return i;if(i.type==="geometry-group"&&e&&typeof e!="string"&&Tu.is(e)){let[K]=i.children;if(K.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(h=i.altitude)!=null?h:0,visible:i.visible,color:i.color,height:K.height,opacity:i.opacity,interactive:i.interactive}}else{if(i.type==="path")return{type:"path",color:i.color,visible:i.visible,nearRadius:i.nearRadius,farRadius:i.farRadius,altitude:i.altitude,completeFraction:i.completeFraction};if(i.type==="group-container"&&typeof e!="string"&&Io.is(e)){let K=(d=this.currentMap.floorsById.get(e.id))==null?void 0:d.layers.get(Gn),H=K?this.core.getState(K.containerId):void 0,_t=(m=this.currentMap.floorsById.get(e.id))==null?void 0:m.layers.get(iu),ct=(v=this.currentMap.floorsById.get(e.id))==null?void 0:v.layers.get(ol),ft=(x=this.currentMap.floorsById.get(e.id))==null?void 0:x.layers.get(qg),mt=ft?this.core.getState(ft.containerId):void 0,St=(S=this.currentMap.floorsById.get(e.id))==null?void 0:S.layers.get(qp),dt=St?this.core.getState(St.containerId):void 0,xt=(I=this.currentMap.floorsById.get(e.id))==null?void 0:I.layers.get(sl),q=xt?this.core.getState(xt.containerId):void 0;return{type:"floor",geometry:{opacity:(w=H==null?void 0:H.opacity)!=null?w:0,visible:(E=H==null?void 0:H.visible)!=null?E:!0},labels:{enabled:(T=_t==null?void 0:_t.visible)!=null?T:!1},markers:{enabled:(D=ct==null?void 0:ct.visible)!=null?D:!1},footprint:{altitude:(A=mt==null?void 0:mt.altitude)!=null?A:0,visible:(L=mt==null?void 0:mt.visible)!=null?L:!1,height:(B=mt==null?void 0:mt.height)!=null?B:0,opacity:(j=mt==null?void 0:mt.opacity)!=null?j:0,side:(W=mt==null?void 0:mt.side)!=null?W:"double",color:($=mt==null?void 0:mt.color)!=null?$:"white"},images:{visible:(F=q==null?void 0:q.visible)!=null?F:!1},occlusion:{enabled:(J=dt==null?void 0:dt.visible)!=null?J:!1},visible:i.visible,altitude:(ot=i.altitude)!=null?ot:0}}else if(i.type==="group-container"&&i.children.length>0&&typeof e!="string"&&Ps.is(e)){let K=this.core.getState(i.children[0].id);return{type:"facade",opacity:K.opacity,visible:K.visible}}}}}}setHoverColor(e){this.core.setState({hoverColor:e})}getHoverColor(){let e=this.core.getState();return(e==null?void 0:e.type)==="map-view"?e.hoverColor:void 0}createCoordinateFromScreenCoordinate(e,n,i){var m;if(i!=null){let v=this.core.projectScreenXYToCoordinate(e,n,!0);return v?new ve(v.coordinate[1],v.coordinate[0],i.id):void 0}let a=this.core.projectScreenXYToCoordinate(e,n);if(a==null||a.coordinate==null)return;let{coordinate:u,groupContainers:h}=a,d=(m=h==null?void 0:h.find(v=>{let x=v.userData.entityId.toString();return x.includes("f_")||x.includes("m_")}))==null?void 0:m.userData.entityId.toString();return new ve(u[1],u[0],d)}getScreenCoordinateFromCoordinate(e){var i,a,u;let n=0;if(e.floorId!=null){let h=(i=this.mapData)==null?void 0:i.getById("floor",e.floorId);h!=null&&(n=(u=(a=this.getState(h))==null?void 0:a.altitude)!=null?u:0)}return this.core.projectCoordinateToScreenXY([e.longitude,e.latitude,n])}isInView(e){return this.core.isInView(typeof e=="string"?e:e.id)}auto(){return{labels:this.Labels.all()}}tween(e){let n=new Ho(e);return this.core.getExternalTweenGroup().add(n),this.core.render(),n}removeTween(e){this.core.getExternalTweenGroup().remove(e)}tweenGroup(){return this.core.getExternalTweenGroup()}get __core(){return this.core}getCameraState(){return this.core.camera.getState()}getNavigationState(){return{isMultiFloor:this.Navigation.isMultiFloor,floorStacks:this.Navigation.floorStacks,floors:this.Navigation.floors,activeDirections:this.Navigation.activeDirections,activePath:this.Navigation.activePath,paths:this.Navigation.paths}}getAllState(){return{currentFloor:this.currentFloor,currentFloorStack:this.currentFloorStack,Camera:this.getCameraState(),Navigation:this.getNavigationState(),manualFloorVisibility:this.manualFloorVisibility}}publishAllState(){this.externalPubSub.publish("state-change-internal",this.getAllState())}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}_publishBlueDotState(e){let n;if(e)n=e;else{let{state:i,following:a,heading:u,accuracy:h,coordinate:d,floor:m}=this.BlueDot;n={state:i,following:a,heading:u,accuracy:h,coordinate:d,floor:m}}this.externalPubSub.publish("state-change-internal",{BlueDot:n})}getOptimalVisualDistanceBetweenFloors(e,n=!1){let i=this.currentMap;if(!i){tt.error("Cannot compute optimal visual distance between floors. Missing current map.");return}if(e.length<2){tt.warn("Cannot compute optimal visual distance between floors. Must provide at least 2 floors.");return}let a=i.renderer.getInternalState().geometry3DMap.get(e[0].id),u=i.renderer.getInternalState().geometry3DMap.get(e[1].id);if(!a||!u){tt.warn("Cannot compute optimal visual distance between floors. Floors not found in current map.");return}if(Hl(a,"group-container"),Hl(u,"group-container"),n){let d=new In;d.setFromObject(a);let m=new In;if(m.setFromObject(u),a.children.forEach(T=>{T instanceof ue&&T.userData.debugBox&&Jr(T)}),u.children.forEach(T=>{T instanceof ue&&T.userData.debugBox&&Jr(T)}),!Is(d)||!Is(m))return;let v=new Fo(d.max.x-d.min.x,d.max.y-d.min.y,d.max.z-d.min.z),x=new On({color:255,transparent:!0,opacity:.5}),S=new ue(v,x);S.position.set((d.min.x+d.max.x)/2,(d.min.y+d.max.y)/2,(d.min.z+d.max.z)/2),S.userData.debugBox=!0;let I=new Fo(m.max.x-m.min.x,m.max.y-m.min.y,m.max.z-m.min.z),w=new On({color:"cyan",transparent:!0,opacity:.5}),E=new ue(I,w);E.position.set((m.min.x+m.max.x)/2,(m.min.y+m.max.y)/2,(m.min.z+m.max.z)/2),E.userData.debugBox=!0,a.add(S),u.add(E)}let h=i.renderer.computeMinZOffsetBetweenContainers(a,u);if(h!==-1)return h}};y0=new WeakMap,l(MT,"GeoJsonApi");var g0=MT;function gL(r){if(r===""){LM(""),DM("");return}DM("".concat(r,"/").concat(c_)),LM("".concat(r,"/").concat(u_))}l(gL,"setWorkersUrl");var bZ=["color","nearRadius","farRadius","visible","completeFraction","altitude"],xZ=["color","altitude"];y();var TT=class TT{constructor(t){b(this,"state");b(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};l(TT,"Debug");var E2=TT;y();var yL=Pi.object({environment:Pi.union([Pi.literal("basic"),Pi.literal(!1)]).optional(),text3d:Pi.object({hoverColor:Pi.string().optional()}).optional(),geometry:Pi.object({hoverColor:Pi.string().optional()}).optional(),backgroundColor:Pi.string().optional(),backgroundAlpha:Pi.number().optional()}).strict();y();var wT=$r(P3(),1);var _Z=l((r,t)=>{let e={},n=l((i,a,u)=>{for(let h in a){let d=i[h],m=a[h];typeof m=="object"&&!Array.isArray(m)&&m!==null&&typeof d=="object"&&!Array.isArray(d)&&d!==null?(u[h]={},n(d,m,u[h])):u[h]=d}},"processObject");return n(r,t,e),e},"extractProperties"),vL=l((r,t)=>{let e=_Z(r,t),n=(0,wT.default)({},e,t),i=(0,wT.default)({},e),a=l((u,h,d,m=i)=>{for(let v in h){let x=u[v],S=h[v];if(typeof S=="number"&&typeof x=="number")m[v]=x+(S-x)*d;else if(typeof S=="string"&&typeof x=="string"){if(hg(x)&&hg(S)){let I=i_(x),w=i_(S);I&&w?m[v]=Jw([I[0]+(w[0]-I[0])*d,I[1]+(w[1]-I[1])*d,I[2]+(w[2]-I[2])*d]):tt.warn('Color "'.concat(v,'" could not be animated!'))}}else typeof S=="object"&&S!==null&&typeof x=="object"&&x!==null?a(x,S,d,m[v]):tt.warn('Value "'.concat(v,'" could not be animated!'))}},"interpolate");return u=>(u=Math.min(Math.max(u,0),1),u===0?r:u===1?n:(a(e,t,u),i))},"animationFactory");var mf,jt,Pl,PT=class PT{constructor(t){R(this,mf);R(this,jt);R(this,Pl);b(this,"Camera");b(this,"Labels");b(this,"Text3D");b(this,"Markers");b(this,"Images");b(this,"Models");b(this,"Paths");b(this,"Exporter");b(this,"Navigation");b(this,"BlueDot");b(this,"Style");b(this,"Shapes");b(this,"Outdoor");b(this,"update",l(()=>{p(this,jt).core.render()},"update"));b(this,"getDirections",l((t,e,n)=>{var i;return(i=p(this,jt).getMapData())==null?void 0:i.getDirections(t,e,n)},"getDirections"));b(this,"getDirectionsMultiDestination",l((t,e,n)=>{var i;return(i=p(this,jt).getMapData())==null?void 0:i.getDirectionsMultiDestination(t,e,n)},"getDirectionsMultiDestination"));b(this,"on",l((t,e)=>{p(this,mf).on(t,e)},"on"));b(this,"off",l((t,e)=>{p(this,mf).off(t,e)},"off"));b(this,"Debug");V(this,mf,new le),V(this,Pl,t);let e=new g0(t,this,p(this,mf));V(this,jt,e),this.Camera=p(this,jt).Camera,this.Markers=p(this,jt).Markers,this.Models=p(this,jt).Models,this.Labels=p(this,jt).Labels,this.Text3D=p(this,jt).Text3D,this.Exporter=p(this,jt).Exporter,this.Paths=p(this,jt).Paths,this.Navigation=p(this,jt).Navigation,this.BlueDot=p(this,jt).BlueDot,this.Shapes=p(this,jt).Shapes,this.Style=p(this,jt).Style,this.auto=p(this,jt).auto,this.Outdoor=p(this,jt).Outdoor,this.Images=p(this,jt).Images,p(this,Pl).container.dataset.version=P.env.npm_package_version,this.Debug=new E2(p(this,jt).core)}get StackedMaps(){return p(this,jt).currentMap.StackedMaps}updateState(t,e){return p(this,jt).updateState(t,e)}animateState(t,e,n){var d;let i=p(this,jt).getState(t);if(i==null)return tt.warn("Cannot animate state of ".concat(t,".")),new Promise(v=>v({result:"completed"}));let a=vL(i,e),u=p(this,jt).tween({percent:0}).to({percent:1},(d=n==null?void 0:n.duration)!=null?d:1e3).onUpdate(({percent:m})=>{p(this,jt).updateState(t,a(m))});n!=null&&n.easing&&n.easing in xu&&u.easing(xu[n.easing]);let h=new Promise(m=>{u.onComplete(()=>{p(this,jt).removeTween(u),m({result:"completed"})}).onStop(()=>{p(this,jt).removeTween(u),m({result:"cancelled"})}),u.start()});return h.cancel=()=>{u.stop(),p(this,jt).updateState(t,a(0))},h}updateGlobalState(t){var e,n,i,a;try{yL.parse(t)}catch(u){tt.error("updateGlobalState",u);return}if(typeof t=="object"){let u={};if((e=t.text3d)!=null&&e.hoverColor&&(u.text3dHoverColor=t.text3d.hoverColor),(n=t.geometry)!=null&&n.hoverColor&&(u.hoverColor=t.geometry.hoverColor),t.backgroundColor||t.backgroundAlpha!==void 0){let h=(i=t.backgroundColor)!=null?i:p(this,jt).core.backgroundColor,d=(a=t.backgroundAlpha)!=null?a:p(this,jt).core.backgroundAlpha;p(this,jt).core.setBackgroundColor(h,d)}t.environment!=null&&p(this,jt).core.setEnvironment(t.environment),p(this,jt).core.setState(u)}}get options(){return _7(p(this,jt).currentMap.options)}getGlobalState(){let t=p(this,jt).core.getState();return{backgroundColor:p(this,jt).core.backgroundColor,backgroundAlpha:p(this,jt).core.backgroundAlpha,environment:p(this,jt).core.getEnvironment(),geometry:{hoverColor:t.hoverColor},text3d:{hoverColor:t.text3dHoverColor}}}getMapData(){if(p(this,jt).mapData==null)throw new Ci("MapData not found.");return p(this,jt).mapData}getDimensions(){return{width:p(this,Pl).canvasWidth,height:p(this,Pl).canvasHeight}}expand(t){var e;return(e=p(this,jt).currentMap)==null?void 0:e.StackedMaps.expand(t)}collapse(t){var e;return(e=p(this,jt).currentMap)==null?void 0:e.StackedMaps.collapse(t)}addMap(t,e){return p(this,jt).addMap(t,e)}setFloor(t,e){return p(this,jt).setFloor(t,e==null?void 0:e.context)}setFloorStack(t,e){return p(this,jt).setFloorStack(t,e==null?void 0:e.context)}preloadFloors(t){p(this,jt).preloadFloors(t)}tween(t){return p(this,jt).tween(t)}removeTween(t){p(this,jt).removeTween(t)}get tweenGroup(){return p(this,jt).tweenGroup()}get currentFloorStack(){return p(this,jt).currentFloorStack}get currentFloor(){return p(this,jt).currentFloor}updateWatermark(t){p(this,jt).updateWatermark(t)}getState(t){return p(this,jt).getState(t)}setHoverColor(t){p(this,jt).setHoverColor(t)}getHoverColor(){return p(this,jt).getHoverColor()}convertAltitudeToMercatorZoomLevel(t){return p(this,jt).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(t)}convertMercatorZoomLevelToAltitude(t){return p(this,jt).core.getSystems().cameraSystem.convertZoomLevelToAltitude(t)}isInView(t){return p(this,jt).isInView(t)}getDistance(t,e){var n;return(n=p(this,jt).getMapData())==null?void 0:n.getDistance(t,e)}createCoordinate(t,e,n){return typeof t=="object"?new ve(t):new ve(t,e,n==null?void 0:n.id)}createCoordinateFromScreenCoordinate(t,e,n){return p(this,jt).createCoordinateFromScreenCoordinate(t,e,n)}getScreenCoordinateFromCoordinate(t){return p(this,jt).getScreenCoordinateFromCoordinate(t)}auto(){return{labels:this.Labels.all()}}get __core(){if(P.env.INTERNAL==="true")return p(this,jt).core;throw new Error("__core is not available.")}get container(){return p(this,Pl).container}publishAllState(){p(this,jt).publishAllState()}clear(){p(this,jt).clear()}destroy(){p(this,jt).destroy()}async enableDebug(t={}){let{Inspector:e}=await import("./inspector-DPNZIY36.js");await new e(this,p(this,jt)).enable(t)}async takeScreenshot(){return await p(this,Pl).renderSync(),p(this,Pl).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return p(this,jt).manualFloorVisibility}set manualFloorVisibility(t){p(this,jt).manualFloorVisibility=t}getOptimalVisualDistanceBetweenFloors(t){return p(this,jt).getOptimalVisualDistanceBetweenFloors(t)}};mf=new WeakMap,jt=new WeakMap,Pl=new WeakMap,l(PT,"MapView");var km=PT;y();y();var ET=class ET extends le{constructor(e){super();b(this,"gl");b(this,"el",document.createElement("div"));b(this,"core");b(this,"origin");b(this,"map");b(this,"layer");b(this,"handleStyleChange",l(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));b(this,"handleMove",l(()=>{if(!this.map)return;let[e,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(e,n),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(Ie.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Ie.degToRad(this.map.getPitch()))},"handleMove"));b(this,"handleError",l(e=>{tt.warn(e)},"handleError"));this.origin=e}onAdd(e){this.origin=this.origin||e.getCenter().toArray(),this.gl=e.painter.context.gl,this.core=new C1(e._container,{center:this.origin,zoomLevel:e.getZoom(),pitch:e.getPitch(),bearing:e.getBearing(),gl:this.gl,map:e,mode:"outdoors-overlay"}),this.map=e,this.core.camera.setMinZoomLevel(e.getMinZoom()),this.core.camera.setMaxZoomLevel(e.getMaxZoom()),this.core.camera.setMinPitch(e.getMinPitch()),this.core.camera.setMaxPitch(e.getMaxPitch()),this.map.on("error",this.handleError);let n=oP.fromLngLat(this.origin,0);return this.layer=tv(n,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};l(ET,"MapLibreOverlay");var O2=ET;var gf,yf,Rm,Qc,vf,v0=class v0{constructor(t,e,n){R(this,gf);R(this,yf);R(this,Rm);R(this,Qc);R(this,vf);b(this,"on",l((t,e)=>{p(this,gf).on(t,e)},"on"));b(this,"off",l((t,e)=>{p(this,gf).off(t,e)},"off"));V(this,gf,new le),V(this,vf,new O2(t)),V(this,yf,e),V(this,Rm,n)}onAdd(t){var i,a;let e=p(this,vf).onAdd(t),n=rt(U(U({},Yp),(i=p(this,Rm))!=null?i:{}),{outdoorView:U({token:p(this,yf).outdoorViewToken},(a=p(this,Rm))==null?void 0:a.outdoorView)});return V(this,Qc,new km(p(this,vf).core)),p(this,Qc).addMap(p(this,yf),n).then(()=>{p(this,gf).publish("loaded",{mapView:p(this,Qc),mapData:p(this,yf)})}),e}onRemove(){p(this,Qc)&&p(this,Qc).clear(),v0.instance=null,p(this,vf).onRemove()}};gf=new WeakMap,yf=new WeakMap,Rm=new WeakMap,Qc=new WeakMap,vf=new WeakMap,l(v0,"MappedinMapLibreOverlay"),b(v0,"instance");var Fm=v0;y();var CZ=1e3*60*60*2,tp,Gm,on,Ia,Ma,Us,Ta,Vm,jm,b0,dn,bL,xL,Bm,D2,OT,DT,LT,AT=class AT{constructor(t,e){R(this,dn);R(this,tp,new le);R(this,Gm);R(this,on);R(this,Ia);R(this,Ma);R(this,Us);R(this,Ta);R(this,Vm);R(this,jm);R(this,b0,l(()=>{"key"in p(this,on)&&"secret"in p(this,on)&&yt(this,dn,Bm).call(this),yt(this,dn,D2).call(this)},"#handleWindowFocus"));b(this,"on",l((t,e)=>p(this,tp).on(t,e),"on"));b(this,"off",l((t,e)=>p(this,tp).off(t,e),"off"));V(this,Gm,t),V(this,on,e)}setMapIds(t){V(this,Gm,t)}setEnterprise(t){p(this,on).enterprise=t}async readySync(){var i;if((!("key"in p(this,on))||!("secret"in p(this,on)))&&!("accessToken"in p(this,on))){tt.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[yt(this,dn,Bm).call(this),null];p(this,on).enterprise||(t[1]=this.getSasTokensAsync());let[e,n]=await Promise.all(t);yt(this,dn,LT).call(this),yt(this,dn,OT).call(this,e),n!=null&&yt(this,dn,DT).call(this,n),pg()&&((i=globalThis.addEventListener)==null||i.call(globalThis,"focus",p(this,b0)))}async refreshing(){let t=[];return p(this,Ia)!=null&&t.push(p(this,Ia)),p(this,Ma)!=null&&t.push(p(this,Ma)),Promise.all(t)}getAccessTokenAsync(){return yt(this,dn,Bm).call(this)}getSasTokensAsync(){return yt(this,dn,D2).call(this)}getAccessToken(){return p(this,Us)==null?(tt.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):p(this,Us)}getSasToken(t){return this.isEnterpriseMode()?(tt.error("SAS tokens are not available in the enterprise mode!"),{token:""}):p(this,Ta)==null?(tt.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in p(this,Ta).tokens?p(this,Ta).tokens[t]:(tt.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=p(this,on).enterprise)!=null?t:!1}destroy(){yt(this,dn,LT).call(this),p(this,tp).destroy(),pg()&&globalThis.removeEventListener("focus",p(this,b0))}};tp=new WeakMap,Gm=new WeakMap,on=new WeakMap,Ia=new WeakMap,Ma=new WeakMap,Us=new WeakMap,Ta=new WeakMap,Vm=new WeakMap,jm=new WeakMap,b0=new WeakMap,dn=new WeakSet,bL=l(function(t){var n;let e=t.token!==((n=p(this,Us))==null?void 0:n.token);V(this,Us,t),e&&p(this,tp).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),xL=l(function(t){var n;let e=JSON.stringify(t.tokens)!==JSON.stringify((n=p(this,Ta))==null?void 0:n.tokens);V(this,Ta,t),e&&p(this,tp).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),Bm=l(async function(t=!1){var e;if("accessToken"in p(this,on)&&typeof p(this,on).accessToken=="string"){let n={token:p(this,on).accessToken,expires:Date.now()+72e5};return V(this,Us,n),n}if(!("key"in p(this,on))||!("secret"in p(this,on))||typeof p(this,on).key!="string"||typeof p(this,on).secret!="string")throw new Error("No API keys or access token provided!");return p(this,Ia)!=null?p(this,Ia):p(this,Us)!=null&&p(this,Us).expires!=null&&p(this,Us).expires>Date.now()&&!t?p(this,Us):(V(this,Ia,iy(rt(U({},p(this,on)),{key:p(this,on).key,secret:p(this,on).secret}),(e=p(this,on).enterprise)!=null?e:!1).then(n=>{let i={token:n.accessToken,expires:n.expiresTimestamp*1e3};return yt(this,dn,bL).call(this,i),i})),p(this,Ia).finally(()=>{V(this,Ia,void 0)}),p(this,Ia))},"#refreshAccessToken"),D2=l(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:p(this,Ma)!=null?p(this,Ma):p(this,Ta)!=null&&p(this,Ta).expires>Date.now()&&!t?p(this,Ta):(V(this,Ma,new Promise((e,n)=>{yt(this,dn,Bm).call(this).then(i=>{let a={},u=p(this,Gm).map(h=>IS(rt(U({},p(this,on)),{mapId:h}),i.token).then(d=>{a[h]={token:d.token,expires:d.expires}}).catch(d=>{tt.error("Error getting SAS token for map ".concat(h,":"),d)}));Promise.all(u).then(()=>{let h={tokens:a,expires:Math.min(...Object.values(a).map(d=>{var m;return(m=d.expires)!=null?m:1/0}))};yt(this,dn,xL).call(this,h),e(h)})}).catch(i=>{n(i)})})),p(this,Ma).catch(e=>{throw e}).finally(()=>{V(this,Ma,void 0)}),p(this,Ma))},"#refreshSasTokens"),OT=l(function(t){if(!("key"in p(this,on))||!("secret"in p(this,on)))return;let e=t.expires!=null?t.expires-Date.now():CZ;isFinite(e)&&V(this,Vm,setTimeout(()=>{yt(this,dn,Bm).call(this,!0).then(n=>{yt(this,dn,OT).call(this,n)})},e-G7))},"#setAccessTokenRefresh"),DT=l(function(t){let e=t.expires-Date.now();isFinite(e)&&V(this,jm,setTimeout(()=>{yt(this,dn,D2).call(this,!0).then(n=>{yt(this,dn,DT).call(this,n)})},e-U7))},"#setSasTokensRefresh"),LT=l(function(){p(this,Vm)!=null&&clearTimeout(p(this,Vm)),p(this,jm)!=null&&clearTimeout(p(this,jm))},"#stopRefreshing"),l(AT,"TokenManager");var Um=AT;y();var _L=l(async(r,t)=>{var w,E,T,D,A,L,B;let e=(T="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?T:"options"in r&&"version"in((w=r.options)!=null?w:{})?(E=r.options)==null?void 0:E.version:void 0,n=rt(U({prefetchTokens:!0},t||{}),{mvfVersion:e}),i,a=Sc();a.updateByUserOption(n);let u={};if("type"in r&&typeof r.type=="string"){if(u.enterprise=(D=r.options)==null?void 0:D.enterprise,r.type==="binary"&&r.main instanceof Uint8Array){i=await oy(r.main,n.mvfVersion),u.languagePacks=[];for(let j of(A=r.languagePacks)!=null?A:[])j.localePack instanceof Uint8Array&&u.languagePacks.push({language:j.language,localePack:await Od(j.localePack)})}else if(r.type==="json")i=r.main,u.languagePacks=(L=r.languagePacks)!=null?L:[];else throw new Error("Invalid backup type");r.type==="binary"&&r.main instanceof Uint8Array&&(u.binaryBundle=r.main)}else i=r,u.enterprise=i.enterprise!=null;let h=fb(i),d=h.length>0?h:[n.mapId],m=new Um(d,rt(U({},n),{enterprise:u.enterprise})),v;if("accessToken"in n)v=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=a.getBaseAuthUri(u.enterprise);let j=await m.getAccessTokenAsync();v=(j==null?void 0:j.token)||""}if(u.outdoorViewToken=v,u.env=a,u.getMapDataOptions=n,n.prefetchTokens)try{await m.readySync()}catch(j){tt.error("Failed to ready token manager!",j)}let x=new bf(i,u);v&&x.Analytics.init(rt(U({accessToken:v,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0},n.analytics),{baseUri:a.getAnalyticsBaseUri(),context:(B=n.analytics)==null?void 0:B.context}));let S=new cy(x),I=x.findPreferredLanguage({languageCode:n.language,fallbackToNavigatorLanguage:!1});if(I)try{await S.changeLanguage(I.code)}catch(j){}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(i),S},"hydrateMapData");y();var CL=l((r,{id:t}={})=>{let e=Array.isArray(r)?r:[r];if(!e.every(a=>typeof a=="string"))return;let n=e.join(""),i=null;if(t){let a=document.getElementById(t);a instanceof HTMLStyleElement&&(i=a)}i==null&&(i=document.createElement("style")),t&&t!==""&&(i.id=t),i.textContent=n,document.head.appendChild(i)},"injectCSS");var SL=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var IL=".mappedin-marker {\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor=\"low-priority-pin\"]> .mappedin-marker-content {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker::before {\n content: '';\n display: none;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n\n.mappedin-marker[data-anchor=\"low-priority-pin\"]::before {\n display: block;\n}\n";var ML=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var TL=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var wL=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var PL='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';y();function EZ(r){var t,e;if(!(!r.languages||!pg()||!((e=(t=globalThis.navigator)==null?void 0:t.languages)!=null&&e.length)))for(let n=0;n<globalThis.navigator.languages.length;n++){let i=r.languages.find(a=>a.code.toLowerCase()===globalThis.navigator.languages[n].toLowerCase());if(i)return{code:i.code,name:i.name}}}l(EZ,"findNavigatorPreferredLanguageInVenue");function L2(r,t){var u,h,d;let e=(u=t==null?void 0:t.languageCode)!=null?u:"",n=(h=t==null?void 0:t.fallbackToNavigatorLanguage)!=null?h:!0,i=(d=r==null?void 0:r.languages)==null?void 0:d.find(m=>m.code.toLowerCase()===e.toLowerCase()),a;if(i)a=i;else if(n==null||n)try{let m=EZ(r);m&&(a=m)}catch(m){tt.error("fallbackToNavigatorLanguage is set, however, there was an error getting the navigator language",m)}return a!=null?a:r.defaultLanguage}l(L2,"findPreferredLanguageInVenue");var OZ=[SL,IL,ML,TL,wL,PL],EL;function DZ(r){EL=r}l(DZ,"__setWatermarkOnClickFn");var LZ=l(async(r,t)=>{let e,n=Sc();t&&n.updateByUserOption(t);try{t&&(e=(await iy(rt(U({},t),{baseAuthUri:n.getBaseAuthUri()}))).accessToken)}catch(u){tt.warn("Getting access token failed. Outdoor map disabled.",u)}let i=new bf(r,{outdoorViewToken:e,languagePacks:t==null?void 0:t.languagePacks,env:n});return new cy(i)},"hydrateMapDataFromMVF"),OL=!1;function AZ(r){OL=r}l(AZ,"setUseEnterpriseAPI");var DL=l(async r=>{var T,D;let t=OL,e,n=Sc();n.updateByUserOption(r);let i=rt(U({prefetchTokens:!0},r),{fallbackToNavigatorLanguage:(T=r.fallbackToNavigatorLanguage)!=null?T:!0}),a=new Um([i.mapId],i);if("accessToken"in i){e=i.accessToken;let{aud:A,sub:L}=z0(e);(v7.some(B=>A.includes(B))||L&&L.startsWith("client"))&&(t=!0,a.setEnterprise(t))}else if("key"in i&&"secret"in i){if(i.key.startsWith("mipk_"))throw new Error("Partner API keys detected! \n\nPartner API keys should not be passed directly to the SDK. See https://developer.mappedin.com/docs/rest-apis/partner for more details.");i.key.startsWith("mik_")||(t=!0,a.setEnterprise(t)),i.baseAuthUri=n.getBaseAuthUri(t),e=(await a.getAccessTokenAsync()).token}else throw new Error("Missing key or secret.");i.layoutId!=null&&(t?i.layoutId!=="draft"&&tt.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):tt.warn("layoutId is currently unsupported!")),i.baseUri=n.getBaseUri(t);let u=performance.now(),h,d;if(t){let A=rt(U({},i),{venue:i.mapId,clientId:i.key,clientSecret:i.secret,version:"1.0.0",perspective:i.viewId,useDraftData:i.layoutId==="draft"}),L=await wS(A);h=L.compressed,d=L.localePacks}else h=await PS(i,e);let m=performance.now(),v=await oy(h,i.mvfVersion),x=performance.now();typeof r.onMVFParsed=="function"&&r.onMVFParsed(v);let S=fb(v);if(S.length>0?a.setMapIds(S):a.setMapIds([i.mapId]),i.prefetchTokens)try{await a.readySync()}catch(A){tt.error("Failed to ready token manager!",A)}let I=new bf(v,{env:n,outdoorViewToken:e,tokenManager:a,enterprise:t,localePacksUrls:d,binaryBundle:h,getMapDataOptions:i}),w=new cy(I,{search:r.search});I.Analytics.init(rt(U({accessToken:e,mapId:i.mapId,key:"key"in i?i.key:void 0,secret:"secret"in i?i.secret:void 0},i.analytics),{baseUri:n.getAnalyticsBaseUri(),context:(D=i.analytics)==null?void 0:D.context})),I.Analytics.sendGetMapDataEvent({parseDuration:x-m,downloadDuration:m-u,viewId:i.viewId});let E=I.findPreferredLanguage({languageCode:i.language,fallbackToNavigatorLanguage:i.fallbackToNavigatorLanguage});if(E)try{await w.changeLanguage(E.code)}catch(A){}return w},"getMapData"),NZ=DL,kZ=l((r,t)=>{Fm.instance!=null&&tt.warn("Only a single map venue is supported at this time.");let e=new Fm([r.mapCenter.longitude,r.mapCenter.latitude],r,t);return Fm.instance=e,e},"createMapLibreOverlay"),LL=l(async()=>{if(hh===""||h2==="")return!1;let r=[fetch(hh,{mode:"same-origin"}),fetch(h2,{mode:"same-origin"})],[t,e]=[{ok:!1},{ok:!1}];try{[t,e]=await Promise.all(r)}catch(n){}return{collision:t.ok,maplibre:e.ok}},"checkWorkerUrls"),AL=l(async(r,t,e)=>{var S,I,w,E,T,D,A,L,B,j,W,$,F,J,ot,K;let n=performance.now(),i=pS(e,t);i&&cS(i),((S=i.injectStyles)==null||S)&&CL(OZ,{id:"mappedin__styles"});let a=x7((I=t.outdoorViewToken)!=null?I:""),u=py(t);(w=i.outdoorView)!=null&&w.style&&u.envControl.updateTileServerBaseUrl((E=i.outdoorView)==null?void 0:E.style);let h=!1,d=!1,m=await LL();m&&(m.collision||(h=!0),m.maplibre||(d=!0));let v=await TD(r,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:i.bearing,pitch:i.pitch,zoomLevel:i.zoomLevel,backgroundAlpha:(T=i.style)==null?void 0:T.backgroundAlpha,backgroundColor:(D=i.style)==null?void 0:D.backgroundColor,outdoorView:!d&&((A=i.outdoorView)!=null&&A.token)?{headers:{"x-mappedin-tiles-key":(L=i.outdoorView)==null?void 0:L.token},style:t.getEnv().tileServerUri,enabled:!!((B=i.outdoorView)!=null&&B.enabled),lowDpi:(j=i.outdoorView)==null?void 0:j.lowDpi}:void 0,watermark:rt(U({},i.watermark),{visible:($=(W=i.watermark)==null?void 0:W.visible)!=null?$:!u.enterpriseMode&&!a.remove_watermark,onClick:EL||void 0}),attribution:i.attribution,antialias:typeof i.antialiasing=="boolean"?i.antialiasing:!!((F=i.antialiasing)!=null&&F.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(J=i.occlusion)==null?void 0:J.enabled,transformImageRequest:u.enterpriseMode?void 0:u.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:i.imagePlacementOptions,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:i.onWebGLContextRestored,onWebGLRendererError:i.onWebGLRendererError,useStandaloneCamera:(ot=i.useStandaloneCamera)!=null?ot:!1,useWorkers:!((K=i.disableWorkers)!=null&&K),useCollisionWorker:!h}),x=new km(v);return await x.addMap(t,i),u.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:x.getDimensions(),collisionWorkerDisabled:h,outdoorsWorkerDisabled:d}),x},"show3dMap"),RZ=AL;function js(r){return r.verticalOffset===0?[r.longitude,r.latitude]:[r.longitude,r.latitude,r.verticalOffset]}l(js,"convertCoordinateToPosition");function BZ(r){return new Map(r.map(t=>{let{properties:e}=t,{id:n}=e;return[n,t]}))}l(BZ,"getEntranceMap");var $M=l((r,t)=>{let e=BZ(t),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:r[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let i of r){let a=[i.geometry.coordinates],u=(i.properties.entrances||[]).reduce((h,d)=>(e.has(d)&&h.push(e.get(d)),h),[]);if(u.length){let{entrances:h,obstructions:d}=AS(i,u);a=d.map(m=>m.geometry.coordinates),n.entrances.features.push(...h)}n.walls.geometry.coordinates.push(...a)}return n},"cutEntrancesFromLineStrings");function pL(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.text&&(e.text=r.text),r.appearance&&(e.options.appearance=r.appearance),r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!==void 0&&(e.enabled=r.enabled),r.interactive!==void 0&&(e.options.interactive=r.interactive),r.enabled!==void 0&&(e.enabled=r.enabled),e}l(pL,"translateLabelStateToGeojsonCore");function hL(r,t){let e={options:{}};if(!e.options)throw new Error("options should exist");return r.rank!=null&&(r.rank==="initial"?e.options.rank=t.initialRank||2:e.options.rank=r.rank),r.enabled!=null&&(e.enabled=r.enabled),r.interactive!=null&&(e.options.interactive=r.interactive),r.enabled!==null&&(e.enabled=r.enabled),r.contentHTML!==void 0&&(e.contentHTML=r.contentHTML),e}l(hL,"translateMarkerStateToGeojsonCore");function P2(r,t){var n,i;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((n=r.texture)==null?void 0:n.url)!==void 0&&(e.texture=r.texture.url),((i=r.topTexture)==null?void 0:i.url)!==void 0&&(e.topTexture=r.topTexture.url),r.opacity!==void 0&&(e.opacity=r.opacity)),e}l(P2,"translateDoorsStateToGeojsonCore");function IT(r,t){var n,i;let e={};return t==null||(r.color&&(r.color==="initial"?e.color=t.initialColor:e.color=r.color),r.topColor&&(r.topColor==="initial"?e.topColor=t.initialTopColor:e.topColor=r.topColor),r.visible!==void 0&&(e.visible=r.visible),((n=r.texture)==null?void 0:n.url)!==void 0&&(e.texture=r.texture.url),((i=r.topTexture)==null?void 0:i.url)!==void 0&&(e.topTexture=r.topTexture.url),r.height!==void 0&&(e.height=r.height),r.opacity!==void 0&&(e.opacity=r.opacity)),e}l(IT,"translateWallsStateToGeojsonCore");function fL(r,t,e){var i,a,u;let n={};return t==null||(r.color&&(r.color==="initial"?n.color=t.initialColor:n.color=r.color),r.topColor&&(r.topColor==="initial"?n.topColor=t.initialTopColor:n.topColor=r.topColor),r.visible!==void 0&&(n.visible=r.visible),((i=r.texture)==null?void 0:i.url)!==void 0&&(n.texture=r.texture.url),((a=r.topTexture)==null?void 0:a.url)!==void 0&&(n.topTexture=r.topTexture.url),r.hoverColor!==void 0&&(n.hoverColor=r.hoverColor),r.interactive!==void 0&&(n.interactive=r.interactive),r.height!==void 0&&(n.height=r.height),r.opacity!==void 0&&(n.opacity=r.opacity),r.flipImageToFaceCamera!==void 0&&(n.flipImageToFaceCamera=r.flipImageToFaceCamera),r.altitude!==void 0&&(n.altitude=r.altitude-((u=e==null?void 0:e.altitude)!=null?u:0))),n}l(fL,"translateSpaceStateToGeojsonCore");function NL(r,t){return((t-r+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}l(NL,"differenceBetweenAngles");function kL(r,t){let e="Left";return r<=-Math.PI/4?e="Right":r<=-t?e="SlightRight":r<=t?e="Straight":r<=Math.PI/4?e="SlightLeft":e="Left",e}l(kL,"getRelativeBearing");function qD(r){let t={};for(let e in r){let n=r[e];if(n!=null){if(n.id=e,"polygons"in n)for(let i of n.polygons)t[i]=n;else if("lineStrings"in n)for(let i of n.lineStrings)t[i]=n;else if("points"in n)for(let i of n.points)t[i]=n}}return t}l(qD,"extractStyleMap");function v2(r,t){return r.reduce((e,n)=>{let i=t[n.properties.id];if(i==null)return e;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let a=rt(U({},i),{id:i.id+"-textures"});e.set(a,[n])}else e.has(i)||e.set(i,[]),e.get(i).push(n);return e},new Map)}l(v2,"groupGeometryByStyle");function wm(r,t={}){var i,a,u,h,d,m,v;let e=rt(U({},r),{flipImageToFaceCamera:(i=t==null?void 0:t.flipImagesToFaceCamera)!=null?i:!0}),n=(u=(a=t==null?void 0:t.style)==null?void 0:a.shading)!=null?u:t==null?void 0:t.shadingAndOutlines;if(n===!0?e.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(e.shading={start:n.start,end:n.end,intensity:n.intensity}),e.outline=(d=(h=t==null?void 0:t.style)==null?void 0:h.outlines)!=null?d:t==null?void 0:t.shadingAndOutlines,"lineStrings"in r){let x=(v=(m=t==null?void 0:t.style)==null?void 0:m.wallTopColor)!=null?v:t==null?void 0:t.wallTopColor;x!=null&&(e.topColor=x)}return e}l(wm,"translateToCoreStyle");var dL=l((r,t)=>{var i;let n=((i=t.currentMap)==null?void 0:i.currentFloor).layers.get(Gn);switch(r){case"interior-walls":return n==null?void 0:n.layers.get(yc);case"exterior-walls":return n==null?void 0:n.layers.get(il);case"interior-doors":return n==null?void 0:n.layers.get(Sd);case"exterior-doors":return n==null?void 0:n.layers.get(Id);default:return typeof r=="string"?r:r.id}},"getTargetID");function lT(r){return new Promise(t=>{r.onComplete(t),r.onStop(t)})}l(lT,"tweenToPromise");function b2(r){return r.bbox?r.bbox:Kn(r)}l(b2,"getBoundingBox");function mL(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1]),Math.max(r[2],t[2]),Math.max(r[3],t[3])]}l(mL,"expandBbox");function RL(r){return[...new Set(r)]}l(RL,"unique");function uT(r,t,e){return r.floorId&&t.has(r.floorId)?t.get(r.floorId):e}l(uT,"getTargetFloorObject");function Tm(r){if(ui.is(r)||Vo.is(r))return r.id}l(Tm,"getAttachableGeometryId");function WD(r,t,e){var a,u,h,d,m,v;let n=r.coordinates.length===2,i=!0;if(n&&r.coordinates[0].floorId!=null&&r.coordinates[1].floorId!=null){let x=t==null?void 0:t.getById("floor",r.coordinates[0].floorId),S=t==null?void 0:t.getById("floor",r.coordinates[1].floorId);x&&S&&(i=((u=(a=e.getState(x))==null?void 0:a.visible)!=null?u:!0)&&((d=(h=e.getState(S))==null?void 0:h.visible)!=null?d:!0))}else{let x=r.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",r.coordinates[0].floorId):void 0;i=x&&(v=(m=e.getState(x))==null?void 0:m.visible)!=null?v:!0}return i}l(WD,"determineFloorVisibleBasedOnPath");y();function Uu(r,t){var e,n,i,a;if(ih.is(r))return r.navigationTarget.flatMap(u=>Uu(u,t));if(nu.is(r)){let u=t.Query.nearest(r,{types:["node"],lineOfSight:!0});return(e=u==null?void 0:u[0])!=null&&e.feature.id?[u[0].feature.id]:[]}else if(ve.is(r)){let u=t.Query.nearest(r,{types:["node"],lineOfSight:!0});return(n=u==null?void 0:u[0])!=null&&n.feature.id?[u[0].feature.id]:[]}else if(ru.is(r)){let u=t.Query.nearest(r,{types:["node"],lineOfSight:!0});return(i=u==null?void 0:u[0])!=null&&i.feature.id?[u[0].feature.id]:[]}else if(ca.is(r)){let u=t==null?void 0:t.getMVFFeatureById("entrance",r.id);return u!=null&&u.properties.node?[u==null?void 0:u.properties.node]:[]}else if(tu.is(r)){let u=t==null?void 0:t.getMVFFeatureById("area",r.id);return(a=u==null?void 0:u.properties.destinationNodes)!=null?a:[]}else if(ui.is(r)){let u=t==null?void 0:t.getMVFFeatureById("space",r.id);return u==null?[]:u.properties.destinationNodes}else{if(bc.is(r))return r.coordinates.reduce((u,h)=>{var m;let d=t.Query.nearest(h,{types:["node"],lineOfSight:!0});return(m=d==null?void 0:d[0])!=null&&m.feature.id&&u.push(d[0].feature.id),u},[]);if(Vo.is(r)){let u=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[r.id];return u!=null?u:[]}else return Ps.is(r)?r.spaces.flatMap(u=>{var h,d;return(d=(h=t==null?void 0:t.getMVFFeatureById("space",u.id))==null?void 0:h.properties.destinationNodes)!=null?d:[]}).filter(u=>typeof u=="string"):nl.is(r)?r.nodes.map(u=>u.id):$l.is(r)?[r.id]:[]}}l(Uu,"getNodesFromTarget");var FL=Math.PI*.1,zn,uo,Li,zu,Hu,Xu,xf,Hm,zs,BL,zm,GL,NT=class NT{constructor(t,e,n,i,a){R(this,zs);b(this,"id");R(this,zn,{});R(this,uo);R(this,Li);R(this,zu);R(this,Hu);R(this,Xu);R(this,xf);R(this,Hm);var u;this.id=(u=a==null?void 0:a.id)!=null?u:Mr(),V(this,uo,e),V(this,Li,t.features),V(this,zu,n),V(this,Hu,i)}get path(){return p(this,Li).map(t=>p(this,uo).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(p(this,zn).departure)return p(this,zn).departure;if(p(this,Li).length===0||p(this,zu).length===0)return;let t=p(this,Li)[0].properties.id,e=p(this,zu)[0];if(p(this,zu).length>1){for(let n of p(this,zu))if(Uu(n,p(this,uo)).includes(t)){e=n;break}}return p(this,zn).departure=e,e}get destination(){if(p(this,zn).destination)return p(this,zn).destination;if(p(this,Li).length===0||p(this,Hu).length===0)return;let t=p(this,Li)[p(this,Li).length-1].properties.id,e=p(this,Hu)[0];if(p(this,Hu).length>1){for(let n of p(this,Hu))if(Uu(n,p(this,uo)).includes(t)){e=n;break}}return p(this,zn).destination=e,e}get coordinates(){return p(this,zn).coordinates?p(this,zn).coordinates:(p(this,zn).coordinates=p(this,Li).map(t=>new ve(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),p(this,zn).coordinates)}get distance(){return p(this,zn).distance?p(this,zn).distance:(p(this,zn).distance=p(this,Li).reduce((t,e)=>t+(e.properties.distance||0),0),p(this,zn).distance)}get instructions(){if(p(this,Li).length<2)return[];if(p(this,zn).instructions)return p(this,zn).instructions;let t=[],e=0;for(let n=0;n<p(this,Li).length;n++){let i=p(this,Li)[n],a=p(this,Li)[n-1],u=p(this,Li)[n+1],h=new ve(i.geometry.coordinates[1],i.geometry.coordinates[0],i.properties.groupBy),d=yt(this,zs,BL).call(this,{prevDirection:a,direction:i,nextDirection:u});e+=(a==null?void 0:a.properties.distance)||0;for(let m of d)m&&(t.push({action:m,distance:e,coordinate:h,node:p(this,uo).getById("node",i.properties.id)}),e=0)}return p(this,zn).instructions=t,p(this,zn).instructions}toJSON(){return{id:this.id,directions:p(this,Li),__type:"directions",from:p(this,zu),to:p(this,Hu)}}};zn=new WeakMap,uo=new WeakMap,Li=new WeakMap,zu=new WeakMap,Hu=new WeakMap,Xu=new WeakMap,xf=new WeakMap,Hm=new WeakMap,zs=new WeakSet,BL=l(function(t){var w,E;let{prevDirection:e,direction:n,nextDirection:i}=t,a=e&&p(this,uo).getById("floor",e.properties.groupBy),u=p(this,uo).getById("floor",n.properties.groupBy),h=i&&p(this,uo).getById("floor",i.properties.groupBy),d=[];e||d.push({type:"Departure"});let m=p(this,uo).getMVFFeatureByNodeId("connection",n.properties.id),v=m?p(this,uo).getById("connection",m.id):void 0,x=m&&m.nodes.length>1,S=p(this,uo).enterpriseMode&&(!n.properties.destination||!(m!=null&&m.nodes.includes(n.properties.destination))||!(m!=null&&m.nodes.includes(n.properties.id)));if(m&&!(!x||S))if(!p(this,Xu)||p(this,Xu)==="exit")d.push(yt(this,zs,zm).call(this,"TakeConnection",u,h,v,m)),V(this,Xu,"take"),V(this,xf,v),V(this,Hm,m);else{let T=p(this,uo).getMVFFeatureByNodeId("connection",(w=e==null?void 0:e.properties.id)!=null?w:""),D=p(this,uo).getById("connection",(E=T==null?void 0:T.id)!=null?E:"");d.push(yt(this,zs,zm).call(this,"ExitConnection",u,a,D,T)),V(this,Xu,"exit"),V(this,xf,v),V(this,Hm,m)}else p(this,Xu)==="take"?(d.push(yt(this,zs,zm).call(this,"ExitConnection",u,a,p(this,xf),p(this,Hm))),V(this,Xu,"exit"),V(this,xf,v)):h&&u.id!==h.id?d.push(yt(this,zs,zm).call(this,"TakeConnection",u,h,v)):a&&a.id!==u.id?d.push(yt(this,zs,zm).call(this,"ExitConnection",u,a,v)):d.push(yt(this,zs,GL).call(this,e,n));return i||d.push({type:"Arrival"}),d},"#getActions"),zm=l(function(t,e,n,i,a){var d,m;let u="none";if(e.elevation!=null&&(n==null?void 0:n.elevation)!=null){let v=e.elevation-n.elevation;v>0?u="down":v<0&&(u="up")}let h=(m=(d=i==null?void 0:i.type)!=null?d:a==null?void 0:a.type)!=null?m:"stairs";return{type:t,fromFloor:e,toFloor:n,direction:u,connection:i,connectionType:h}},"#createConnectionAction"),GL=l(function(t,e){let n=e.properties.edges;if(!n||n.filter(u=>u.destination.properties.id!==(t==null?void 0:t.properties.id)&&u.destination.properties.id!==e.properties.destination).length===0)return null;let a=t?-NL(t.properties.angle,e.properties.angle):0;return Math.abs(a)>=FL?{type:"Turn",bearing:kL(a,FL),referencePosition:"At"}:null},"#createTurnAction"),l(NT,"Directions");var ju=NT;y();var kT=class kT{constructor({nodes:t,geojsonCollection:e,connections:n,groupBy:i,multiplicativeDistanceWeightScaling:a}){b(this,"navigator");b(this,"connections");b(this,"getDirections",l((t,e,n,i)=>{let{accessible:a,smoothing:{enabled:u,radius:h},connectionIdWeightMap:d}=n,m=t.flatMap(T=>Uu(T,i)),v=e.flatMap(T=>Uu(T,i)),x=this.getExcludedNodeIds(n.excludedConnections).filter(T=>!m.includes(T)&&!v.includes(T)),S=this.getDisabledConnectionNodeIds(a).filter(T=>!m.includes(T)&&!v.includes(T)),I=new Map;for(let T in d){let D=i.getMVFFeatureById("connection",T);if(!D)continue;let A=this.navigator.graph.edges[D.nodes[0]];if(A){let L=A.find(B=>B.destination.properties.id===D.nodes[1]);L&&I.set(L,d[T])}}let w=this.navigator.getDirections({zones:n.zones.map(T=>{var D;return{geometry:T.geometry,cost:T.cost,map:(D=T.floor)==null?void 0:D.id}}),originIds:m,destinationNodeIds:v,excludedNodeIds:x,disabledConnectionNodeIds:S,simplify:{enabled:u,bufferRadius:h},overrideEdgeWeights:I,multiplicativeDistanceWeightScaling:!i.enterpriseMode});this.addCoordinateDirections(w,t,e);let E=new ju(w,i,t,e);if(!(E.distance===0&&new Set([...m,...v]).size===m.length+v.length))return E},"getDirections"));b(this,"getExcludedNodeIds",l(t=>{if(t.length===0)return[];let e=new Set(t.map(n=>n.id));return this.connections.reduce((n,i)=>e.has(i.id)?n.concat(i.nodes):n,[])},"getExcludedNodeIds"));b(this,"getDisabledConnectionNodeIds",l(t=>t===!1?[]:this.connections.reduce((e,n)=>n.accessible?e:e.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));b(this,"addCoordinateDirections",l((t,[e],[n])=>{if(t.features.length){if(ve.is(e)){let i=this.createDirectionFeature(e,this.navigator.getAngle([e.longitude,e.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([e.longitude,e.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,i)}if(ve.is(n)){let i=this.createDirectionFeature(n,0,0),a=t.features[t.features.length-1];a.properties.distance=this.navigator.getDistance(a.geometry.coordinates,[n.longitude,n.latitude]),a.properties.angle=this.navigator.getAngle(a.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(i)}}},"addCoordinateDirections"));b(this,"createDirectionFeature",l((t,e,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:e,distance:n,edges:[]}}),"createDirectionFeature"));this.navigator=new gm({nodes:t,geojsonCollection:this.createCollection(e),groupBy:i,multiplicativeDistanceWeightScaling:a}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((e,[n,i])=>e.concat(i.features.map(a=>(a.properties.map=n,a))),[])}}};l(kT,"DirectionsInternal");var Xm=kT;y();y();y();y();y();y();function RT(r){let t=+this._x.call(null,r),e=+this._y.call(null,r);return VL(this.cover(t,e),t,e,r)}l(RT,"default");function VL(r,t,e,n){if(isNaN(t)||isNaN(e))return r;var i,a=r._root,u={data:n},h=r._x0,d=r._y0,m=r._x1,v=r._y1,x,S,I,w,E,T,D,A;if(!a)return r._root=u,r;for(;a.length;)if((E=t>=(x=(h+m)/2))?h=x:m=x,(T=e>=(S=(d+v)/2))?d=S:v=S,i=a,!(a=a[D=T<<1|E]))return i[D]=u,r;if(I=+r._x.call(null,a.data),w=+r._y.call(null,a.data),t===I&&e===w)return u.next=a,i?i[D]=u:r._root=u,r;do i=i?i[D]=new Array(4):r._root=new Array(4),(E=t>=(x=(h+m)/2))?h=x:m=x,(T=e>=(S=(d+v)/2))?d=S:v=S;while((D=T<<1|E)===(A=(w>=S)<<1|I>=x));return i[A]=a,i[D]=u,r}l(VL,"add");function jL(r){var t,e,n=r.length,i,a,u=new Array(n),h=new Array(n),d=1/0,m=1/0,v=-1/0,x=-1/0;for(e=0;e<n;++e)isNaN(i=+this._x.call(null,t=r[e]))||isNaN(a=+this._y.call(null,t))||(u[e]=i,h[e]=a,i<d&&(d=i),i>v&&(v=i),a<m&&(m=a),a>x&&(x=a));if(d>v||m>x)return this;for(this.cover(d,m).cover(v,x),e=0;e<n;++e)VL(this,u[e],h[e],r[e]);return this}l(jL,"addAll");y();function FT(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(e))i=(e=Math.floor(r))+1,a=(n=Math.floor(t))+1;else{for(var u=i-e||1,h=this._root,d,m;e>r||r>=i||n>t||t>=a;)switch(m=(t<n)<<1|r<e,d=new Array(4),d[m]=h,h=d,u*=2,m){case 0:i=e+u,a=n+u;break;case 1:e=i-u,a=n+u;break;case 2:i=e+u,n=a-u;break;case 3:e=i-u,n=a-u;break}this._root&&this._root.length&&(this._root=h)}return this._x0=e,this._y0=n,this._x1=i,this._y1=a,this}l(FT,"default");y();function BT(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}l(BT,"default");y();function GT(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}l(GT,"default");y();y();function fi(r,t,e,n,i){this.node=r,this.x0=t,this.y0=e,this.x1=n,this.y1=i}l(fi,"default");function VT(r,t,e){var n,i=this._x0,a=this._y0,u,h,d,m,v=this._x1,x=this._y1,S=[],I=this._root,w,E;for(I&&S.push(new fi(I,i,a,v,x)),e==null?e=1/0:(i=r-e,a=t-e,v=r+e,x=t+e,e*=e);w=S.pop();)if(!(!(I=w.node)||(u=w.x0)>v||(h=w.y0)>x||(d=w.x1)<i||(m=w.y1)<a))if(I.length){var T=(u+d)/2,D=(h+m)/2;S.push(new fi(I[3],T,D,d,m),new fi(I[2],u,D,T,m),new fi(I[1],T,h,d,D),new fi(I[0],u,h,T,D)),(E=(t>=D)<<1|r>=T)&&(w=S[S.length-1],S[S.length-1]=S[S.length-1-E],S[S.length-1-E]=w)}else{var A=r-+this._x.call(null,I.data),L=t-+this._y.call(null,I.data),B=A*A+L*L;if(B<e){var j=Math.sqrt(e=B);i=r-j,a=t-j,v=r+j,x=t+j,n=I.data}}return n}l(VT,"default");y();function jT(r){if(isNaN(v=+this._x.call(null,r))||isNaN(x=+this._y.call(null,r)))return this;var t,e=this._root,n,i,a,u=this._x0,h=this._y0,d=this._x1,m=this._y1,v,x,S,I,w,E,T,D;if(!e)return this;if(e.length)for(;;){if((w=v>=(S=(u+d)/2))?u=S:d=S,(E=x>=(I=(h+m)/2))?h=I:m=I,t=e,!(e=e[T=E<<1|w]))return this;if(!e.length)break;(t[T+1&3]||t[T+2&3]||t[T+3&3])&&(n=t,D=T)}for(;e.data!==r;)if(i=e,!(e=e.next))return this;return(a=e.next)&&delete e.next,i?(a?i.next=a:delete i.next,this):t?(a?t[T]=a:delete t[T],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(n?n[D]=e:this._root=e),this):(this._root=a,this)}l(jT,"default");function UL(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}l(UL,"removeAll");y();function UT(){return this._root}l(UT,"default");y();function zT(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}l(zT,"default");y();function HT(r){var t=[],e,n=this._root,i,a,u,h,d;for(n&&t.push(new fi(n,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(n=e.node,a=e.x0,u=e.y0,h=e.x1,d=e.y1)&&n.length){var m=(a+h)/2,v=(u+d)/2;(i=n[3])&&t.push(new fi(i,m,v,h,d)),(i=n[2])&&t.push(new fi(i,a,v,m,d)),(i=n[1])&&t.push(new fi(i,m,u,h,v)),(i=n[0])&&t.push(new fi(i,a,u,m,v))}return this}l(HT,"default");y();function XT(r){var t=[],e=[],n;for(this._root&&t.push(new fi(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var a,u=n.x0,h=n.y0,d=n.x1,m=n.y1,v=(u+d)/2,x=(h+m)/2;(a=i[0])&&t.push(new fi(a,u,h,v,x)),(a=i[1])&&t.push(new fi(a,v,h,d,x)),(a=i[2])&&t.push(new fi(a,u,x,v,m)),(a=i[3])&&t.push(new fi(a,v,x,d,m))}e.push(n)}for(;n=e.pop();)r(n.node,n.x0,n.y0,n.x1,n.y1);return this}l(XT,"default");y();function zL(r){return r[0]}l(zL,"defaultX");function YT(r){return arguments.length?(this._x=r,this):this._x}l(YT,"default");y();function HL(r){return r[1]}l(HL,"defaultY");function qT(r){return arguments.length?(this._y=r,this):this._y}l(qT,"default");function x0(r,t,e){var n=new WT(t==null?zL:t,e==null?HL:e,NaN,NaN,NaN,NaN);return r==null?n:n.addAll(r)}l(x0,"quadtree");function WT(r,t,e,n,i,a){this._x=r,this._y=t,this._x0=e,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}l(WT,"Quadtree");function XL(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}l(XL,"leaf_copy");var Lo=x0.prototype=WT.prototype;Lo.copy=function(){var r=new WT(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,n;if(!t)return r;if(!t.length)return r._root=XL(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var i=0;i<4;++i)(n=t.source[i])&&(n.length?e.push({source:n,target:t.target[i]=new Array(4)}):t.target[i]=XL(n));return r};Lo.add=RT;Lo.addAll=jL;Lo.cover=FT;Lo.data=BT;Lo.extent=GT;Lo.find=VT;Lo.remove=jT;Lo.removeAll=UL;Lo.root=UT;Lo.size=zT;Lo.visit=HT;Lo.visitAfter=XT;Lo.x=YT;Lo.y=qT;var wa,Yu,qu,Ym,ZT=class ZT{constructor(t,e){R(this,wa,{});R(this,Yu,{});R(this,qu);R(this,Ym);V(this,qu,t),V(this,Ym,e)}getTreeByType(t,e,n,i=[]){var m,v;p(this,wa)[t]||(p(this,wa)[t]={}),p(this,Yu)[t]||(p(this,Yu)[t]={}),p(this,Yu)[t][e]||(p(this,Yu)[t][e]={});let a=p(this,Yu)[t][e][n],u=!Y0(a,i);if((m=p(this,wa)[t][e])!=null&&m[n]&&!u)return p(this,wa)[t][e][n];p(this,wa)[t][e]||(p(this,wa)[t][e]={}),p(this,wa)[t][e][n]=x0();let h=p(this,wa)[t][e][n];h.x(x=>p(this,Ym).call(this,x.geometry.coordinates).x),h.y(x=>p(this,Ym).call(this,x.geometry.coordinates).y);let d=[];switch(t){case"node":d=((v=p(this,qu).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:v.filter(x=>x.properties.neighbors.length>0))||[];break;case"point-of-interest":d=p(this,qu).mvfPoisByFloorId[n]||[];break;case"door":d=p(this,qu).mvfEntrancesByFloorId[n]||[];break;case"annotation":d=p(this,qu).mvfAnnotationsByFloorId[n]||[];break}if((i==null?void 0:i.length)>0&&(d==null?void 0:d.length)>0){let x=new Set(i);d=d.filter(S=>{let I=p(this,qu).getById(t,S.properties.id);return I&&!x.has(I)})}return(d==null?void 0:d.length)>0&&h.addAll(d),p(this,Yu)[t][e][n]=i?[...i]:void 0,h}};wa=new WeakMap,Yu=new WeakMap,qu=new WeakMap,Ym=new WeakMap,l(ZT,"QueryCache");var A2=ZT;var GZ=.1,VZ=5,jZ=100,UZ=2,YL=1e3,qL=111319.9,zZ=Pi.object({limit:Pi.enum(["same-floor","same-elevation"]).optional(),radius:Pi.number().optional(),useLineOfSight:Pi.boolean().optional(),types:Pi.array(Pi.enum(["node","point-of-interest","door","annotation"])).min(1)}),Ao,_f,Cf,C0,N2,S0,k2,$T=class $T{constructor(t){R(this,Ao);R(this,_f);R(this,Cf,l(([t,e])=>{let[n,i]=[p(this,Ao).mapCenter.longitude,p(this,Ao).mapCenter.latitude],a=qL,u=qL*Math.cos(e*Math.PI/180),h=(t-n)*u,d=(e-i)*a;return{x:h,y:d}},"#projectOntoCartesianPlane"));R(this,C0,new Map);R(this,N2,l((t,e)=>{var a;let n=(a=p(this,C0).get(t))==null?void 0:a.get(e);if(n)return n;let i=p(this,_f).getTreeByType(t,p(this,Ao).mapName,e);if(typeof i.extent=="function")if(i.extent()){let[[u,h],[d,m]]=i.extent(),v=d-u,x=m-h;n=Math.max(v,x)}else n=YL;else n=YL;return p(this,C0).set(t,new Map([[e,n]])),n},"#getMaxRadiusForFloorId"));R(this,S0,l((t,e,n,i,a,u=[])=>{let h=[],d=0,m=p(this,N2).call(this,e,n);for(;h.length===0&&d<jZ;){if(a>m)return;h=p(this,k2).call(this,e,n,i,[t.longitude,t.latitude],a,u),h.length===0&&(a*=UZ,d++)}let v=h.sort((x,S)=>{let I=ps([t.longitude,t.latitude],x.geometry.coordinates),w=ps([t.longitude,t.latitude],S.geometry.coordinates);return I-w});for(let x of v)if(u.push(x.properties.id),p(this,Ao).directions.navigator.hasLineOfSight([t.longitude,t.latitude],x.geometry.coordinates,n,GZ))return x;return p(this,S0).call(this,t,e,n,i,a,u)},"#searchWithLineOfSight"));R(this,k2,l((t,e,n,i,a,u=[])=>{let{x:h,y:d}=p(this,Cf).call(this,i),m=h-a,v=h+a,x=d-a,S=d+a,I=[];return p(this,_f).getTreeByType(t,p(this,Ao).mapName,e,n).visit((w,E,T,D,A)=>{if(!w.length)do{if(!("data"in w))continue;let L=w.data;if(u.includes(L.properties.id))continue;let B=p(this,Cf).call(this,L.geometry.coordinates);B.x>=m&&B.x<v&&B.y>=x&&B.y<S&&I.push(L)}while("next"in w&&w.next&&(w=w.next));return E>=v||T>=S||D<m||A<x}),I},"#searchWithinBounds"));V(this,Ao,t),V(this,_f,new A2(p(this,Ao),p(this,Cf)))}nearest(t,e){var u,h,d;try{zZ.parse(e)}catch(m){tt.error(m);return}let n=Yg(t);if(!n)return;let i=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let m of p(this,Ao).getByType("floor-stack")){let v=m.defaultFloor;v&&i.push(v.id)}else if(e.limit==="same-elevation"){let m=p(this,Ao).floorsById[n.floorId];if(m){let v=m==null?void 0:m.elevation;v&&(i=p(this,Ao).getByType("floor-stack").map(x=>{var S;return(S=x.floors.find(I=>I.elevation===v))==null?void 0:S.id}).filter(Boolean))}}let a=[];for(let m of RL(e.types))for(let v of i){let x;if(((u=e.lineOfSight)==null||u)&&(x=p(this,S0).call(this,n,m,v,(h=e.exclude)!=null?h:[],(d=e.radius)!=null?d:VZ)),!x){let S=p(this,Cf).call(this,[n.longitude,n.latitude]);x=p(this,_f).getTreeByType(m,p(this,Ao).mapName,v,e.exclude).find(S.x,S.y)}if(x){let S=p(this,Ao).getById(m,x.properties.id);S&&a.push({distance:ps([n.longitude,n.latitude],x.geometry.coordinates),feature:S})}}return a.sort((m,v)=>m.distance-v.distance)}};Ao=new WeakMap,_f=new WeakMap,Cf=new WeakMap,C0=new WeakMap,N2=new WeakMap,S0=new WeakMap,k2=new WeakMap,l($T,"Query");var _0=$T;y();y();var I0,JT=class JT{constructor(t){R(this,I0);V(this,I0,t||[])}get raw(){return p(this,I0)}};I0=new WeakMap,l(JT,"OpeningHours");var R2=JT;var Zi,Ht,tn,Sf=class Sf extends si{constructor(e,n){super(n.mvfData.id);b(this,"__type",Sf.__type);b(this,"id","loc_");b(this,"name","");b(this,"externalId");b(this,"description");b(this,"logo");b(this,"phone");b(this,"social",[]);b(this,"images",[]);b(this,"links",[]);b(this,"website");b(this,"icon");R(this,Zi);R(this,Ht,{});R(this,tn);V(this,Zi,e),V(this,tn,n.mvfData);for(let i in n.mvfData)i==="links"?this.links=n.mvfData.links.map(a=>new fc({mvfData:a})):i==="pictures"?this.images=n.mvfData.pictures.map(a=>{var u;return a.url?new mc({mvfData:rt(U({},a),{url:(u=a.url)!=null?u:""}),mapData:p(this,Zi)}):void 0}).filter(a=>a!=null):i==="website"?n.mvfData.website&&(this.website=new fc({mvfData:n.mvfData.website})):i==="icon"?n.mvfData.icon&&(this.icon=new mc({mvfData:{url:n.mvfData.icon},mapData:p(this,Zi)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return p(this,tn)[i]}})}static is(e){return e.__type===Sf.__type}get spaces(){if(p(this,Ht).spaces)return p(this,Ht).spaces;if(p(this,tn).spaces==null)return p(this,Ht).spaces=[],p(this,Ht).spaces;p(this,Ht).spaces=[];for(let e=0;e<p(this,tn).spaces.length;e++){let n=p(this,Zi).getById("space",p(this,tn).spaces[e].id);n&&p(this,Ht).spaces.push(n)}return p(this,Ht).spaces}get points(){if(p(this,Ht).points)return p(this,Ht).points;if(p(this,tn).spaces==null)return p(this,Ht).points=[],p(this,Ht).points;p(this,Ht).points=[];for(let e=0;e<p(this,tn).spaces.length;e++){let n=p(this,Zi).getById("point-of-interest",p(this,tn).spaces[e].id);n&&p(this,Ht).points.push(n)}return p(this,Ht).points}get doors(){if(p(this,Ht).doors)return p(this,Ht).doors;if(p(this,tn).entrances==null)return p(this,Ht).doors=[],p(this,Ht).doors;p(this,Ht).doors=[];for(let e=0;e<p(this,tn).entrances.length;e++){let n=p(this,Zi).getById("door",p(this,tn).entrances[e].id);n&&p(this,Ht).doors.push(n)}return p(this,Ht).doors}get connections(){var n;if(p(this,Ht).connections)return p(this,Ht).connections;if(p(this,tn).connections==null)return p(this,Ht).connections=[],p(this,Ht).connections;let e=new Set;for(let i=0;i<p(this,tn).connections.length;i++){let a=p(this,tn).connections[i],u=p(this,Zi).mvfConnectionsById[a],d=(u==null?[]:u.nodes).map(m=>p(this,Zi).getById("node",m)).filter(Boolean);for(let m of d){if(m==null)continue;let v=el([m.coordinate.longitude,m.coordinate.latitude]),S=((n=p(this,Zi).connectionSpaceIdsByLatLon[v])!=null?n:[]).map(I=>p(this,Zi).connectionsById[I]).filter(I=>I!=null);for(let I of S)e.add(I)}}return p(this,Ht).connections=Array.from(e),p(this,Ht).connections}get annotations(){if(p(this,Ht).annotations)return p(this,Ht).annotations;if(p(this,tn).annotations==null)return p(this,Ht).annotations=[],p(this,Ht).annotations;p(this,Ht).annotations=[];for(let e=0;e<p(this,tn).annotations.length;e++){let n=p(this,Zi).getById("annotation",p(this,tn).annotations[e].id);n&&p(this,Ht).annotations.push(n)}return p(this,Ht).annotations}get categories(){return p(this,Ht).categories?p(this,Ht).categories:p(this,tn).categories==null?(p(this,Ht).categories=[],p(this,Ht).categories):(p(this,Ht).categories=p(this,tn).categories.map(e=>p(this,Zi).getById("location-category",e)).filter(e=>e!=null),p(this,Ht).categories)}get mapObjects(){return p(this,Ht).mapObjects?p(this,Ht).mapObjects:p(this,tn).obstructions==null?(p(this,Ht).mapObjects=[],p(this,Ht).mapObjects):(p(this,Ht).mapObjects=p(this,tn).obstructions.map(e=>p(this,Zi).getById("object",e.id)).filter(e=>e!=null),p(this,Ht).mapObjects)}get areas(){return p(this,Ht).areas?p(this,Ht).areas:p(this,tn).areas==null?(p(this,Ht).areas=[],p(this,Ht).areas):(p(this,Ht).areas=p(this,tn).areas.map(e=>p(this,Zi).getById("area",e.id)).filter(e=>e!=null),p(this,Ht).areas)}get focusTarget(){if(p(this,Ht).focusTarget)return p(this,Ht).focusTarget;let e=[];for(let n of this.spaces)e.push(n);for(let n of this.connections)e.push(...n.coordinates);for(let n of this.doors)e.push(n.focusTarget);for(let n of this.mapObjects)e.push(n.focusTarget);for(let n of this.annotations)e.push(n.focusTarget);for(let n of this.points)e.push(n.focusTarget);for(let n of this.areas)e.push(n.focusTarget);return p(this,Ht).focusTarget=e,e}get openingHours(){var e;return p(this,Ht).openingHours?p(this,Ht).openingHours:(p(this,Ht).openingHours=new R2((e=p(this,tn).openingHoursSpecification)!=null?e:[]),p(this,Ht).openingHours)}get navigationTarget(){if(p(this,Ht).navigationTarget)return p(this,Ht).navigationTarget;let e=[];for(let n of this.spaces)e.push(n);for(let n of this.connections)e.push(...n.coordinates);for(let n of this.doors)e.push(n.focusTarget);for(let n of this.mapObjects)e.push(n.focusTarget);for(let n of this.annotations)e.push(n.focusTarget);for(let n of this.points)e.push(n.focusTarget);return p(this,Ht).navigationTarget=e,e}toJSON(){return{__type:Sf.__type,id:this.id,name:this.name}}};Zi=new WeakMap,Ht=new WeakMap,tn=new WeakMap,l(Sf,"LocationProfile"),b(Sf,"__type","location-profile");var KT=Sf,ih=KT;y();var ep,Wo,Mf,If=class If extends si{constructor(e,n){super(n.mvfData.id);b(this,"__type",If.__type);b(this,"id","cat_");b(this,"name","");b(this,"icon","");R(this,ep);R(this,Wo,{});R(this,Mf);V(this,ep,e),V(this,Mf,n.mvfData);for(let i in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return p(this,Mf)[i]}})}static is(e){return e.__type===If.__type}get parent(){return p(this,Wo).parent?p(this,Wo).parent:(p(this,Wo).parent=p(this,Mf).parent?p(this,ep).getById("location-category",p(this,Mf).parent):void 0,p(this,Wo).parent)}get children(){return p(this,Wo).children?p(this,Wo).children:(p(this,Wo).children=p(this,ep).locationCategoriesByParentId[this.id]||[],p(this,Wo).children)}get locationProfiles(){if(p(this,Wo).locationProfiles)return p(this,Wo).locationProfiles;let e=[];for(let n of p(this,ep).locationProfilesByCategoryId[this.id]||[]){let i=p(this,ep).getById("location-profile",n.id);i&&e.push(i)}return p(this,Wo).locationProfiles=e,e}toJSON(){return{__type:If.__type,id:this.id,name:this.name}}};ep=new WeakMap,Wo=new WeakMap,Mf=new WeakMap,l(If,"LocationCategory"),b(If,"__type","location-category");var QT=If,Qg=QT;var re,F2,WL,qm,tw=class tw extends le{constructor(e,n){var u,h,d,m,v;super();R(this,F2);b(this,"Analytics");R(this,re,{});b(this,"Query");b(this,"mvf");b(this,"outdoorViewToken");b(this,"objectEntranceNodeIdsByObstructionId");b(this,"obstructionIdByEntranceId");b(this,"venue");b(this,"tokenManager");b(this,"directions");b(this,"enterpriseMode",!1);b(this,"nodesById");b(this,"spacesById");b(this,"floorsById");b(this,"floorStacksById");b(this,"facadesById");b(this,"facadesBySpaceId");b(this,"connectionsById");b(this,"objectsById");b(this,"doorsById");b(this,"pointsOfInterestById");b(this,"annotationsById");b(this,"areasById");b(this,"locationProfilesById");b(this,"locationCategoriesById");b(this,"locationProfilesByExternalId");b(this,"locationProfilesByCategoryId");b(this,"locationCategoriesByParentId");b(this,"doorsByNodeId");b(this,"mvfAnnotationsById");b(this,"mvfConnectionsById");b(this,"mvfConnectionsByNodeId");b(this,"mvfConnectionIdsByLatLon");b(this,"mvfEntrancesById");b(this,"mvfNodesById");b(this,"mvfObstructionById");b(this,"mvfSpacesById");b(this,"mvfFloorsById");b(this,"mvfFloorStacksById");b(this,"mvfAreasById");b(this,"spacesByExternalId");b(this,"nodesByExternalId");b(this,"objectsByExternalId");b(this,"poisByExternalId");b(this,"floorsByExternalId");b(this,"floorStacksByExternalId");b(this,"doorsByExternalId");b(this,"areasByExternalId");b(this,"connectionSpaceIdsByLatLon",{});b(this,"locationProfilesByAttachedFeatureId",{});b(this,"locationsById",{});b(this,"categoriesById",{});b(this,"mvfLocationsBySpaceId",{});b(this,"locationIdsByNodeId",{});b(this,"spaceIdsByNodeId",{});b(this,"connectionsByExternalId",{});b(this,"locationsByExternalId",{});b(this,"categoriesByExternalId",{});b(this,"destinationNodesIdsBySpaceId",{});b(this,"mvfNodesByFloorId");b(this,"mvfSpacesByFloorId");b(this,"mvfPoisByFloorId");b(this,"mvfEntrancesByFloorId");b(this,"mvfAnnotationsByFloorId");b(this,"localePacksUrls");b(this,"currentLanguage");b(this,"languagePacks",{});b(this,"tilesets",{});b(this,"binaryBundle");b(this,"envControl");b(this,"getMapDataOptions");R(this,qm);b(this,"getDirectionsMultiDestination",l((e,n,i)=>this.getDirections(e,n,rt(U({},i),{multiDestination:!0})),"getDirectionsMultiDestination"));b(this,"getDirections",l((e,n,i)=>{let{accessible:a=!1,smoothing:u=!0,multiDestination:h=!1}=i||{},d=typeof u=="object"?u.enabled:u,m=typeof u=="object"?u.radius:void 0,v=(i==null?void 0:i.zones)||[],x={accessible:a,zones:v,smoothing:{enabled:d!=null?d:!0,radius:m!=null?m:.75},excludedConnections:(i==null?void 0:i.excludedConnections)||[],connectionIdWeightMap:(i==null?void 0:i.connectionIdWeightMap)||{}};if(h&&Array.isArray(n)){let S=Array.isArray(e)?e:[e],I=[];for(let w of n){let E=Array.isArray(w)?w:[w],T=this.directions.getDirections(S,E,x,this);if(!T){tt.error("getDirections failed due to missing directions for one of the segments");return}S=E,I.push(T)}return I}else{let S=Array.isArray(e)?e:[e],I=Array.isArray(n)?n:[n];if(Array.isArray(I[0])){tt.error("getDirections does not support multi-destination without multisegment option");return}S[0].id&&I[0].id&&this.Analytics.sendGetDirectionsEvent(S[0].id,I[0].id);try{return this.directions.getDirections(S,I,x,this)}catch(w){tt.error("Unable to get directions",w);return}}},"getDirections"));b(this,"transformImageRequest",l(async e=>{var i;if(this.enterpriseMode||!this.getMapDataOptions)return{url:e};if(!m7(e))return{url:e};if(g7(e))return{url:e};let n=ob(e);if(!n)return{url:e};try{let a=await((i=this.tokenManager)==null?void 0:i.getSasTokensAsync()),u=a==null?void 0:a[n.mapId];if(u==null)throw new Error("SAS token not found");let[h]=e.split("?");return{url:"".concat(h,"?").concat(u.token)}}catch(a){return tt.error("Failed to append SAS token to image request. Requests for private images may fail.",a),{url:e}}},"transformImageRequest"));let i=(u=n==null?void 0:n.env)!=null?u:Sc();if(this.envControl=i,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new Td,this.localePacksUrls=(h=n==null?void 0:n.localePacksUrls)!=null?h:{},this.mvf=e,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((d=e["tileset.json"])==null?void 0:d.default)!=null&&(this.tilesets[e["tileset.json"].default.key]=e["tileset.json"].default,i.updateTileServerBaseUrl(e["tileset.json"].default.url),e["tileset.json"].others!=null))for(let x of e["tileset.json"].others)this.tilesets[x.key]=x;this.enterpriseMode=(m=n==null?void 0:n.enterprise)!=null?m:!1,this.tokenManager=n==null?void 0:n.tokenManager;let a=S7(e,this);if(this.nodesById=a.nodesById,this.spacesById=a.spacesById,this.floorsById=a.floorsById,this.floorStacksById=a.floorStacksById,this.facadesById=a.facadesById,this.facadesBySpaceId=a.facadesBySpaceId,this.connectionsById=a.connectionsById,this.objectsById=a.objectsById,this.doorsById=a.doorsById,this.pointsOfInterestById=a.poisById,this.annotationsById=a.annotationsById,this.areasById=a.areasById,this.locationProfilesById=a.locationProfilesById,this.locationCategoriesById=a.locationCategoriesById,this.locationProfilesByCategoryId=a.locationProfilesByCategoryId,this.locationCategoriesByParentId=a.locationCategoriesByParentId,this.spacesByExternalId=a.spacesByExternalId,this.nodesByExternalId=a.nodesByExternalId,this.objectsByExternalId=a.objectsByExternalId,this.floorsByExternalId=a.floorsByExternalId,this.locationProfilesByExternalId=a.locationProfilesByExternalId,this.floorStacksByExternalId=a.floorStacksByExternalId,this.poisByExternalId=a.poisByExternalId,this.doorsByExternalId=a.doorsByExternalId,this.areasByExternalId=a.areasByExternalId,this.mvfAnnotationsById=a.mvfAnnotationsById,this.mvfConnectionsById=a.mvfConnectionsById,this.mvfConnectionsByNodeId=a.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=a.mvfConnectionIdsByLatLon,this.mvfEntrancesById=a.mvfEntrancesById,this.mvfNodesById=a.mvfNodesById,this.mvfObstructionById=a.mvfObstructionById,this.mvfSpacesById=a.mvfSpacesById,this.mvfFloorsById=a.mvfFloorsById,this.mvfFloorStacksById=a.mvfFloorStacksById,this.mvfNodesByFloorId=a.mvfNodesByFloorId,this.mvfSpacesByFloorId=a.mvfSpacesByFloorId,this.mvfPoisByFloorId=a.mvfPoisByFloorId,this.mvfEntrancesByFloorId=a.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=a.mvfAnnotationsByFloorId,this.mvfAreasById=a.mvfAreasById,this.doorsByNodeId=a.doorsByNodeId,this.objectEntranceNodeIdsByObstructionId=a.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=a.obstructionIdByEntranceId,this.connectionSpaceIdsByLatLon=a.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=a.locationProfilesByAttachedFeatureId,this.enterpriseMode){let x=C7(e,this);if(this.locationsById=x.locationsById,this.categoriesById=x.categoriesById,this.mvfLocationsBySpaceId=x.mvfLocationsBySpaceId,this.locationIdsByNodeId=x.locationIdsByNodeId,this.spaceIdsByNodeId=x.spaceIdsByNodeId,this.connectionsByExternalId=x.connectionsByExternalId,this.locationsByExternalId=x.locationsByExternalId,this.categoriesByExternalId=x.categoriesByExternalId,this.destinationNodesIdsBySpaceId=x.destinationNodesIdsBySpaceId,x.venue.name!=null){this.venue=new lb(this,{mvfData:x.venue});let S={};for(let I in x.mvfLocationsById)S[I]=x.mvfLocationsById[I];for(let I in x.locationInstancesById)S[I]=x.locationInstancesById[I];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":S,"enterprise-category":x.mvfCategoriesById,"floor-stack":a.mvfFloorStacksById,floor:a.mvfFloorsById}},(v=n==null?void 0:n.languagePacks)==null||v.forEach(({language:I,localePack:w})=>{this.languagePacks[I.code]=$C(w)}),this.currentLanguage=this.venue.defaultLanguage}}this.directions=new Xm({nodes:e["node.geojson"],geojsonCollection:e.enterprise?e.space:e.obstruction,connections:e["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode}),this.Query=new _0(this)}getEnv(){let e=this;return{get baseUri(){var n;return e.envControl.getBaseUri((n=e.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return e.envControl.getBaseAuthUri()},get analyticsBaseUri(){return e.envControl.getAnalyticsBaseUri()},get tileServerUri(){return e.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?e:""}get mapCenter(){return new ve(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var e;return(e=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?e:0}get spaces(){return p(this,re).spaces==null&&(p(this,re).spaces=globalThis.Object.values(this.spacesById)),p(this,re).spaces}get objects(){return p(this,re).objects==null&&(p(this,re).objects=globalThis.Object.values(this.objectsById)),p(this,re).objects}get connections(){return p(this,re).connections==null&&(p(this,re).connections=globalThis.Object.values(this.connectionsById)),p(this,re).connections}get floors(){return p(this,re).floors==null&&(p(this,re).floors=globalThis.Object.values(this.floorsById)),p(this,re).floors}get floorStacks(){return p(this,re).floorStacks==null&&(p(this,re).floorStacks=globalThis.Object.values(this.floorStacksById)),p(this,re).floorStacks}get facades(){return p(this,re).facades==null&&(p(this,re).facades=globalThis.Object.values(this.facadesById)),p(this,re).facades}get doors(){return p(this,re).doors==null&&(p(this,re).doors=globalThis.Object.values(this.doorsById)),p(this,re).doors}get pointsOfInterest(){return p(this,re).pointsOfInterest==null&&(p(this,re).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),p(this,re).pointsOfInterest}get annotations(){return p(this,re).annotations==null&&(p(this,re).annotations=globalThis.Object.values(this.annotationsById)),p(this,re).annotations}get areas(){return p(this,re).areas==null&&(p(this,re).areas=globalThis.Object.values(this.areasById)),p(this,re).areas}get nodes(){return p(this,re).nodes==null&&(p(this,re).nodes=globalThis.Object.values(this.nodesById)),p(this,re).nodes}get locations(){return p(this,re).locations==null&&(p(this,re).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return p(this,re).categories==null&&(p(this,re).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return p(this,re).locationProfiles==null&&(p(this,re).locationProfiles=globalThis.Object.values(this.locationProfilesById)),p(this,re).locationProfiles}get locationCategories(){return p(this,re).locationCategories==null&&(p(this,re).locationCategories=globalThis.Object.values(this.locationCategoriesById)),p(this,re).locationCategories}get mvfFloors(){return p(this,re).mvfFloors==null&&(p(this,re).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),p(this,re).mvfFloors}get mvfFloorStacks(){return p(this,re).mvfFloorStacks==null&&(p(this,re).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),p(this,re).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[]}}getById(e,n){let i={"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":l(h=>yt(this,F2,WL).call(this,this.mvfConnectionsById[h]),"mvf-connection"),object:this.objectsById,"point-of-interest":this.pointsOfInterestById,annotation:this.annotationsById,area:this.areasById,"enterprise-location":this.locationsById,"enterprise-category":this.categoriesById},a=l(h=>{let d=i[h];if(d!=null)return typeof d=="function"?d(n):d[n]},"getItemFromCollection"),u=l(()=>{for(let h of Object.keys(i)){let d=a(h);if(d!=null)return d}},"getItemFromAllCollections");return e==="unknown"?u():a(e)}getByExternalId(e,n){var i,a,u,h,d,m,v,x,S,I,w,E;switch(e){case"location-profile":return(i=this.locationProfilesByExternalId[n])!=null?i:[];case"location-category":return[];case"space":return(a=this.spacesByExternalId[n])!=null?a:[];case"floor":return(u=this.floorsByExternalId[n])!=null?u:[];case"floor-stack":return(h=this.floorStacksByExternalId[n])!=null?h:[];case"node":return(d=this.nodesByExternalId[n])!=null?d:[];case"door":return(m=this.doorsByExternalId[n])!=null?m:[];case"connection":return(v=this.connectionsByExternalId[n])!=null?v:[];case"object":return(x=this.objectsByExternalId[n])!=null?x:[];case"point-of-interest":return(S=this.poisByExternalId[n])!=null?S:[];case"area":return(I=this.areasByExternalId[n])!=null?I:[];case"enterprise-location":return(w=this.locationsByExternalId[n])!=null?w:[];case"enterprise-category":return(E=this.categoriesByExternalId[n])!=null?E:[];default:return[]}}getMapDataById(e){var n,i,a,u,h,d,m,v,x,S;return(S=(x=(v=(m=(d=(h=(u=(a=(i=(n=this.spacesById[e])!=null?n:this.floorsById[e])!=null?i:this.floorStacksById[e])!=null?a:this.facadesById[e])!=null?u:this.nodesById[e])!=null?h:this.doorsById[e])!=null?d:this.connectionsById[e])!=null?m:this.objectsById[e])!=null?v:this.pointsOfInterestById[e])!=null?x:this.annotationsById[e])!=null?S:this.areasById[e]}getMVFFeatureById(e,n){switch(e){case"space":return this.mvfSpacesById[n];case"node":return this.mvfNodesById[n];case"obstruction":return this.mvfObstructionById[n];case"floor":return this.mvfFloorsById[n];case"floor-stack":return this.mvfFloorStacksById[n];case"connection":return this.mvfConnectionsById[n];case"entrance":return this.mvfEntrancesById[n];case"annotation":return this.mvfAnnotationsById[n];case"area":return this.mvfAreasById[n];default:throw new Error("Unknown MVF feature type: ".concat(e))}}getMVFFeatureByNodeId(e,n){switch(e){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getMVFFeatureByType(e){switch(e){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(e))}}getPropTranslation(e,n,i,a){var d,m;if(!this.currentLanguage)return a;let{code:u}=this.currentLanguage,h=(m=(d=this.languagePacks[u])==null?void 0:d.optimized)==null?void 0:m[e];if(h){let v=h[i];if(v!=null&&v[n]!==void 0)return v[n]}return a}findPreferredLanguage(e){if(!this.venue)return;let n=L2(this.venue,e);return(e==null?void 0:e.languageCode)!=null&&e.languageCode.toLowerCase()!==n.code.toLowerCase()&&tt.warn('Language code "'.concat(e.languageCode,'" could not be found in the venue. Using "').concat(n.code,'" instead.')),n}async changeLanguage(e){var h;let n=e.toLowerCase();if(!n){tt.error("Language code must be defined.");return}if(!this.currentLanguage||!this.venue){tt.error("Changing the language is not supported for this map.");return}let i=this.currentLanguage.code,a=(h=this.venue)==null?void 0:h.languages.find(({code:d})=>d.toLowerCase()===n.toLowerCase());if(!a){tt.warn('Language code "'.concat(n,'" could not be found in the venue.'));return}if(i===a.code)return;let u=this.languagePacks[a.code];if(!u){let d=this.localePacksUrls[a.code];if(!d){tt.error('Locale pack URL not found for language code "'.concat(a.code,'".'));return}p(this,qm)&&p(this,qm).abort();let m=new AbortController;V(this,qm,m);let v;try{v=await W7(d,{signal:m.signal})}catch(x){tt.error('Failed to download language pack for language code "'.concat(a.code,'".'),x);return}if(!v||m.signal.aborted)return;u=$C(v),this.languagePacks[a.code]=u}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=a,this.publish("language-change",this.currentLanguage)}getDistance(e,n){let i=Yg(e),a=Yg(n);return ps([i.longitude,i.latitude],[a.longitude,a.latitude])}async toJSONBundle({downloadLanguagePacks:e=!0}={}){var i;let n=[];if(e&&this.enterpriseMode){let a=new AbortController;for(let u of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[u.code]){let h=await TS(this.localePacksUrls[u.code],{signal:a.signal}),d=await Od(h);d&&n.push({language:{code:u.code,name:u.name},localePack:d})}}catch(h){tt.warn("failed downloading language pack",h)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:e=!0}={}){var i;if(!this.binaryBundle){tt.error("binary bundle not found");return}let n=[];if(e&&this.enterpriseMode){let a=new AbortController;for(let u of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[u.code]){let h=await TS(this.localePacksUrls[u.code],{signal:a.signal});h&&n.push({language:{code:u.code,name:u.name},localePack:h})}}catch(h){tt.warn("failed downloading language pack",h)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let e of globalThis.Object.keys(p(this,re)))p(this,re)[e]=null}};re=new WeakMap,F2=new WeakSet,WL=l(function(e){var h;let n=(h=e==null?void 0:e.nodes)==null?void 0:h[0],i=this.getById("node",n);if(i==null)return;let a=el([i.coordinate.longitude,i.coordinate.latitude]),u=this.connectionSpaceIdsByLatLon[a];return u==null?void 0:u.map(d=>this.connectionsById[d]).find(d=>d!=null)},"#getConnectionFromMVFConnection"),qm=new WeakMap,l(tw,"MapDataInternal");var bf=tw;var Wm,wf,Zm,El,Tf=class Tf extends la{constructor(e,n){super(n.mvfData.id,e);b(this,"__type",Tf.__type);R(this,Wm);R(this,wf);R(this,Zm);R(this,El,{});V(this,Wm,n.mvfData),V(this,wf,e),V(this,Zm,n.floorStackId)}static is(e){return e.__type===Tf.__type}get floorStack(){return p(this,wf).getById("floor-stack",p(this,Zm))}get spaces(){if(!p(this,El).spaces){p(this,El).spaces=[];for(let e of p(this,Wm).spaces){let n=p(this,wf).getById("space",e.spaceId);n&&p(this,El).spaces.push(n)}}return p(this,El).spaces}get center(){if(!p(this,El).center){let e={type:"FeatureCollection",features:[]};for(let i of this.spaces){let a=p(this,wf).mvfSpacesById[i.id];a&&e.features.push(a)}if(e.features.length===0)throw new Ci("No geometry found for facade!");let n=qa(e);p(this,El).center=new ve({latitude:n.geometry.coordinates[1],longitude:n.geometry.coordinates[0],floorId:p(this,Wm).spaces[0].floorId})}return p(this,El).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}toJSON(){return{id:this.id,__type:Tf.__type,floorStackId:p(this,Zm),floorStack:this.floorStack,spaces:this.spaces}}};Wm=new WeakMap,wf=new WeakMap,Zm=new WeakMap,El=new WeakMap,l(Tf,"Facade"),b(Tf,"__type","facade");var ew=Tf,Ps=ew;export{ve as a,$l as b,ui as c,Vg as d,Ps as e,nl as f,Kg as g,Q as h,z3 as i,WW as j,DL as k,AL as l,FZ as m};